SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
apfMesh.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 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_MESH_H
9 #define APF_MESH_H
10 
14 #include <vector>
15 #include <map>
16 #include <set>
17 #include "apfVector.h"
18 #include "apfDynamicArray.h"
19 
20 struct gmi_model;
21 
22 namespace apf {
23 
24 class FieldShape;
25 class Field;
26 template <class T>
27 class NumberingOf;
29 typedef NumberingOf<int> Numbering;
30 typedef NumberingOf<long> GlobalNumbering;
31 
32 class MeshEntity;
33 class MeshIterator;
34 class MeshTag;
35 
36 class ModelEntity;
37 
41 typedef std::map<int,MeshEntity*> Copies;
43 typedef std::set<int> Parts;
46 typedef DynamicArray<MeshEntity*> Adjacent;
52 typedef MeshEntity* Downward[12];
53 
54 class Migration;
55 
63 struct Up
64 {
66  int n;
68  MeshEntity* e[400];
69 };
70 
75 struct Copy
76 {
78  Copy():peer(0),entity(0) {}
80  Copy(int p, MeshEntity* e):peer(p),entity(e) {}
82  int peer;
84  MeshEntity* entity;
85 };
87 typedef Copy Match;
88 
90 typedef DynamicArray<Copy> CopyArray;
95 
103 class Mesh
104 {
105  public:
110  void init(FieldShape* s);
115  virtual ~Mesh();
117  virtual int getDimension() = 0;
119  virtual std::size_t count(int dimension) = 0;
121  virtual MeshIterator* begin(int dimension) = 0;
124  virtual MeshEntity* iterate(MeshIterator* it) = 0;
128  virtual void end(MeshIterator* it) = 0;
129 // seol
130  // return true if adjacency *from_dim <--> to_dim* is stored
131  virtual bool hasAdjacency(int from_dim, int to_dim) = 0;
132  // store adjacency *from_dim <--> to_dim* if not stored
133  virtual void createAdjacency(int from_dim, int to_dim) = 0;
134  // remove adjacency *from_dim <--> to_dim* except for one-level apart adjacency
135  virtual void deleteAdjacency(int from_dim, int to_dim) = 0;
136 
138  virtual bool isShared(MeshEntity* e) = 0;
139 //seol
140  virtual bool isGhosted(MeshEntity* e) = 0;
141  virtual bool isGhost(MeshEntity* e) = 0;
144  virtual bool isOwned(MeshEntity* e) = 0;
146  virtual int getOwner(MeshEntity* e) = 0;
148  enum Type {
150  VERTEX, //0
152  EDGE, //1
154  TRIANGLE, //2
156  QUAD, //3
158  TET, //4
160  HEX, //5
162  PRISM, //6
164  PYRAMID, //7
166  TYPES }; //8
169  static int const adjacentCount[TYPES][4];
171  static int const typeDimension[TYPES];
173  static char const* const typeName[TYPES];
175  static Type const simplexTypes[4];
182  virtual void getAdjacent(MeshEntity* e, int dimension,
183  Adjacent& adjacent) = 0;
192  virtual int getDownward(MeshEntity* e, int dimension,
193  MeshEntity** adjacent) = 0;
195  virtual int countUpward(MeshEntity* e) = 0;
197  virtual MeshEntity* getUpward(MeshEntity* e, int i) = 0;
199  virtual void getUp(MeshEntity* e, Up& up) = 0;
201  virtual bool hasUp(MeshEntity* e) = 0;
210  void getPoint(MeshEntity* e, int node, Vector3& point);
212  virtual void getPoint_(MeshEntity* e, int node, Vector3& point) = 0;
214  virtual void getParam(MeshEntity* e, Vector3& p) = 0;
217  virtual Type getType(MeshEntity* e) = 0;
219  virtual void getRemotes(MeshEntity* e, Copies& remotes) = 0;
220 // seol
221  virtual int getGhosts(MeshEntity* e, Copies& ghosts) = 0;
225  virtual void getResidence(MeshEntity* e, Parts& residence) = 0;
227  virtual MeshTag* createDoubleTag(const char* name, int size) = 0;
229  virtual MeshTag* createIntTag(const char* name, int size) = 0;
231  virtual MeshTag* createLongTag(const char* name, int size) = 0;
233  virtual MeshTag* findTag(const char* name) = 0;
235  virtual void destroyTag(MeshTag* tag) = 0;
239  virtual void getTags(DynamicArray<MeshTag*>& tags) = 0;
242  virtual void getDoubleTag(MeshEntity* e, MeshTag* tag, double* data) = 0;
245  virtual void setDoubleTag(MeshEntity* e, MeshTag* tag, double const* data) = 0;
248  virtual void getIntTag(MeshEntity* e, MeshTag* tag, int* data) = 0;
251  virtual void setIntTag(MeshEntity* e, MeshTag* tag, int const* data) = 0;
254  virtual void getLongTag(MeshEntity* e, MeshTag* tag, long* data) = 0;
257  virtual void setLongTag(MeshEntity* e, MeshTag* tag, long const* data) = 0;
260  virtual void removeTag(MeshEntity* e, MeshTag* tag) = 0;
262  virtual bool hasTag(MeshEntity* e, MeshTag* tag) = 0;
264  virtual void renameTag(MeshTag* tag, const char* newName) = 0;
266  virtual unsigned getTagChecksum(MeshTag* tag, int type) = 0;
268  enum TagType {
274  LONG };
277  virtual int getTagType(MeshTag* t) = 0;
279  virtual int getTagSize(MeshTag* t) = 0;
283  virtual const char* getTagName(MeshTag* t) = 0;
285  virtual ModelEntity* toModel(MeshEntity* e) = 0;
287  virtual gmi_model* getModel() = 0;
289  virtual void setModel(gmi_model* newModel) = 0;
291  int getModelType(ModelEntity* e);
293  int getModelTag(ModelEntity* e);
295  ModelEntity* findModelEntity(int type, int tag);
297  bool canSnap();
299  bool canGetClosestPoint();
301  bool canGetModelNormal();
303  void snapToModel(ModelEntity* m, Vector3 const& p, Vector3& x);
305  void getParamOn(ModelEntity* g, MeshEntity* e, Vector3& p);
309  bool getPeriodicRange(ModelEntity* g, int axis,
310  double range[2]);
312  void getClosestPoint(ModelEntity* g, Vector3 const& from,
313  Vector3& to, Vector3& p);
315  void getNormal(ModelEntity* g, Vector3 const& p, Vector3& n);
317  void getFirstDerivative(ModelEntity* g, Vector3 const& p,
318  Vector3& t0, Vector3& t1);
321  bool isParamPointInsideModel(ModelEntity* g,
322  Vector3 const& param, Vector3& x);
324  bool isInClosureOf(ModelEntity* g, ModelEntity* target);
326  void boundingBox(ModelEntity* g, Vector3& bmin, Vector3& bmax);
328  bool isOnModel(ModelEntity* g, Vector3 p, double scale);
330  FieldShape* getShape() const;
332  Field* getCoordinateField() {return coordinateField;}
334  void setCoordinateField(Field* field);
337  void changeShape(FieldShape* newShape, bool project = true);
341  virtual void migrate(Migration* plan) = 0;
343  virtual int getId() = 0;
345  virtual void writeNative(const char* fileName) = 0;
347  virtual void destroyNative() = 0;
350  virtual void verify() = 0;
352  virtual bool hasMatching() = 0;
354  virtual void getMatches(MeshEntity* e, Matches& m) = 0;
356  virtual void getDgCopies(MeshEntity* e, DgCopies& dgCopies, ModelEntity* me = 0) = 0;
362  virtual double getElementBytes(int) {return 1.0;}
366  void addField(Field* f);
370  void removeField(Field* f);
372  Field* findField(const char* name);
374  int countFields();
376  Field* getField(int i);
380  void addNumbering(Numbering* f);
384  void removeNumbering(Numbering* f);
386  Numbering* findNumbering(const char* name);
388  int countNumberings();
390  Numbering* getNumbering(int i);
391  void addGlobalNumbering(GlobalNumbering* f);
392  void removeGlobalNumbering(GlobalNumbering* f);
393  int countGlobalNumberings();
395  GlobalNumbering* findGlobalNumbering(const char* name);
396 
397  GlobalNumbering* getGlobalNumbering(int i);
400  protected:
401  Field* coordinateField;
402  std::vector<Field*> fields;
403  std::vector<Numbering*> numberings;
404  std::vector<GlobalNumbering*> globalNumberings;
405 };
406 
410 void verify(Mesh* m, bool abort_on_error=true);
411 
412 long verifyVolumes(Mesh* m, bool printVolumes = true);
413 
415 int getDimension(Mesh* m, MeshEntity* e);
416 
419 void unite(Parts& into, Parts const& from);
420 
422 void removeTagFromDimension(Mesh* m, MeshTag* tag, int d);
423 
426 MeshEntity* findUpward(Mesh* m, int type, MeshEntity** down);
427 
429 MeshEntity* findElement(
430  Mesh* m,
431  int type,
432  MeshEntity** verts);
433 
435 MeshEntity* getEdgeVertOppositeVert(Mesh* m, MeshEntity* edge, MeshEntity* v);
436 
438 void getBridgeAdjacent(Mesh* m, MeshEntity* origin,
439  int bridgeDimension, int targetDimension, Adjacent& result);
440 
442 int countEntitiesOfType(Mesh* m, int type);
443 
445 bool isSimplex(int type);
446 
450 Vector3 getLinearCentroid(Mesh* m, MeshEntity* e);
451 
454 {
455  public:
458  Migration(Mesh* m);
459  Migration(Mesh* m, MeshTag* existingTag);
460  ~Migration();
462  int count();
464  MeshEntity* get(int i);
466  bool has(MeshEntity* e);
468  void send(MeshEntity* e, int to);
470  int sending(MeshEntity* e);
471  Mesh* getMesh() {return mesh;}
472  private:
473  Mesh* mesh;
474  MeshTag* tag;
475  std::vector<MeshEntity*> elements;
476 };
477 
483 struct Sharing
484 {
485  virtual ~Sharing() {}
487  virtual bool isOwned(MeshEntity* e) = 0;
489  virtual int getOwner(MeshEntity* e) = 0;
491  virtual void getCopies(MeshEntity* e,
492  CopyArray& copies) = 0;
493  virtual bool isShared(MeshEntity* e) = 0;
494 };
495 
496 struct NormalSharing : public Sharing
497 {
498  NormalSharing(Mesh* m);
499  virtual int getOwner(MeshEntity* e);
500  virtual bool isOwned(MeshEntity* e);
501  virtual void getCopies(MeshEntity* e,
502  CopyArray& copies);
503  virtual bool isShared(MeshEntity* e);
504 private:
505  Mesh* mesh;
506 };
507 
508 struct MatchedSharing : public Sharing
509 {
510  MatchedSharing(Mesh* m);
511  Copy getOwnerCopy(MeshEntity* e);
512  virtual int getOwner(MeshEntity* e);
513  virtual bool isOwned(MeshEntity* e);
514  virtual void getCopies(MeshEntity* e,
515  CopyArray& copies);
516  virtual bool isShared(MeshEntity* e);
517  Mesh* mesh;
518 private:
519  size_t getNeighborCount(int peer);
520  bool isLess(Copy const& a, Copy const& b);
521  void getNeighbors(Parts& neighbors);
522  void formCountMap();
523  NormalSharing helper;
524  std::map<int, size_t> countMap;
525 };
526 
532 Sharing* getSharing(Mesh* m);
533 
535 extern int const tri_edge_verts[3][2];
537 extern int const quad_edge_verts[4][2];
539 extern int const tet_edge_verts[6][2];
541 extern int const prism_edge_verts[9][2];
543 extern int const pyramid_edge_verts[8][2];
545 extern int const tet_tri_verts[4][3];
547 extern int const hex_quad_verts[6][4];
549 extern int const prism_tri_verts[2][3];
551 extern int const prism_quad_verts[3][4];
553 extern int const pyramid_tri_verts[4][3];
554 
556 void getPeers(Mesh* m, int d, Parts& peers);
557 
560 int findIn(MeshEntity** a, int n, MeshEntity* e);
561 
564 void findTriDown(
565  Mesh* m,
566  MeshEntity** verts,
567  MeshEntity** down);
568 
570 void changeMeshShape(Mesh* m, FieldShape* newShape, bool project = true);
571 
574 void unfreezeFields(Mesh* m);
575 
577 int countEntitiesOn(Mesh* m, ModelEntity* me, int dim);
578 
581 int countOwned(Mesh* m, int dim, Sharing * shr = NULL);
582 
584 void printStats(Mesh* m);
585 
587 void warnAboutEmptyParts(Mesh* m);
588 
590 Copy getOtherCopy(Mesh* m, MeshEntity* s);
591 
592 class ElementVertOp
593 {
594  public:
595  virtual MeshEntity* apply(int type, MeshEntity** down) = 0;
596  MeshEntity* run(int type, MeshEntity** verts);
597  void runDown(int type, MeshEntity** verts, MeshEntity** down);
598 };
599 
601 int getFirstType(Mesh* m, int dim);
602 
611 void getAlignment(Mesh* m, MeshEntity* elem, MeshEntity* boundary,
612  int& which, bool& flip, int& rotate);
613 
614 void packString(std::string s, int to);
615 std::string unpackString();
616 void packTagInfo(Mesh* m, MeshTag* t, int to);
617 void unpackTagInfo(std::string& name, int& type, int& size);
618 
619 extern char const* const dimName[4];
620 
621 } //namespace apf
622 
623 #endif
void getAlignment(Mesh *m, MeshEntity *elem, MeshEntity *boundary, int &which, bool &flip, int &rotate)
boundary entity alignment to an element
void send(MeshEntity *e, int to)
assign a destination part id to an element
quadrilateral (square)
Definition: apfMesh.h:156
signed 32-bit integer
Definition: apfMesh.h:272
void unfreezeFields(Mesh *m)
unfreeze all associated fields
Numbering * getNumbering(int i)
get the i&#39;th associated numbering
void getFirstDerivative(ModelEntity *g, Vector3 const &p, Vector3 &t0, Vector3 &t1)
get first derivative at a point
std::map< int, MeshEntity * > Copies
Remote copy container.
Definition: apfMesh.h:36
int countOwned(Mesh *m, int dim, Sharing *shr=NULL)
count the number of owned entities of dimension (dim) using sharing shr the default sharing is used i...
virtual void getUp(MeshEntity *e, Up &up)=0
Get the unordered set of one-level upward entities.
void removeField(Field *f)
disassociate a field from this mesh
Migration plan object: local elements to destinations.
Definition: apfMesh.h:453
Copy()
required
Definition: apfMesh.h:78
virtual bool isOwned(MeshEntity *e)=0
return true if the entity is owned
DynamicArray< Copy > CopyArray
a set of copies, possibly multiple copies per part
Definition: apfMesh.h:90
Copy Match
matches are just a special case of copies
Definition: apfMesh.h:87
virtual void setLongTag(MeshEntity *e, MeshTag *tag, long const *data)=0
set long array tag data
void getPoint(MeshEntity *e, int node, Vector3 &point)
Returns the coordinates of a node on a mesh entity.
64-bit IEE754 floating-point number
Definition: apfMesh.h:270
void boundingBox(ModelEntity *g, Vector3 &bmin, Vector3 &bmax)
get the bounding box of the model entity g
Migration(Mesh *m)
must be constructed with a mesh
NumberingOf< long > GlobalNumbering
Global numberings use 64-bit integers.
Definition: apfMesh.h:30
static char const *const typeName[TYPES]
name strings for apf::Mesh::Type
Definition: apfMesh.h:173
int const prism_edge_verts[9][2]
map from prism edge order to prism vertex order
int const hex_quad_verts[6][4]
map from hex quad order to hex vertex order
virtual void removeTag(MeshEntity *e, MeshTag *tag)=0
detach tag data from an entity.
int count()
return the number of elements with assigned destinations
placeholder to set array sizes
Definition: apfMesh.h:166
MeshEntity * Downward[12]
a static array type downward adjacency queries.
Definition: apfMesh.h:52
bool canGetModelNormal()
return true if the geometric model supports normal computation
Field * getField(int i)
get the i&#39;th associated field
CopyArray Matches
a set of periodic copies
Definition: apfMesh.h:92
void changeMeshShape(Mesh *m, FieldShape *newShape, bool project=true)
deprecated wrapper for apf::Mesh::changeShape
bool hasFrozenFields
true if any associated fields use array storage
Definition: apfMesh.h:399
Copy getOtherCopy(Mesh *m, MeshEntity *s)
given a mesh face, return its remote copy
MeshEntity * findUpward(Mesh *m, int type, MeshEntity **down)
find an entity from one-level downward adjacencies
virtual ~Mesh()
destroy the base class structures.
virtual void getParam(MeshEntity *e, Vector3 &p)=0
Get the geometric parametric coordinates of a vertex.
virtual void end(MeshIterator *it)=0
destroy an iterator.
virtual int getOwner(MeshEntity *e)=0
Returns the owning part number of this entity.
Sharing * getSharing(Mesh *m)
create a default sharing object for this mesh
Describes field distribution and shape functions.
Definition: apfShape.h:73
int getDimension(Mesh *m, MeshEntity *e)
get the dimension of a mesh entity
static int const typeDimension[TYPES]
for a given entity type, its dimension.
Definition: apfMesh.h:171
void init(FieldShape *s)
initialize the base class structures.
virtual void renameTag(MeshTag *tag, const char *newName)=0
renames a tag
virtual int getId()=0
Get the part ID.
virtual int getOwner(MeshEntity *e)=0
return owning part ID
void getPeers(Mesh *m, int d, Parts &peers)
scan the part for [vtx|edge|face]-adjacent part ids
virtual int getDownward(MeshEntity *e, int dimension, MeshEntity **adjacent)=0
Returns an ordered set of downward adjacent entities.
virtual int getTagSize(MeshTag *t)=0
return the array size of a tag
Type
Entity topological types.
Definition: apfMesh.h:148
FieldShape * getShape() const
get the distribution of the mesh&#39;s coordinate field
virtual void writeNative(const char *fileName)=0
write the underlying mesh into a set of files
virtual std::size_t count(int dimension)=0
returns the number of entities in this dimension
Copy(int p, MeshEntity *e)
build from contents
Definition: apfMesh.h:80
bool isInClosureOf(ModelEntity *g, ModelEntity *target)
checks if g is in the closure of the target
void getParamOn(ModelEntity *g, MeshEntity *e, Vector3 &p)
reparameterize mesh vertex (e) onto model entity (g)
virtual void getTags(DynamicArray< MeshTag * > &tags)=0
Get all the tags on a mesh part.
the basic structure for all GMI models
Definition: gmi.h:112
bool has(MeshEntity *e)
return true if the element has been assigned a destination
void setCoordinateField(Field *field)
Set the mesh&#39;s coordinate field - Be very careful using this.
hexahedron (cube, brick)
Definition: apfMesh.h:160
int countNumberings()
get the number of associated numberings
virtual double getElementBytes(int)
estimate mesh entity memory usage.
Definition: apfMesh.h:362
int countFields()
get the number of associated fields
virtual void destroyTag(MeshTag *tag)=0
Removes a mesh tag. This does not detach data from entities.
void verify(Mesh *m, bool abort_on_error=true)
run consistency checks on an apf::Mesh structure
int const prism_tri_verts[2][3]
map from prism triangle order to prism vertex order
virtual MeshTag * createLongTag(const char *name, int size)=0
Creates a long array tag over the mesh given a name and size.
Numbering * findNumbering(const char *name)
lookup a numbering by its unique name
int const pyramid_tri_verts[4][3]
map from pyramid triangle order to pyramid vertex order
TagType
Tag data type enumeration.
Definition: apfMesh.h:268
void unite(Parts &into, Parts const &from)
unite two sets of unique part ids
static int const adjacentCount[TYPES][4]
for a given entity type, number of adjacent entities of a given dimension
Definition: apfMesh.h:169
int const tet_edge_verts[6][2]
map from tet edge order to tet vertex order
int getModelType(ModelEntity *e)
return the model entity dimension
virtual void getLongTag(MeshEntity *e, MeshTag *tag, long *data)=0
get long array tag data
Interface to a mesh part.
Definition: apfMesh.h:103
virtual gmi_model * getModel()=0
get a GMI interface to the geometric model
void getNormal(ModelEntity *g, Vector3 const &p, Vector3 &n)
get normal vector at a point
MeshEntity * findElement(Mesh *m, int type, MeshEntity **verts)
finds an entity from a set of vertices
bool isOnModel(ModelEntity *g, Vector3 p, double scale)
checks if p is on model g
bool getPeriodicRange(ModelEntity *g, int axis, double range[2])
get the periodic properties of a model entity
virtual bool hasMatching()=0
return true if the mesh has matched entities
bool isSimplex(int type)
return true if the topological type is a simplex
void findTriDown(Mesh *m, MeshEntity **verts, MeshEntity **down)
given the vertices of a triangle, find its edges
MeshEntity * getEdgeVertOppositeVert(Mesh *m, MeshEntity *edge, MeshEntity *v)
get the other vertex of an edge
virtual void getDgCopies(MeshEntity *e, DgCopies &dgCopies, ModelEntity *me=0)=0
get the DG copies of an entity on optional model entity filter
int const quad_edge_verts[4][2]
map from quad edge order to quad vertex order
virtual bool hasTag(MeshEntity *e, MeshTag *tag)=0
Returns true if there is data for this tag attached.
apf::Mesh2 Mesh
convenient mesh name
Definition: maMesh.h:27
int const prism_quad_verts[3][4]
map from prism quad order to prism vertex order
static Type const simplexTypes[4]
the simplex type for each dimension
Definition: apfMesh.h:175
abstract description of entity copy sharing
Definition: apfMesh.h:483
statically sized container for upward adjacency queries.
Definition: apfMesh.h:63
virtual void destroyNative()=0
actually destroy the underlying mesh data structure
convenience wrapper over apf::Vector&lt;3&gt;
Definition: apfVector.h:150
int peer
resident part of the copy object
Definition: apfMesh.h:82
virtual MeshIterator * begin(int dimension)=0
begins iteration over elements of one dimension
bool canSnap()
return true if the geometric model supports snapping
int const tet_tri_verts[4][3]
map from tet triangle order to tet vertex order
GlobalNumbering * findGlobalNumbering(const char *name)
lookup a numbering by its unique name
int n
actual number of adjacent entities
Definition: apfMesh.h:66
triangular prism (wedge)
Definition: apfMesh.h:162
virtual bool hasUp(MeshEntity *e)=0
Return true iff the entity has upward adjacencies.
virtual MeshTag * findTag(const char *name)=0
Finds a tag by name, returns 0 if it doesn&#39;t exist.
virtual unsigned getTagChecksum(MeshTag *tag, int type)=0
returns the checksum of a tag for the specificed topological type
void warnAboutEmptyParts(Mesh *m)
print to stderr the number of empty parts, if any
virtual void setModel(gmi_model *newModel)=0
set the geometric model
int const tri_edge_verts[3][2]
map from triangle edge order to triangle vertex order
virtual void verify()=0
run a set of consistency checks on the underlying data structure
void removeTagFromDimension(Mesh *m, MeshTag *tag, int d)
removes a tag from all entities of dimension (d)
virtual void getDoubleTag(MeshEntity *e, MeshTag *tag, double *data)=0
get double array tag data
virtual void getIntTag(MeshEntity *e, MeshTag *tag, int *data)=0
get int array tag data
int findIn(MeshEntity **a, int n, MeshEntity *e)
find pointer (e) in array (a) of length (n)
virtual ModelEntity * toModel(MeshEntity *e)=0
get geometric classification
virtual MeshTag * createIntTag(const char *name, int size)=0
Creates an int array tag over the mesh given a name and size.
virtual MeshEntity * getUpward(MeshEntity *e, int i)=0
Get the i&#39;th one-level upward adjacent entity.
std::set< int > Parts
Set of unique part ids.
Definition: apfMesh.h:43
Vector3 getLinearCentroid(Mesh *m, MeshEntity *e)
get the average of the entity&#39;s vertex coordinates
virtual void getCopies(MeshEntity *e, CopyArray &copies)=0
get the copies of the entity
int const pyramid_edge_verts[8][2]
map from pyramid edge order to pyramid vertex order
DynamicArray< MeshEntity * > Adjacent
Set of adjacent mesh entities.
Definition: apfMesh.h:46
bool canGetClosestPoint()
return true if the geometric model supports get closest point
virtual void setDoubleTag(MeshEntity *e, MeshTag *tag, double const *data)=0
set double array tag data
void changeShape(FieldShape *newShape, bool project=true)
make a new coordinate field.
Field * getCoordinateField()
get the mesh&#39;s coordinate field
Definition: apfMesh.h:332
virtual void getRemotes(MeshEntity *e, Copies &remotes)=0
Get the remote copies of an entity.
virtual bool isOwned(MeshEntity *e)=0
Returns true if the entity is shared in parallel and this is the dominant copy, or the entity is not ...
void getClosestPoint(ModelEntity *g, Vector3 const &from, Vector3 &to, Vector3 &p)
get closest point on geometry
tetrahedron
Definition: apfMesh.h:158
virtual const char * getTagName(MeshTag *t)=0
return the name of a tag
virtual MeshEntity * iterate(MeshIterator *it)=0
iterate over mesh entities
virtual bool isShared(MeshEntity *e)=0
Returns true if the entity is shared in parallel.
int sending(MeshEntity *e)
return the destination part id of an element
int countEntitiesOfType(Mesh *m, int type)
count all on-part entities of one topological type
MeshEntity * entity
on-part pointer to the copy object
Definition: apfMesh.h:84
Matrix3x3 rotate(Vector3 const &u, double a)
get the rotation matrix around an axis
int getFirstType(Mesh *m, int dim)
get the type of the first entity in this dimension
ModelEntity * findModelEntity(int type, int tag)
get the model entity by dimension and identifier
virtual void migrate(Migration *plan)=0
Migrate elements.
virtual void getMatches(MeshEntity *e, Matches &m)=0
get the periodic copies of an entity
bool isParamPointInsideModel(ModelEntity *g, Vector3 const &param, Vector3 &x)
checks if parametric point is inside the model, and updates puts the location in x ...
void printStats(Mesh *m)
print global mesh entity counts per dimension
virtual MeshTag * createDoubleTag(const char *name, int size)=0
Creates a double array tag over the mesh given a name and size.
NumberingOf< int > Numbering
Numbering is meant to be a 32-bit local numbering.
Definition: apfMesh.h:27
void addField(Field *f)
associate a field with this mesh
int countEntitiesOn(Mesh *m, ModelEntity *me, int dim)
count the number of mesh entities classified on a model entity
CopyArray DgCopies
a set of DG copies
Definition: apfMesh.h:94
signed 64-bit integer
Definition: apfMesh.h:274
void snapToModel(ModelEntity *m, Vector3 const &p, Vector3 &x)
evaluate parametric coordinate (p) as a spatial point (x)
quadrilateral pyramid
Definition: apfMesh.h:164
Field * findField(const char *name)
lookup a field by its unique name
virtual void getResidence(MeshEntity *e, Parts &residence)=0
Get the resident parts of an entity.
virtual void getPoint_(MeshEntity *e, int node, Vector3 &point)=0
Implementation-defined code for apf::Mesh::getPoint.
MeshEntity * e[400]
array containing pointers to adjacent entities
Definition: apfMesh.h:68
virtual int countUpward(MeshEntity *e)=0
Return the number of one-level upward adjacent entities.
void removeNumbering(Numbering *f)
disassociate a numbering from this mesh
virtual int getDimension()=0
returns the element dimension of this mesh
Vector< N > project(Vector< N > const &a, Vector< N > const &b)
Returns vector (a) projected onto vector (b)
Definition: apfVector.h:134
void addNumbering(Numbering *f)
associate a numbering with this mesh
virtual void setIntTag(MeshEntity *e, MeshTag *tag, int const *data)=0
set int array tag data
virtual void getAdjacent(MeshEntity *e, int dimension, Adjacent &adjacent)=0
Returns the set of entities of one dimension adjacent to a given entity.
The APF linear algebra vector interface.
int getModelTag(ModelEntity *e)
get the dimension-unique model entity identifier
virtual int getTagType(MeshTag *t)=0
get the data type of a tag
virtual Type getType(MeshEntity *e)=0
Get the topological type of a mesh entity.
void getBridgeAdjacent(Mesh *m, MeshEntity *origin, int bridgeDimension, int targetDimension, Adjacent &result)
get 2nd-order adjacent entities
a reference to an object representing the same entity
Definition: apfMesh.h:75