@@ -19,9 +19,12 @@ static double getNaN() { return std::numeric_limits<double>::quiet_NaN(); }
1919/* common base for Scalar Integrator. */
2020class SInt : public MeshField ::Integrator {
2121public:
22- SInt (int order) : MeshField::Integrator(order), r(0 ) {}
22+ SInt (int order, Omega_h::CommPtr comm_in)
23+ : MeshField::Integrator(order), r(0 ), comm(comm_in) {}
2324 void reset () { r = 0 ; }
2425 MeshField::Real r;
26+ Omega_h::CommPtr comm;
27+ void parallelReduce () { comm->allreduce (r, OMEGA_H_SUM); }
2528};
2629
2730template <typename ShapeField> class Estimation {
@@ -83,8 +86,8 @@ template <typename EstimationT, typename OmegahMeshField>
8386class SelfProduct : public SInt {
8487public:
8588 SelfProduct (EstimationT &estimation_in, OmegahMeshField &omf_in)
86- : SInt(estimation_in.integration_order), estimation( estimation_in),
87- omf (omf_in) {}
89+ : SInt(estimation_in.integration_order, estimation_in.mesh.comm() ),
90+ estimation (estimation_in), omf(omf_in) {}
8891 void atPoints (Kokkos::View<MeshField::Real **> p,
8992 Kokkos::View<MeshField::Real *> w,
9093 Kokkos::View<MeshField::Real *> dV) {
@@ -155,8 +158,9 @@ template <typename EstimationT, typename OmegahMeshField>
155158class Error : public SInt {
156159public:
157160 Error (EstimationT &estimation_in, OmegahMeshField &omf_in)
158- : SInt(estimation_in.integration_order), estimation(estimation_in),
159- omf (omf_in), errorNorm(" errorNorm" , estimation_in.mesh.nelems()) {}
161+ : SInt(estimation_in.integration_order, estimation_in.mesh.comm()),
162+ estimation (estimation_in), omf(omf_in),
163+ errorNorm(" errorNorm" , estimation_in.mesh.nelems()) {}
160164 void atPoints (Kokkos::View<MeshField::Real **> p,
161165 Kokkos::View<MeshField::Real *> w,
162166 Kokkos::View<MeshField::Real *> dV) {
0 commit comments