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

A description of element shape and field definitions. More...

#include <elementtemplate.hpp>

Public Member Functions

 Elementtemplate (cmzn_elementtemplate_id element_template_id)
 
 Elementtemplate (const Elementtemplate &elementTemplate)
 
Elementtemplateoperator= (const Elementtemplate &elementTemplate)
 
bool isValid () const
 
cmzn_elementtemplate_id getId () const
 
enum Element::ShapeType getElementShapeType ()
 
int setElementShapeType (enum Element::ShapeType shapeType)
 
int getNumberOfNodes ()
 
int setNumberOfNodes (int numberOfNodes)
 
int defineField (const Field &field, int componentNumber, const Elementfieldtemplate &eft)
 
int defineFieldElementConstant (const Field &field, int componentNumber)
 
int defineFieldSimpleNodal (const Field &field, int componentNumber, const Elementbasis &basis, int nodeIndexesCount, const int *nodeIndexesIn)
 
int setMapNodeValueLabel (const Field &field, int componentNumber, int basisNodeIndex, int nodeFunctionIndex, Node::ValueLabel nodeValueLabel)
 
int setMapNodeVersion (const Field &field, int componentNumber, int basisNodeIndex, int nodeFunctionIndex, int versionNumber)
 
Node getNode (int localNodeIndex)
 
int setNode (int localNodeIndex, const Node &node)
 
int removeField (const Field &field)
 
int undefineField (const Field &field)
 

Detailed Description

A description of element shape and field definitions.

A description of element shape and field definitions (incl. basis, parameter mappings), used as a template for creating new elements in a mesh, or merging into an element to define additional fields on it.

Member Function Documentation

int OpenCMISS::Zinc::Elementtemplate::defineField ( const Field field,
int  componentNumber,
const Elementfieldtemplate eft 
)
inline

Define the field component(s) on the element template using the element field template. The element template is not valid until all components are defined for all fields.

Parameters
fieldThe field to define. May be finite element type only.
componentNumberThe component to define from 1 to the number of field components, or -1 to define all components.
eftThe element field template. Must be for mesh this element template was created from.
Returns
Result OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::defineFieldElementConstant ( const Field field,
int  componentNumber 
)
inline

Defines per element constant field or field component in the element_template.

Note
DEPRECATED. Use element field template and define field function instead.
See also
Elementtemplate::defineField
Parameters
fieldThe field to define. May be finite element type only.
componentNumberThe component to define from 1 to the number of field components, or -1 to define all components.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::defineFieldSimpleNodal ( const Field field,
int  componentNumber,
const Elementbasis basis,
int  nodeIndexesCount,
const int *  nodeIndexesIn 
)
inline

Defines a nodally interpolated element field or field component in the element template. 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. Do not use in combination with new general define field function.

Note
DEPRECATED. Use element field template and define field function instead.
See also
Elementtemplate::defineField
Parameters
fieldThe field to define. May be finite element type only.
componentNumberThe component to define from 1 to the number of field components, or -1 to define all components with identical basis and nodal mappings.
basisThe element basis to use for all field components.
nodeIndexesCountThe number of nodes indexed by the basis, equals the size of the local_node_indexes array.
nodeIndexesInArray containing the local node indexes of the nodes from which element field parameters are mapped, which range from 1 to the number of nodes set for the element_template. Local nodes are ordered by lowest xi coordinate varying fastest, e.g. for biquadratic Lagrange: xi = (0,0), (0.5,0), (1,0), (0,0.5), (0.5,0.5) ...
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
enum Element::ShapeType OpenCMISS::Zinc::Elementtemplate::getElementShapeType ( )
inline

Get the current element shape type set in the element template.

Returns
The element shape type, or INVALID if not set or error.
cmzn_elementtemplate_id OpenCMISS::Zinc::Elementtemplate::getId ( ) const
inline

Return the C handle of the Elementtemplate object.

Returns
C handle of Elementtemplate if this objects is valid, 0 otherwise.
Node OpenCMISS::Zinc::Elementtemplate::getNode ( int  localNodeIndex)
inline

Gets the global node at a given local node index in the element_template.

Note
DEPRECATED. Only used with deprecated define field simple nodal.
Parameters
localNodeIndexThe index from 1 to number of nodes in template.
Returns
Handle to global node, or NULL/invalid handle if none or failed.
int OpenCMISS::Zinc::Elementtemplate::getNumberOfNodes ( )
inline

Gets the number of local nodes this element_template can address.

Returns
The number of local nodes, or 0 on error.
bool OpenCMISS::Zinc::Elementtemplate::isValid ( ) const
inline

Check if this is a valid Elementtemplate object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Elementtemplate::removeField ( const Field field)
inline

Removes field from list of fields to define or undefine in element template.

Parameters
fieldThe field to remove. May be finite element type only.
Returns
Result OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::setElementShapeType ( enum Element::ShapeType  shapeType)
inline

Set the element shape to a standard element shape type. The shape must have the same dimension as the mesh from which the element template was created. Beware that face mappings are lost if shape changes are merged into elements.

Parameters
shapeTypeStandard element shapes enumerated value. Note can be INVALID which means the shape is not set when merged into an element, but new elements cannot be created unless they have a valid shape.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::setMapNodeValueLabel ( const Field field,
int  componentNumber,
int  basisNodeIndex,
int  nodeFunctionIndex,
Node::ValueLabel  nodeValueLabel 
)
inline

For a field defined by node interpolation, sets the node value label (value or derivative) mapped to one function parameter in the element basis. Note that any values set by this function are reset if the field is re-defined at the node. Only to be used after define field simple nodal.

Note
DEPRECATED. Use element field template instead.
Parameters
fieldThe field to modify mapping for.
componentNumberThe component to modify mapping for, from 1 to the number of field components, or -1 to set all components identically.
basisNodeIndexThe basis node index starting at 1, up to number used by basis.
See also
Elementbasis::getNumberOfNodes
Parameters
nodeFunctionIndexThe function index starting at 1, up to the number per node in the element basis.
See also
Elementbasis::getNumberOfFunctionsPerNode
Parameters
nodeValueLabelThe node value label to set.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::setMapNodeVersion ( const Field field,
int  componentNumber,
int  basisNodeIndex,
int  nodeFunctionIndex,
int  versionNumber 
)
inline

For a field defined by node interpolation, sets the version number of the value mapped to one function parameter in the element basis. Note that any values set by this function are reset if the field is re-defined at the node. Only to be used after define field simple nodal.

Note
DEPRECATED. Use element field template instead.
Parameters
fieldThe field to modify mapping for.
componentNumberThe component to modify mapping for, from 1 to the number of field components, or -1 to set all components identically.
basisNodeIndexThe basis node index starting at 1, up to number used by basis.
See also
Elementbasis::getNumberOfNodes
Parameters
nodeFunctionIndexThe function index starting at 1, up to the number per node in the element basis.
See also
Elementbasis::getNumberOfFunctionsPerNode
Parameters
versionNumberThe version number to set, starting at 1.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::setNode ( int  localNodeIndex,
const Node node 
)
inline

Sets the global node at a given local node index in the element_template.

Note
DEPRECATED. Set nodes directly for the element and element field template instead.
Parameters
localNodeIndexThe index from 1 to number of nodes in template.
nodeThe global node to set at that index.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Elementtemplate::setNumberOfNodes ( int  numberOfNodes)
inline

Sets the number of local nodes this element_template can address. This must be done before defining fields that index them. This number cannot be reduced.

Note
DEPRECATED. Use element field template functions instead.
Parameters
numberOfNodesThe number of nodes.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Elementtemplate::undefineField ( const Field field)
inline

Marks field to be undefined when next merged into an existing element. Has no effect on newly created elements. Removes field from define list if present.

Parameters
fieldThe field to undefine. May be finite element type only.
Returns
Result OK on success, any other value on failure.

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