19 #ifndef LIBMESH_PARALLEL_FE_TYPE_H 20 #define LIBMESH_PARALLEL_FE_TYPE_H 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/fe_type.h" 35 #include <type_traits> 60 #ifdef LIBMESH_HAVE_MPI 61 static void fetype_max (
void * intype,
void * inouttype,
int * len, MPI_Datatype *)
65 for (
int i=0; i != *len; ++i)
67 inout[i].
family = std::max(in[i].family, inout[i].family);
68 inout[i].
order = std::max(in[i].order, inout[i].order);
72 static void fetype_min (
void * intype,
void * inouttype,
int * len, MPI_Datatype *)
76 for (
int i=0; i != *len; ++i)
78 inout[i].
family = std::min(in[i].family, inout[i].family);
79 inout[i].
order = std::min(in[i].order, inout[i].order);
83 static void fetype_sum (
void *,
void *,
int *, MPI_Datatype *)
85 libmesh_not_implemented();
92 static MPI_Op _static_op;
97 (MPI_Op_create (fetype_max,
true,
109 static MPI_Op _static_op;
114 (MPI_Op_create (fetype_min,
true,
124 libmesh_not_implemented();
127 #endif // LIBMESH_HAVE_MPI 155 #ifdef LIBMESH_HAVE_MPI 160 std::unique_ptr<FEType> temp;
162 ex =
const_cast<FEType *
>(example);
165 temp = std::make_unique<FEType>();
169 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 170 constexpr std::size_t structsize = 5;
172 constexpr std::size_t structsize = 2;
176 MPI_Datatype int_types[structsize];
179 int blocklengths[structsize];
180 MPI_Aint start, displs[structsize];
181 MPI_Datatype tmptype;
184 (MPI_Get_address (ex, &start));
185 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 187 (MPI_Get_address (&(ex->order), &displs[0]));
189 (MPI_Get_address (&(ex->radial_order), &displs[1]));
191 (MPI_Get_address (&(ex->family), &displs[2]));
193 (MPI_Get_address (&(ex->radial_family), &displs[3]));
195 (MPI_Get_address (&(ex->inf_map), &displs[4]));
196 #else // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 198 (MPI_Get_address (&(ex->order), &displs[0]));
200 (MPI_Get_address (&(ex->family), &displs[1]));
201 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 206 for (std::size_t i = 0; i != structsize; ++i)
209 int_types[i] = MPI_INT;
215 (MPI_Type_create_struct (structsize, blocklengths, displs,
216 int_types, &tmptype));
218 (MPI_Type_commit (&tmptype));
222 (MPI_Type_create_resized (tmptype, 0,
sizeof(FEType),
226 (MPI_Type_commit (&_datatype));
229 (MPI_Type_free (&tmptype));
232 #endif // #ifdef LIBMESH_HAVE_MPI 238 timpi_call_mpi (MPI_Type_dup (t._datatype, &_datatype));
248 #endif // LIBMESH_PARALLEL_FE_TYPE_H class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
static void set_lowest(libMesh::FEType &x)
FEFamily family
The type of finite element.
Order
defines an enum for polynomial orders.
static void set_highest(libMesh::FEType &x)
OrderWrapper order
The approximation order of the element.
The libMesh namespace provides an interface to certain functionality in the library.
StandardType(const libMesh::FEType *example=nullptr)
void libmesh_ignore(const Args &...)
StandardType(const StandardType< libMesh::FEType > &timpi_mpi_var(t))
bool _is_initialized
Flag that tells if init() has been called.
static const bool has_min_max
static const bool is_fixed_type
static void fetype_min(void *intype, void *inouttype, int *len, MPI_Datatype *)
TIMPI_PARALLEL_INTEGER_OPS(char)
static void fetype_max(void *intype, void *inouttype, int *len, MPI_Datatype *)
static void fetype_sum(void *, void *, int *, MPI_Datatype *)
FEFamily
defines an enum for finite element families.
TIMPI_STANDARD_TYPE(char, MPI_CHAR)