SCOREC core
Parallel unstructured mesh tools
apfMDS.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Copyright 2014 Scientific Computation Research Center,
4  Rensselaer Polytechnic Institute. All rights reserved.
5 
6  This work is open source software, licensed under the terms of the
7  BSD license as described in the LICENSE file in the top-level directory.
8 
9 *******************************************************************************/
10 
11 #ifndef APFMDS_H
12 #define APFMDS_H
13 
33 #include <map>
34 //
35 // AJP: including apf.h for single define: CGNSBCMap
36 // AJP: alternative is to allow common cgns base header
37 // but trying to avoid that since it's not core functionality
38 #include <apf.h>
39 #include <PCU_C.h>
40 
41 //
42 namespace pcu{
43  class PCU;
44  PCU* PCU_GetGlobal();
45 }
46 struct gmi_model;
47 
48 namespace apf {
49 
50 class Mesh;
51 class Mesh2;
52 class MeshTag;
53 class MeshEntity;
54 class Migration;
55 class Field;
56 
58 typedef std::map<long, MeshEntity*> GlobalToVert;
59 
65 Mesh2* makeEmptyMdsMesh(gmi_model* model, int dim, bool isMatched, pcu::PCU *PCUObj);
66 
74 Mesh2* loadMdsMesh(const char* modelfile, const char* meshfile, pcu::PCU *PCUObj);
75 
89 Mesh2* loadMdsMesh(gmi_model* model, const char* meshfile, pcu::PCU *PCUObj);
90 
91 // make a serial mesh on all processes - no pmodel & remote link setup
92 Mesh2* loadSerialMdsMesh(gmi_model* model, const char* meshfile, pcu::PCU *PCUObj);
93 
100 Mesh2* createMdsMesh(gmi_model* model, Mesh* from, bool reorder=false, bool copy_data=true);
101 
115 void reorderMdsMesh(Mesh2* mesh, MeshTag* t = 0);
116 
117 Mesh2* repeatMdsMesh(Mesh2* m, gmi_model* g, Migration* plan, int factor, pcu::PCU *PCUObj);
118 
119 Mesh2* expandMdsMesh(Mesh2* m, gmi_model* g, int inputPartCount, pcu::PCU *expandedPCU);
124 
131 
156 void deriveMdlFromManifold(Mesh2* mesh, bool* isModelVert,
157  int nBFaces, int (*bFaces)[5],
158  GlobalToVert &globalToVert,
159  std::map<int, apf::MeshEntity*> &globalToRegion);
160 
181 void derive2DMdlFromManifold(Mesh2* mesh, bool* isModelVert,
182  int nBEdges, int (*bEdges)[4],
183  GlobalToVert &globalToVert,
184  std::map<int, apf::MeshEntity*> &globalToFace);
185 
192 void changeMdsDimension(Mesh2* in, int d);
193 
197 int getMdsIndex(Mesh2* in, MeshEntity* e);
198 
205 MeshEntity* getMdsEntity(Mesh2* in, int dimension, int index);
206 
207 Mesh2* loadMdsFromCGNS(PCU_t h, gmi_model* g, const char* filename, CGNSBCMap& cgnsBCMap);
208 
209 // names of mesh data to read from file: (VERTEX, VelocityX; CellCentre, Pressure)
210 Mesh2* loadMdsFromCGNS(PCU_t h, gmi_model* g, const char* filename, CGNSBCMap& cgnsBCMap, const std::vector<std::pair<std::string, std::string>>& meshData);
211 
212 
213 int gmshMajorVersion(const char* filename);
214 
215 Mesh2* loadMdsFromGmsh(gmi_model* g, const char* filename, pcu::PCU *PCUObj);
216 
217 Mesh2* loadMdsDmgFromGmsh(const char* fnameDmg, const char* filename, pcu::PCU *PCUObj);
218 
219 Mesh2* loadMdsFromUgrid(gmi_model* g, const char* filename, pcu::PCU *PCUObj);
220 
221 void printUgridPtnStats(gmi_model* g, const char* ugridfile, const char* ptnfile,
222  const double elmWeights[], pcu::PCU *PCUObj);
223 
235 Mesh2* loadMdsFromANSYS(const char* nodefile, const char* elemfile, pcu::PCU *PCUObj);
236 
237 void disownMdsModel(Mesh2* in);
238 
239 void setMdsMatching(Mesh2* in, bool has);
240 
241 Mesh2* loadMdsPart(gmi_model* model, const char* meshfile, pcu::PCU *PCUObj);
242 void writeMdsPart(Mesh2* m, const char* meshfile);
243 
244 }
245 
246 #endif
The APF Field interface.
Extended mesh interface for modification.
Definition: apfMesh2.h:30
Interface to a mesh part.
Definition: apfMesh.h:105
Migration plan object: local elements to destinations.
Definition: apfMesh.h:459
The Parallel Contrul Unit class encapsulates parallel communication.
Definition: PCU.h:26
All APF symbols are contained in this namespace.
bool alignMdsMatches(Mesh2 *in)
align the downward adjacencies of matched entities
bool alignMdsRemotes(Mesh2 *in)
align the downward adjacencies of remote copies
MeshEntity * getMdsEntity(Mesh2 *in, int dimension, int index)
retrieve an entity by dimension and index
MeshTag * reorder(Mesh *mesh, const char *name)
Number by adjacency graph traversal.
void deriveMdsModel(Mesh2 *in)
build a null model such that apf::verify accepts the mesh.
void reorderMdsMesh(Mesh2 *mesh, MeshTag *t=0)
apply adjacency-based reordering
Mesh2 * createMdsMesh(gmi_model *model, Mesh *from, bool reorder=false, bool copy_data=true)
create an MDS mesh from an existing mesh
void deriveMdlFromManifold(Mesh2 *mesh, bool *isModelVert, int nBFaces, int(*bFaces)[5], GlobalToVert &globalToVert, std::map< int, apf::MeshEntity * > &globalToRegion)
Given the mesh vertices that are also model vertices, and the classification on boundary mesh faces,...
Mesh2 * loadMdsFromANSYS(const char *nodefile, const char *elemfile, pcu::PCU *PCUObj)
load an MDS mesh from ANSYS .node and .elem files
void derive2DMdlFromManifold(Mesh2 *mesh, bool *isModelVert, int nBEdges, int(*bEdges)[4], GlobalToVert &globalToVert, std::map< int, apf::MeshEntity * > &globalToFace)
Given the mesh vertices that are also model vertices, and the classification on boundary mesh edges,...
Mesh2 * loadMdsMesh(const char *modelfile, const char *meshfile, pcu::PCU *PCUObj)
load an MDS mesh and model from file
std::map< Gid, MeshEntity * > GlobalToVert
a map from global ids to vertex objects
Definition: apfConvert.h:37
Mesh2 * makeEmptyMdsMesh(gmi_model *model, int dim, bool isMatched, pcu::PCU *PCUObj)
create an empty MDS part
void changeMdsDimension(Mesh2 *in, int d)
change the dimension of an MDS mesh
int getMdsIndex(Mesh2 *in, MeshEntity *e)
returns the dimension-unique index for this entity
apf::Mesh2 Mesh
convenient mesh name
Definition: maMesh.h:27
Definition: PCU.h:15
the basic structure for all GMI models
Definition: gmi.h:112