-
Notifications
You must be signed in to change notification settings - Fork 66
Initial implementation of support for complex fields #234
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: develop
Are you sure you want to change the base?
Changes from 1 commit
e72dfe2
c8ac116
dc9324c
1f09105
246a843
80c1c68
07965d0
97a6412
b587a25
91f67a9
99423cc
63744be
0b151f8
e8c761b
5624ba1
3aa1ebe
a9ebda5
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 |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| #include "apfMatrix.h" | ||
| #include "apfNew.h" | ||
| #include "apfDynamicArray.h" | ||
| #include "apfComplex.h" | ||
|
|
||
| #include <vector> | ||
| #include <limits> | ||
|
|
@@ -133,8 +134,6 @@ enum ValueType { | |
| MATRIX, | ||
| /** \brief a user-defined set of components */ | ||
| PACKED, | ||
| /** \brief a user-defined set of complex-components */ | ||
| COMPLEX_PACKED, | ||
| /** \brief placeholder used to set array sizes */ | ||
| VALUE_TYPES | ||
| }; | ||
|
|
@@ -706,9 +705,6 @@ bool isPrintable(Field* f); | |
| */ | ||
| void fail(const char* why) __attribute__((noreturn)); | ||
|
|
||
|
|
||
|
|
||
|
|
||
| /** \brief Convert a Field from Tag to array storage. */ | ||
| void freeze(Field* f); | ||
|
|
||
|
|
@@ -718,15 +714,32 @@ void unfreeze(Field* f); | |
| /** \brief Returns true iff the Field uses array storage. */ | ||
| bool isFrozen(Field* f); | ||
|
|
||
| template <typename T> | ||
| T* getArrayDataT(Field * f); | ||
| /** \brief Return the contiguous array storing this field. | ||
| \details This function is only defined for fields | ||
| which are using array storage, for which apf::isFrozen | ||
| returns true. | ||
| \note If the underlying field data type is NOT double, | ||
| this will cause an assert fail in all compile modes. | ||
| */ | ||
| double* getArrayData(Field* f); | ||
|
||
|
|
||
| /** \brief Return the contiguous array storing this field. | ||
| \details This function is only defined for fields | ||
| which are using array storage, for which apf::isFrozen | ||
| returns true. | ||
| \note If the underlying field data type is NOT int, | ||
| this will cause an assert fail in all compile modes. | ||
| */ | ||
| int* getIntArrayData(Field* f); | ||
|
|
||
| /** \brief Return the contiguous array storing this field. | ||
| \details This function is only defined for fields | ||
| which are using array storage, for which apf::isFrozen | ||
| returns true. | ||
| \note If the underlying field data type is NOT double_complex, | ||
| this will cause an assert fail in all compile modes. | ||
| */ | ||
| inline double * getArrayData(Field* f) { return getArrayDataT<double>(f); } | ||
| double_complex* getComplexArrayData(Field * f); | ||
|
|
||
| /** \brief Initialize all nodal values with all-zero components */ | ||
| void zeroField(Field* f); | ||
|
|
||
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 we are now allowing c++11 in CORE can this be done with a static assert?
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.
Core has been C++11 for a while IIRC. I've been using
autoand range-based for's for a while no one has complained so far.This assert has to be runtime though.