36static void ReadPumiElement(apf::MeshEntity* Ent,
38 const int Attr, apf::Numbering* vert_num,
45 nv = el->GetNVertices();
46 v = el->GetVertices();
49 for (
int i = 0; i < nv; ++i)
51 v[i] = apf::getNumber(vert_num, Verts[i], 0, 0);
55 el->SetAttribute(Attr);
59static int const tet_rotation[12][4]=
76static int const tet_inv_rotation[12][4]=
93static int const tri_rotation[6][3]=
104static int const tri_inv_rotation[6][3]=
116static bool same(
int n,
120 for (
int i = 0; i < n; i++)
130static void rotateSimplex(
int type,
132 apf::MeshEntity** simplex_in,
133 apf::MeshEntity** simplex_out)
136 if (type == apf::Mesh::TRIANGLE)
138 MFEM_ASSERT(r>=0 && r<6,
"incorrect rotation");
141 else if (type == apf::Mesh::TET)
143 MFEM_ASSERT(r>=0 && r<12,
"incorrect rotation");
148 MFEM_ASSERT(0,
"unsupported case!");
151 for (
int i = 0; i < n; i++)
154 simplex_out[i] = simplex_in[tri_rotation[r][i]];
158 simplex_out[i] = simplex_in[tet_rotation[r][i]];
163static int findSimplexRotation(apf::Mesh2* apf_mesh,
164 apf::MeshEntity* simplex,
165 apf::MeshEntity** vs)
167 int type = apf_mesh->getType(simplex);
169 if (type == apf::Mesh::TET)
173 else if (type == apf::Mesh::TRIANGLE)
179 MFEM_ASSERT(0,
"unsupported entity type");
182 apf::MeshEntity* dvs[12];
183 apf::MeshEntity* rotated_dvs[12];
184 int nd = apf_mesh->getDownward(simplex, 0, dvs);
186 int first = apf::findIn(dvs, nd, vs[0]);
187 int begin = first*
dim;
188 int end = first*
dim +
dim;
189 for (
int r = begin; r < end; r++)
191 rotateSimplex(type, r, dvs, rotated_dvs);
192 if (same(nd, rotated_dvs, vs))
200static void rotateSimplexXi(apf::Vector3& xi,
int dim,
int rot)
204 for (
int i = 0; i <
dim; i++)
211 int const* inverseIdx =
dim == 2 ? tri_inv_rotation[rot] :
212 tet_inv_rotation[rot];
214 for (
int i = 0; i <=
dim; i++)
216 b[inverseIdx[i]] =
a[i];
220 xi[2] =
dim == 2 ? 1.-xi[0]-xi[1] :
b[3];
223static void unrotateSimplexXi(apf::Vector3& xi,
int dim,
int rot)
227 for (
int i = 0; i <
dim; i++)
234 int const* originalIdx =
dim == 2 ? tri_rotation[rot] : tet_rotation[rot];
236 for (
int i = 0; i <=
dim; i++)
238 b[originalIdx[i]] =
a[i];
242 xi[2] =
dim == 2 ? 1.-xi[0]-xi[1] :
b[3];
246 bool fix_orientation)
248 Load(apf_mesh, generate_edges, refine, fix_orientation);
256 apf::MeshEntity* ent;
257 apf::MeshIterator* itr = apf_mesh->begin(BcDim);
259 while ((ent=apf_mesh->iterate(itr)))
261 apf::ModelEntity* mdEnt = apf_mesh->toModel(ent);
262 if (apf_mesh->getModelType(mdEnt) == BcDim)
272 MFEM_ABORT(
"no boundary detected!");
277 bool fix_orientation)
279 int curved = 0, read_gf = 1;
285 apf::Field* apf_field_crd = apf_mesh->getCoordinateField();
286 apf::FieldShape* crd_shape = apf::getShape(apf_field_crd);
287 apf::Numbering* v_num_loc = apf::createNumbering(apf_mesh,
"VertexNumbering",
290 curved = (crd_shape->getOrder() > 1) ? 1 : 0;
295 mfem::out <<
"After ReadSCORECMesh" << endl;
315 if (curved && read_gf)
319 crd_shape->getOrder());
337 apf::destroyNumbering(v_num_loc);
348 apf::MeshIterator* itr = apf_mesh->begin(0);
349 apf::MeshEntity* ent;
351 while ((ent = apf_mesh->iterate(itr)))
359 Dim = apf_mesh->getDimension();
364 const char* gmshTagName =
"gmsh_physical_entity";
365 apf::MeshTag* gmshPhysEnt = apf_mesh->findTag(gmshTagName);
368 itr = apf_mesh->begin(
Dim);
370 while ((ent = apf_mesh->iterate(itr)))
374 apf_mesh->getDownward(ent,0,verts);
379 apf_mesh->getIntTag(ent,gmshPhysEnt,&attr);
382 int geom_type = apf_mesh->getType(ent);
384 ReadPumiElement(ent, verts, attr, v_num_loc,
elements[j]);
399 itr = apf_mesh->begin(BCdim);
400 while ((ent = apf_mesh->iterate(itr)))
403 apf::ModelEntity* mdEnt = apf_mesh->toModel(ent);
404 if (apf_mesh->getModelType(mdEnt) == BCdim)
407 apf_mesh->getDownward(ent, 0, verts);
409 int geom_type = apf_mesh->getType(ent);
411 ReadPumiElement(ent, verts, attr, v_num_loc,
boundary[j]);
422 itr = apf_mesh->begin(0);
425 while ((ent = apf_mesh->iterate(itr)))
427 unsigned int id = apf::getNumber(v_num_loc, ent, 0, 0);
429 apf_mesh->getPoint(ent,0,Crds);
444 int refine,
bool fix_orientation)
453 Dim = apf_mesh->getDimension();
456 apf::MeshIterator* itr;
457 apf::MeshEntity* ent;
461 apf::Numbering* vLocNum =
462 apf::numberOwnedDimension(apf_mesh,
"AuxVertexNumbering", 0);
463 apf::GlobalNumbering* VertexNumbering = apf::makeGlobal(vLocNum,
true);
464 apf::synchronize(VertexNumbering);
468 itr = apf_mesh->begin(0);
469 for (
int i = 0; (ent = apf_mesh->iterate(itr)); i++)
471 long id = apf::getNumber(VertexNumbering, ent, 0, 0);
475 apf::destroyGlobalNumbering(VertexNumbering);
480 for (
int j = 0; j < thisVertIds.
Size(); j++)
482 const int i = thisVertIds[j].two;
483 thisVertIds[i].one = j;
487 apf::Field* apf_field_crd = apf_mesh->getCoordinateField();
488 apf::FieldShape* crd_shape = apf::getShape(apf_field_crd);
491 v_num_loc = apf_mesh->findNumbering(
"LocalVertexNumbering");
493 v_num_loc = apf::createNumbering(apf_mesh,
494 "LocalVertexNumbering",
500 itr = apf_mesh->begin(0);
501 for (
int i = 0; (ent = apf_mesh->iterate(itr)); i++)
503 const int id = thisVertIds[i].one;
505 apf::number(v_num_loc, ent, 0, 0,
id);
508 apf_mesh->getPoint(ent,0,Crds);
523 const char* gmshTagName =
"gmsh_physical_entity";
524 apf::MeshTag* gmshPhysEnt = apf_mesh->findTag(gmshTagName);
527 itr = apf_mesh->begin(
Dim);
528 for (
int j = 0; (ent = apf_mesh->iterate(itr)); j++)
532 apf_mesh->getDownward(ent,0,verts);
537 apf_mesh->getIntTag(ent,gmshPhysEnt,&attr);
541 int geom_type = apf_mesh->getType(ent);
543 ReadPumiElement(ent, verts, attr, v_num_loc,
elements[j]);
550 itr = apf_mesh->begin(BcDim);
552 while ((ent=apf_mesh->iterate(itr)))
554 apf::ModelEntity* mdEnt = apf_mesh->toModel(ent);
555 if (apf_mesh->getModelType(mdEnt) == BcDim)
564 itr = apf_mesh->begin(BcDim);
565 for (
int bdr_ctr = 0; (ent = apf_mesh->iterate(itr)); )
568 apf::ModelEntity* mdEnt = apf_mesh->toModel(ent);
569 if (apf_mesh->getModelType(mdEnt) == BcDim)
572 apf_mesh->getDownward(ent, 0, verts);
574 int geom_type = apf_mesh->getType(ent);
576 ReadPumiElement(ent, verts, attr, v_num_loc,
boundary[bdr_ctr]);
599 "[proc " <<
MyRank <<
"]: invalid state");
611 apf::Numbering* AuxFaceNum =
612 apf::numberOwnedDimension(apf_mesh,
"AuxFaceNumbering", 2);
613 apf::GlobalNumbering* GlobalFaceNum = apf::makeGlobal(AuxFaceNum,
true);
614 apf::synchronize(GlobalFaceNum);
616 itr = apf_mesh->begin(2);
617 while ((ent = apf_mesh->iterate(itr)))
619 if (apf_mesh->isShared(ent))
621 long id = apf::getNumber(GlobalFaceNum, ent, 0, 0);
627 apf::destroyGlobalNumbering(GlobalFaceNum);
630 for (
int i = 0; i < sfaces.
Size(); i++)
634 const int thisNumAdjs = 2;
635 int eleRanks[thisNumAdjs];
639 apf_mesh->getResidence(ent, res);
641 for (std::set<int>::iterator res_itr = res.begin();
642 res_itr != res.end(); ++res_itr)
644 eleRanks[kk++] = *res_itr;
648 sfaces[i].one = groups.
Insert(group) - 1;
662 apf::Numbering* AuxEdgeNum =
663 apf::numberOwnedDimension(apf_mesh,
"EdgeNumbering", 1);
664 apf::GlobalNumbering* GlobalEdgeNum = apf::makeGlobal(AuxEdgeNum,
true);
665 apf::synchronize(GlobalEdgeNum);
667 itr = apf_mesh->begin(1);
668 while ((ent = apf_mesh->iterate(itr)))
670 if (apf_mesh->isShared(ent))
672 long id = apf::getNumber(GlobalEdgeNum, ent, 0, 0);
678 apf::destroyGlobalNumbering(GlobalEdgeNum);
682 for (
int i = 0; i < sedges.
Size(); i++)
688 apf_mesh->getResidence(ent, res);
693 for (std::set<int>::iterator res_itr = res.begin();
694 res_itr != res.end(); res_itr++)
696 eleRanks[kk++] = *res_itr;
701 sedges[i].one = groups.
Insert(group) - 1;
710 itr = apf_mesh->
begin(0);
711 while ((ent = apf_mesh->iterate(itr)))
713 if (apf_mesh->isShared(ent))
715 int vtId = apf::getNumber(v_num_loc, ent, 0, 0);
725 for (
int i = 0; i < sverts.
Size(); i++)
731 apf_mesh->getResidence(ent, res);
736 for (std::set<int>::iterator res_itr = res.begin();
737 res_itr != res.end(); res_itr++)
739 eleRanks[kk++] = *res_itr;
743 svert_group[i] = groups.
Insert(group) - 1;
751 for (
int i = 0; i < sfaces.
Size(); i++)
753 apf::Mesh::Type ftype = apf_mesh->getType(sfaces[i].two);
754 if (ftype == apf::Mesh::TRIANGLE)
758 else if (ftype == apf::Mesh::QUAD)
767 for (
int i = 0; i < sfaces.
Size(); i++)
769 apf::Mesh::Type ftype = apf_mesh->getType(sfaces[i].two);
770 if (ftype == apf::Mesh::TRIANGLE)
774 else if (ftype == apf::Mesh::QUAD)
788 for (
int i = 0; i < sedges.
Size(); i++)
793 for (
int i = 0; i < sedges.
Size(); i++)
801 for (
int i = 0; i < svert_group.
Size(); i++)
806 for (
int i = 0; i < svert_group.
Size(); i++)
815 for (
int i = 0; i < sfaces.
Size(); i++)
820 apf_mesh->getDownward(ent,0,verts);
823 apf::Mesh::Type ftype = apf_mesh->getType(ent);
824 if (ftype == apf::Mesh::TRIANGLE)
829 else if (ftype == apf::Mesh::QUAD)
834 for (
int j = 0; j < nv; ++j)
836 v[j] = apf::getNumber(v_num_loc, verts[j], 0, 0);
844 for (
int i = 0; i < sedges.
Size(); i++)
849 apf_mesh->getDownward(ent, 0, verts);
851 id1 = apf::getNumber(v_num_loc, verts[0], 0, 0);
852 id2 = apf::getNumber(v_num_loc, verts[1], 0, 0);
853 if (id1 > id2) { swap(id1,id2); }
860 for (
int i = 0; i < sverts.
Size(); i++)
872 int curved = (crd_shape->getOrder() > 1) ? 1 : 0;
876 crd_shape->getOrder());
878 Nodes->Vector::Swap(auxNodes);
888 apf::Numbering* v_num_loc,
889 const int mesh_order)
900 double* PumiData = this->
GetData();
902 apf::MeshEntity* ent;
903 apf::MeshIterator* itr;
908 int nnodes = All_nodes.
Size();
911 apf::Field* crd_field = PumiM->getCoordinateField();
913 int nc = apf::countComponents(crd_field);
916 while ((ent = PumiM->iterate(itr)))
922 apf::MeshElement* mE = apf::createMeshElement(PumiM, ent);
923 apf::Element* elem = apf::createElement(crd_field, mE);
926 for (
int ip = 0; ip < nnodes; ip++)
935 apf::DynamicVector phCrd(nc);
936 apf::getComponents(elem, param, &phCrd[0]);
939 for (
int kk = 0; kk < spDim; ++kk)
941 int dof_ctr = ip + kk * nnodes;
942 PumiData[vdofs[dof_ctr]] = phCrd[kk];
946 apf::destroyElement(elem);
947 apf::destroyMeshElement(mE);
983 MFEM_ASSERT(
Dim == AdaptedpMesh->
Dim,
"");
1033 for (
int i = 0; i <
faces.Size(); i++)
1055 MFEM_VERIFY(AdaptedpMesh->
NURBSext == NULL,
1056 "invalid adapted mesh: it is a NURBS mesh");
1060 MFEM_VERIFY(AdaptedpMesh->
ncmesh == NULL && AdaptedpMesh->
pncmesh == NULL,
1061 "invalid adapted mesh: it is a non-conforming mesh");
1097 if (AdaptedpMesh->
Nodes)
1114 apf::MeshEntity* ent,
1117 int type = apf_mesh->getType(ent);
1118 MFEM_CONTRACT_VAR(type);
1119 MFEM_ASSERT(apf::isSimplex(type),
1120 "only implemented for simplex entity types");
1123 int nv = apf_mesh->getDownward(ent,0,vs);
1125 for (
int i = 0; i < nv; i++)
1127 pumi_vid[i] = apf::getNumber(v_num_loc, vs[i], 0, 0);
1135 int pumi_vid_rot[12];
1136 for (
int i = 0; i < nv; i++)
1138 pumi_vid_rot[i] = mfem_vid.
Find(pumi_vid[i]);
1140 apf::Downward vs_rot;
1141 for (
int i = 0; i < nv; i++)
1143 vs_rot[i] = vs[pumi_vid_rot[i]];
1145 return findSimplexRotation(apf_mesh, ent, vs_rot);
1150 apf::MeshEntity* tet,
1152 apf::NewArray<apf::Vector3>& pumi_xi,
1153 bool checkOrientation)
1155 int type = apf_mesh->getType(tet);
1156 MFEM_ASSERT(apf::isSimplex(type),
1157 "only implemented for simplex entity types");
1158 int num_nodes = pumi_xi.size();
1161 for (
int i = 0; i < num_nodes; i++)
1166 unrotateSimplexXi(pumi_xi[i], apf::Mesh::typeDimension[type], rotation);
1170 pumi_xi[i].toArray(tmp_xi);
1179 apf::MeshEntity* tet,
1181 apf::NewArray<apf::Vector3>& pumi_xi,
1182 bool checkOrientation)
1184 int type = apf_mesh->getType(tet);
1185 MFEM_ASSERT(apf::isSimplex(type),
1186 "only implemented for simplex entity types");
1187 int num_nodes = mfem_xi.
Size();
1188 if (!pumi_xi.allocated())
1190 pumi_xi.allocate(num_nodes);
1194 pumi_xi.resize(num_nodes);
1198 for (
int i = 0; i < num_nodes; i++)
1201 pumi_xi[i] = apf::Vector3(ip.
x, ip.
y, ip.
z);
1206 rotateSimplexXi(pumi_xi[i], apf::Mesh::typeDimension[type], rotation);
1217 apf::Field* vel_field,
1218 apf::Field* pr_field,
1219 apf::Field* vel_mag_field)
1221 apf::FieldShape* field_shape = getShape(vel_field);
1222 int dim = apf_mesh->getDimension();
1224 apf::MeshEntity* ent;
1225 apf::MeshIterator* itr = apf_mesh->begin(
dim);
1227 while ((ent = apf_mesh->iterate(itr)))
1229 apf::NewArray<apf::Vector3> pumi_nodes;
1230 apf::getElementNodeXis(field_shape, apf_mesh, ent, pumi_nodes);
1232 apf_mesh, ent, iel, pumi_nodes,
true);
1238 grid_pr->
GetValues(iel, mfem_nodes, pr, 1);
1241 for (
int d = 0; d <=
dim; d++)
1243 if (!field_shape->hasNodesIn(d)) {
continue; }
1245 int na = apf_mesh->getDownward(ent,d,
a);
1246 for (
int i = 0; i < na; i++)
1248 int type = apf_mesh->getType(
a[i]);
1249 int nan = field_shape->countNodesOn(type);
1250 for (
int n = 0; n < nan; n++)
1252 apf::Vector3 v(
vel.GetColumn(non));
1253 apf::setVector(vel_field,
a[i], n, v);
1254 apf::setScalar(pr_field,
a[i], n, pr[non]);
1255 apf::setScalar(vel_mag_field,
a[i], n, v.getLength());
1268 apf::Field* pr_field,
1269 apf::Field* pr_mag_field)
1271 apf::FieldShape* field_shape = getShape(pr_field);
1272 int dim = apf_mesh->getDimension();
1274 apf::MeshEntity* ent;
1275 apf::MeshIterator* itr = apf_mesh->begin(
dim);
1277 while ((ent = apf_mesh->iterate(itr)))
1279 apf::NewArray<apf::Vector3> pumi_nodes;
1280 apf::getElementNodeXis(field_shape, apf_mesh, ent, pumi_nodes);
1282 apf_mesh, ent, iel, pumi_nodes,
true);
1285 grid_pr->
GetValues(iel, mfem_nodes, vals, 1);
1288 for (
int d = 0; d <=
dim; d++)
1290 if (!field_shape->hasNodesIn(d)) {
continue; }
1292 int na = apf_mesh->getDownward(ent,d,
a);
1293 for (
int i = 0; i < na; i++)
1295 int type = apf_mesh->getType(
a[i]);
1296 int nan = field_shape->countNodesOn(type);
1297 for (
int n = 0; n < nan; n++)
1299 double pr = vals[non];
1300 double pr_mag = pr >= 0 ? pr : -pr;
1301 apf::setScalar(pr_field,
a[i], n, pr);
1302 apf::setScalar(pr_mag_field,
a[i], n, pr_mag);
1316 apf::Field* vel_field,
1317 apf::Field* vel_mag_field)
1319 apf::FieldShape* field_shape = getShape(vel_field);
1320 int dim = apf_mesh->getDimension();
1322 apf::MeshEntity* ent;
1323 apf::MeshIterator* itr = apf_mesh->begin(
dim);
1325 while ((ent = apf_mesh->iterate(itr)))
1327 apf::NewArray<apf::Vector3> pumi_nodes;
1328 apf::getElementNodeXis(field_shape, apf_mesh, ent, pumi_nodes);
1330 apf_mesh, ent, iel, pumi_nodes,
true);
1337 for (
int d = 0; d <=
dim; d++)
1339 if (!field_shape->hasNodesIn(d)) {
continue; }
1341 int na = apf_mesh->getDownward(ent,d,
a);
1342 for (
int i = 0; i < na; i++)
1344 int type = apf_mesh->getType(
a[i]);
1345 int nan = field_shape->countNodesOn(type);
1346 for (
int n = 0; n < nan; n++)
1348 apf::Vector3 v(
vel.GetColumn(non));
1349 apf::setScalar(vel_mag_field,
a[i], n, v.getLength());
1350 apf::setVector(vel_field,
a[i], n, v);
1362 apf::Field* nedelec_field)
1364 apf::FieldShape* nedelecFieldShape = nedelec_field->getShape();
1365 int dim = apf_mesh->getDimension();
1369 apf::MeshEntity* ent;
1370 apf::MeshIterator* it = apf_mesh->begin(
dim);
1371 while ( (ent = apf_mesh->iterate(it)) )
1374 apf::NewArray<apf::Vector3> pumi_nodes;
1375 apf::getElementNodeXis(nedelecFieldShape, apf_mesh, ent, pumi_nodes);
1377 apf_mesh, ent, elemNo, pumi_nodes,
true);
1385 for (
int d = 0; d <=
dim; d++)
1387 if (!nedelecFieldShape->hasNodesIn(d)) {
continue; }
1389 int na = apf_mesh->getDownward(ent,d,
a);
1390 for (
int i = 0; i < na; i++)
1392 int type = apf_mesh->getType(
a[i]);
1393 int nan = nedelecFieldShape->countNodesOn(type);
1394 apf::MeshElement* me = apf::createMeshElement(apf_mesh,
a[i]);
1395 for (
int n = 0; n < nan; n++)
1397 apf::Vector3 xi, tangent;
1398 nedelecFieldShape->getNodeXi(type, n, xi);
1399 nedelecFieldShape->getNodeTangent(type, n, tangent);
1400 apf::Vector3 pumi_field_vector(mfem_field_vals.
GetColumn(non));
1402 apf::getJacobian(me, xi, J);
1403 double dof = (J * pumi_field_vector) * tangent;
1404 apf::setScalar(nedelec_field,
a[i], n, dof);
1407 apf::destroyMeshElement(me);
1419 int nc = apf::countComponents(field);
1423 int dim = apf_mesh->getDimension();
1425 apf::MeshIterator* it = apf_mesh->begin(
dim);
1426 for (
int i = 0; i < pmesh->
GetNE(); i++)
1430 int non = mfem_xi.
Size();
1431 apf::MeshEntity* ent = apf_mesh->iterate(it);
1432 apf::NewArray<apf::Vector3> pumi_xi(non);
1441 apf::MeshElement* me = apf::createMeshElement(apf_mesh, ent);
1442 apf::Element* el = apf::createElement(field, me);
1443 for (
int j = 0; j < non; j++)
1445 apf::DynamicVector values(nc);
1446 apf::getComponents(el, pumi_xi[j], &values[0]);
1448 for (
int c = 0; c < nc; c++)
1450 int dof_loc = j + c * non;
1451 (grid->
GetData())[vdofs[dof_loc]] = values[c];
1454 apf::destroyElement(el);
1455 apf::destroyMeshElement(me);
void Sort()
Sorts the array in ascending order. This requires operator< to be defined for T.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
void DeleteAll()
Delete the whole array.
int Find(const T &el) const
Return the first index where 'el' is found; return -1 if not found.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
void Copy(Array ©) const
Create a copy of the internal array to the provided copy.
T * begin()
STL-like begin. Returns pointer to the first element of the array.
Data type dense matrix using column-major storage.
void GetColumn(int c, Vector &col) const
Abstract data type element.
virtual Element * Duplicate(Mesh *m) const =0
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
static FiniteElementCollection * New(const char *name)
Factory method: return a newly allocated FiniteElementCollection according to the given name.
virtual const char * Name() const
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for the i'th element. The returned indices are offsets into an ...
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
Ordering::Type GetOrdering() const
Return the ordering method.
const FiniteElementCollection * FEColl() const
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
int GetVDim() const
Returns vector dimension.
Abstract class for all finite elements.
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
Class for PUMI grid functions.
GridFunctionPumi(Mesh *m, apf::Mesh2 *PumiM, apf::Numbering *v_num_loc, const int mesh_order)
Construct a GridFunction from a PUMI mesh.
void GetValues(int i, const IntegrationRule &ir, Vector &vals, int vdim=1) const
FiniteElementCollection * fec
Used when the grid function is read from a file. It can also be set explicitly, see MakeOwner().
void MakeOwner(FiniteElementCollection *fec_)
Make the GridFunction the owner of fec and fes.
FiniteElementSpace * FESpace()
FiniteElementSpace * fes
FE space on which the grid function lives. Owned if fec is not NULL.
void GetNodalValues(int i, Array< real_t > &nval, int vdim=1) const
Returns the values in the vertices of i'th element for dimension vdim.
void GetVectorValues(int i, const IntegrationRule &ir, DenseMatrix &vals, DenseMatrix &tr) const
void SetComm(MPI_Comm comm)
Set the MPI communicator to 'comm'.
void Create(ListOfIntegerSets &groups, int mpitag)
Set up the group topology given the list of sets of shared entities.
void Copy(GroupTopology ©) const
Copy the internal data to the external 'copy'.
Arbitrary order H1-conforming (continuous) finite elements.
void Recreate(const int n, const int *p)
Create an integer set from C-array 'p' of 'n' integers. Overwrites any existing set data.
Class for integration point with weight.
void Set(const real_t *p, const int dim)
Class for an integration rule - an Array of IntegrationPoint.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
int Size()
Return the number of integer sets in the list.
int Insert(IntegerSet &s)
Check to see if set 's' is in the list. If not append it to the end of the list. Returns the index of...
Element * NewElement(int geom)
int GetNEdges() const
Return the number of edges.
Array< FaceInfo > faces_info
Array< int > bdr_attributes
A list of all unique boundary attributes used by the Mesh.
NURBSExtension * NURBSext
Optional NURBS mesh extension.
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices of element i.
const Element * GetElement(int i) const
Return pointer to the i'th element object.
int GetNFaces() const
Return the number of faces in a 3D mesh.
void FinalizeTopology(bool generate_bdr=true)
Finalize the construction of the secondary topology (connectivity) data of a Mesh.
void Clear()
Clear the contents of the Mesh.
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
const Element * GetBdrElement(int i) const
Return pointer to the i'th boundary element object.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr) const
Builds the transformation defining the i-th element in ElTr. ElTr must be allocated in advance and wi...
int SpaceDimension() const
Dimension of the physical space containing the mesh.
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
int GetNBE() const
Returns number of boundary elements.
virtual void Finalize(bool refine=false, bool fix_orientation=false)
Finalize the construction of a general Mesh.
void FreeElement(Element *E)
Array< Element * > boundary
NCMesh * ncmesh
Optional nonconforming mesh extension.
Array< Element * > elements
Array< int > attributes
A list of all unique element attributes used by the Mesh.
Abstract parallel finite element space.
ParMesh * GetParMesh() const
const FiniteElement * GetFE(int i) const override
Class for parallel grid function.
ParFiniteElementSpace * ParFESpace() const
Class for parallel meshes.
Array< Element * > shared_edges
Table group_svert
Shared objects in each group.
Array< Vert4 > shared_quads
void Finalize(bool refine=false, bool fix_orientation=false) override
Finalize the construction of a general Mesh.
Array< int > svert_lvert
Shared to local index mapping.
Array< Vert3 > shared_trias
void FieldPUMItoMFEM(apf::Mesh2 *apf_mesh, apf::Field *field, ParGridFunction *grid)
Transfer a field from PUMI to MFEM after mesh adapt [Scalar and Vector].
void VectorFieldMFEMtoPUMI(apf::Mesh2 *apf_mesh, ParGridFunction *grid_vel, apf::Field *vel_field, apf::Field *vel_mag_field)
Transfer field from MFEM mesh to PUMI mesh [Vector].
void FieldMFEMtoPUMI(apf::Mesh2 *apf_mesh, ParGridFunction *grid_vel, ParGridFunction *grid_pr, apf::Field *vel_field, apf::Field *pr_field, apf::Field *vel_mag_field)
Transfer field from MFEM mesh to PUMI mesh [Mixed].
void ParentXisMFEMtoPUMI(apf::Mesh2 *apf_mesh, int elemId, apf::MeshEntity *tet, const IntegrationRule &mfem_xi, apf::NewArray< apf::Vector3 > &pumi_xi, bool checkOrientation=true)
Convert the parent coordinate from MFEM to PUMI.
int RotationPUMItoMFEM(apf::Mesh2 *apf_mesh, apf::MeshEntity *tet, int elemId)
Returns the PUMI-to-MFEM permutation (aka rotation, aka orientation)
void UpdateMesh(const ParMesh *AdaptedpMesh)
Update the mesh after adaptation.
IntegrationRule ParentXisPUMItoMFEM(apf::Mesh2 *apf_mesh, apf::MeshEntity *tet, int elemId, apf::NewArray< apf::Vector3 > &pumi_xi, bool checkOrientation=true)
Convert the parent coordinate from PUMI to MFEM.
void NedelecFieldMFEMtoPUMI(apf::Mesh2 *apf_mesh, ParGridFunction *gf, apf::Field *nedelec_field)
Transfer Nedelec field from MFEM mesh to PUMI mesh [Vector].
void ReadSCORECMesh(apf::Mesh2 *apf_mesh, apf::Numbering *v_num_loc, const int curved)
PumiMesh(apf::Mesh2 *apf_mesh, int generate_edges=0, int refine=1, bool fix_orientation=true)
Generate an MFEM mesh from a PUMI mesh.
void CountBoundaryEntity(apf::Mesh2 *apf_mesh, const int BcDim, int &NumBC)
void Load(apf::Mesh2 *apf_mesh, int generate_edges=0, int refine=1, bool fix_orientation=true)
Load a PUMI mesh (following the steps in the MFEM Load function).
Data type line segment element.
void AddConnection(int r, int c)
void MakeI(int nrows)
Next 7 methods are used together with the default constructor.
void Copy(Table ©) const
void AddAColumnInRow(int r)
void SetSize(int s)
Resize the vector to size s.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
void vel(const Vector &x, real_t t, Vector &u)