OpenCMISS-Zinc C++ API Documentation
Public Member Functions | Protected Attributes | List of all members
OpenCMISS::Zinc::Mesh Class Reference

A finite element mesh consisting of a set of elements of fixed dimension. More...

#include <mesh.hpp>

Inheritance diagram for OpenCMISS::Zinc::Mesh:
OpenCMISS::Zinc::MeshGroup

Public Member Functions

 Mesh (cmzn_mesh_id mesh_id)
 
 Mesh (const Mesh &mesh)
 
bool isValid () const
 
Meshoperator= (const Mesh &mesh)
 
cmzn_mesh_id getId () const
 
MeshGroup castGroup ()
 
bool containsElement (const Element &element)
 
Elementfieldtemplate createElementfieldtemplate (const Elementbasis &basis)
 
Elementtemplate createElementtemplate ()
 
Element createElement (int identifier, const Elementtemplate &elementTemplate)
 
Elementiterator createElementiterator ()
 
int defineElement (int identifier, const Elementtemplate &elementTemplate)
 
int destroyAllElements ()
 
int destroyElement (const Element &element)
 
int destroyElementsConditional (const Field &conditionalField)
 
Element findElementByIdentifier (int identifier)
 
Differentialoperator getChartDifferentialoperator (int order, int term)
 
int getDimension ()
 
Fieldmodule getFieldmodule () const
 
Mesh getMasterMesh ()
 
char * getName ()
 
int getSize ()
 

Protected Attributes

cmzn_mesh_id id
 

Detailed Description

A finite element mesh consisting of a set of elements of fixed dimension.

A finite element mesh consisting of a set of elements of fixed dimension. Note that Zinc elements are not iso-parametric, meaning each field must be individually defined on them, specifying the basis and parameter mapping.

Member Function Documentation

MeshGroup OpenCMISS::Zinc::Mesh::castGroup ( )
inline

If the mesh is a mesh group i.e. subset of elements from a master mesh, get the mesh group specific interface for add/remove functions.

Parameters
fieldThe mesh to be cast.
Returns
Handle to derived mesh group, or NULL/invalid handle if wrong type or failed.
bool OpenCMISS::Zinc::Mesh::containsElement ( const Element element)
inline

Returns whether the element is from the mesh.

Parameters
elementThe element to query about.
Returns
Boolean true if element is in the mesh, otherwise false.
Element OpenCMISS::Zinc::Mesh::createElement ( int  identifier,
const Elementtemplate elementTemplate 
)
inline

Create a new element in this mesh with shape and fields described by the element_template. Returns handle to new element.

See also
Mesh::defineElement
Parameters
identifierNon-negative integer identifier of new element, or -1 to automatically generate, starting from 1. Fails if supplied identifier already used by an existing element.
elementTemplateTemplate describing element shape and fields to define or undefine. Must be valid, with a valid shape.
Returns
Handle to new element, or NULL/invalid handle on failure.
Elementfieldtemplate OpenCMISS::Zinc::Mesh::createElementfieldtemplate ( const Elementbasis basis)
inline

Create an element field template to describe parameter mapping and interpolation of a scalar field / field component over elements of the mesh. The new template defaults to NODE parameter mapping mode, with the standard number of nodes for the element basis. For Lagrange, simplex and constant basis function types there are as many nodes as basis functions and the single parameter per node has VALUE label. For Hermite bases with multiple functions per node, default parameters are expected in numerical order of the node value label e.g. for bicubic Hermite the first four functions are for the first node and expected in order: VALUE D_DS1 D_DS2 D2_DS1DS2. By default, versions are initialised to 1, and no scaling is used. In all cases local nodes cycle fastest in lowest element xi direction.

Parameters
basisThe element basis which will be used for interpolation, which must have the same dimension as the mesh.
Returns
Handle to new element field template, or NULL/invalid handle on failure.
Elementiterator OpenCMISS::Zinc::Mesh::createElementiterator ( )
inline

Create an element iterator object for iterating through the elements in the mesh which are ordered from lowest to highest identifier. The iterator initially points at the position before the first element, so the first call to the element iterator next method returns the first element and advances the iterator. Iterator becomes invalid if mesh is modified or any of its elements are given new identifiers.

See also
Elementiterator::next
Returns
Handle to new element iterator, or NULL/invalid handle on failure.
Elementtemplate OpenCMISS::Zinc::Mesh::createElementtemplate ( )
inline

Create a blank template from which new elements can be created in this mesh. Also used for defining new fields over elements. The new element template does not have a valid shape, which allows adding fields to existing elements without changing shape, however a valid shape must be set to create new elements with this element template.

Returns
Handle to new element template, or NULL/invalid handle on failure.
int OpenCMISS::Zinc::Mesh::defineElement ( int  identifier,
const Elementtemplate elementTemplate 
)
inline

Create a new element in this mesh with shape and fields described by the element_template.

See also
Mesh::createElement
Parameters
identifierNon-negative integer identifier of new element, or -1 to automatically generate, starting from 1. Fails if supplied identifier already used by an existing element.
elementTemplateTemplate describing element shape and fields to define or undefine. Must be valid, with a valid shape.
Returns
Result OK on success, any other value on failure.
int OpenCMISS::Zinc::Mesh::destroyAllElements ( )
inline

Destroy all elements in mesh, also removing them from any related groups. All handles to the destroyed element become invalid.

Returns
Status OpenCMISS::Zinc::OK if all elements destroyed, any other value if failed.
int OpenCMISS::Zinc::Mesh::destroyElement ( const Element element)
inline

Destroy the element if it is in the mesh. Removes element from any related groups it is in. All handles to the destroyed element become invalid.

Parameters
elementThe element to destroy.
Returns
Status OpenCMISS::Zinc::OK if element is successfully destroyed, any other value if failed.
int OpenCMISS::Zinc::Mesh::destroyElementsConditional ( const Field conditionalField)
inline

Destroy all elements in the mesh for which the conditional field is true i.e. non-zero valued in element. These elements are removed from any related groups they are in. All handles to removed elements become invalid. Results are undefined if conditional field is not constant over element. Note that group and element_group fields are valid conditional fields.

Parameters
conditionalFieldField which if non-zero in the element indicates it is to be destroyed.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
Element OpenCMISS::Zinc::Mesh::findElementByIdentifier ( int  identifier)
inline

Return a handle to the element in the mesh with this identifier.

Parameters
identifierNon-negative integer identifier of element.
Returns
Handle to element, or NULL/invalid handle if not found or failed.
Differentialoperator OpenCMISS::Zinc::Mesh::getChartDifferentialoperator ( int  order,
int  term 
)
inline

Returns the differential operator giving a field derivative of the given order with respect to the mesh's chart. The term identifies which of the possible differential operator terms are available for the order and dimension of the mesh.

Parameters
orderThe order of the derivative. Currently must be 1.
termWhich of the (dimensions)^order differential operators is required, starting at 1. For order 1, corresponds to a chart axis.
Returns
Handle to differential operator, or NULL/invalid handle on failure.
int OpenCMISS::Zinc::Mesh::getDimension ( )
inline

Returns the number of dimensions of the mesh.

Returns
dimension of mesh.
Fieldmodule OpenCMISS::Zinc::Mesh::getFieldmodule ( ) const
inline

Returns handle to field module for region this mesh belongs to.

Returns
Handle to field module, or NULL/invalid handle on failure.
cmzn_mesh_id OpenCMISS::Zinc::Mesh::getId ( ) const
inline

Return the C handle of the Mesh object.

Returns
C handle of Mesh if this objects is valid, 0 otherwise.
Mesh OpenCMISS::Zinc::Mesh::getMasterMesh ( )
inline

Get the master mesh which owns the elements for this mesh. Can be the same as the supplied mesh if it is a master.

Returns
Handle to the master mesh, or NULL/invalid handle on failure.
char* OpenCMISS::Zinc::Mesh::getName ( )
inline

Return the name of the mesh.

See also
Void::cmznDeallocate
Returns
On success: allocated string containing mesh name. Up to caller to free using Void::cmznDeallocate().
int OpenCMISS::Zinc::Mesh::getSize ( )
inline

Return the number of elements in the mesh.

Returns
Number of elements in mesh.
bool OpenCMISS::Zinc::Mesh::isValid ( ) const
inline

Check if this is a valid Mesh object.

Returns
Status True if object is valid, false otherwise.

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