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::Fieldcache Class Reference

Cache for setting domain locations at which fields are evaluated or assigned. More...

#include <fieldcache.hpp>

Public Member Functions

 Fieldcache (cmzn_fieldcache_id in_field_cache_id)
 
 Fieldcache (const Fieldcache &fieldCache)
 
Fieldcacheoperator= (const Fieldcache &fieldCache)
 
bool isValid () const
 
cmzn_fieldcache_id getId () const
 
int clearLocation ()
 
int setElement (const Element &element)
 
int setMeshLocation (const Element &element, int coordinatesCount, const double *coordinatesIn)
 
int setFieldReal (const Field &referenceField, int valuesCount, const double *valuesIn)
 
int setNode (const Node &node)
 
int setTime (double time)
 

Protected Attributes

cmzn_fieldcache_id id
 

Detailed Description

Cache for setting domain locations at which fields are evaluated or assigned.

Cache for setting domain locations at which fields are to be evaluated or assigned, and for storing intermediate values and data structures so that multiple evaluations are more efficient.

Member Function Documentation

int OpenCMISS::Zinc::Fieldcache::clearLocation ( )
inline

Clears domain locations held in the field cache. Call this function before evaluating fields in a different domain (e.g. nodes <-> elements <-> point) to ensure false field values at the last domain location are not returned. Note that all domain locations are cleared by this function including time which is reset to 0.0, so these need to be set again if needed.

Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
cmzn_fieldcache_id OpenCMISS::Zinc::Fieldcache::getId ( ) const
inline

Return the C handle of the Fieldcache object.

Returns
C handle of Fieldcache if this objects is valid, 0 otherwise.
bool OpenCMISS::Zinc::Fieldcache::isValid ( ) const
inline

Check if this is a valid Fieldcache object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Fieldcache::setElement ( const Element element)
inline

Prescribes an element location without specifying chart coordinates. Suitable only for evaluating fields that are constant across the element. Note: replaces any other spatial location in cache (e.g. node.) but time is unchanged.

Parameters
elementThe element to set. Must belong to same region as cache.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Fieldcache::setFieldReal ( const Field referenceField,
int  valuesCount,
const double *  valuesIn 
)
inline

Prescribes a value of a field for subsequent evaluation and assignment with the cache. Note: currently treated as a spatial location, replacing any other spatial location in cache (e.g. element, node) but time is unchanged.

Parameters
referenceFieldThe field whose values are to be prescribed.
valuesInCountThe size of the values array. Can be less than the number of field components, and if so it is padded with zeroes.
valuesInThe field values to set.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Fieldcache::setMeshLocation ( const Element element,
int  coordinatesCount,
const double *  coordinatesIn 
)
inline

Prescribes a location in an element for field evaluation or assignment with the cache. Note: replaces any other spatial location in cache (e.g. node.) but time is unchanged.

Parameters
elementThe element the location is in. Must belong to same region as cache.
coordinatesCountThe size of the chart_coordinates array, checked to be not less than the element dimension.
coordinatesInLocation in element chart. Value is not checked; caller is responsible for supplying locations within the bounds of the element shape.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Fieldcache::setNode ( const Node node)
inline

Prescribes a node location for field evaluation or assignment with the cache. Note: replaces any other spatial location in cache (e.g. element) but time is unchanged.

Parameters
nodeThe node to set as spatial location. Must belong to same region as cache.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Fieldcache::setTime ( double  time)
inline

Prescribes the time for field evaluation or assignment with the cache.

Parameters
timeThe time value to be set.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.

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