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

A template defining field parameter mapping and interpolation over an element chart. More...

#include <elementfieldtemplate.hpp>

Public Types

enum  ParameterMappingMode { PARAMETER_MAPPING_MODE_INVALID = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_INVALID, PARAMETER_MAPPING_MODE_ELEMENT = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_ELEMENT, PARAMETER_MAPPING_MODE_FIELD = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_FIELD, PARAMETER_MAPPING_MODE_NODE = CMZN_ELEMENTFIELDTEMPLATE_PARAMETER_MAPPING_MODE_NODE }
 
enum  ScaleFactorType {
  SCALE_FACTOR_TYPE_INVALID = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_INVALID, SCALE_FACTOR_TYPE_ELEMENT_GENERAL = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_ELEMENT_GENERAL, SCALE_FACTOR_TYPE_ELEMENT_PATCH = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_ELEMENT_PATCH, SCALE_FACTOR_TYPE_GLOBAL_GENERAL = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_GLOBAL_GENERAL,
  SCALE_FACTOR_TYPE_GLOBAL_PATCH = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_GLOBAL_PATCH, SCALE_FACTOR_TYPE_NODE_GENERAL = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_NODE_GENERAL, SCALE_FACTOR_TYPE_NODE_PATCH = CMZN_ELEMENTFIELDTEMPLATE_SCALE_FACTOR_TYPE_NODE_PATCH
}
 

Public Member Functions

 Elementfieldtemplate (cmzn_elementfieldtemplate_id elementfieldtemplate_id)
 
 Elementfieldtemplate (const Elementfieldtemplate &elementfieldtemplate)
 
Elementfieldtemplateoperator= (const Elementfieldtemplate &elementfieldemplate)
 
bool isValid () const
 
cmzn_elementfieldtemplate_id getId () const
 
Elementbasis getElementbasis () const
 
int getFunctionNumberOfTerms (int functionNumber) const
 
int setFunctionNumberOfTerms (int functionNumber, int newNumberOfTerms)
 
int getNumberOfFunctions () const
 
int getNumberOfLocalNodes () const
 
int setNumberOfLocalNodes (int number)
 
int getNumberOfLocalScaleFactors () const
 
int setNumberOfLocalScaleFactors (int number)
 
ParameterMappingMode getParameterMappingMode () const
 
int setParameterMappingMode (ParameterMappingMode mode)
 
int getScaleFactorIdentifier (int localScaleFactorIndex) const
 
int setScaleFactorIdentifier (int localScaleFactorIndex, int identifier)
 
ScaleFactorType getScaleFactorType (int localScaleFactorIndex) const
 
int setScaleFactorType (int localScaleFactorIndex, ScaleFactorType type)
 
int getTermLocalNodeIndex (int functionNumber, int term) const
 
Node::ValueLabel getTermNodeValueLabel (int functionNumber, int term) const
 
int getTermNodeVersion (int functionNumber, int term) const
 
int setTermNodeParameter (int functionNumber, int term, int localNodeIndex, Node::ValueLabel nodeValueLabel, int version)
 
int getTermScaling (int functionNumber, int term, int indexesCount, int *indexesOut) const
 
int setTermScaling (int functionNumber, int term, int indexesCount, const int *indexesIn)
 
bool validate ()
 

Detailed Description

A template defining field parameter mapping and interpolation over an element chart.

A template defining parameter mapping and interpolation for a scalar quantity over an element chart, to apply to field components across elements of a mesh. Consists of an element basis, plus how to evaluate the parameter multiplying each function in the basis. The element parameter for each basis function is defined as a sum of zero or more terms, with each term multiplied by zero or more scale factors given by their local indexes. Depending on the parameter mapping mode, the terms map node parameters, element parameters or spatially constant field parameters. For node parameters each term extracts a node value/derivative version for a local node. When used on the mesh, a local-to-global node map for this template is applied to give different parameters for each element field component, and element scale factors are similarly indexed for each element.

Member Enumeration Documentation

Modes for how element parameters are mapped from global DOFs.

Enumerator
PARAMETER_MAPPING_MODE_INVALID 

Invalid mapping mode

PARAMETER_MAPPING_MODE_ELEMENT 

Element parameters are mapped directly by element

PARAMETER_MAPPING_MODE_FIELD 

Constant value for field component

PARAMETER_MAPPING_MODE_NODE 

Element parameters are mapped from nodes via local-to-global node map

Unique types for element scale factors which together with node/element and scale factor identifier allow merging of common scale factors in neighbouring elements, or for different templates in the same element. Note that types with the PATCH suffix are intended to be used for rescaling, e.g. scaling arc-length derivatives to be with respect to element chart. Note that a NODE type scale factor must scale parameters from exactly one local node. Note that ELEMENT types are currently limited to using scale factor identifier 0, meaning unique to a given element and element field template.

Enumerator
SCALE_FACTOR_TYPE_INVALID 

Invalid type

SCALE_FACTOR_TYPE_ELEMENT_GENERAL 

General linear map coefficients private to an element

SCALE_FACTOR_TYPE_ELEMENT_PATCH 

Patch to local element coordinate scaling private to an element

SCALE_FACTOR_TYPE_GLOBAL_GENERAL 

General linear map coefficients shared across multiple points in the mesh

SCALE_FACTOR_TYPE_GLOBAL_PATCH 

Patch to local element coordinate scaling shared across multiple points in the mesh

SCALE_FACTOR_TYPE_NODE_GENERAL 

General linear map coefficients shared through global nodes

SCALE_FACTOR_TYPE_NODE_PATCH 

Patch to local element coordinate scaling shared through global nodes

Member Function Documentation

Elementbasis OpenCMISS::Zinc::Elementfieldtemplate::getElementbasis ( ) const
inline

Get the element basis used by this element field template.

Returns
Handle to element basis, or NULL/invalid handle if failed.

The parameter mapping mode or INVALID on error.

int OpenCMISS::Zinc::Elementfieldtemplate::getFunctionNumberOfTerms ( int  functionNumber) const
inline

Get the number of terms that are summed to give the element parameter weighting the given function number.

Parameters
functionNumberBasis function number from 1 to number of functions.
Returns
The number of terms >= 0, or -1 if invalid arguments.
cmzn_elementfieldtemplate_id OpenCMISS::Zinc::Elementfieldtemplate::getId ( ) const
inline

Return the C handle of the Elementfieldtemplate object.

Returns
C handle of Elementfieldtemplate if this objects is valid, 0 otherwise.
int OpenCMISS::Zinc::Elementfieldtemplate::getNumberOfFunctions ( ) const
inline

Get the number of basis functions in the element basis used by the template.

Returns
The number of basis functions, 0 on error.
int OpenCMISS::Zinc::Elementfieldtemplate::getNumberOfLocalNodes ( ) const
inline

Get the number of local nodes this element field template uses.

Returns
The number of local nodes, or 0 if not node parameter mapping.
int OpenCMISS::Zinc::Elementfieldtemplate::getNumberOfLocalScaleFactors ( ) const
inline

Get the number of local scale factors this element field template uses.

Returns
The number of local scale factors, 0 if none or error.
ParameterMappingMode OpenCMISS::Zinc::Elementfieldtemplate::getParameterMappingMode ( ) const
inline

Get the parameter mapping mode used for all parameters in the template.

Returns
The parameter mapping mode or INVALID on error.
int OpenCMISS::Zinc::Elementfieldtemplate::getScaleFactorIdentifier ( int  localScaleFactorIndex) const
inline

Get the identifier of the scale factor mapped to the local scale factor index. Used to match common scale factors between elements and fields.

Parameters
localScaleFactorIndexThe local scale factor index from 1 to number of local scale factors.
Returns
The element scale factor identifier >= 0, or -1 if invalid or error.
ScaleFactorType OpenCMISS::Zinc::Elementfieldtemplate::getScaleFactorType ( int  localScaleFactorIndex) const
inline

Get the type of scale factor mapped to the local scale factor index. Used to match common scale factors between elements and fields.

Parameters
localScaleFactorIndexThe local scale factor index from 1 to number of local scale factors.
Returns
The element scale factor type, or INVALID on error.
int OpenCMISS::Zinc::Elementfieldtemplate::getTermLocalNodeIndex ( int  functionNumber,
int  term 
) const
inline

Get the local node index from which a node parameter is extracted for the given term for the function number. For parameter mapping mode NODE only.

Parameters
functionNumberBasis function number from 1 to number of functions.
termThe term number, from 1 to function number of terms.
Returns
The local node index from 1 to number of local nodes, or 0 if invalid or error.
Node::ValueLabel OpenCMISS::Zinc::Elementfieldtemplate::getTermNodeValueLabel ( int  functionNumber,
int  term 
) const
inline

Get the node parameter value label mapped to the given term for the function number. For parameter mapping mode NODE only.

Parameters
functionNumberBasis function number from 1 to number of functions.
termThe term number, from 1 to function number of terms.
Returns
The node value label, or INVALID if invalid or error.
int OpenCMISS::Zinc::Elementfieldtemplate::getTermNodeVersion ( int  functionNumber,
int  term 
) const
inline

Get the node parameter version mapped to the given term for the function number. For parameter mapping mode NODE only.

Parameters
functionNumberBasis function number from 1 to number of functions.
termThe term number, from 1 to function number of terms.
Returns
The node parameter version >= 1, or 0 if invalid or error.
int OpenCMISS::Zinc::Elementfieldtemplate::getTermScaling ( int  functionNumber,
int  term,
int  indexesCount,
int *  indexesOut 
) const
inline

Get the number and local indexes of scale factors multiplying the given term for the function number. For parameter mapping mode NODE only.

Parameters
functionNumberBasis function number from 1 to number of functions.
termThe term number, from 1 to function number of terms.
indexesCountThe size of the indexes array; can be more or less than the number of indexes in use.
indexesOutArray to store indexesCount indexes. Can be NULL if indexesCount is zero.
Returns
The actual number of scaling indexes >= 0 for term, or -1 on error.
bool OpenCMISS::Zinc::Elementfieldtemplate::isValid ( ) const
inline

Check if this is a valid Elementfieldtemplate object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Elementfieldtemplate::setFunctionNumberOfTerms ( int  functionNumber,
int  newNumberOfTerms 
)
inline

Set the number of terms that are summed to give the element parameter weighting the given basis function number. Currently only supported for node mapping - other parameter mapping modes are fixed at 1 term. If reducing number, existing mappings for higher terms are discarded. If increasing number, new mappings must be completely specified by subsequent calls; new mappings are unscaled by default.

Parameters
functionNumberBasis function number from 1 to number of functions.
newNumberOfTermsNew number of terms to be summed, >= 0.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setNumberOfLocalNodes ( int  number)
inline

Set the number of local nodes this element field template uses. If reducing number, template is only valid once all indexes are in the range [1..number]. Only valid in node mapping mode.

Parameters
numberThe number of local nodes to set, > 0.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setNumberOfLocalScaleFactors ( int  number)
inline

Set the number of local scale factors this element field template uses. If reducing number, template is only valid once all indexes are in the range [1..number]. Only valid in node mapping mode. New local scale factors default to type LOCAL_GENERAL, version 1.

Parameters
numberThe number of local scale factors to set, >= 0.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setParameterMappingMode ( ParameterMappingMode  mode)
inline

Set the parameter mapping mode used for all parameters in the template. A current restriction is that all parameters are mapped by NODE, ELEMENT or FIELD. Note this resets the mapping to the default for the given mapping mode: one term per basis function with no scaling hence should be the first setting changed.

Parameters
modeThe parameter mapping mode to set.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setScaleFactorIdentifier ( int  localScaleFactorIndex,
int  identifier 
)
inline

Set the identifier of the scale factor mapped to the local scale factor index. Used to match common scale factors between elements and fields. Global scale factors are matched by type and as appropriate global node/element and local or global scale factor identifier. For each global scale factor type, the identifier is globally unique. For each node-based scale factor type, the identifier is unique at each node. For each element-based scale factor, only the special identifier 0 is currently permitted, and scale factors are private to each element and element field template. To tie node-based scale factor identifiers to node value labels/derivatives, the recommended convention is to use an identifier matching the numerical value of the node value label enumeration, and for each distinct version of the scale factor, add 100 times the version number (to allow for new node value labels in future). New scale factors default to ELEMENT GENERAL type with identifier 0.

Parameters
localScaleFactorIndexThe local scale factor index from 1 to number of local scale factors.
identifierThe identifier >= 0. Special value 0 is only permitted for element type scale factors, but this is not checked until final validation.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setScaleFactorType ( int  localScaleFactorIndex,
ScaleFactorType  type 
)
inline

Set the type of scale factor mapped to the local scale factor index. Used to match common scale factors between elements and fields. Global scale factors are matched by type and as appropriate global node/element and local or global scale factor identifier. New scale factors default to ELEMENT GENERAL type.

Parameters
localScaleFactorIndexThe local scale factor index from 1 to number of local scale factors.
typeThe element scale factor type.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setTermNodeParameter ( int  functionNumber,
int  term,
int  localNodeIndex,
Node::ValueLabel  nodeValueLabel,
int  version 
)
inline

Set the node parameter mapped to the given term for the function number, via the local node index, node value label and node parameter version. For parameter mapping mode NODE only.

Parameters
functionNumberBasis function number from 1 to number of functions.
termThe term number, from 1 to function number of terms.
localNodeIndexThe local node index from 1 to number of local nodes.
nodeValueLabelThe node parameter value label.
versionThe node parameter version >= 1.
Returns
Result OK on success, otherwise an error code.
int OpenCMISS::Zinc::Elementfieldtemplate::setTermScaling ( int  functionNumber,
int  term,
int  indexesCount,
const int *  indexesIn 
)
inline

Set scaling of the function term by the product of scale factors at the given local scale factor indexes. Must have set positive number of local scale factors before calling. For parameter mapping mode NODE only.

Parameters
functionNumberBasis function number from 1 to number of functions.
termThe term number, from 1 to function number of terms.
indexesCountThe size of the indexes array; can be more or less than the number of indexes in use.
indexesInArray of indexesCount indexes, each from 1 to number of local scale factors. Can be NULL if indexesCount is zero.
Returns
Result OK on success, otherwise an error code.
bool OpenCMISS::Zinc::Elementfieldtemplate::validate ( )
inline

Query whether element field template passes validation. Failure typically results from local node or scale factor indexes being out of range, or use of combinations of values that are not supported, e.g. scale factor identifiers have various restrictions for each type. Refer to the respective API help to determine what is valid. Validation errors are sent to the logger; clients may either inspect logger output or query template to determine source of error.

Returns
True if element field template passes validation, otherwise false.

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