Skip to content

Commit e089dae

Browse files
author
William Tobin
committed
Implementation of AggregateNumbering as a read-only field, also adding several operations to PCU including PCU_Allgather and rank translation between MPI_Comms as needed in the implementation of AggregateNumberings.
1 parent 97ff898 commit e089dae

19 files changed

+663
-70
lines changed

apf/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ endif()
66
# Package sources
77
set(SOURCES
88
apf.cc
9+
apfAggregateNumbering.cc
910
apfCavityOp.cc
1011
apfElement.cc
1112
apfField.cc
@@ -51,6 +52,7 @@ set(SOURCES
5152
# Package headers
5253
set(HEADERS
5354
apf.h
55+
apfAggregateNumbering.h
5456
apfMesh.h
5557
apfMesh2.h
5658
apfMatrix.h

apf/apf.cc

-4
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,6 @@ bool isFrozen(Field* f)
453453
return f->getData()->isFrozen();
454454
}
455455

456-
Function::~Function()
457-
{
458-
}
459-
460456
Field* createUserField(Mesh* m, const char* name, int valueType, FieldShape* s,
461457
Function* f)
462458
{

apf/apf.h

+16-11
Original file line numberDiff line numberDiff line change
@@ -654,27 +654,32 @@ double* getArrayData(Field* f);
654654
/** \brief Initialize all nodal values with all-zero components */
655655
void zeroField(Field* f);
656656

657-
/** \brief User-defined Analytic Function. */
658-
struct Function
657+
/** \brief User-defined Analytic Function for arbitrary scalar type. */
658+
template <class T>
659+
struct FunctionBase
659660
{
660661
/** \brief Possible user-defined cleanup */
661-
virtual ~Function();
662+
virtual ~FunctionBase() {}
662663
/** \brief The user's analytic function call.
663-
\details For simplicity, this
664-
currently only supports one node per entity.
665-
\param e the entity on which the node is
666-
\param result the field component values for that node
667-
*/
668-
virtual void eval(MeshEntity* e, double* result) = 0;
664+
\details For simplicity, this
665+
currently only supports one node per entity.
666+
\param e the entity on which the node is
667+
\param result the field component values for that node
668+
*/
669+
virtual void eval(MeshEntity * e, T * result) = 0;
669670
};
671+
typedef FunctionBase<double> Function;
670672

671673
/** \brief Create a Field from a user's analytic function.
672674
\details This field will use no memory, has values on all
673675
nodes, and calls the user Function for all value queries.
674676
Writing to this field does nothing.
675677
*/
676-
Field* createUserField(Mesh* m, const char* name, int valueType, FieldShape* s,
677-
Function* f);
678+
Field * createUserField(Mesh* m,
679+
const char* name,
680+
int valueType,
681+
FieldShape* s,
682+
Function * f);
678683

679684
/** \brief Compute a nodal gradient field from a nodal input field
680685
\details given a nodal field, compute approximate nodal gradient

0 commit comments

Comments
 (0)