Skip to content

Commit

Permalink
Implementation of AggregateNumbering as a read-only field, also addin…
Browse files Browse the repository at this point in the history
…g several operations to PCU including PCU_Allgather and rank translation between MPI_Comms as needed in the implementation of AggregateNumberings.
  • Loading branch information
William Tobin committed Aug 6, 2018
1 parent 97ff898 commit e089dae
Show file tree
Hide file tree
Showing 19 changed files with 663 additions and 70 deletions.
2 changes: 2 additions & 0 deletions apf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ endif()
# Package sources
set(SOURCES
apf.cc
apfAggregateNumbering.cc
apfCavityOp.cc
apfElement.cc
apfField.cc
Expand Down Expand Up @@ -51,6 +52,7 @@ set(SOURCES
# Package headers
set(HEADERS
apf.h
apfAggregateNumbering.h
apfMesh.h
apfMesh2.h
apfMatrix.h
Expand Down
4 changes: 0 additions & 4 deletions apf/apf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,6 @@ bool isFrozen(Field* f)
return f->getData()->isFrozen();
}

Function::~Function()
{
}

Field* createUserField(Mesh* m, const char* name, int valueType, FieldShape* s,
Function* f)
{
Expand Down
27 changes: 16 additions & 11 deletions apf/apf.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,27 +654,32 @@ double* getArrayData(Field* f);
/** \brief Initialize all nodal values with all-zero components */
void zeroField(Field* f);

/** \brief User-defined Analytic Function. */
struct Function
/** \brief User-defined Analytic Function for arbitrary scalar type. */
template <class T>
struct FunctionBase
{
/** \brief Possible user-defined cleanup */
virtual ~Function();
virtual ~FunctionBase() {}
/** \brief The user's analytic function call.
\details For simplicity, this
currently only supports one node per entity.
\param e the entity on which the node is
\param result the field component values for that node
*/
virtual void eval(MeshEntity* e, double* result) = 0;
\details For simplicity, this
currently only supports one node per entity.
\param e the entity on which the node is
\param result the field component values for that node
*/
virtual void eval(MeshEntity * e, T * result) = 0;
};
typedef FunctionBase<double> Function;

/** \brief Create a Field from a user's analytic function.
\details This field will use no memory, has values on all
nodes, and calls the user Function for all value queries.
Writing to this field does nothing.
*/
Field* createUserField(Mesh* m, const char* name, int valueType, FieldShape* s,
Function* f);
Field * createUserField(Mesh* m,
const char* name,
int valueType,
FieldShape* s,
Function * f);

/** \brief Compute a nodal gradient field from a nodal input field
\details given a nodal field, compute approximate nodal gradient
Expand Down
Loading

0 comments on commit e089dae

Please sign in to comment.