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

Object for assigning values of a field from a source field. More...

#include <fieldassignment.hpp>

Public Member Functions

 Fieldassignment (cmzn_fieldassignment_id fieldassignment_id)
 
 Fieldassignment (const Fieldassignment &fieldassignment)
 
Fieldassignmentoperator= (const Fieldassignment &fieldassignment)
 
bool isValid () const
 
cmzn_fieldassignment_id getId () const
 
int assign ()
 
Field getConditionalField () const
 
int setConditionalField (const Field &conditionalField)
 
Nodeset getNodeset () const
 
int setNodeset (const Nodeset &nodeset)
 
Field getSourceField () const
 
Field getTargetField () const
 

Protected Attributes

cmzn_fieldassignment_id id
 

Detailed Description

Object for assigning values of a field from a source field.

Object performing assignment of a source field to a target field so that the target field will afterwards give as near as possible the same values over its domain as the source. Beware this object may not handle all cases, notably element-based fields. It is initially designed to assign node parameters, and normally only the node field value is assigned to. If the target field is real-valued finite element type then three special cases are handled:

  1. If the source field is finite element type, derivatives and versions are copied directly. Only derivatives/versions present in both source and target field at the node are evaluated and assigned.
  2. If the source field is a function of the target field, it attempts to assign appropriately to different value versions and derivatives, latter by computing the gradient of the source w.r.t. target. In both cases only simple functions of target field value are currently expected to work.
  3. If the source field is not a function of the target field, the source field values are simply evaluated and assigned to all versions of the value parameter of the target field at the node.

Member Function Documentation

int OpenCMISS::Zinc::Fieldassignment::assign ( )
inline

Perform assignment of values from source to target field.

Returns
Result OK on success, WARNING_PART_DONE if partial success, otherwise any other error.
Field OpenCMISS::Zinc::Fieldassignment::getConditionalField ( ) const
inline

Get the current conditional field for the field assignment.

See also
Fieldassignment::setConditionalField
Returns
Handle to conditional field, or NULL/invalid handle if none or invalid field assignment object.
cmzn_fieldassignment_id OpenCMISS::Zinc::Fieldassignment::getId ( ) const
inline

Return the C handle of the Fieldassignment object.

Returns
C handle of Fieldassignment if this objects is valid, 0 otherwise.
Nodeset OpenCMISS::Zinc::Fieldassignment::getNodeset ( ) const
inline

Get the nodeset for the field assignment, if set.

See also
Fieldassignment::setNodeset
Returns
Handle to conditional field, or NULL/invalid handle if none or invalid field assignment object.
Field OpenCMISS::Zinc::Fieldassignment::getSourceField ( ) const
inline

Get the source field for the field assignment.

Returns
Handle to source field, or NULL/invalid handle if invalid field assignment object.
Field OpenCMISS::Zinc::Fieldassignment::getTargetField ( ) const
inline

Get the target field for the field assignment.

Returns
Handle to target field, or NULL/invalid handle if invalid field assignment object.
bool OpenCMISS::Zinc::Fieldassignment::isValid ( ) const
inline

Check if this is a valid Fieldassignment object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Fieldassignment::setConditionalField ( const Field conditionalField)
inline

Set conditional field determining which parts of the target field domain, or domain where DOFs are defined, to assign values over.

Parameters
conditionalFieldThe conditional field to set, or invalid handle to clear. This is commonly a generic or node group field, but may be any field expression returning non-zero/true at domain locations of the target field where values are to be assigned, zero/false where no assignment is done.
Returns
Result OK on success, otherwise ERROR_ARGUMENT.
int OpenCMISS::Zinc::Fieldassignment::setNodeset ( const Nodeset nodeset)
inline

Set nodeset over which DOFs are assigned. Pass NULL/invalid nodeset to assign over default nodeset 'nodes'.

Parameters
nodesetThe nodeset or nodeset group to assign over, or NULL/invalid to clear to default.
Returns
Result OK on success, otherwise ERROR_ARGUMENT.

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