Version: 9.14.0
ICoCo::MEDDoubleField Class Reference
Inheritance diagram for ICoCo::MEDDoubleField:
Collaboration diagram for ICoCo::MEDDoubleField:

Public Member Functions

MEDCoupling::MEDCouplingFieldDoublegetMCField () const
 
 MEDDoubleField ()
 
 MEDDoubleField (const MEDDoubleField &field)
 
 MEDDoubleField (MEDCoupling::MEDCouplingFieldDouble *field)
 
MEDDoubleFieldoperator= (const MEDDoubleField &field)
 
void setMCField (MEDCoupling::MEDCouplingFieldDouble *field)
 
virtual ~MEDDoubleField ()
 
- Public Member Functions inherited from ICoCo::Field
const char * getCharName () const
 
const std::string & getName () const
 
void setName (const std::string &name)
 

Additional Inherited Members

- Protected Member Functions inherited from ICoCo::Field
 Field ()
 
virtual ~Field ()
 

Detailed Description

Field data stored internally as a MEDCoupling object.

This class is a wrapper around a MEDCoupling::MEDCouplingFieldDouble object, which holds the field data. In version 2 of ICoCo, MEDCoupling::MEDCouplingFieldDouble objects are not anymore exposed directly into the API of ICoCo::Problem. The rationale is to make the interface ICoCo::Problem free of external dependencies (MEDCoupling particularly).

See also
the MEDCoupling documentation, notably the reference counter mechanism used to manage the lifecycle of MEDCoupling objects.

Constructor & Destructor Documentation

◆ MEDDoubleField() [1/3]

ICoCo::MEDDoubleField::MEDDoubleField ( )

Builds an empty field (internal MEDCoupling object not set).

◆ MEDDoubleField() [2/3]

ICoCo::MEDDoubleField::MEDDoubleField ( MEDCoupling::MEDCouplingFieldDouble field)

Builds a field and assign its internal MEDCouplingField object.

The name of 'this' is also automatically set the name of the MEDCouplingField object. If 'field' is null the name is set to the empty string.

Parameters
fieldMEDCoupling field instance to use for field data. The field reference counter is incremented.

◆ MEDDoubleField() [3/3]

ICoCo::MEDDoubleField::MEDDoubleField ( const MEDDoubleField field)

Copy construcotr.

◆ ~MEDDoubleField()

virtual ICoCo::MEDDoubleField::~MEDDoubleField ( )
virtual

Destructor.

Member Function Documentation

◆ operator=()

MEDDoubleField& ICoCo::MEDDoubleField::operator= ( const MEDDoubleField field)

Assignement operator.

Parameters
fieldanother MEDDoubleField instance. The previous internal MEDCoupling field reference (if any) has its counter decremented.

◆ getMCField()

MEDCoupling::MEDCouplingFieldDouble* ICoCo::MEDDoubleField::getMCField ( ) const

Get the internal MEDCoupling field object.

Returns
a pointer to the MEDCouplingField object detained by this instance. Note that the corresponding object should not be deleted, or its reference counter should not be decreased! Doing so will result in an invalid instance of the current MEDField.

Referenced by MEDCoupling::DisjointDEC::attachLocalField(), MEDCoupling::OverlapDEC::attachSourceLocalField(), and MEDCoupling::OverlapDEC::attachTargetLocalField().

◆ setMCField()

void ICoCo::MEDDoubleField::setMCField ( MEDCoupling::MEDCouplingFieldDouble field)

Set the internal MEDCoupling field object.

Any previously set field is discarded (its reference counter is decreased) and the reference counter of the field being set is increased.

The name of 'this' is also automatically set the name of the MEDCouplingField object. If 'field' is nullptr the name is reset to the empty string.

Parameters
fieldMEDCouplingFieldDouble object to be used.