19 #ifndef LIBMESH_PARALLEL_ALGEBRA_H 20 #define LIBMESH_PARALLEL_ALGEBRA_H 55 std::unique_ptr<TypeVector<T>> temp;
64 #ifdef LIBMESH_HAVE_MPI 68 int blocklength = LIBMESH_DIM;
69 MPI_Aint displs, start;
70 MPI_Datatype tmptype, type = T_type;
73 (MPI_Get_address (ex, &start));
75 (MPI_Get_address (&((*ex)(0)), &displs));
82 (MPI_Type_create_struct (1, &blocklength, &displs, &type,
85 (MPI_Type_commit (&tmptype));
96 (MPI_Type_free (&tmptype));
97 #endif // #ifdef LIBMESH_HAVE_MPI 103 libmesh_call_mpi (MPI_Type_dup (t._datatype, &
_datatype));
110 template <
typename T>
118 std::unique_ptr<VectorValue<T>> temp;
127 #ifdef LIBMESH_HAVE_MPI 130 int blocklength = LIBMESH_DIM;
131 MPI_Aint displs, start;
132 MPI_Datatype tmptype, type = T_type;
135 (MPI_Get_address (ex, &start));
137 (MPI_Get_address (&((*ex)(0)), &displs));
144 (MPI_Type_create_struct (1, &blocklength, &displs, &type,
147 (MPI_Type_commit (&tmptype));
151 (MPI_Type_create_resized (tmptype, 0,
159 (MPI_Type_free (&tmptype));
160 #endif // #ifdef LIBMESH_HAVE_MPI 166 #ifdef LIBMESH_HAVE_MPI 167 libmesh_call_mpi (MPI_Type_dup (t._datatype, &
_datatype));
185 #ifdef LIBMESH_HAVE_MPI 190 std::unique_ptr<Point> temp;
192 ex =
const_cast<Point *
>(example);
195 temp.reset(
new Point());
201 int blocklength = LIBMESH_DIM;
202 MPI_Aint displs, start;
203 MPI_Datatype tmptype, type = T_type;
206 (MPI_Get_address (ex, &start));
208 (MPI_Get_address (&((*ex)(0)), &displs));
215 (MPI_Type_create_struct (1, &blocklength, &displs, &type,
218 (MPI_Type_commit (&tmptype));
222 (MPI_Type_create_resized (tmptype, 0,
sizeof(
Point),
229 (MPI_Type_free (&tmptype));
230 #endif // #ifdef LIBMESH_HAVE_MPI 236 libmesh_call_mpi (MPI_Type_dup (t._datatype, &
_datatype));
254 template <
typename V>
258 #ifdef LIBMESH_HAVE_MPI 259 static void vector_max (
void * invec,
void * inoutvec,
int * len, MPI_Datatype *)
261 V *in =
static_cast<V *
>(invec);
262 V *inout =
static_cast<V *
>(inoutvec);
263 for (
int i=0; i != *len; ++i)
264 for (
int d=0; d != LIBMESH_DIM; ++d)
265 inout[i](d) =
std::max(in[i](d), inout[i](d));
268 static void vector_min (
void * invec,
void * inoutvec,
int * len, MPI_Datatype *)
270 V *in =
static_cast<V *
>(invec);
271 V *inout =
static_cast<V *
>(inoutvec);
272 for (
int i=0; i != *len; ++i)
273 for (
int d=0; d != LIBMESH_DIM; ++d)
274 inout[i](d) =
std::min(in[i](d), inout[i](d));
277 static void vector_sum (
void * invec,
void * inoutvec,
int * len, MPI_Datatype *)
279 V *in =
static_cast<V *
>(invec);
280 V *inout =
static_cast<V *
>(inoutvec);
281 for (
int i=0; i != *len; ++i)
282 for (
int d=0; d != LIBMESH_DIM; ++d)
283 inout[i](d) += in[i](d);
290 static MPI_Op _static_op;
307 static MPI_Op _static_op;
324 static MPI_Op _static_op;
338 #endif // LIBMESH_HAVE_MPI 341 template <
typename T>
344 template <
typename T>
354 template <
typename T>
365 template <
typename T>
378 #endif // LIBMESH_PARALLEL_ALGEBRA_H StandardType(const StandardType< VectorValue< T >> &t)
static void vector_max(void *invec, void *inoutvec, int *len, MPI_Datatype *)
StandardType(const TypeTensor< T > *example=nullptr)
StandardType(const StandardType< Point > &libmesh_mpi_var(t))
long double max(long double a, double b)
static void vector_min(void *invec, void *inoutvec, int *len, MPI_Datatype *)
StandardType(const TensorValue< T > *example=nullptr)
void libmesh_ignore(const Args &...)
StandardType(const VectorValue< T > *example=nullptr)
StandardType(const Point *example=nullptr)
StandardType(const TypeVector< T > *example=nullptr)
StandardType(const StandardType< TypeVector< T >> &libmesh_mpi_var(t))
long double min(long double a, double b)
A geometric point in (x,y,z) space.
static void vector_sum(void *invec, void *inoutvec, int *len, MPI_Datatype *)