-
Notifications
You must be signed in to change notification settings - Fork 641
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
WIP: Allow unequal DFT frequencies #1141
Closed
Closed
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
ca82d45
added some TODOs, need more
danielwboyce 7a21f0e
Should be all TODOs for src/meep.hpp
danielwboyce 0ba7651
Should have added TODOs for all relevant function/class/struct defint…
danielwboyce 354b460
Changed freq_min/freq_max/dfreq to freqs
danielwboyce 612eb98
Changed freq_min/freq_max/dfreq to freqs
danielwboyce 286e22f
greater detail in TODOs; add overloaded versions of constructors, hel…
danielwboyce ea7ba08
greater detail in TODOs; add overloaded versions of constructors, hel…
danielwboyce 92895cf
typo
danielwboyce 4cfc13b
details on TODOs, added some overloaded constructors
danielwboyce 157638f
greater detail in TODOs; add overloaded versions of constructors, hel…
danielwboyce c24fa0a
greater detail in TODOs; add overloaded versions of constructors, hel…
danielwboyce d89d799
greater detail in TODOs; add overloaded versions of constructors, hel…
danielwboyce 1698f2d
greater detail in TODOs; add overloaded versions of constructors, hel…
danielwboyce b4f0926
Fixed how freqs is constructed and added freqs deletion to the remove…
danielwboyce a429fd8
changed freqs definitions in classes to be just pointers. compiles un…
danielwboyce 67c3205
* Change properties of DftObj class.
danielwboyce 082247d
* Created add_*_uneven functions
danielwboyce 9f986bf
Make sure freqs is sorted
danielwboyce 1f972bf
Removed (nfreq - 1) term from linspace functions; had misunderstood w…
danielwboyce b10366c
Replacement of get_omega_min and get_domega with get_omegas
danielwboyce e075a34
Alterations for dft_ldos in python/meep.i
danielwboyce d7c8a7d
Change because of differing number of arguments
danielwboyce 8212547
Merge branch 'master' of https://github.com/danielwboyce/meep into is…
danielwboyce bee4c0b
Additional attempt #1 at typemaps in SWIG
danielwboyce c781850
cleanup
danielwboyce 4dd0683
this is certainly wrong
danielwboyce df25758
Remove extra tolist()
danielwboyce db61366
python/meep.i still doesn't seem to be working
danielwboyce 89ffda4
Merge branch 'master' of https://github.com/NanoComp/meep into iss_1070
danielwboyce 27f4536
Revert python/meep.i and python/simulation.py to master state
danielwboyce 772a906
Replace freqs arrays with std::vectors
danielwboyce 0e54974
Replace freqs arrays with std::vectors
danielwboyce b6c2317
Replace freqs arrays with std::vectors
danielwboyce ab83da1
Replace freqs arrays with std::vectors
danielwboyce 12c40aa
Replace freqs arrays with std::vectors
danielwboyce fe3c650
Replace freqs arrays with std::vectors
danielwboyce 9fdc3c9
Replace freqs arrays with std::vectors
danielwboyce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -965,6 +965,25 @@ meep::volume_list *make_volume_list(const meep::volume &v, int c, | |
//-------------------------------------------------- | ||
// typemaps needed for add_dft_fields | ||
//-------------------------------------------------- | ||
/* | ||
%typecheck(SWIG_TYPECHECK_POINTER, fragment="NumPy_Fragments") double* freqs { | ||
$1 = is_array($input); | ||
} | ||
|
||
%typemap(in, fragment="NumPy_Macros") double* freqs { | ||
$1 = (double *)array_data($input); | ||
} | ||
|
||
%typecheck(SWIG_TYPECHECK_INTEGER) int Nfreqs { | ||
$1 = PyInteger_Check($input); | ||
} | ||
|
||
%typemap(in) int Nfreqs { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This typemap isn't needed. It's covered by the |
||
int py_nfreqs = PyInteger_Check($input); | ||
$1 = py_nfreqs; | ||
} | ||
*/ | ||
%apply (double *IN_ARRAY1, int DIM1) {(double *freqs, int Nfreqs)}; | ||
|
||
%typecheck(SWIG_TYPECHECK_POINTER) const volume where { | ||
int py_material = PyObject_IsInstance($input, py_volume_object()); | ||
|
@@ -1346,11 +1365,8 @@ void _get_eigenmode(meep::fields *f, double omega_src, meep::direction d, const | |
// Make omega members of meep::dft_ldos available as 'freq' in python | ||
%extend meep::dft_ldos { | ||
|
||
double get_omega_min() { | ||
return $self->omega_min; | ||
} | ||
double get_domega() { | ||
return $self->domega; | ||
double* get_omegas() { | ||
return $self->omegas; | ||
} | ||
int get_Nomega() { | ||
return $self->Nomega; | ||
|
@@ -1363,12 +1379,10 @@ void _get_eigenmode(meep::fields *f, double omega_src, meep::direction d, const | |
stop = start + (self.domega / (2 * math.pi)) * self.Nomega | ||
return np.linspace(start, stop, num=self.Nomega, endpoint=False).tolist() | ||
|
||
__swig_getmethods__["freq_min"] = get_omega_min | ||
__swig_getmethods__["freqs"] = get_omegas | ||
__swig_getmethods__["nfreq"] = get_Nomega | ||
__swig_getmethods__["dfreq"] = get_domega | ||
if _newclass: freq_min = property(get_omega_min) | ||
if _newclass: freqs = property(get_omegas) | ||
if _newclass: nfreq = property(get_Nomega) | ||
if _newclass: dfreq = property(get_domega) | ||
%} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This typemap isn't needed. It's covered by the
%apply
below.