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

Detailed Description

Data fields on mixed-element meshes.

This class represents a single data field defined on a mixed-element mesh. Data can have arbitrary dimensions (scalar, n-dimensional vector, etc), but must either be defined for all elements of the mesh, or for all vertices.

See Also

#include <mxmeshfield.h>

Inheritance diagram for MxMeshField:
Collaboration diagram for MxMeshField:


class  ValueClass
 class represented by this field More...

Public Member Functions

 MxMeshField (const MxMesh *pmesh, bool nodalf=true, size_t dim=1)
 create named field
 MxMeshField (const MxMeshField &)=default
 default copy
 MxMeshField (MxMeshField &&a)
 move construction
MxMeshFieldoperator= (const MxMeshField &)=default
 copy assignment
MxMeshFieldoperator= (MxMeshField &&a)
 move assignment
const std::string & name () const
 field name
void rename (const std::string &s)
 change name
void bind (const MxMesh *pmesh)
 bind to another mesh (dangerous)
ValueClass valueClass () const
 access value class tag
void valueClass (ValueClass c)
 access value class tag
size_t solutionIndex () const
 field belongs to this solution
void solutionIndex (size_t si)
 change solution index
bool nodal () const
 nodal or cell data?
bool realField () const
 real-valued or integer-valued ?
size_t ndimension () const
 number of components per node/cell value
size_t size () const
 field length : number of scalar values
size_t nelements () const
 number of N-dimensional elements
bool compatible (const MxMeshField &a) const
 check if dimension and type are compatible
bool merge (const MxMeshField &a)
 append data in a if possible
void transform (const Trafo3d &trafo)
 transform 3D field data
template<typename Type , uint N>
void value (size_t node, SVector< N, Type > &x) const
 retrieve vector value
template<typename Type , uint N>
void setValue (size_t k, const SVector< N, Type > &x)
 change vector value
template<typename Type >
void scalar (size_t k, Type &x) const
 retrieve scalar value (conversion)
template<typename Type >
void scalar (size_t i, size_t k, Type &x) const
 retrieve scalar value (conversion)
template<typename Type >
void setScalar (size_t k, const Type &x)
 change scalar value
template<typename Type >
void fetch (const Indices &idx, Type x[]) const
 retrieve scalar values (conversion)
template<typename Container >
void fetch (Container &c) const
 retrieve values to container
template<typename ElementType >
void fetch (DVector< ElementType > &c) const
 retrieve values to container
template<typename Type , uint N>
void fetch (PointList< N, Type > &vf) const
 retrieve values to container
template<typename Type , uint N>
void fetch (const Indices &idx, PointList< N, Type > &vf) const
 retrieve subset of vector values to container
template<typename Container >
void fetch (size_t stride, Container &c) const
 strided copy
void scale (Real f)
 scale real values
template<class FloatType >
void copyReal (const std::string &s, size_t nd, const FloatType a[])
 construct field from raw data
template<class IntType >
void copyInt (const std::string &s, size_t nd, const IntType a[])
 construct field from raw data
void scalarField (const std::string &s, const DVector< double > &v)
 set scalar field
void scalarField (const std::string &s, const DVector< float > &v)
 set scalar field
void scalarField (const std::string &s, const DVector< int > &vi)
 set scalar field
void vectorField (const std::string &s, const PointList< 3 > &v)
 set 3-component vector field (displacements, velocities...)
void vectorField (const std::string &s, const PointList< 3, float > &v)
 set 3-component vector field (displacements, velocities...)
void vectorField (const std::string &s, const PointList< 6 > &v)
 set 6-component vector field
void vectorField (const std::string &s, const PointList< 6, float > &v)
 set 6-component vector field
void fitField (Real t=0.0)
 pad field with t to match changed node/element count
void condensed (int vfm, DVector< float > &vf) const
 create a condensed field for visualization
void stats (Real &minval, Real &maxval, Real &meanval) const
 field statistics for real-valued scalar fields
void stats (int condensation, Real &minval, Real &maxval, Real &meanval) const
 field statistics for real-valued vector fields
template<class BinaryOp >
void updateExtremes (Vector &xvalues, BinaryOp op) const
 update a extremal value array from *this field
void erase (size_t begin, size_t end)
 erase range of values
void extend (const Indices &idx)
 extend with copies of values belonging to nodes/elements in idx
void extend (const Indices &idx, const Plane &pln)
 extend with mirror copies of values belonging to nodes/elements in idx
template<typename Iterator >
void insert (size_t pos, Iterator begin, Iterator end)
 insert values (changes field size!)
void reorder (const Indices &perm)
 reorder nodal field
std::string componentName (uint k) const
 access name of component k
void componentNames (const std::initializer_list< const char * > &namelist)
 set all component names
bool fromFFA (const FFANode &node)
 read from FFA node returns status
bool readBdis (const std::string &fname)
 read displacement field from .bdis file
bool writeBdis (const std::string &fname) const
 write field as bdis; will only create correct output if annotations present
bool readCgns (CgnsSol &sol, int i)
 read field i from CGNS solution
void writeCgns (CgnsSol &sol) const
 write to cgns solution entry
XmlElement toVTK (const Indices &ipts) const
 write to VTK xml format
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
float megabytes () const
 memory requirements (w/o notes)
void swap (MxMeshField &a)
 swap contents
- Public Member Functions inherited from MxAnnotated
 MxAnnotated ()
 empty annotations
 MxAnnotated (const MxAnnotated &)=default
 default copy
 MxAnnotated (MxAnnotated &&a)
 move constructor
virtual ~MxAnnotated ()
 meant as a base class
MxAnnotatedoperator= (const MxAnnotated &)=default
 default copy asignment
MxAnnotatedoperator= (MxAnnotated &&a)
 move assignment
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
void attribute (const std::string &key, const std::string &value)
 assign attribute, i.e. key-value pair in top-level annotation
std::string attribute (const std::string &key) const
 retrieve attribute; return empty string if not present

Static Public Member Functions

static void fileFloatPrecision (TypeCode tc)
 globally change the precision stored in files that support conversion

Private Member Functions

size_t nalloc () const
 allocated size

Private Attributes

const MxMeshparent
 parent mesh
std::string fid
 name of the field stored
Vector rval
 floating-point field values
DVector< int > ival
 integer field values
StringArray compNames
 (optional) names for the components of a multi-dimensional field
size_t ndim
 components per point
ValueClass vclass
 value class, default is field
size_t solindex
 assign a solution index
bool bNodal
 nodal or cell data?

Static Private Attributes

static TypeCode s_fileFloatPrecision = TypeCode(TypeCode::Float64)
 global setting - store real data in single precision?


class MxMesh

Additional Inherited Members

- Protected Attributes inherited from MxAnnotated
XmlElement xnote
 xml annotation

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