-
Notifications
You must be signed in to change notification settings - Fork 84
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
Cell Rotations and Translations #225
Changes from all commits
3bca812
bcc800c
2544255
b4db6b6
0d834c8
937bb55
c74105e
897069f
3095060
7487920
fe0b8de
7359765
477c58f
4018686
05d693e
a233bb0
15a31d9
8a000a3
8218237
5b06cb3
5c93374
2b31945
64f4dc5
0f34157
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,23 @@ | |
* using NumPy arrays */ | ||
%apply (double* IN_ARRAY1, int DIM1) {(double* xs, int num_groups)} | ||
|
||
/* The typemap used to match the method signature for the Cell rotation | ||
* angle setter method. This allows users to set the rotation angles | ||
* using NumPy arrays */ | ||
%apply (double* IN_ARRAY1, int DIM1) {(double* rotation, int num_axes)} | ||
|
||
/* The typemap used to match the method signature for the Cell translation | ||
* setter method. This allows users to set translations using NumPy arrays */ | ||
%apply (double* IN_ARRAY1, int DIM1) {(double* translation, int num_axes)} | ||
|
||
/* The typemap used to match the method signature for the Cell's | ||
* getter method for rotations used by the OpenCG compatibility module. */ | ||
%apply (double* ARGOUT_ARRAY1, int DIM1) {(double* rotations, int num_axes)} | ||
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. does this signature need another attribute for the units? 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. I wondered that too, but it doesn't seem too since it works with my test case. 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. Hmmm...maybe swig just ignores all arguments after those included in the signature. 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. That's what I think. But this is related to the way NumPy typemaps work with SWIG - and that isn't particularly well documented IMHO. |
||
|
||
/* The typemap used to match the method signature for the Cell's | ||
* getter method for translations used by the OpenCG compatibility module. */ | ||
%apply (double* ARGOUT_ARRAY1, int DIM1) {(double* translations, int num_axes)} | ||
|
||
/* The typemap used to match the method signature for the TrackGenerator's | ||
* getter methods for track start and end coordinates for the plotting | ||
* routines in openmoc.plotter */ | ||
|
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.
Is there a good reason for using arrays rather than vectors everywhere? If this was a vector, no typemap would be needed.
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 this is indeed the case, then I'm sold. I'm not going to make vectors the standard in this PR, but certainly think it would be nice to start using them in place of arrays in some if not all cases, esp. if it would simplify our swig typemaps.