-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature/dielectric refraction #109
Feature/dielectric refraction #109
Conversation
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.
Good job! This was the idea. I have requested some minor changes.
test/pyWrapper/test_full_system.py
Outdated
value = probe.df['field'][idx] | ||
return {"time":time, "value": value} | ||
|
||
def getRefractedField(probe:Probe) -> Dict: |
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 the EMC&RF sector, we usually prefer to name it as "transmission" rather than "refraction". I guess "refraction" is more typical of the optics domain.
test/pyWrapper/test_full_system.py
Outdated
def getRefractedField(probe:Probe) -> Dict: | ||
idx = probe.df['field'].argmin() | ||
time = probe.df['time'][idx] | ||
value = probe.df['field'][idx] |
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.
Please use the direct accessor as dict:
def __getitem__(self, key):
return self.df[key]
Rather than .df. I should have named df as _df to indicate that is private.
test/pyWrapper/test_full_system.py
Outdated
|
||
expectedDelayRatio = 1/np.sqrt(_RELATIVE_PERMITTIVITY) | ||
|
||
fn = CASES_FOLDER + "dielectric_refraction/dielectricRefraction.fdtd.json" |
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 would suggest that the folder is named "dielectric" with the idea that it can possibly store more than one case related with dielectrics. "dielectricRefraction.fdtd.json" is ok as it is a good description of the purpose of the test.
|
||
"materialAssociations": [ | ||
{ | ||
"type": "bulk", |
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.
type
is no longer required within materialAssociations
. We realized that it was mostly a source of confusion.
|
||
#%% | ||
outside = Probe(solver.getSolvedProbeFilenames("outside")[0]) | ||
plt.plot(outside.df['time'], outside.df['field'], label='outside') |
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 my case I need to add .to_numpy(), as:
plt.plot(outside.df['time'].to_numpy(), outside.df['field'].to_numpy(), label='outside')
Maybe due to a difference in pandas version
plt.legend() | ||
#%% | ||
inside = Probe(solver.getSolvedProbeFilenames("inside")[0]) | ||
plt.plot(inside.df['time'], inside.df['field'], label='inside') |
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.
Same
plt.legend() | ||
#%% | ||
reflected = Probe(solver.getSolvedProbeFilenames("reflected")[0]) | ||
plt.plot(reflected.df['time'], reflected.df['field'], label='reflected') |
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.
Same
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.
Almost
test/pyWrapper/test_full_system.py
Outdated
return {"time":time, "value": value} | ||
|
||
def getTransmitedField(probe:Probe) -> Dict: | ||
idx = probe.__getitem__('field').argmin() |
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.
Much better using brackets
ea5a871
to
d04db03
Compare
Added case for a plane wave iteration with an isotropic material