SCOREC core
Parallel unstructured mesh tools
apfConvert.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014 Scientific Computation Research Center
3  *
4  * This work is open source software, licensed under the terms of the
5  * BSD license as described in the LICENSE file in the top-level directory.
6  */
7 
8 #ifndef APF_CONVERT_H
9 #define APF_CONVERT_H
10 
14 #include <map>
15 #include <vector>
16 
17 namespace apf {
18 
19 class Mesh;
20 class Mesh2;
21 class MeshTag; //Extra?
22 class ModelEntity;
23 class MeshEntity;
24 using NewElements = std::vector<MeshEntity*>;
25 
31 void convert(Mesh *in, Mesh2 *out,
32  MeshEntity** nodes=NULL, MeshEntity** elems=NULL, bool copy_data=true);
33 
34 typedef long Gid;
35 
37 typedef std::map<Gid, MeshEntity*> GlobalToVert;
38 
44 NewElements assemble(Mesh2* m, const apf::Gid* conn, int nelem, int etype,
45  GlobalToVert& globalToVert);
46 
53 void finalise(Mesh2* m, GlobalToVert& globalToVert);
54 
71 NewElements construct(Mesh2* m, const apf::Gid* conn, int nelem, int etype,
72  GlobalToVert& globalToVert);
73 
82 void setCoords(Mesh2* m, const double* coords, int nverts,
83  GlobalToVert& globalToVert);
84 
94 void setMatches(Mesh2* m, const Gid* matches, int nverts,
95  GlobalToVert& globalToVert);
96 
97 
105 void destruct(Mesh2* m, Gid*& conn, int& nelem, int &etype, int cellDim = -1);
106 
109 void extractCoords(Mesh2* m, double*& coords, int& nverts);
110 
111 }
112 
113 #endif
Extended mesh interface for modification.
Definition: apfMesh2.h:30
Interface to a mesh part.
Definition: apfMesh.h:105
All APF symbols are contained in this namespace.
void setMatches(Mesh2 *m, const Gid *matches, int nverts, GlobalToVert &globalToVert)
Assign matching to the mesh.
void extractCoords(Mesh2 *m, double *&coords, int &nverts)
get a contiguous set of global vertex coordinates
void finalise(Mesh2 *m, GlobalToVert &globalToVert)
finalise construction of a mixed-cell-type mesh from just a connectivity array
void setCoords(Mesh2 *m, const double *coords, int nverts, GlobalToVert &globalToVert)
Assign coordinates to the mesh.
NewElements assemble(Mesh2 *m, const apf::Gid *conn, int nelem, int etype, GlobalToVert &globalToVert)
assemble a mixed-cell-type mesh from just a connectivity array
NewElements construct(Mesh2 *m, const apf::Gid *conn, int nelem, int etype, GlobalToVert &globalToVert)
construct a mesh from just a connectivity array
void convert(Mesh *in, Mesh2 *out, MeshEntity **nodes=NULL, MeshEntity **elems=NULL, bool copy_data=true)
convert one mesh data structure to another
std::map< Gid, MeshEntity * > GlobalToVert
a map from global ids to vertex objects
Definition: apfConvert.h:37
void destruct(Mesh2 *m, Gid *&conn, int &nelem, int &etype, int cellDim=-1)
convert an apf::Mesh2 object into a connectivity array
apf::Mesh2 Mesh
convenient mesh name
Definition: maMesh.h:27