SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
apf::Mesh2 Class Referenceabstract

Extended mesh interface for modification. More...

Inheritance diagram for apf::Mesh2:
apf::Mesh

Public Member Functions

virtual void setRemotes (MeshEntity *e, Copies &remotes)=0
 Set the remote copies of an entity. More...
 
virtual void addRemote (MeshEntity *e, int p, MeshEntity *r)=0
 Add just one remote copy to an entity.
 
virtual void addGhost (MeshEntity *e, int p, MeshEntity *r)=0
 Add just one ghost copy to an entity.
 
virtual void setResidence (MeshEntity *e, Parts &residence)=0
 Set the resident part set of an entity. More...
 
virtual void setParam (MeshEntity *e, Vector3 const &p)=0
 Set the geometric parametric coordinates for a vertex.
 
virtual void increment (MeshIterator *it)=0
 Just increment an iterator.
 
virtual bool isDone (MeshIterator *it)=0
 Return true iff the iterator points past the end.
 
virtual MeshEntity * deref (MeshIterator *it)=0
 Just dereference an iterator without incrementing it. More...
 
void setPoint (MeshEntity *e, int node, Vector3 const &p)
 Set the spacial coordinates of a mesh node.
 
virtual void setPoint_ (MeshEntity *e, int node, Vector3 const &p)=0
 Underlying implementation of apf::Mesh2::setPoint.
 
MeshEntity * createVertex (ModelEntity *c, Vector3 const &point, Vector3 const &param)
 Create a fully-specified vertex. More...
 
void requireUnfrozen ()
 require that no fields are stored in arrays
 
virtual MeshEntity * createVert_ (ModelEntity *c)=0
 Underlying implementation of apf::Mesh2::createVert.
 
MeshEntity * createVert (ModelEntity *c)
 Just create a vertex. More...
 
virtual MeshEntity * createEntity_ (int type, ModelEntity *c, MeshEntity **down)=0
 Underlying implementation of apf::Mesh2::createEntity.
 
MeshEntity * createEntity (int type, ModelEntity *c, MeshEntity **down)
 Create a non-vertex mesh entity. More...
 
virtual void destroy_ (MeshEntity *e)=0
 Underlying implementation of apf::Mesh2::destroy.
 
void destroy (MeshEntity *e)
 Destroy a mesh entity. More...
 
virtual void setModelEntity (MeshEntity *e, ModelEntity *c)=0
 Change the geometric classification of an entity.
 
virtual void addMatch (MeshEntity *e, int peer, MeshEntity *match)=0
 Add a matched copy to an entity.
 
virtual void clearMatches (MeshEntity *e)=0
 Remove all matched copies of an entity.
 
virtual void clear_ ()=0
 Remove all entities.
 
virtual void acceptChanges ()=0
 Implementation-defined synchronization after modification. More...
 
- Public Member Functions inherited from apf::Mesh
void init (FieldShape *s)
 initialize the base class structures. More...
 
virtual ~Mesh ()
 destroy the base class structures. More...
 
virtual int getDimension ()=0
 returns the element dimension of this mesh
 
virtual std::size_t count (int dimension)=0
 returns the number of entities in this dimension
 
virtual MeshIterator * begin (int dimension)=0
 begins iteration over elements of one dimension
 
virtual MeshEntity * iterate (MeshIterator *it)=0
 iterate over mesh entities More...
 
virtual void end (MeshIterator *it)=0
 destroy an iterator. More...
 
virtual bool isShared (MeshEntity *e)=0
 Returns true if the entity is shared in parallel.
 
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 shared.
 
virtual int getOwner (MeshEntity *e)=0
 Returns the owning part number of this entity.
 
virtual void getAdjacent (MeshEntity *e, int dimension, Adjacent &adjacent)=0
 Returns the set of entities of one dimension adjacent to a given entity. More...
 
virtual int getDownward (MeshEntity *e, int dimension, MeshEntity **adjacent)=0
 Returns an ordered set of downward adjacent entities. More...
 
virtual int countUpward (MeshEntity *e)=0
 Return the number of one-level upward adjacent entities.
 
virtual MeshEntity * getUpward (MeshEntity *e, int i)=0
 Get the i'th one-level upward adjacent entity.
 
virtual void getUp (MeshEntity *e, Up &up)=0
 Get the unordered set of one-level upward entities.
 
virtual bool hasUp (MeshEntity *e)=0
 Return true iff the entity has upward adjacencies.
 
void getPoint (MeshEntity *e, int node, Vector3 &point)
 Returns the coordinates of a node on a mesh entity. More...
 
virtual void getPoint_ (MeshEntity *e, int node, Vector3 &point)=0
 Implementation-defined code for apf::Mesh::getPoint.
 
virtual void getParam (MeshEntity *e, Vector3 &p)=0
 Get the geometric parametric coordinates of a vertex.
 
virtual Type getType (MeshEntity *e)=0
 Get the topological type of a mesh entity. More...
 
virtual void getRemotes (MeshEntity *e, Copies &remotes)=0
 Get the remote copies of an entity.
 
virtual void getResidence (MeshEntity *e, Parts &residence)=0
 Get the resident parts of an entity. More...
 
virtual MeshTag * createDoubleTag (const char *name, int size)=0
 Creates a double array tag over the mesh given a name and size.
 
virtual MeshTag * createIntTag (const char *name, int size)=0
 Creates an int array tag over the mesh given a name and size.
 
virtual MeshTag * createLongTag (const char *name, int size)=0
 Creates a long array tag over the mesh given a name and size.
 
virtual MeshTag * findTag (const char *name)=0
 Finds a tag by name, returns 0 if it doesn't exist.
 
virtual void destroyTag (MeshTag *tag)=0
 Removes a mesh tag. This does not detach data from entities.
 
virtual void getTags (DynamicArray< MeshTag * > &tags)=0
 Get all the tags on a mesh part. More...
 
virtual void getDoubleTag (MeshEntity *e, MeshTag *tag, double *data)=0
 get double array tag data More...
 
virtual void setDoubleTag (MeshEntity *e, MeshTag *tag, double const *data)=0
 set double array tag data More...
 
virtual void getIntTag (MeshEntity *e, MeshTag *tag, int *data)=0
 get int array tag data More...
 
virtual void setIntTag (MeshEntity *e, MeshTag *tag, int const *data)=0
 set int array tag data More...
 
virtual void getLongTag (MeshEntity *e, MeshTag *tag, long *data)=0
 get long array tag data More...
 
virtual void setLongTag (MeshEntity *e, MeshTag *tag, long const *data)=0
 set long array tag data More...
 
virtual void removeTag (MeshEntity *e, MeshTag *tag)=0
 detach tag data from an entity. More...
 
virtual bool hasTag (MeshEntity *e, MeshTag *tag)=0
 Returns true if there is data for this tag attached.
 
virtual void renameTag (MeshTag *tag, const char *newName)=0
 renames a tag
 
virtual unsigned getTagChecksum (MeshTag *tag, int type)=0
 returns the checksum of a tag for the specificed topological type
 
virtual int getTagType (MeshTag *t)=0
 get the data type of a tag More...
 
virtual int getTagSize (MeshTag *t)=0
 return the array size of a tag
 
virtual const char * getTagName (MeshTag *t)=0
 return the name of a tag More...
 
virtual ModelEntity * toModel (MeshEntity *e)=0
 get geometric classification
 
virtual gmi_modelgetModel ()=0
 get a GMI interface to the geometric model
 
virtual void setModel (gmi_model *newModel)=0
 set the geometric model
 
int getModelType (ModelEntity *e)
 return the model entity dimension
 
int getModelTag (ModelEntity *e)
 get the dimension-unique model entity identifier
 
ModelEntity * findModelEntity (int type, int tag)
 get the model entity by dimension and identifier
 
bool canSnap ()
 return true if the geometric model supports snapping
 
bool canGetClosestPoint ()
 return true if the geometric model supports get closest point
 
bool canGetModelNormal ()
 return true if the geometric model supports normal computation
 
void snapToModel (ModelEntity *m, Vector3 const &p, Vector3 &x)
 evaluate parametric coordinate (p) as a spatial point (x)
 
void getParamOn (ModelEntity *g, MeshEntity *e, Vector3 &p)
 reparameterize mesh vertex (e) onto model entity (g)
 
bool getPeriodicRange (ModelEntity *g, int axis, double range[2])
 get the periodic properties of a model entity More...
 
void getClosestPoint (ModelEntity *g, Vector3 const &from, Vector3 &to, Vector3 &p)
 get closest point on geometry
 
void getNormal (ModelEntity *g, Vector3 const &p, Vector3 &n)
 get normal vector at a point
 
void getFirstDerivative (ModelEntity *g, Vector3 const &p, Vector3 &t0, Vector3 &t1)
 get first derivative at a point
 
bool isParamPointInsideModel (ModelEntity *g, Vector3 const &param, Vector3 &x)
 checks if parametric point is inside the model, and updates puts the location in x
 
bool isInClosureOf (ModelEntity *g, ModelEntity *target)
 checks if g is in the closure of the target
 
void boundingBox (ModelEntity *g, Vector3 &bmin, Vector3 &bmax)
 get the bounding box of the model entity g
 
bool isOnModel (ModelEntity *g, Vector3 p, double scale)
 checks if p is on model g
 
FieldShapegetShape () const
 get the distribution of the mesh's coordinate field
 
Field * getCoordinateField ()
 get the mesh's coordinate field
 
void setCoordinateField (Field *field)
 Set the mesh's coordinate field - Be very careful using this.
 
void changeShape (FieldShape *newShape, bool project=true)
 make a new coordinate field. More...
 
virtual void migrate (Migration *plan)=0
 Migrate elements. More...
 
virtual int getId ()=0
 Get the part ID.
 
virtual void writeNative (const char *fileName)=0
 write the underlying mesh into a set of files
 
virtual void destroyNative ()=0
 actually destroy the underlying mesh data structure
 
virtual void verify ()=0
 run a set of consistency checks on the underlying data structure
 
virtual bool hasMatching ()=0
 return true if the mesh has matched entities
 
virtual void getMatches (MeshEntity *e, Matches &m)=0
 get the periodic copies of an entity
 
virtual void getDgCopies (MeshEntity *e, DgCopies &dgCopies, ModelEntity *me=0)=0
 get the DG copies of an entity on optional model entity filter
 
virtual double getElementBytes (int)
 estimate mesh entity memory usage. More...
 
void addField (Field *f)
 associate a field with this mesh More...
 
void removeField (Field *f)
 disassociate a field from this mesh More...
 
Field * findField (const char *name)
 lookup a field by its unique name
 
int countFields ()
 get the number of associated fields
 
Field * getField (int i)
 get the i'th associated field
 
void addNumbering (Numbering *f)
 associate a numbering with this mesh More...
 
void removeNumbering (Numbering *f)
 disassociate a numbering from this mesh More...
 
NumberingfindNumbering (const char *name)
 lookup a numbering by its unique name
 
int countNumberings ()
 get the number of associated numberings
 
NumberinggetNumbering (int i)
 get the i'th associated numbering
 
GlobalNumberingfindGlobalNumbering (const char *name)
 lookup a numbering by its unique name
 

Additional Inherited Members

- Public Types inherited from apf::Mesh
enum  Type {
  VERTEX, EDGE, TRIANGLE, QUAD,
  TET, HEX, PRISM, PYRAMID,
  TYPES
}
 Entity topological types. More...
 
enum  TagType { DOUBLE, INT, LONG }
 Tag data type enumeration. More...
 
- Public Attributes inherited from apf::Mesh
bool hasFrozenFields
 true if any associated fields use array storage
 
- Static Public Attributes inherited from apf::Mesh
static int const adjacentCount [TYPES][4]
 for a given entity type, number of adjacent entities of a given dimension
 
static int const typeDimension [TYPES]
 for a given entity type, its dimension.
 
static char const *const typeName [TYPES]
 name strings for apf::Mesh::Type
 
static Type const simplexTypes [4]
 the simplex type for each dimension
 

Detailed Description

Extended mesh interface for modification.

this interface, which is a superset of apf::Mesh, includes methods for mesh modification. Not all mesh databases support this, which is why the two classes are separated.

In this case, mesh modification means any entity creation, deletion, changing inter-part boundary links (including remote copies, matching, etc), and changing node coordinates.

Definition at line 29 of file apfMesh2.h.

Member Function Documentation

virtual void apf::Mesh2::acceptChanges ( )
pure virtual

Implementation-defined synchronization after modification.

users are encouraged to call this function after finishing mesh modifications so that all structures are properly updated before using the mesh any further.

MeshEntity* apf::Mesh2::createEntity ( int  type,
ModelEntity *  c,
MeshEntity **  down 
)
inline

Create a non-vertex mesh entity.

to create entities from more than one level down, including intermediate entities, see apf::buildElement

Parameters
typeselect from apf::Mesh::Type
cgeometric classification, which is very immutable in APF
downarray of one-level downward adjacent entities

Definition at line 91 of file apfMesh2.h.

92  {
94  return createEntity_(type,c,down);
95  }
virtual MeshEntity * createEntity_(int type, ModelEntity *c, MeshEntity **down)=0
Underlying implementation of apf::Mesh2::createEntity.
void requireUnfrozen()
require that no fields are stored in arrays
Definition: apfMesh2.h:68
MeshEntity* apf::Mesh2::createVert ( ModelEntity *  c)
inline

Just create a vertex.

Parameters
cgeometric classification, which is very immutable in APF

Definition at line 77 of file apfMesh2.h.

78  {
80  return createVert_(c);
81  }
virtual MeshEntity * createVert_(ModelEntity *c)=0
Underlying implementation of apf::Mesh2::createVert.
void requireUnfrozen()
require that no fields are stored in arrays
Definition: apfMesh2.h:68
MeshEntity* apf::Mesh2::createVertex ( ModelEntity *  c,
Vector3 const &  point,
Vector3 const &  param 
)

Create a fully-specified vertex.

this function sets geometric classification and coordinates all at once. see apf::Mesh2::createVert for a more minimal interface

virtual MeshEntity* apf::Mesh2::deref ( MeshIterator *  it)
pure virtual

Just dereference an iterator without incrementing it.

this is needed by apf::CavityOp, and Simmetrix meshes don't support the separation of dereference and increment

void apf::Mesh2::destroy ( MeshEntity *  e)
inline

Destroy a mesh entity.

this does not destroy any other entities, including downward adjacencies

Definition at line 101 of file apfMesh2.h.

102  {
103  requireUnfrozen();
104  destroy_(e);
105  }
virtual void destroy_(MeshEntity *e)=0
Underlying implementation of apf::Mesh2::destroy.
void requireUnfrozen()
require that no fields are stored in arrays
Definition: apfMesh2.h:68
virtual void apf::Mesh2::setRemotes ( MeshEntity *  e,
Copies remotes 
)
pure virtual

Set the remote copies of an entity.

this does not affect the residence or ownership, so users are advised to use apf::stitchMesh after calling this function.

virtual void apf::Mesh2::setResidence ( MeshEntity *  e,
Parts residence 
)
pure virtual

Set the resident part set of an entity.

this is also known as partition model classification


The documentation for this class was generated from the following file: