@@ -30,8 +30,8 @@ void replaceMaterial(mfem::QuadratureFunction* shapeQFunc,
30
30
SLIC_ASSERT (materialQFunc->Size () == shapeQFunc->Size ());
31
31
32
32
const int SZ = materialQFunc->Size ();
33
- double * mData = materialQFunc->GetData ();
34
- double * sData = shapeQFunc->GetData ();
33
+ double * mData = materialQFunc->HostReadWrite ();
34
+ double * sData = shapeQFunc->HostReadWrite ();
35
35
36
36
if (shapeReplacesMaterial)
37
37
{
@@ -61,8 +61,8 @@ void copyShapeIntoMaterial(const mfem::QuadratureFunction* shapeQFunc,
61
61
SLIC_ASSERT (materialQFunc->Size () == shapeQFunc->Size ());
62
62
63
63
const int SZ = materialQFunc->Size ();
64
- double * mData = materialQFunc->GetData ();
65
- const double * sData = shapeQFunc->GetData ();
64
+ double * mData = materialQFunc->HostReadWrite ();
65
+ const double * sData = shapeQFunc->HostRead ();
66
66
67
67
// When reuseExisting, don't reset material values; otherwise, just copy values over
68
68
if (reuseExisting)
@@ -114,9 +114,11 @@ void generatePositionsQFunction(mfem::Mesh* mesh,
114
114
const int nq = ir.GetNPoints ();
115
115
const auto * geomFactors =
116
116
mesh->GetGeometricFactors (ir, mfem::GeometricFactors::COORDINATES);
117
+ geomFactors->X .HostRead ();
117
118
118
119
mfem::QuadratureFunction* pos_coef = new mfem::QuadratureFunction (sp, dim);
119
120
pos_coef->SetOwnsSpace (true );
121
+ pos_coef->HostReadWrite ();
120
122
121
123
// Rearrange positions into quadrature function
122
124
{
@@ -186,6 +188,7 @@ void computeVolumeFractions(const std::string& matField,
186
188
fes = new mfem::FiniteElementSpace (mesh, fec);
187
189
volFrac = new mfem::GridFunction (fes);
188
190
volFrac->MakeOwner (fec);
191
+ volFrac->HostReadWrite ();
189
192
190
193
dc->RegisterField (volFracName, volFrac);
191
194
}
@@ -400,6 +403,7 @@ void computeVolumeFractionsIdentity(mfem::DataCollection* dc,
400
403
mfem::FiniteElementSpace* fes = new mfem::FiniteElementSpace (mesh, fec);
401
404
mfem::GridFunction* volFrac = new mfem::GridFunction (fes);
402
405
volFrac->MakeOwner (fec);
406
+ volFrac->HostReadWrite ();
403
407
dc->RegisterField (name, volFrac);
404
408
405
409
(*volFrac) = (*inout);
0 commit comments