OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
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 <element.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
 
bool containsElement (const Element &element)
 
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

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 for element shape and fields.
Returns
Handle to new element, 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.

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 for element shape and fields.
Returns
Status OpenCMISS::Zinc::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: