-
Notifications
You must be signed in to change notification settings - Fork 183
Custom\Manual waveguide mode addition, for arbitrary waveguide structures #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
84b9aa2 to
387e1ae
Compare
|
Hey @thliebig What I couldn't (easily) overcome here was in the excitation extension, I couldn't pass just the file name. Other than that, pretty straight forward. Hope I didn't mess anything else up, too bad. Cheers |
|
Hey @thliebig First of all, thank you for merging the local obsorber PR. I hope it will be useful for other things, as the SIBC/MUR-SA is a pretty cool addition. This PR went through rather extensive changes (along with it's CSXCAD counterpart) so let me know how do you find it. Cheers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it would also be nice to eventually add an Matlab/Octave interface and example too? But maybe once this is done and merged...
Does this work for cylindrical coordinates? But as not many (if any) use this is CS, it is not a deal-breaker...
|
Hey @thliebig I will review them this week. Seems straightforward enough. Regarding the Octave/Matlab interface, I will put that on the task list. If you insist, I'll do it now, but I really want to organize my Repo a bit. This on-job git training was very deductive, but I really want to keep it cleaner from here on forward. I'm more fluent in m-scripting than I am in Matlab, so should be simpler. I need to think about how to do it in cylindrical CS, as I never really used it. I need to figure out the deal with the mesh there. Also, the interpolation schemes I wrote for the mode parser hardly fit that. Add it to the pile, I guess 😆. Hardly a finalized version, but some of my initial mode solver codes are here: |
|
As I said, keep both points (Octave interface and Cylindrical CS) for later. I would almost think that Cylindrical Coordinates might just work as is (of course with matching csv data)... maybe I will look into it... later... |
|
I've finished the changes requested. Since the local absorbers were already merged, I'd like to add another example with a different T-Line. Maybe remake the MSL case, or add a CPW one. I'll push when done. |
cbb1a5a to
7d5823a
Compare
|
Added another example, for CPW. I couldn't verify it against 3rd party software, regretfully, yet. |
|
Here, a nice video test_CPW.mp4 |
|
Great video. What settings did you use to render the 3D volume correctly? This is worth documenting, the best thing I managed to do in ParaView is to render a slice from a volume rather than a full volume. |
|
Hey @biergaizi |
|
Hey @thliebig Any other changes necessary for thie PR? |
|
@thliebig can this be merged yet? |
|
Give me some more time to start another review soon hopefully... |
|
Hi @thliebig -- any chance you might have an opportunity to merge this soon, to expand support for waveguides? |
|
While I'm not the project owner and can't do any code review on the algorithm, but as the build system and CI/CD maintainer I must point out that this Pull Request should be rebased against the latest Please run: # add an alternative origin named upstream
git remote add upstream https://github.com/thliebig/openEMS
git fetch upstream master
# go to your local feature branch
git checkout WaveguideModes
# save a duplicate backup branch it in case the rebase went wrong
git branch WaveguideModesBackup
# rebase the local feature branch against the upstream git branch
# to reset the time of divergence to the last commit, to avoid a complicated
# fork-in-the-middle merge
git rebase upstream/master
# solve any merge conflicts here, should be none
# use git add and git rebase --continue to mark resolution if any conflict does raise
# overwrite the current Pull Request
git push --forceIf the rebase succeeds and the CI pipeline passes, your next problem is to fixup/squash/reword all isolated fixes together, because no future developer is interested in reviewing facts such as how the folder example has been changed in the draft. All commits ideally should compile because broken commits prevents developers from testing individual commits in Now git should start a text editor. Because a lot of editing is involved, make sure the default editor is easy to use. If not, you can change it using the shell variable such as If you want to merge a commit to its previous commit (common when the next commit fixes a mistake in the previous one), change the keyword Any new feature development should be carefully reintegrated into the main branch. I recommend rebase incrementally, starting from the easiest tasks. This is what I would do - keep a few milestones, and merge unnecessary fixes upwards. When you're done, save the file. After saving, you have three clean commits. Because the last commit message "Compiles, untested!" is now outdated and would mislead futere developers, you should rewrite the commit log of the last commit to reflect the actual changes. What I'd do is to write a full introduction of the feature in the last commit. You can start a rebase again Once you're done, do a force-commit to overwrite the PR: If you use consistently this technique during actual development, you can ensure every single commit is working and also create the impression that there's never any build failures in the project like the Ministry of Truth (but don't abuse it, rewriting history in |
|
Well the alternative and what I would have most likely done is to just squash merge this after review. Said said, if you do not want to rewrite the history and are fine with a squash merge, you can at least rebase to the latest master to see if the CI system finds any build issues... |
|
You want me to rebase, sure, no worries. It won't ever build until the CSXCAD PR is merged. It's based on stuff programmed there... |
| # For the mode file to be used correctly, the direction of | ||
| # propagation has to be explicitly set. | ||
| if not use_function_expr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why? What's the difference between a function defining the fields and a file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I remember this one, not fondly. I think when a function expression is used, this is set implicitly later, or something.
I remember real trouble wrapping my head around this during the development. Even more so right now. This might be un-necessary, or this might be a life saver. Fact of the matter is, right now I can't even test it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know your thoughts @thliebig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to find out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I can remove one redundency, why not. I'd rather deal with this once the CSXCAD issues are resolved, anyway. I'd be happy to test it (crossing fingers that I can). I know for a fact that setting this vector is necessary for everything to work.
What I don't know, is if the if condition is necessary...
You are right, no need to therefore at this point. I will squash merge and build test locally and let CI check afterwards and fix anything if it is found. Please just look at my initial review comments .. |
I see. As a tip, the openEMS CI/CD pipeline is now enabled globally for all branches, after rebasing your openEMS feature branch, CI/CD will now try using the I need to document that in my website PR... Perhaps it can be improved further in the future, such as falling back to the upstream if the repos don't exist, or use the branch of the same names in two different repos... |
|
I just opened a TODO proposal named Enhanced Dependency-Aware Multi-Repo CI/CD Pipeline Logic to make things easier for both @gadiLhv and reviewers. |
Will do, @thliebig. It requires actual thinking, so I'll get to it tomorrow.
I'm actually more confused by this, somehow. But I'm not a prime example of a developer. Just happen to like computational electromagnetics. |
What I basically said is that, if the idea is implemented in the future, two simultaneous changes targeting CSXCAD and openEMS will be tested together at the same time, if both Pull Requests come from the same developer, and use the same local branch names. This will eliminate the problem of not being able to run meaningful CI in a stalemate like this PR (I've also encountered the problem many times). |
Added test scripts
Not finished Far from compiling. TODO: 1. Finish probes 2. Verify input validity 3. Try to find more elegant solution for excitation.
1. Finished mode match integration 2. Fixed compilation errors 3. Changed python bindings to work with file name
1. Issues in ports.py 2. Minor changes to operator_ext_exciation TODO: Still need to validate everything and check probes & modes modes.
1. Fixed direction and naming bugs in ports.py 2. Added example script and example mode files
Minor changes to test script
be0283b to
f732f6e
Compare
|
My "Pull Request Ganging" proposal has just been implemented. Please try a dummy useless force push to force the CI/CD pipeline to rerun: After a force push, your openEMS Pull Request will be tested together with your latest CSXCAD Pull Request commits (because both have the same |
|
I can request a re-run manually |
|
I couldn't figure out what went wrong with the MSVC test. Any hints, @biergaizi & @thliebig? Nice to see some green lights on this, for a change |
Undefined reference due to unexported library functions. On Windows, all symbols are private by default. To make a symbol available to other applications in a DLL, you must mark the class or function as For example, the class But your But we should be careful here. Everything in The class name is not following CSXCAD naming convention of I think we have several choices:
|
|
The fixes here were very minor. Applied, as well. |

This one was rather tricky. Took me a good long while to figure out what functionality I should access in openEMS.
I'll start from the tricky part, in
ports.py. This is where openEMS and CSXCAD are intertwined. I needed some sort of validation of the inputs, to add this functionality toWaveguidePort. Until the CSXCAD PR isn't finalized, this can't be, either. Unless you want to neglect the python functionality for now.https://github.com/thliebig/openEMS/compare/master...gadiLhv:openEMS:WaveguideModes?plain=1#diff-fe6a56ae621157b6691266fcc774ca626b01b38cb611a5b21e623b9a9d3493c7R382-R391
The only bit of redundancy may be this:
master...gadiLhv:openEMS:WaveguideModes#diff-53e7f365700486b254789d1b8ff10d0073b4bfd6b44e4b5823f72f2192d1b96fR282-R305
where this doesn't exist anywhere else in openEMS, rather in CSXCAD. If I understand correctly, you would rather some sort of field file handling class for this.
Here is the clever bit, though. I didn't write anything to the engine extension. It's actually done in the
GetWeightedExcitationfunction, here:https://github.com/gadiLhv/openEMS/blob/4195be2c83c118ea9f26ddf8eff90715744d7a68/FDTD/extensions/operator_ext_excitation.cpp#L205
and here:
https://github.com/gadiLhv/openEMS/blob/4195be2c83c118ea9f26ddf8eff90715744d7a68/FDTD/extensions/operator_ext_excitation.cpp#L260C9-L260C84