-
Notifications
You must be signed in to change notification settings - Fork 48
Custom\manual waveguide modes definition for Excitations #56
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
|
Hey @thliebig Took me long enough, but I have a parser for CSV files with E and H data. double CSPropExcitation::GetWeightedExcitation(int ny, const double* coords)is used by openEMS. |
|
Hey @thliebig In order to overcome that, I have two possible courses of action:
I'll go with #1 right now, but if you have a different idea I'd love to hear. Cheers |
e992297 to
68e0075
Compare
|
Hey @thliebig Finally got a hold of this, or at least I think. Rebased, tested, the works. Cheers |
|
Hey @thliebig. This was done in parallel to the openEMS PR, as usual. Let me know if this is more in the direction you wanted |
|
@thliebig found an opportunity to take a look by any chance? |
|
Yes I had a first look. I have not yet tried to build and test this. Looks good so far I think. Next I will have a closer look at the openEMS counterpart first. |
Not compiling, yet.
Didn't resolve the local coordinates shift, yet. Didn't figure out how to write in XML the mode file name.
1. Minor C++ fixes 2. Fixed python bindings 3. Fixed CMakeLists.txt
Syntax fixes
1. Bilinear interpolation errors 2. Parsing error - line too short.
No longer necessary as there are no more c-style memory allocations in the python interface.
18e1059 to
f0868ed
Compare
|
During adding another example, I found a bug in the transpose of the file parser. Fixed in the last push. Forced push for rebase purposes, as usual... |
thliebig
left a comment
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.
Additionally there are many random blank lines in odd places?
|
I pushed the changes @thliebig. I'm assuming it's just an initial review... |
|
Yes, but I think it is looking okay. I need some closer look at the You may add some unit tests in the |
|
I'm having serious trouble with the python bindings. There was a change to update_openEMS.sh, and now the python binding are compiled using /scripts/build_python.sh. I can't find the logs anywhere to find the errors.
|
|
Very testing and development you should really not use the update_openEMS.sh. That is meant to build and install everything. What you want is only build what you are actively working on! If it is only the python bindings, cd into the the specific python path, here You have to adept the path obviously and @biergaizi is most likely yelling at me for not using a venv and pip 😏 |
|
I did that. It compiled and everything, but when I run the unit test it doesn't see my additions. Let me know what to do. I'm really on the verge of ditching this. |
What do you mean? You are in the "tests" folder when you run |
|
I wrote everything and tested as best as I could. I can't install with the new workflow, and I'm not going to try anymore. The new installation script after @biergaizi 's latest "re-write" doesn't work with my additions. Tried rebasing and everything. Got no idea why. The C++ part works. The python, doesn't. There is no feedback, logs or anything that I can find. When I tried this:
The python bindings compiled fine. They were installed somewhere. When I tried to run the unit tests, it referred to the previous version. Why? I don't know. ~ Throwing the white flag ~ My collegue said he wanted to try from his side. @tmpusr123, it's up to you now. |
|
Well I was able to checkout, rebase and build it just fine. Not sure whats up with your setup (or mine). The tests obviously can not work like this yet and they are already a bit deeper than I intended. |
|
I can port This is the line it uses: m_ModeFile.linInterp2(loc_coords[nPyp],loc_coords[nPypp],Wny)With this test, you can use both interpolants. I'm guessing this entire effort was to better use VScode. I use Eclipse for all of my work. As far as the rest of the setup, it's the same Linux VM I've been working with since the first lumped element PR. |
That does make little sense, just "unpush"? The last commit and we go from there... |
I edited a second later. This is the line it uses: m_ModeFile.linInterp2(loc_coords[nPyp],loc_coords[nPypp],Wny)With this test, you can use both interpolants. |
|
I'll refine. In the // Get weights in both directions
double Wny[2] = {0.0,0.0};
m_ModeFile.linInterp2(loc_coords[nPyp],loc_coords[nPypp],Wny);While the "shift" to the local coordinate system is done in openEMS, as it relates to the primitive that defines the excitation. if (!shiftCoordsForModeFile(volt_coord, highestPriorityPrim))This may not be the optimal solution. However, considering that in the rectangular waveguide port, this is done in the openEMS python interface, I figured that doing it in the C++ code would even be a bit friendlier. This is how it's done in the original master branch, BTW:: name_P = '({}-{})'.format(xyz[self.ny_P], self.start[self.ny_P])
name_PP = '({}-{})'.format(xyz[self.ny_PP], self.start[self.ny_PP])So testing |
|
Hi @thliebig, happy new year — did you have a chance to build/test this locally, or are there any more blockers to merging? |
As I am getting the hang of the Git protocol, I can start this, seperately. This was (re)based around the original repository master, rather than my one, which has the absorbers. In the future I'll make a habit of opening branches for new features.
I'll go over the remarks from the previous PR
The line that guided me here was "make as little damage as possible". This was for two main reasons:
Hence, the fields for the mode consist of three columns of coordinates, and three columns of field values: [X,Y,Z,Ex,Ey,Ez]. Replace with H at your own convenience.
Three reasons, this time
To avoid all this mess, I simply extract all three coordinates. I'll give this some more re-thinking.
I know. I didn't find any built-in XML functions for handling arrays, except for the mesh processing. Care to give me a hint?
I'll think how to implement these functions just one time. Missed this remark while re-basing the code.
This will take some figuring out. CSV is my weapon of choice, I guess. Easy to manipulate both in M-script and python. If I make this a 2D file, how do I handle the coordinate shift? Rotation is the easy bit, but where is (0,0)?