libgenua
Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
MxMeshSection Class Reference

Detailed Description

Section of a mixed-element mesh.

Each section of a MxMesh contains only one element type. This restriction is necessary to allow one-to-one writing to CGNS. Furthermore, different sections can be used to communicate areas to be treated differently, for example to mark surfaces for which separate force integration is to be performed.

See Also
MxMesh

#include <mxmeshsection.h>

Collaboration diagram for MxMeshSection:
[legend]

Public Types

enum  DomainType
 tag to indicate which domain this section belongs to
 

Public Member Functions

 MxMeshSection (const MxMesh *pmesh=0, Mx::ElementType t=Mx::Undefined)
 construct empty section
 
Mx::ElementType elementType () const
 access element type
 
DomainType domain () const
 domain type flag
 
void domain (DomainType t)
 domain type flag
 
void tag (int t)
 set integer tag
 
int tag () const
 access integer tag
 
uint nElementNodes () const
 number of nodes in elements in this section
 
uint nelements () const
 number of elements
 
uint indexOffset () const
 element count offset
 
const std::string & name () const
 access section name
 
void rename (const std::string &s)
 change section name
 
void shiftVertexIndices (int offset)
 apply an vertex index offset to all elements
 
uint replaceVertex (uint eix, uint iold, uint inew)
 in element eix, replace iold with inew
 
bool dropOrder ()
 restrict from P2 to P1 elements if possible, return success
 
const Indices & nodes () const
 access node array
 
Indices & nodes ()
 access node array
 
void appendElements (const Indices &elm)
 add element nodes
 
void appendElements (uint ne, const uint idx[])
 add element nodes, ne is the number of elements
 
const uint * element (uint i) const
 access pointer to nodes of element i
 
const uint * globalElement (uint i) const
 access pointer to nodes of element i
 
void swapElements (Mx::ElementType t, Indices &elix)
 change element indices and type
 
void usedNodes (Indices &ipts) const
 determine indices of points used in this section
 
size_t dropDegenerateElements ()
 drop all elements which contain duplicate nodes
 
int triangleVertices (int vi[]) const
 triangle vertex indices, relative to element vertices
 
int quadVertices (int vi[]) const
 quad vertex indices, relative to element vertices
 
int lineVertices (int vi[]) const
 line vertex indices, relative to element vertices
 
int triangleMap (const int *map[]) const
 access mapping of local element vertex indices to triangle decomposition
 
bool toTriangles (Indices &tri) const
 convert entire section to triangles (e.g. for location queries)
 
bool lineElements () const
 true if section contains 1D (line) elements
 
bool surfaceElements () const
 true if section contains surface elements
 
bool volumeElements () const
 true if section contains volume elements
 
bool sameElementClass (const MxMeshSection &sec) const
 true if element class (surface/volume/line) matches
 
uint planeCut (const std::vector< bool > &nbelow, Indices &ise) const
 determine list of local elements that intersect p
 
void aspectRatio (Vector &aspr) const
 compute element aspect ratio (longest/shortest edge)
 
void elementLength (Vector &elen) const
 compute a typical one-dimensional element size
 
std::string elementTypeName () const
 return a name for the element type
 
uint vizNormalPoints (PointList< 3, float > &pts) const
 visualization utility : compute shell element normal data
 
Vct6 integratePressure (const MxMeshField &pfield, const Vct3 &pref) const
 utility : integrate a pressure field over this section
 
void note (const XmlElement &xe)
 set the contents of the complete annotation object
 
const XmlElementnote () const
 retrieve xml annotation object
 
void annotate (const XmlElement &xe)
 append annotation element
 
XmlElement::const_iterator noteBegin () const
 iterate over annotations
 
XmlElement::const_iterator noteEnd () const
 iterate over annotations
 
bool maps (const MxMeshBoco &bc) const
 return true if element set mapped by boco matches this section exactly
 
bool contains (const MxMeshBoco &bc) const
 return true if element set mapped by boco are all contained in *this
 
bool estimateNormals (PointList< 3 > &nrm) const
 estimate normal vector for surface elements, where supported
 
const ColordisplayColor () const
 access display color
 
void displayColor (const Color &c)
 access display color
 
float megabytes () const
 memory requirements for this section (w/o note)
 
void clear ()
 clear all elements
 
void readCgns (CgnsSection &cs)
 retrieve data from CGNS file section
 
void writeCgns (CgnsSection &cs, int isec=0) const
 write section in CGNS file
 
void writeAbaqus (const Indices &gid, const Indices &eid, std::ostream &os) const
 write in plain-text Abaqus format
 
void writeSU2 (std::ostream &os) const
 write to plain-text format for SU2
 
void writeEnsight (int partno, std::ostream &os) const
 write section as part to binary Ensight format
 
void writeEnsight (int partno, const MxMeshField &f, std::ostream &os) const
 write field data for this section to binary Ensight format
 
XmlElement toVTK () const
 write section to xml vtk
 
BinFileNodePtr gbfNode (bool share=true) const
 create a binary file node
 
void fromGbf (const BinFileNodePtr &np, bool digestNode=false)
 retrieve data from gbf file node
 
XmlElement toXml (bool share) const
 convert to xml representation
 
void fromXml (const XmlElement &xe)
 retrieve section from xml representation
 
void toFFA (FFANode &node) const
 write section in FFA format
 
bool fromFFA (const FFANode &node)
 recover section from FFA format
 

Static Public Member Functions

static int triangleMap (Mx::ElementType etype, const int *map[])
 access mapping of local element vertex indices to triangle decomposition
 
static uint createFromEnsight (MxMesh *pmx, int flags, std::istream &in)
 create mesh section from part block in Ensight geometry file
 
static uint nElementNodes (Mx::ElementType t)
 return the number of node for element type t
 
static bool lineElement (Mx::ElementType etype)
 return if etype is a 1D (line) element
 
static bool surfaceElement (Mx::ElementType etype)
 true if section contains surface elements
 
static bool volumeElement (Mx::ElementType etype)
 true if section contains volume elements
 

Private Member Functions

void indexOffset (uint off)
 element count offset (set by MxMesh)
 
void ipreorder (const Indices &iperm)
 change index ordering
 
size_t dropCollapsedElements ()
 eliminate elements which collapse to one single node
 

Private Attributes

const MxMeshparent
 pointer to parent mesh
 
Indices inodes
 node indices
 
Mx::ElementType etype
 element type
 
std::string secid
 optional name
 
XmlElement xnote
 annotation object
 
Color dispColor
 color to use for display
 
uint eloff
 element count offset
 
DomainType domainType
 tag to identify fluid/structure domain
 
int itag
 integer tag
 

Static Private Attributes

static const uint npelm [Mx::NElmTypes]
 number of nodes per element (fixed)
 

Friends

class MxMesh
 

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