SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 struct gmi_model;
36 
37 namespace apf {
38 
39 class Mesh;
40 class Mesh2;
41 class MeshTag;
42 class MeshEntity;
43 class Migration;
44 
46 typedef std::map<int, MeshEntity*> GlobalToVert;
47 
53 Mesh2* makeEmptyMdsMesh(gmi_model* model, int dim, bool isMatched);
54 
62 Mesh2* loadMdsMesh(const char* modelfile, const char* meshfile);
63 
77 Mesh2* loadMdsMesh(gmi_model* model, const char* meshfile);
78 
79 // make a serial mesh on all processes - no pmodel & remote link setup
80 Mesh2* loadSerialMdsMesh(gmi_model* model, const char* meshfile);
81 
88 Mesh2* createMdsMesh(gmi_model* model, Mesh* from, bool reorder=false, bool copy_data=true);
89 
103 void reorderMdsMesh(Mesh2* mesh, MeshTag* t = 0);
104 
105 Mesh2* repeatMdsMesh(Mesh2* m, gmi_model* g, Migration* plan, int factor);
106 Mesh2* expandMdsMesh(Mesh2* m, gmi_model* g, int inputPartCount);
107 
109 bool alignMdsMatches(Mesh2* in);
111 bool alignMdsRemotes(Mesh2* in);
112 
118 void deriveMdsModel(Mesh2* in);
119 
144 void deriveMdlFromManifold(Mesh2* mesh, bool* isModelVert,
145  int nBFaces, int (*bFaces)[5],
146  GlobalToVert &globalToVert,
147  std::map<int, apf::MeshEntity*> &globalToRegion);
148 
169 void derive2DMdlFromManifold(Mesh2* mesh, bool* isModelVert,
170  int nBEdges, int (*bEdges)[4],
171  GlobalToVert &globalToVert,
172  std::map<int, apf::MeshEntity*> &globalToFace);
173 
180 void changeMdsDimension(Mesh2* in, int d);
181 
185 int getMdsIndex(Mesh2* in, MeshEntity* e);
186 
193 MeshEntity* getMdsEntity(Mesh2* in, int dimension, int index);
194 
195 Mesh2* loadMdsFromGmsh(gmi_model* g, const char* filename);
196 
197 Mesh2* loadMdsFromUgrid(gmi_model* g, const char* filename);
198 
199 void printUgridPtnStats(gmi_model* g, const char* ugridfile, const char* ptnfile,
200  const double elmWeights[]);
201 
213 Mesh2* loadMdsFromANSYS(const char* nodefile, const char* elemfile);
214 
215 void disownMdsModel(Mesh2* in);
216 
217 void setMdsMatching(Mesh2* in, bool has);
218 
219 Mesh2* loadMdsPart(gmi_model* model, const char* meshfile);
220 void writeMdsPart(Mesh2* m, const char* meshfile);
221 
222 }
223 
224 #endif
Mesh2 * createMdsMesh(gmi_model *model, Mesh *from, bool reorder=false, bool copy_data=true)
create an MDS mesh from an existing mesh
int getMdsIndex(Mesh2 *in, MeshEntity *e)
returns the dimension-unique index for this entity
void changeMdsDimension(Mesh2 *in, int d)
change the dimension of an MDS 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...
bool alignMdsMatches(Mesh2 *in)
align the downward adjacencies of matched entities
the basic structure for all GMI models
Definition: gmi.h:112
Mesh2 * loadMdsMesh(const char *modelfile, const char *meshfile)
load an MDS mesh and model from file
bool alignMdsRemotes(Mesh2 *in)
align the downward adjacencies of remote copies
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...
apf::Mesh2 Mesh
convenient mesh name
Definition: maMesh.h:27
void deriveMdsModel(Mesh2 *in)
build a null model such that apf::verify accepts the mesh.
MeshEntity * getMdsEntity(Mesh2 *in, int dimension, int index)
retrieve an entity by dimension and index
void reorderMdsMesh(Mesh2 *mesh, MeshTag *t=0)
apply adjacency-based reordering
std::map< int, MeshEntity * > GlobalToVert
a map from global ids to vertex objects
Definition: apfConvert.h:32
Mesh2 * loadMdsFromANSYS(const char *nodefile, const char *elemfile)
load an MDS mesh from ANSYS .node and .elem files
Mesh2 * makeEmptyMdsMesh(gmi_model *model, int dim, bool isMatched)
create an empty MDS part
MeshTag * reorder(Mesh *mesh, const char *name)
Number by adjacency graph traversal.