Version: 9.12.0
MEDCoupling::MEDCouplingFieldDouble Class Reference
Inheritance diagram for MEDCoupling::MEDCouplingFieldDouble:
Collaboration diagram for MEDCoupling::MEDCouplingFieldDouble:

Public Member Functions

void accumulate (double *res) const
 
double accumulate (int compId) const
 
std::string advancedRepr () const
 
void applyFunc (const std::string &func)
 
void applyFunc (int nbOfComp, const std::string &func)
 
void applyFunc (int nbOfComp, double val)
 
void applyFunc (int nbOfComp, FunctionToEvaluate func)
 
void applyFuncCompo (int nbOfComp, const std::string &func)
 
void applyFuncFast32 (const std::string &func)
 
void applyFuncFast64 (const std::string &func)
 
void applyFuncNamedCompo (int nbOfComp, const std::vector< std::string > &varsOrder, const std::string &func)
 
void applyLin (double a, double b)
 
void applyLin (double a, double b, int compoId)
 
bool areCompatibleForMeld (const MEDCouplingFieldDouble *other) const
 
bool areCompatibleForMerge (const MEDCouplingField *other) const
 
MEDCouplingFieldDoublebuildNewTimeReprFromThis (TypeOfTimeDiscretization td, bool deepCpy) const
 
MEDCouplingFieldDoublecellToNodeDiscretization () const
 
void changeNbOfComponents (std::size_t newNbOfComp, double dftValue=0.)
 
void changeUnderlyingMesh (const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15)
 
MEDCouplingFieldDoubleclone (bool recDeepCpy) const
 
MEDCouplingFieldDoublecomputeVectorFieldCyl (const double center[3], const double vect[3]) const
 
MCAuto< MEDCouplingFieldDoubleconvertQuadraticCellsToLinear () const
 
MEDCouplingFieldFloat * convertToFloatField () const
 
MEDCouplingFieldInt64 * convertToInt64Field () const
 
MEDCouplingFieldInt32 * convertToIntField () const
 
MEDCouplingFieldDoublecrossProduct (const MEDCouplingFieldDouble &other) const
 
MEDCouplingFieldDoubledeepCopy () const
 
MEDCouplingFieldDoubledeterminant () const
 
MEDCouplingFieldDoubledeviator () const
 
MEDCouplingFieldDoubledot (const MEDCouplingFieldDouble &other) const
 
MEDCouplingFieldDoubledoublyContractedProduct () const
 
MEDCouplingFieldDoubleeigenValues () const
 
MEDCouplingFieldDoubleeigenVectors () const
 
MEDCouplingFieldDoubleextractSlice3D (const double *origin, const double *vec, double eps) const
 
void fillFromAnalytic (int nbOfComp, const std::string &func)
 
void fillFromAnalytic (int nbOfComp, FunctionToEvaluate func)
 
void fillFromAnalyticCompo (int nbOfComp, const std::string &func)
 
void fillFromAnalyticNamedCompo (int nbOfComp, const std::vector< std::string > &varsOrder, const std::string &func)
 
DataArrayIdType * findIdsInRange (double vmin, double vmax) const
 
double getAverageValue () const
 
std::string getClassName () const override
 
std::vector< const BigMemoryObject * > getDirectChildrenWithNull () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
double getIJK (mcIdType cellId, int nodeIdInCell, int compoId) const
 
double getMaxValue () const
 
double getMaxValue2 (DataArrayIdType *&tupleIds) const
 
double getMinValue () const
 
double getMinValue2 (DataArrayIdType *&tupleIds) const
 
std::size_t getNumberOfComponents () const
 
mcIdType getNumberOfTuples () const
 
mcIdType getNumberOfValues () const
 
MEDCouplingTimeDiscretizationgetTimeDiscretizationUnderGround ()
 
const MEDCouplingTimeDiscretizationgetTimeDiscretizationUnderGround () const
 
void getValueOn (const double *spaceLoc, double *res) const
 
void getValueOn (const double *spaceLoc, double time, double *res) const
 
DataArrayDoublegetValueOnMulti (const double *spaceLoc, mcIdType nbOfPoints) const
 
void getValueOnPos (mcIdType i, mcIdType j, mcIdType k, double *res) const
 
void getWeightedAverageValue (double *res, bool isWAbs=true) const
 
double getWeightedAverageValue (int compId, bool isWAbs=true) const
 
void integral (bool isWAbs, double *res) const
 
double integral (int compId, bool isWAbs) const
 
MEDCouplingFieldDoubleinverse () const
 
MEDCouplingFieldDoublekeepSelectedComponents (const std::vector< std::size_t > &compoIds) const
 
MEDCouplingFieldDoublemagnitude () const
 
MEDCouplingFieldDoublemax (const MEDCouplingFieldDouble &other) const
 
MEDCouplingFieldDoublemaxPerTuple () const
 
bool mergeNodes (double eps, double epsOnVals=1e-15)
 
bool mergeNodesCenter (double eps, double epsOnVals=1e-15)
 
MEDCouplingFieldDoublemin (const MEDCouplingFieldDouble &other) const
 
MEDCouplingFieldDoublenegate () const
 
MEDCouplingFieldDoublenodeToCellDiscretization () const
 
double norm2 () const
 
void normL1 (double *res) const
 
double normL1 (int compId) const
 
void normL2 (double *res) const
 
double normL2 (int compId) const
 
void normMax (double *res) const
 
double normMax (int compId) const
 
MEDCouplingFieldDoubleoperator* (const MEDCouplingFieldDouble &other) const
 
const MEDCouplingFieldDoubleoperator*= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator+ (const MEDCouplingFieldDouble &other) const
 
const MEDCouplingFieldDoubleoperator+= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator- (const MEDCouplingFieldDouble &other) const
 
const MEDCouplingFieldDoubleoperator-= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator/ (const MEDCouplingFieldDouble &other) const
 
const MEDCouplingFieldDoubleoperator/= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator= (double value)
 
MEDCouplingFieldDoubleoperator^ (const MEDCouplingFieldDouble &other) const
 
const MEDCouplingFieldDoubleoperator^= (const MEDCouplingFieldDouble &other)
 
void renumberNodes (const mcIdType *old2NewBg, double eps=1e-15)
 
void renumberNodesWithoutMesh (const mcIdType *old2NewBg, mcIdType newNbOfNodes, double eps=1e-15)
 
void setSelectedComponents (const MEDCouplingFieldDouble *f, const std::vector< std::size_t > &compoIds)
 
bool simplexize (int policy)
 
void sortPerTuple (bool asc)
 
void substractInPlaceDM (const MEDCouplingFieldDouble *f, int levOfCheck, double precOnMesh, double eps=1e-15)
 
void synchronizeTimeWithSupport ()
 
MEDCouplingFieldDoubletrace () const
 
void updateTime () const
 
MCAuto< MEDCouplingFieldDoublevoronoize (double eps) const
 
std::string writeVTK (const std::string &fileName, bool isBinary=true) const
 
bool zipConnectivity (int compType, double epsOnVals=1e-15)
 
bool zipCoords (double epsOnVals=1e-15)
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingFieldT< double >
bool areCompatibleForDiv (const MEDCouplingField *other) const
 
bool areCompatibleForMul (const MEDCouplingField *other) const
 
bool areStrictlyCompatible (const MEDCouplingField *other) const
 
bool areStrictlyCompatibleForMulDiv (const MEDCouplingField *other) const
 
Traits< double >::FieldType * buildSubPart (const DataArrayIdType *part) const
 
Traits< double >::FieldType * buildSubPart (const mcIdType *partBg, const mcIdType *partEnd) const
 
Traits< double >::FieldType * buildSubPartRange (mcIdType begin, mcIdType end, mcIdType step) const
 
void checkConsistencyLight () const
 
void checkForUnserialization (const std::vector< mcIdType > &tinyInfoI, const DataArrayIdType *dataInt, const std::vector< typename Traits< double >::ArrayType * > &arrays)
 
Traits< double >::FieldType * cloneWithMesh (bool recDeepCpy) const
 
void copyAllTinyAttrFrom (const MEDCouplingFieldT< double > *other)
 
void copyTinyAttrFrom (const MEDCouplingFieldT< double > *other)
 
void copyTinyStringsFrom (const MEDCouplingField *other)
 
void finishUnserialization (const std::vector< mcIdType > &tinyInfoI, const std::vector< double > &tinyInfoD, const std::vector< std::string > &tinyInfoS)
 
Traits< double >::ArrayType * getArray ()
 
const Traits< double >::ArrayType * getArray () const
 
std::vector< typename Traits< double >::ArrayType * > getArrays () const
 
Traits< double >::ArrayType * getEndArray ()
 
const Traits< double >::ArrayType * getEndArray () const
 
double getEndTime (int &iteration, int &order) const
 
double getIJ (mcIdType tupleId, std::size_t compoId) const
 
double getStartTime (int &iteration, int &order) const
 
double getTime (int &iteration, int &order) const
 
TypeOfTimeDiscretization getTimeDiscretization () const
 
double getTimeTolerance () const
 
std::string getTimeUnit () const
 
void getTinySerializationDbleInformation (std::vector< double > &tinyInfo) const
 
void getTinySerializationIntInformation (std::vector< mcIdType > &tinyInfo) const
 
void getTinySerializationStrInformation (std::vector< std::string > &tinyInfo) const
 
virtual bool isEqual (const MEDCouplingFieldT< double > *other, double meshPrec, double valsPrec) const
 
virtual bool isEqualIfNotWhy (const MEDCouplingFieldT< double > *other, double meshPrec, double valsPrec, std::string &reason) const
 
virtual bool isEqualWithoutConsideringStr (const MEDCouplingFieldT< double > *other, double meshPrec, double valsPrec) const
 
void renumberCells (const mcIdType *old2NewBg, bool check=true)
 
void renumberCellsWithoutMesh (const mcIdType *old2NewBg, bool check=true)
 
void reprQuickOverview (std::ostream &stream) const
 
void resizeForUnserialization (const std::vector< mcIdType > &tinyInfoI, DataArrayIdType *&dataInt, std::vector< typename Traits< double >::ArrayType * > &arrays)
 
void serialize (DataArrayIdType *&dataInt, std::vector< typename Traits< double >::ArrayType * > &arrays) const
 
void setArray (typename Traits< double >::ArrayType *array)
 
void setArrays (const std::vector< typename Traits< double >::ArrayType * > &arrs)
 
void setEndArray (typename Traits< double >::ArrayType *array)
 
void setEndIteration (int it)
 
void setEndOrder (int order)
 
void setEndTime (double val, int iteration, int order)
 
void setEndTimeValue (double val)
 
void setIteration (int it)
 
void setOrder (int order)
 
void setStartTime (double val, int iteration, int order)
 
void setTime (double val, int iteration, int order)
 
void setTimeTolerance (double val)
 
void setTimeUnit (const std::string &unit)
 
void setTimeValue (double val)
 
std::string simpleRepr () const
 
void synchronizeTimeWithMesh ()
 
const MEDCouplingTimeDiscretizationTemplate< double > * timeDiscrSafe () const
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingField
MEDCouplingFieldDoublebuildMeasureField (bool isAbs) const
 
MEDCouplingMeshbuildSubMeshData (const mcIdType *start, const mcIdType *end, DataArrayIdType *&di) const
 
MEDCouplingMeshbuildSubMeshDataRange (mcIdType begin, mcIdType end, mcIdType step, mcIdType &beginOut, mcIdType &endOut, mcIdType &stepOut, DataArrayIdType *&di) const
 
void clearGaussLocalizations ()
 
DataArrayIdType * computeTupleIdsToSelectFromCellIds (const mcIdType *startCellIds, const mcIdType *endCellIds) const
 
void getCellIdsHavingGaussLocalization (int locId, std::vector< mcIdType > &cellIds) const
 
std::string getDescription () const
 
MEDCouplingFieldDiscretizationgetDiscretization ()
 
const MEDCouplingFieldDiscretizationgetDiscretization () const
 
MEDCouplingGaussLocalizationgetGaussLocalization (int locId)
 
const MEDCouplingGaussLocalizationgetGaussLocalization (int locId) const
 
mcIdType getGaussLocalizationIdOfOneCell (mcIdType cellId) const
 
mcIdType getGaussLocalizationIdOfOneType (INTERP_KERNEL::NormalizedCellType type) const
 
std::set< mcIdType > getGaussLocalizationIdsOfOneType (INTERP_KERNEL::NormalizedCellType type) const
 
DataArrayDoublegetLocalizationOfDiscr () const
 
MEDCoupling::MEDCouplingMeshgetMesh ()
 
const MEDCoupling::MEDCouplingMeshgetMesh () const
 
std::string getName () const
 
NatureOfField getNature () const
 
mcIdType getNbOfGaussLocalization () const
 
mcIdType getNumberOfMeshPlacesExpected () const
 
mcIdType getNumberOfTuplesExpected () const
 
mcIdType getNumberOfTuplesExpectedRegardingCode (const std::vector< mcIdType > &code, const std::vector< const DataArrayIdType * > &idsPerType) const
 
TypeOfField getTypeOfField () const
 
void setDescription (const std::string &desc)
 
void setDiscretization (MEDCouplingFieldDiscretization *newDisc)
 
void setGaussLocalizationOnCells (const mcIdType *begin, const mcIdType *end, const std::vector< double > &refCoo, const std::vector< double > &gsCoo, const std::vector< double > &wg)
 
void setGaussLocalizationOnType (INTERP_KERNEL::NormalizedCellType type, const std::vector< double > &refCoo, const std::vector< double > &gsCoo, const std::vector< double > &wg)
 
void setMesh (const MEDCoupling::MEDCouplingMesh *mesh)
 
void setName (const std::string &name)
 
virtual void setNature (NatureOfField nat)
 
- Public Member Functions inherited from MEDCoupling::RefCountObjectOnly
bool decrRef () const
 
int getRCValue () const
 
void incrRef () const
 
RefCountObjectOnlyoperator= (const RefCountObjectOnly &other)
 
- Public Member Functions inherited from MEDCoupling::BigMemoryObject
std::string debugHeapMemorySize () const
 
std::vector< const BigMemoryObject * > getAllTheProgeny () const
 
std::vector< const BigMemoryObject * > getDirectChildren () const
 
std::size_t getHeapMemorySize () const
 
std::string getHeapMemorySizeStr () const
 
bool isObjectInTheProgeny (const BigMemoryObject *obj) const
 
virtual ~BigMemoryObject ()
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 
 TimeLabel (const TimeLabel &other)=default
 

Static Public Member Functions

static MEDCouplingFieldDoubleAddFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleCrossProductFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleDivideFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleDotFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleMaxFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleMeldFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleMergeFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleMergeFields (const std::vector< const MEDCouplingFieldDouble * > &a)
 
static MEDCouplingFieldDoubleMinFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleMultiplyFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleNew (const MEDCouplingFieldTemplate &ft, TypeOfTimeDiscretization td=ONE_TIME)
 
static MEDCouplingFieldDoubleNew (TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
 
static MEDCouplingFieldDoublePowFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static MEDCouplingFieldDoubleSubstractFields (const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2)
 
static std::string WriteVTK (const std::string &fileName, const std::vector< const MEDCouplingFieldDouble * > &fs, bool isBinary=true)
 
- Static Public Member Functions inherited from MEDCoupling::BigMemoryObject
static std::size_t GetHeapMemorySizeOfObjs (const std::vector< const BigMemoryObject * > &objs)
 

Protected Member Functions

 ~MEDCouplingFieldDouble ()
 
- Protected Member Functions inherited from MEDCoupling::MEDCouplingFieldT< double >
 MEDCouplingFieldT (const MEDCouplingField &other, MEDCouplingTimeDiscretizationTemplate< double > *timeDiscr, bool deepCopy=true)
 
 MEDCouplingFieldT (const MEDCouplingFieldT< double > &other, bool deepCopy)
 
 MEDCouplingFieldT (MEDCouplingFieldDiscretization *type, NatureOfField n, MEDCouplingTimeDiscretizationTemplate< double > *timeDiscr)
 
 MEDCouplingFieldT (TypeOfField type, MEDCouplingTimeDiscretizationTemplate< double > *timeDiscr)
 
MEDCouplingTimeDiscretizationTemplate< double > * timeDiscrSafe ()
 
 ~MEDCouplingFieldT ()
 
- Protected Member Functions inherited from MEDCoupling::MEDCouplingField
bool isEqualIfNotWhyProtected (const MEDCouplingField *other, double meshPrec, std::string &reason) const
 
bool isEqualWithoutConsideringStrProtected (const MEDCouplingField *other, double meshPrec) const
 
 MEDCouplingField (const MEDCouplingField &other, bool deepCopy=true)
 
 MEDCouplingField (MEDCouplingFieldDiscretization *type, NatureOfField nature=NoNature)
 
 MEDCouplingField (TypeOfField type)
 
virtual ~MEDCouplingField ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObjectOnly
 RefCountObjectOnly ()
 
 RefCountObjectOnly (const RefCountObjectOnly &other)
 
virtual ~RefCountObjectOnly ()
 
- Protected Member Functions inherited from MEDCoupling::TimeLabel
void forceTimeOfThis (const TimeLabel &other) const
 
 TimeLabel ()
 
void updateTimeWith (const TimeLabel &other) const
 
virtual ~TimeLabel ()
 

Additional Inherited Members

- Protected Attributes inherited from MEDCoupling::MEDCouplingFieldT< double >
MEDCouplingTimeDiscretizationTemplate< double > * _time_discr
 
- Protected Attributes inherited from MEDCoupling::MEDCouplingField
std::string _desc
 
const MEDCouplingMesh_mesh
 
std::string _name
 
NatureOfField _nature
 
MCAuto< MEDCouplingFieldDiscretization_type
 

Constructor & Destructor Documentation

◆ ~MEDCouplingFieldDouble()

MEDCoupling::MEDCouplingFieldDouble::~MEDCouplingFieldDouble ( )
protected

Member Function Documentation

◆ New() [1/2]

MEDCouplingFieldDouble * MEDCouplingFieldDouble::New ( TypeOfField  type,
TypeOfTimeDiscretization  td = ONE_TIME 
)
static

Creates a new MEDCouplingFieldDouble, of given spatial type and time discretization. For more info, see Building a field from scratch.

Parameters
[in]type- the type of spatial discretization of the created field, one of (ON_CELLS, ON_NODES, ON_GAUSS_PT, ON_GAUSS_NE, ON_NODES_KR).
[in]td- the type of time discretization of the created field, one of (NO_TIME, ONE_TIME, LINEAR_TIME, CONST_ON_TIME_INTERVAL).
Returns
MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildCellFieldOnRecurseWithoutOverlapWithoutGhost(), MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithGhost(), MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost(), MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField(), MEDCoupling::MEDCouplingCurveLinearMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingStructuredMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingUMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField(), MEDCoupling::MEDCoupling1SGTUMesh::computeDiameterField(), MEDCoupling::MEDCouplingUMesh::computeDiameterField(), MEDCoupling::MEDFileInt32Field1TS::ConvertFieldIntToFieldDouble(), MEDCoupling::MEDFileInt64Field1TS::ConvertFieldIntToFieldDouble(), convertQuadraticCellsToLinear(), MEDCoupling::MEDCouplingMesh::fillFromAnalytic(), MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo(), MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo(), MEDCoupling::MEDCouplingUMesh::getAspectRatioField(), MEDCoupling::MEDCouplingUMesh::getEdgeRatioField(), MEDCoupling::MEDCouplingCMesh::getMeasureField(), MEDCoupling::MEDCouplingCurveLinearMesh::getMeasureField(), MEDCoupling::MEDCouplingIMesh::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getMeasureField(), MEDCoupling::MEDCouplingMappedExtrudedMesh::getMeasureField(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::getMeasureField(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getMeasureFieldOnNode(), MEDCoupling::MEDCouplingUMesh::getSkewField(), MEDCoupling::MEDCouplingUMesh::getWarpField(), MEDCoupling::ParaFIELD::ParaFIELD(), MEDCoupling::MEDCouplingRemapper::reverseTransferField(), MEDCoupling::MEDCouplingRemapper::transferField(), and MEDCoupling::MEDCouplingAMRAttribute::writeVTHB().

◆ New() [2/2]

MEDCouplingFieldDouble * MEDCouplingFieldDouble::New ( const MEDCouplingFieldTemplate ft,
TypeOfTimeDiscretization  td = ONE_TIME 
)
static

Creates a new MEDCouplingFieldDouble, of a given time discretization and with a spatial type and supporting mesh copied from a given field template. For more info, see Building a field from scratch.

Warning
This method does not deeply copy neither the mesh nor the spatial discretization. Only a shallow copy (reference) is done for the mesh and the spatial discretization!
Parameters
[in]ft- the field template defining the spatial discretization and the supporting mesh.
[in]td- the type of time discretization of the created field, one of (NO_TIME, ONE_TIME, LINEAR_TIME, CONST_ON_TIME_INTERVAL).
Returns
MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.

◆ synchronizeTimeWithSupport()

void MEDCouplingFieldDouble::synchronizeTimeWithSupport ( )

Sets a time unit of this field. For more info, see Building a field from scratch.

Parameters
[in]unitunit (string) in which time is measured.

Returns a time unit of this field.

Returns
a string describing units in which time is measured.

This method if possible the time information (time unit, time iteration, time unit and time value) with its support that is to say its mesh.

Exceptions
Ifthis->_mesh is null an exception will be thrown. An exception will also be throw if the spatial discretization is NO_TIME.

References MEDCoupling::MEDCouplingField::_mesh, and MEDCoupling::MEDCouplingTimeDiscretization::synchronizeTimeWith().

◆ advancedRepr()

◆ writeVTK()

std::string MEDCouplingFieldDouble::writeVTK ( const std::string &  fileName,
bool  isBinary = true 
) const

References WriteVTK().

◆ areCompatibleForMerge()

bool MEDCouplingFieldDouble::areCompatibleForMerge ( const MEDCouplingField other) const
virtual

This method states if this and 'other' are compatibles each other before performing any treatment. This method is good for methods like : mergeFields. This method is not very demanding compared to areStrictlyCompatible that is better for operation on fields.

Reimplemented from MEDCoupling::MEDCouplingField.

References MEDCoupling::MEDCouplingField::areCompatibleForMerge().

Referenced by MergeFields(), and substractInPlaceDM().

◆ areCompatibleForMeld()

bool MEDCouplingFieldDouble::areCompatibleForMeld ( const MEDCouplingFieldDouble other) const

This method is invocated before any attempt of melding. This method is very close to areStrictlyCompatible, except that this and other can have different number of components.

References MEDCoupling::MEDCouplingField::areStrictlyCompatible().

Referenced by MeldFields().

◆ renumberNodes()

void MEDCouplingFieldDouble::renumberNodes ( const mcIdType *  old2NewBg,
double  eps = 1e-15 
)

Permutes values of this field according to a given permutation array for node renumbering. The underlying mesh is deeply copied and its nodes are also permuted. The number of nodes can change, contrary to renumberCells().

Parameters
[in]old2NewBg- the permutation array in "Old to New" mode. Its length is to be equal to this->getMesh()->getNumberOfNodes().
[in]eps- a precision used to compare field values at merged nodes. If the values differ more than eps, an exception is thrown.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifcheck == true and old2NewBg contains equal ids.
Ifmesh nature does not allow renumbering (e.g. structured mesh).
Ifvalues at merged nodes differ more than eps.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingMesh::deepCopy(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), renumberNodesWithoutMesh(), and MEDCoupling::MEDCouplingField::setMesh().

◆ renumberNodesWithoutMesh()

void MEDCouplingFieldDouble::renumberNodesWithoutMesh ( const mcIdType *  old2NewBg,
mcIdType  newNbOfNodes,
double  eps = 1e-15 
)

Permutes values of this field according to a given permutation array for nodes renumbering. The underlying mesh is not permuted. The number of nodes can change, contrary to renumberCells(). A given epsilon specifies a threshold of error in case of two nodes are merged but the difference of values on these nodes are higher than eps. This method performs a part of job of renumberNodes(), excluding node renumbering in mesh. The reasonable use of this method is only for multi-field instances lying on the same mesh to avoid a systematic duplication and renumbering of _mesh attribute.

Warning
Use this method with a lot of care!
In case of an exception thrown, the contents of the data array can be partially modified until the exception occurs.
Parameters
[in]old2NewBg- the permutation array in "Old to New" mode. Its length is to be equal to this->getMesh()->getNumberOfNodes().
[in]newNbOfNodes- a number of nodes in the mesh after renumbering.
[in]eps- a precision used to compare field values at merged nodes. If the values differ more than eps, an exception is thrown.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifvalues at merged nodes differ more than eps.

References MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays().

Referenced by changeUnderlyingMesh(), and renumberNodes().

◆ findIdsInRange()

DataArrayIdType * MEDCouplingFieldDouble::findIdsInRange ( double  vmin,
double  vmax 
) const

Returns all tuple ids of this scalar field that fit the range [vmin, vmax]. This method calls DataArrayDouble::findIdsInRange().

Parameters
[in]vmin- a lower boundary of the range. Tuples with values less than vmin are not included in the result array.
[in]vmax- an upper boundary of the range. Tuples with values more than vmax are not included in the result array.
Returns
DataArrayIdType * - a new instance of DataArrayIdType holding ids of selected tuples. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe data array is not set.
Ifthis->getNumberOfComponents() != 1.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ deepCopy()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::deepCopy ( ) const

Returns a new MEDCouplingFieldDouble which is a deep copy of this one including the mesh. The result of this method is exactly the same as that of cloneWithMesh(true). So the resulting field can not be used together with this one in the methods like operator+(), operator*() etc. To avoid deep copying the underlying mesh, the user can call clone().

Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.
See also
cloneWithMesh()

References MEDCoupling::MEDCouplingFieldT< double >::cloneWithMesh().

◆ clone()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::clone ( bool  recDeepCpy) const
virtual

Returns a new MEDCouplingFieldDouble which is a copy of this one. The data of this field is copied either deep or shallow depending on recDeepCpy parameter. But the underlying mesh is always shallow copied. Data that can be copied either deeply or shallow are:

clone(false) is rather dedicated for advanced users that want to limit the amount of memory. It allows the user to perform methods like operator+(), operator*() etc. with this and the returned field. If the user wants to duplicate deeply the underlying mesh he should call cloneWithMesh() method or deepCopy() instead.

Warning
The underlying mesh of the returned field is always the same (pointer) as this one whatever the value of recDeepCpy parameter.
Parameters
[in]recDeepCpy- if true, the copy of the underlying data arrays is deep, else all data arrays of this field are shared by the new field.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.
See also
cloneWithMesh()

Implements MEDCoupling::MEDCouplingFieldT< double >.

Referenced by cellToNodeDiscretization(), extractSlice3D(), and nodeToCellDiscretization().

◆ buildNewTimeReprFromThis()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::buildNewTimeReprFromThis ( TypeOfTimeDiscretization  td,
bool  deepCpy 
) const

Creates a new MEDCouplingFieldDouble of given temporal discretization. The result field either shares the data array(s) with this field, or holds a deep copy of it, depending on deepCopy parameter. But the underlying mesh is always shallow copied.

Parameters
[in]td- the type of time discretization of the created field, one of (NO_TIME, ONE_TIME, LINEAR_TIME, CONST_ON_TIME_INTERVAL).
[in]deepCpy- if true, the copy of the underlying data arrays is deep, else all data arrays of this field are shared by the new field.
Returns
MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.

Here is a C++ example.
Here is a Python example.

See also
clone()

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretization::buildNewTimeReprFromThis(), MEDCoupling::MEDCouplingField::getDescription(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), and MEDCoupling::MEDCouplingField::getNature().

◆ nodeToCellDiscretization()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::nodeToCellDiscretization ( ) const

This method converts a field on nodes (this) to a cell field (returned field). The conversion is a non conservative remapping ! This method is useful only for users that need a fast conversion from node to cell spatial discretization. The algorithm applied is simply to attach to each cell the average of values on nodes constituting this cell.

Returns
MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed. The returned field will share the same mesh object object than those in this.
Exceptions
Ifthis spatial discretization is empty or not ON_NODES.
Ifthis is not coherent (see MEDCouplingFieldDouble::checkConsistencyLight).
Warning
This method is a non conservative method of remapping from node spatial discretization to cell spatial discretization. If a conservative method of interpolation is required MEDCoupling::MEDCouplingRemapper class should be used instead with "P1P0" method.

References MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), clone(), MEDCoupling::MEDCouplingFieldT< double >::getArrays(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingMesh::getNodeIdsOfCell(), MEDCoupling::MEDCouplingMesh::getNumberOfCells(), getNumberOfComponents(), MEDCoupling::MEDCouplingField::getTypeOfField(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::ON_NODES.

◆ cellToNodeDiscretization()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::cellToNodeDiscretization ( ) const

This method converts a field on cell (this) to a node field (returned field). The conversion is a non conservative remapping ! This method is useful only for users that need a fast conversion from cell to node spatial discretization. The algorithm applied is simply to attach to each node the average of values on cell sharing this node. If this lies on a mesh having orphan nodes the values applied on them will be NaN (division by 0.).

Returns
MEDCouplingFieldDouble* - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed. The returned field will share the same mesh object object than those in this.
Exceptions
Ifthis spatial discretization is empty or not ON_CELLS.
Ifthis is not coherent (see MEDCouplingFieldDouble::checkConsistencyLight).
Warning
This method is a non conservative method of remapping from cell spatial discretization to node spatial discretization. If a conservative method of interpolation is required MEDCoupling::MEDCouplingRemapper class should be used instead with "P0P1" method.

References MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), clone(), MEDCoupling::MEDCouplingFieldT< double >::getArrays(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingMesh::getReverseNodalConnectivity(), MEDCoupling::MEDCouplingField::getTypeOfField(), and MEDCoupling::ON_CELLS.

◆ convertToIntField()

MEDCouplingFieldInt32 * MEDCouplingFieldDouble::convertToIntField ( ) const

◆ convertToInt64Field()

MEDCouplingFieldInt64 * MEDCouplingFieldDouble::convertToInt64Field ( ) const

◆ convertToFloatField()

MEDCouplingFieldFloat * MEDCouplingFieldDouble::convertToFloatField ( ) const

◆ getIJK()

double MEDCouplingFieldDouble::getIJK ( mcIdType  cellId,
int  nodeIdInCell,
int  compoId 
) const

Returns a value of this field of type either ON_GAUSS_PT or ON_GAUSS_NE.

Parameters
[in]cellId- an id of cell of interest.
[in]nodeIdInCell- a node index within the cell.
[in]compoId- an index of component.
Returns
double - the field value corresponding to the specified parameters.
Exceptions
Ifthe data array is not set.
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifthis field if of type other than ON_GAUSS_PT or ON_GAUSS_NE.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ accumulate() [1/2]

double MEDCouplingFieldDouble::accumulate ( int  compId) const

Accumulate values of a given component of this field.

Parameters
[in]compId- the index of the component of interest.
Returns
double - a sum value of compId-th component.
Exceptions
Ifthe data array is not set.
Ifthe condition ( 0 <= compId < this->getNumberOfComponents() ) is not respected.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ accumulate() [2/2]

void MEDCouplingFieldDouble::accumulate ( double *  res) const

Accumulates values of each component of this array.

Parameters
[out]res- an array of length this->getNumberOfComponents(), allocated by the caller, that is filled by this method with sum value for each component.
Exceptions
Ifthe data array is not set.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ getMaxValue()

double MEDCouplingFieldDouble::getMaxValue ( ) const

Returns the maximal value within this scalar field. Values of all arrays stored in this->_time_discr are checked.

Returns
double - the maximal value among all values of this field.
Exceptions
Ifthis->getNumberOfComponents() != 1
Ifthe data array is not set.
Ifthere is an empty data array in this field.

References MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays().

◆ getMaxValue2()

double MEDCouplingFieldDouble::getMaxValue2 ( DataArrayIdType *&  tupleIds) const

Returns the maximal value and all its locations within this scalar field. Only the first of available data arrays is checked.

Parameters
[out]tupleIds- a new instance of DataArrayIdType containing indices of tuples holding the maximal value. The caller is to delete it using decrRef() as it is no more needed.
Returns
double - the maximal value among all values of the first array of this filed.
Exceptions
Ifthis->getNumberOfComponents() != 1.
Ifthere is an empty data array in this field.

References MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays().

◆ getMinValue()

double MEDCouplingFieldDouble::getMinValue ( ) const

Returns the minimal value within this scalar field. Values of all arrays stored in this->_time_discr are checked.

Returns
double - the minimal value among all values of this field.
Exceptions
Ifthis->getNumberOfComponents() != 1
Ifthe data array is not set.
Ifthere is an empty data array in this field.

References MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays().

◆ getMinValue2()

double MEDCouplingFieldDouble::getMinValue2 ( DataArrayIdType *&  tupleIds) const

Returns the minimal value and all its locations within this scalar field. Only the first of available data arrays is checked.

Parameters
[out]tupleIds- a new instance of DataArrayIdType containing indices of tuples holding the minimal value. The caller is to delete it using decrRef() as it is no more needed.
Returns
double - the minimal value among all values of the first array of this filed.
Exceptions
Ifthis->getNumberOfComponents() != 1.
Ifthere is an empty data array in this field.

References MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays().

◆ getAverageValue()

double MEDCouplingFieldDouble::getAverageValue ( ) const

Returns the average value of this scalar field.

Returns
double - the average value over all values of the data array.
Exceptions
Ifthis->getNumberOfComponents() != 1
Ifthe data array is not set or it is empty.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ norm2()

double MEDCouplingFieldDouble::norm2 ( ) const

This method returns the euclidean norm of this field.

\[ \sqrt{\sum_{0 \leq i < nbOfEntity}val[i]*val[i]} \]

Exceptions
Ifthe data array is not set.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ getWeightedAverageValue() [1/2]

void MEDCouplingFieldDouble::getWeightedAverageValue ( double *  res,
bool  isWAbs = true 
) const

Computes the weighted average of values of each component of this field, the weights being the values returned by buildMeasureField().

Parameters
[out]res- pointer to an array of result sum values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
[in]isWAbs- if true (default), abs() is applied to the weights computed by buildMeasureField(). It makes this method slower. If you are sure that all the cells of the underlying mesh have a correct orientation (no negative volume), you can put isWAbs == false to speed up the method.
Exceptions
Ifthe mesh is not set.
Ifthe data array is not set.

References MEDCoupling::MEDCouplingField::buildMeasureField(), and MEDCoupling::MEDCouplingFieldT< double >::getArray().

Referenced by getWeightedAverageValue().

◆ getWeightedAverageValue() [2/2]

double MEDCouplingFieldDouble::getWeightedAverageValue ( int  compId,
bool  isWAbs = true 
) const

Computes the weighted average of values of a given component of this field, the weights being the values returned by buildMeasureField().

Parameters
[in]compId- an index of the component of interest.
[in]isWAbs- if true (default), abs() is applied to the weights computed by buildMeasureField(). It makes this method slower. If you are sure that all the cells of the underlying mesh have a correct orientation (no negative volume), you can put isWAbs == false to speed up the method.
Exceptions
Ifthe mesh is not set.
Ifthe data array is not set.
IfcompId is not valid. A valid range is ( 0 <= compId < this->getNumberOfComponents() ).

References MEDCoupling::MEDCouplingFieldT< double >::getArray(), and getWeightedAverageValue().

◆ normL1() [1/2]

double MEDCouplingFieldDouble::normL1 ( int  compId) const

Returns the normL1 of values of a given component of this field:

\[ \frac{\sum_{0 \leq i < nbOfEntity}|val[i]*Vol[i]|}{\sum_{0 \leq i < nbOfEntity}|Vol[i]|} \]

Parameters
[in]compId- an index of the component of interest.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
IfcompId is not valid. A valid range is ( 0 <= compId < this->getNumberOfComponents() ).

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ normL1() [2/2]

void MEDCouplingFieldDouble::normL1 ( double *  res) const

Returns the normL1 of values of each component of this field:

\[ \frac{\sum_{0 \leq i < nbOfEntity}|val[i]*Vol[i]|}{\sum_{0 \leq i < nbOfEntity}|Vol[i]|} \]

Parameters
[out]res- pointer to an array of result values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ normL2() [1/2]

double MEDCouplingFieldDouble::normL2 ( int  compId) const

Returns the normL2 of values of a given component of this field:

\[ \sqrt{\frac{\sum_{0 \leq i < nbOfEntity}|val[i]^{2}*Vol[i]|}{\sum_{0 \leq i < nbOfEntity}|Vol[i]|}} \]

Parameters
[in]compId- an index of the component of interest.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
IfcompId is not valid. A valid range is ( 0 <= compId < this->getNumberOfComponents() ).

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ normL2() [2/2]

void MEDCouplingFieldDouble::normL2 ( double *  res) const

Returns the normL2 of values of each component of this field:

\[ \sqrt{\frac{\sum_{0 \leq i < nbOfEntity}|val[i]^{2}*Vol[i]|}{\sum_{0 \leq i < nbOfEntity}|Vol[i]|}} \]

Parameters
[out]res- pointer to an array of result values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ normMax() [1/2]

double MEDCouplingFieldDouble::normMax ( int  compId) const

Returns the infinite norm of values of a given component of this field:

\[ \max_{0 \leq i < nbOfEntity}{abs(val[i])} \]

Parameters
[in]compId- an index of the component of interest.
Exceptions
IfcompId is not valid. A valid range is ( 0 <= compId < this->getNumberOfComponents() ).
Ifthe data array is not set.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ normMax() [2/2]

void MEDCouplingFieldDouble::normMax ( double *  res) const

Returns the infinite norm of values of each component of this field:

\[ \max_{0 \leq i < nbOfEntity}{abs(val[i])} \]

Parameters
[out]res- pointer to an array of result values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe data array is not set.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ integral() [1/2]

double MEDCouplingFieldDouble::integral ( int  compId,
bool  isWAbs 
) const

Computes a sum of values of a given component of this field multiplied by values returned by buildMeasureField(). This method is useful to check the conservativity of interpolation method.

Parameters
[in]compId- an index of the component of interest.
[in]isWAbs- if true (default), abs() is applied to the weighs computed by buildMeasureField() that makes this method slower. If a user is sure that all cells of the underlying mesh have correct orientation, he can put isWAbs == false that speeds up this method.
Exceptions
Ifthe mesh is not set.
Ifthe data array is not set.
IfcompId is not valid. A valid range is ( 0 <= compId < this->getNumberOfComponents() ).

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

Referenced by MEDCoupling::ParaFIELD::getVolumeIntegral().

◆ integral() [2/2]

void MEDCouplingFieldDouble::integral ( bool  isWAbs,
double *  res 
) const

Computes a sum of values of each component of this field multiplied by values returned by buildMeasureField(). This method is useful to check the conservativity of interpolation method.

Parameters
[in]isWAbs- if true (default), abs() is applied to the weighs computed by buildMeasureField() that makes this method slower. If a user is sure that all cells of the underlying mesh have correct orientation, he can put isWAbs == false that speeds up this method.
[out]res- pointer to an array of result sum values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe mesh is not set.
Ifthe data array is not set.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ getValueOnPos()

void MEDCouplingFieldDouble::getValueOnPos ( mcIdType  i,
mcIdType  j,
mcIdType  k,
double *  res 
) const

Returns a value at a given cell of a structured mesh. The cell is specified by its (i,j,k) index.

Parameters
[in]i- a index of node coordinates array along X axis. The cell is located between the i-th and ( i + 1 )-th nodes along X axis.
[in]j- a index of node coordinates array along Y axis. The cell is located between the j-th and ( j + 1 )-th nodes along Y axis.
[in]k- a index of node coordinates array along Z axis. The cell is located between the k-th and ( k + 1 )-th nodes along Z axis.
[out]res- pointer to an array returning a feild value, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe spatial discretization of this field is NULL.
Ifthe mesh is not set.
Ifthe mesh is not a structured one.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArray().

◆ getValueOn() [1/2]

void MEDCouplingFieldDouble::getValueOn ( const double *  spaceLoc,
double *  res 
) const

Returns a value of this at a given point using spatial discretization.

Parameters
[in]spaceLoc- the point of interest.
[out]res- pointer to an array returning a feild value, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe spatial discretization of this field is NULL.
Ifthe mesh is not set.
IfspaceLoc is out of the spatial discretization.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArray().

◆ getValueOn() [2/2]

void MEDCouplingFieldDouble::getValueOn ( const double *  spaceLoc,
double  time,
double *  res 
) const

Returns a value of this field at a given point at a given time using spatial discretization. If the time is not covered by this->_time_discr, an exception is thrown.

Parameters
[in]spaceLoc- the point of interest.
[in]time- the time of interest.
[out]res- pointer to an array returning a feild value, of size at least this->getNumberOfComponents(), that is to be allocated by the caller.
Exceptions
Ifthe spatial discretization of this field is NULL.
Ifthe mesh is not set.
IfspaceLoc is out of the spatial discretization.
Iftime is not covered by this->_time_discr.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretization::getArraysForTime(), and MEDCoupling::MEDCouplingTimeDiscretization::getValueForTime().

◆ getValueOnMulti()

DataArrayDouble * MEDCouplingFieldDouble::getValueOnMulti ( const double *  spaceLoc,
mcIdType  nbOfPoints 
) const

Returns values of this at given points using spatial discretization.

Parameters
[in]spaceLoc- coordinates of points of interest in full-interlace mode. This array is to be of size ( nbOfPoints * this->getNumberOfComponents() ).
[in]nbOfPoints- number of points of interest.
Returns
DataArrayDouble * - a new instance of DataArrayDouble holding field values relating to the input points. This array is of size nbOfPoints tuples per this->getNumberOfComponents() components. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe spatial discretization of this field is NULL.
Ifthe mesh is not set.
Ifany point in spaceLoc is out of the spatial discretization.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArray().

◆ applyLin() [1/2]

void MEDCouplingFieldDouble::applyLin ( double  a,
double  b,
int  compoId 
)

Apply a linear function to a given component of this field, so that a component value (x) becomes $ a * x + b $.

Parameters
[in]a- the first coefficient of the function.
[in]b- the second coefficient of the function.
[in]compoId- the index of component to modify.
Exceptions
Ifthe data array(s) is(are) not set.

References MEDCoupling::MEDCouplingTimeDiscretization::applyLin().

Referenced by MEDCoupling::DisjointDEC::renormalizeTargetField().

◆ applyLin() [2/2]

void MEDCouplingFieldDouble::applyLin ( double  a,
double  b 
)

Apply a linear function to all components of this field, so that values (x) becomes $ a * x + b $.

Parameters
[in]a- the first coefficient of the function.
[in]b- the second coefficient of the function.
Exceptions
Ifthe data array(s) is(are) not set.

References MEDCoupling::MEDCouplingTimeDiscretization::applyLin().

◆ operator=()

MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator= ( double  value)

This method sets this to a uniform scalar field with one component. All tuples will have the same value 'value'. An exception is thrown if no underlying mesh is defined.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::setOrCreateUniformValueOnAllComponents().

◆ fillFromAnalytic() [1/2]

void MEDCouplingFieldDouble::fillFromAnalytic ( int  nbOfComp,
FunctionToEvaluate  func 
)

Creates data array(s) of this field by using a C function for value generation.

Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is to compute a field value basing on coordinates of value location point.
Exceptions
Ifthe mesh is not set.
Iffunc returns false.
Ifthe spatial discretization of this field is NULL.

Here is a C++ example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::fillFromAnalytic().

◆ fillFromAnalytic() [2/2]

void MEDCouplingFieldDouble::fillFromAnalytic ( int  nbOfComp,
const std::string &  func 
)

Creates data array(s) of this field by using a function for value generation.
The function is applied to coordinates of value location points. For example, if this field is on cells, the function is applied to cell barycenters. For more info on supported expressions that can be used in the function, see Expressions supported.
The function can include arbitrary named variables (e.g. "x","y" or "va44") to refer to components of point coordinates. Names of variables are sorted in alphabetical order to associate a variable name with a component. For example, in the expression "2*x+z", "x" stands for the component #0 and "z" stands for the component #1 (not #2)!
In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, coordinates of a 3D point are (1.,3.,7.), then

  • "2*x + z" produces (5.,5.,5.,5.)
  • "2*x + 0*y + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,4.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,4.)
Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is used to compute a field value basing on coordinates of value location point. For example, if this field is on cells, the function is applied to cell barycenters.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::fillFromAnalytic().

◆ fillFromAnalyticCompo()

void MEDCouplingFieldDouble::fillFromAnalyticCompo ( int  nbOfComp,
const std::string &  func 
)

Creates data array(s) of this field by using a function for value generation.
The function is applied to coordinates of value location points. For example, if this field is on cells, the function is applied to cell barycenters.
This method differs from fillFromAnalytic() by the way how variable names, used in the function, are associated with components of coordinates of field location points; here, a variable name corresponding to a component is retrieved from a corresponding node coordinates array (where it is set via DataArrayDouble::setInfoOnComponent()).
For more info on supported expressions that can be used in the function, see Expressions supported.
In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, names of spatial components are "x", "y" and "z", coordinates of a 3D point are (1.,3.,7.), then

  • "2*x + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,8.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,8.)
Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is used to compute a field value basing on coordinates of value location point. For example, if this field is on cells, the function is applied to cell barycenters.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::fillFromAnalyticCompo().

◆ fillFromAnalyticNamedCompo()

void MEDCouplingFieldDouble::fillFromAnalyticNamedCompo ( int  nbOfComp,
const std::vector< std::string > &  varsOrder,
const std::string &  func 
)

Creates data array(s) of this field by using a function for value generation.
The function is applied to coordinates of value location points. For example, if this field is on cells, the function is applied to cell barycenters.
This method differs from fillFromAnalytic() by the way how variable names, used in the function, are associated with components of coordinates of field location points; here, a component index of a variable is defined by a rank of the variable within the input array varsOrder.
For more info on supported expressions that can be used in the function, see Expressions supported. In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, names of spatial components are given in varsOrder: ["x", "y","z"], coordinates of a 3D point are (1.,3.,7.), then

  • "2*x + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,8.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,8.)
Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is used to compute a field value basing on coordinates of value location point. For example, if this field is on cells, the function is applied to cell barycenters.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::fillFromAnalyticNamedCompo().

◆ applyFunc() [1/4]

void MEDCouplingFieldDouble::applyFunc ( int  nbOfComp,
FunctionToEvaluate  func 
)

Modifies values of this field by applying a C function to each tuple of all data arrays.

Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is to compute a field value basing on a current field value.
Exceptions
Iffunc returns false.

Here is a C++ example.

References MEDCoupling::MEDCouplingTimeDiscretization::applyFunc().

◆ applyFunc() [2/4]

void MEDCouplingFieldDouble::applyFunc ( int  nbOfComp,
double  val 
)

Fill this field with a given value.
This method is a specialization of other overloaded methods. When nbOfComp == 1 this method is equivalent to MEDCoupling::MEDCouplingFieldDouble::operator=().

Parameters
[in]nbOfComp- the number of components for this field to have.
[in]val- the value to assign to every atomic value of this field.
Exceptions
Ifthe spatial discretization of this field is NULL.
Ifthe mesh is not set.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::setUniformValue().

◆ applyFunc() [3/4]

void MEDCouplingFieldDouble::applyFunc ( int  nbOfComp,
const std::string &  func 
)

Modifies values of this field by applying a function to each tuple of all data arrays. For more info on supported expressions that can be used in the function, see Expressions supported.
The function can include arbitrary named variables (e.g. "x","y" or "va44") to refer to components of a field value. Names of variables are sorted in alphabetical order to associate a variable name with a component. For example, in the expression "2*x+z", "x" stands for the component #0 and "z" stands for the component #1 (not #2)!
In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, components of a field value are (1.,3.,7.), then

  • "2*x + z" produces (5.,5.,5.,5.)
  • "2*x + 0*y + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,4.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,8.,1.)
Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is to compute a field value basing on a current field value.
Exceptions
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingTimeDiscretization::applyFunc().

◆ applyFuncCompo()

void MEDCouplingFieldDouble::applyFuncCompo ( int  nbOfComp,
const std::string &  func 
)

Modifies values of this field by applying a function to each tuple of all data arrays. For more info on supported expressions that can be used in the function, see Expressions supported.
This method differs from applyFunc() by the way how variable names, used in the function, are associated with components of field values; here, a variable name corresponding to a component is retrieved from component information of an array (where it is set via DataArrayDouble::setInfoOnComponent()).
In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, components of a field value are (1.,3.,7.), then

  • "2*x + z" produces (5.,5.,5.,5.)
  • "2*x + 0*y + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,4.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,8.,1.)
Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is to compute a new field value basing on a current field value.
Exceptions
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingTimeDiscretization::applyFuncCompo().

◆ applyFuncNamedCompo()

void MEDCouplingFieldDouble::applyFuncNamedCompo ( int  nbOfComp,
const std::vector< std::string > &  varsOrder,
const std::string &  func 
)

Modifies values of this field by applying a function to each tuple of all data arrays. This method differs from applyFunc() by the way how variable names, used in the function, are associated with components of field values; here, a component index of a variable is defined by a rank of the variable within the input array varsOrder.
For more info on supported expressions that can be used in the function, see Expressions supported. In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, names of components are given in varsOrder: ["x", "y","z"], components of a 3D vector are (1.,3.,7.), then

  • "2*x + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,8.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,8.)
Parameters
[in]nbOfComp- the number of components for this field to have.
[in]func- the function used to compute values of this field. This function is to compute a new field value basing on a current field value.
Exceptions
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingTimeDiscretization::applyFuncNamedCompo().

◆ applyFunc() [4/4]

void MEDCouplingFieldDouble::applyFunc ( const std::string &  func)

Modifies values of this field by applying a function to each atomic value of all data arrays. The function computes a new single value basing on an old single value. For more info on supported expressions that can be used in the function, see Expressions supported.
The function can include only one arbitrary named variable (e.g. "x","y" or "va44") to refer to a field atomic value.
In a general case, a value resulting from the function evaluation is assigned to a single field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, components of a field value are (1.,3.,7.), then

  • "2*x - 1" produces (1.,5.,13.)
  • "2*x*IVec + (x+3)*KVec" produces (2.,0.,10.)
  • "2*x*IVec + (x+3)*KVec + 1" produces (3.,1.,11.)
Parameters
[in]func- the function used to compute values of this field. This function is to compute a field value basing on a current field value.
Exceptions
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingTimeDiscretization::applyFunc().

◆ applyFuncFast32()

void MEDCouplingFieldDouble::applyFuncFast32 ( const std::string &  func)

Applyies the function specified by the string repr 'func' on each tuples on all arrays contained in _time_discr. The field will contain exactly the same number of components after the call. Use is not warranted for the moment !

References MEDCoupling::MEDCouplingTimeDiscretization::applyFuncFast32().

◆ applyFuncFast64()

void MEDCouplingFieldDouble::applyFuncFast64 ( const std::string &  func)

Applyies the function specified by the string repr 'func' on each tuples on all arrays contained in _time_discr. The field will contain exactly the same number of components after the call. Use is not warranted for the moment !

References MEDCoupling::MEDCouplingTimeDiscretization::applyFuncFast64().

◆ getNumberOfComponents()

std::size_t MEDCouplingFieldDouble::getNumberOfComponents ( ) const

Returns number of components in the data array. For more info on the data arrays, see Arrays of data.

Returns
int - the number of components in the data array.
Exceptions
Ifthe data array is not set.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

Referenced by nodeToCellDiscretization(), MEDCoupling::MEDCouplingRemapper::reverseTransfer(), and MEDCoupling::OverlapDEC::synchronize().

◆ getNumberOfTuples()

mcIdType MEDCouplingFieldDouble::getNumberOfTuples ( ) const

Use MEDCouplingField::getNumberOfTuplesExpected instead of this method. This method will be removed soon, because it is confusing compared to getNumberOfComponents() and getNumberOfValues() behaviour.

Returns number of tuples in this field, that depends on

The returned value does not depend on the number of tuples in the data array (which has to be equal to the returned value), contrary to getNumberOfComponents() and getNumberOfValues() that retrieve information from the data array (Sorry, it is confusing !). So this method behaves exactly as MEDCouplingField::getNumberOfTuplesExpected method.

Warning
No checkConsistencyLight() is done here. For more info on the data arrays, see Arrays of data.
Returns
int - the number of tuples.
Exceptions
Ifthe mesh is not set.
Ifthe spatial discretization of this field is NULL.
Ifthe spatial discretization is not fully defined.
See also
MEDCouplingField::getNumberOfTuplesExpected

References MEDCoupling::MEDCouplingField::_mesh, and MEDCoupling::MEDCouplingField::_type.

Referenced by MEDCoupling::InterpolationMatrix::InterpolationMatrix(), MEDCoupling::ParaFIELD::ParaFIELD(), and MEDCoupling::InterpolationMatrix::prepare().

◆ getNumberOfValues()

mcIdType MEDCouplingFieldDouble::getNumberOfValues ( ) const

Returns number of atomic double values in the data array of this field. For more info on the data arrays, see Arrays of data.

Returns
int - (number of tuples) * (number of components) of the data array.
Exceptions
Ifthe data array is not set.

References MEDCoupling::MEDCouplingFieldT< double >::getArray().

◆ updateTime()

void MEDCouplingFieldDouble::updateTime ( ) const
virtual

Sets own modification time by the most recently modified element of data (the mesh, the data array etc). For more info, see Time label in MEDCoupling.

Reimplemented from MEDCoupling::MEDCouplingField.

References MEDCoupling::MEDCouplingField::updateTime(), and MEDCoupling::TimeLabel::updateTimeWith().

◆ getHeapMemorySizeWithoutChildren()

std::size_t MEDCouplingFieldDouble::getHeapMemorySizeWithoutChildren ( ) const
virtual

◆ getDirectChildrenWithNull()

std::vector< const BigMemoryObject * > MEDCouplingFieldDouble::getDirectChildrenWithNull ( ) const
virtual

◆ changeUnderlyingMesh()

void MEDCouplingFieldDouble::changeUnderlyingMesh ( const MEDCouplingMesh other,
int  levOfCheck,
double  precOnMesh,
double  eps = 1e-15 
)

Sets the data array.

Parameters
[in]array- the data array holding values of this field. It's size should correspond to the mesh and spatial discretization of this field (see getNumberOfTuples()), but this size is not checked here.

Sets the data array holding values corresponding to an end of a time interval for which this field is defined.

Parameters
[in]array- the data array holding values of this field. It's size should correspond to the mesh and spatial discretization of this field (see getNumberOfTuples()), but this size is not checked here.

Sets all data arrays needed to define the field values.

Parameters
[in]arrs- a vector of DataArrayDouble's holding values of this field. Size of each array should correspond to the mesh and spatial discretization of this field (see getNumberOfTuples()), but this size is not checked here.
Exceptions
Ifnumber of arrays in arrs does not correspond to type of temporal discretization of this field.

Tries to set an other mesh as the support of this field. An attempt fails, if a current and the other meshes are different with use of specified equality criteria, and then an exception is thrown.

Parameters
[in]other- the mesh to use as the field support if this mesh can be considered equal to the current mesh.
[in]levOfCheck- defines equality criteria used for mesh comparison. For it's meaning explanation, see MEDCouplingMesh::checkGeoEquivalWith() which is used for mesh comparison.
[in]precOnMesh- a precision used to compare nodes of the two meshes. It is used as prec parameter of MEDCouplingMesh::checkGeoEquivalWith().
[in]eps- a precision used at node renumbering (if needed) to compare field values at merged nodes. If the values differ more than eps, an exception is thrown.
Exceptions
Ifthe mesh is not set.
Ifother == NULL.
Ifany of the meshes is not well defined.
Ifthe two meshes do not match.
Iffield values at merged nodes (if any) differ more than eps.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingMesh::checkGeoEquivalWith(), MEDCoupling::MEDCouplingFieldT< double >::renumberCellsWithoutMesh(), renumberNodesWithoutMesh(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by substractInPlaceDM().

◆ substractInPlaceDM()

void MEDCouplingFieldDouble::substractInPlaceDM ( const MEDCouplingFieldDouble f,
int  levOfCheck,
double  precOnMesh,
double  eps = 1e-15 
)

Subtracts another field from this one in case when the two fields have different supporting meshes. The subtraction is performed provided that the tho meshes can be considered equal with use of specified equality criteria, else an exception is thrown. If the meshes match, the mesh of f is set to this field (this is permuted if necessary) and field values are subtracted. No interpolation is done here, only an analysis of two underlying mesh is done to see if the meshes are geometrically equivalent.
The job of this method consists in calling this->changeUnderlyingMesh() with f->getMesh() as the first parameter, and then this -= f.
This method requires that f and this are coherent (checkConsistencyLight()) and that f and this are coherent for a merge.
"DM" in the method name stands for "different meshes".

Parameters
[in]f- the field to subtract from this.
[in]levOfCheck- defines equality criteria used for mesh comparison. For it's meaning explanation, see MEDCouplingMesh::checkGeoEquivalWith() which is used for mesh comparison.
[in]precOnMesh- a precision used to compare nodes of the two meshes. It is used as prec parameter of MEDCouplingMesh::checkGeoEquivalWith().
[in]eps- a precision used at node renumbering (if needed) to compare field values at merged nodes. If the values differ more than eps, an exception is thrown.
Exceptions
Iff == NULL.
Ifany of the meshes is not set or is not well defined.
Ifthe two meshes do not match.
Ifthe two fields are not coherent for merge.
Iffield values at merged nodes (if any) differ more than eps.

Here is a C++ example.
Here is a Python example.

See also
changeUnderlyingMesh().

References areCompatibleForMerge(), changeUnderlyingMesh(), MEDCoupling::MEDCouplingFieldT< T >::checkConsistencyLight(), MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), MEDCoupling::MEDCouplingField::getMesh(), and operator-=().

◆ mergeNodes()

bool MEDCouplingFieldDouble::mergeNodes ( double  eps,
double  epsOnVals = 1e-15 
)

Merges coincident nodes of the underlying mesh. If some nodes are coincident, the underlying mesh is replaced by a new mesh instance where the coincident nodes are merged.

Parameters
[in]eps- a precision used to compare nodes of the two meshes.
[in]epsOnVals- a precision used to compare field values at merged nodes. If the values differ more than epsOnVals, an exception is thrown.
Returns
bool - true if some nodes have been merged and hence this field lies on another mesh.
Exceptions
Ifthe mesh is of type not inheriting from MEDCouplingPointSet.
Ifthe mesh is not well defined.
Ifthe spatial discretization of this field is NULL.
Ifthe data array is not set.
Iffield values at merged nodes (if any) differ more than epsOnVals.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingMesh::deepCopy(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), and MEDCoupling::MEDCouplingField::setMesh().

◆ mergeNodesCenter()

bool MEDCouplingFieldDouble::mergeNodesCenter ( double  eps,
double  epsOnVals = 1e-15 
)

Merges coincident nodes of the underlying mesh. If some nodes are coincident, the underlying mesh is replaced by a new mesh instance where the coincident nodes are merged.
In contrast to mergeNodes(), location of merged nodes is changed to be at their barycenter.

Parameters
[in]eps- a precision used to compare nodes of the two meshes.
[in]epsOnVals- a precision used to compare field values at merged nodes. If the values differ more than epsOnVals, an exception is thrown.
Returns
bool - true if some nodes have been merged and hence this field lies on another mesh.
Exceptions
Ifthe mesh is of type not inheriting from MEDCouplingPointSet.
Ifthe mesh is not well defined.
Ifthe spatial discretization of this field is NULL.
Ifthe data array is not set.
Iffield values at merged nodes (if any) differ more than epsOnVals.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingMesh::deepCopy(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), and MEDCoupling::MEDCouplingField::setMesh().

◆ zipCoords()

bool MEDCouplingFieldDouble::zipCoords ( double  epsOnVals = 1e-15)

Removes from the underlying mesh nodes not used in any cell. If some nodes are removed, the underlying mesh is replaced by a new mesh instance where the unused nodes are removed.

Parameters
[in]epsOnVals- a precision used to compare field values at merged nodes. If the values differ more than epsOnVals, an exception is thrown.
Returns
bool - true if some nodes have been removed and hence this field lies on another mesh.
Exceptions
Ifthe mesh is of type not inheriting from MEDCouplingPointSet.
Ifthe mesh is not well defined.
Ifthe spatial discretization of this field is NULL.
Ifthe data array is not set.
Iffield values at merged nodes (if any) differ more than epsOnVals.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingMesh::deepCopy(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), and MEDCoupling::MEDCouplingField::setMesh().

◆ zipConnectivity()

bool MEDCouplingFieldDouble::zipConnectivity ( int  compType,
double  epsOnVals = 1e-15 
)

Removes duplicates of cells from the understanding mesh. If some cells are removed, the underlying mesh is replaced by a new mesh instance where the cells duplicates are removed.

Parameters
[in]compType- specifies a cell comparison technique. Meaning of its valid values [0,1,2] is explained in the description of MEDCouplingPointSet::zipConnectivityTraducer() which is called by this method.
[in]epsOnVals- a precision used to compare field values at merged cells. If the values differ more than epsOnVals, an exception is thrown.
Returns
bool - true if some cells have been removed and hence this field lies on another mesh.
Exceptions
Ifthe mesh is not an instance of MEDCouplingUMesh.
Ifthe mesh is not well defined.
Ifthe spatial discretization of this field is NULL.
Ifthe data array is not set.
Iffield values at merged cells (if any) differ more than epsOnVals.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingUMesh::deepCopy(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), and MEDCoupling::MEDCouplingField::setMesh().

◆ extractSlice3D()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::extractSlice3D ( const double *  origin,
const double *  vec,
double  eps 
) const

This method calls MEDCouplingUMesh::buildSlice3D method. So this method makes the assumption that underlying mesh exists. For the moment, this method is implemented for fields on cells.

Returns
a newly allocated field double containing the result that the user should deallocate.

References MEDCoupling::MEDCouplingMesh::buildUnstructured(), clone(), MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getTypeOfField(), and MEDCoupling::ON_CELLS.

◆ simplexize()

bool MEDCouplingFieldDouble::simplexize ( int  policy)

Divides every cell of the underlying mesh into simplices (triangles in 2D and tetrahedra in 3D). If some cells are divided, the underlying mesh is replaced by a new mesh instance containing the simplices.

Parameters
[in]policy- specifies a pattern used for splitting. For its description, see MEDCouplingUMesh::simplexize().
Returns
bool - true if some cells have been divided and hence this field lies on another mesh.
Exceptions
Ifpolicy has an invalid value. For valid values, see the description of MEDCouplingUMesh::simplexize().
IfMEDCouplingMesh::simplexize() is not applicable to the underlying mesh.
Ifthe mesh is not well defined.
Ifthe spatial discretization of this field is NULL.
Ifthe data array is not set.

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingMesh::deepCopy(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), MEDCoupling::MEDCouplingMesh::getNumberOfCells(), and MEDCoupling::MEDCouplingField::setMesh().

◆ voronoize()

MCAuto< MEDCouplingFieldDouble > MEDCouplingFieldDouble::voronoize ( double  eps) const

This method makes the hypothesis that this is a Gauss field. This method returns a newly created field on cells with same number of tuples than this. Each Gauss points in this is replaced by a polygon or polyhedron cell with associated region following Voronoi algorithm.

References MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingMesh::getMeshDimension(), and MEDCoupling::MEDCouplingMesh::getSpaceDimension().

◆ convertQuadraticCellsToLinear()

◆ computeVectorFieldCyl()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::computeVectorFieldCyl ( const double  center[3],
const double  vect[3] 
) const

This is expected to be a 3 components vector field on nodes (if not an exception will be thrown). this is also expected to lie on a MEDCouplingPointSet mesh. Finally this is also expected to be consistent. In these conditions this method returns a newly created field (to be dealed by the caller). The returned field will also 3 compo vector field be on nodes lying on the same mesh than this.

For each 3 compo tuple tup in this the returned tuple is the result of the transformation of tup in the new referential. This referential is defined by Ur, Uteta, Uz. Ur is the vector between center point and the associated node with tuple. Uz is vect normalized. And Uteta is the cross product of Uz with Ur.

See also
DataArrayDouble::fromCartToCylGiven

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), and MEDCoupling::MEDCouplingField::getNature().

◆ doublyContractedProduct()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::doublyContractedProduct ( ) const

Creates a new MEDCouplingFieldDouble filled with the doubly contracted product of every tensor of this 6-componental field.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, whose each tuple is calculated from the tuple (t) of this field as follows: $ t[0]^2+t[1]^2+t[2]^2+2*t[3]^2+2*t[4]^2+2*t[5]^2$. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() != 6.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ determinant()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::determinant ( ) const

Creates a new MEDCouplingFieldDouble filled with the determinant of a square matrix defined by every tuple of this field, having either 4, 6 or 9 components. The case of 6 components corresponds to that of the upper triangular matrix.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, whose each tuple is the determinant of matrix of the corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() is not in [4,6,9].
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ eigenValues()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::eigenValues ( ) const

Creates a new MEDCouplingFieldDouble with 3 components filled with 3 eigenvalues of an upper triangular matrix defined by every tuple of this 6-componental field.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, having 3 components, whose each tuple contains the eigenvalues of the matrix of corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() != 6.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ eigenVectors()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::eigenVectors ( ) const

Creates a new MEDCouplingFieldDouble with 9 components filled with 3 eigenvectors of an upper triangular matrix defined by every tuple of this 6-componental field.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, having 9 components, whose each tuple contains the eigenvectors of the matrix of corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() != 6.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ inverse()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::inverse ( ) const

Creates a new MEDCouplingFieldDouble filled with the inverse matrix of a matrix defined by every tuple of this field having either 4, 6 or 9 components. The case of 6 components corresponds to that of the upper triangular matrix.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, having the same number of components as this one, whose each tuple contains the inverse matrix of the matrix of corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() is not in [4,6,9].
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ trace()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::trace ( ) const

Creates a new MEDCouplingFieldDouble filled with the trace of a matrix defined by every tuple of this field having either 4, 6 or 9 components. The case of 6 components corresponds to that of the upper triangular matrix.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, having 1 component, whose each tuple is the trace of the matrix of corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() is not in [4,6,9].
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ deviator()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::deviator ( ) const

Creates a new MEDCouplingFieldDouble filled with the stress deviator tensor of a stress tensor defined by every tuple of this 6-componental field.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, having same number of components and tuples as this field, whose each tuple contains the stress deviator tensor of the stress tensor of corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthis->getNumberOfComponents() != 6.
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ magnitude()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::magnitude ( ) const

Creates a new MEDCouplingFieldDouble filled with the magnitude of every vector of this field.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, having one component, whose each tuple is the magnitude of the vector of corresponding tuple of this field. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ maxPerTuple()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::maxPerTuple ( ) const

Creates a new scalar MEDCouplingFieldDouble filled with the maximal value among values of every tuple of this field.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. This new field lies on the same mesh as this one. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe spatial discretization of this field is NULL.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), and MEDCoupling::MEDCouplingField::getNature().

◆ changeNbOfComponents()

void MEDCouplingFieldDouble::changeNbOfComponents ( std::size_t  newNbOfComp,
double  dftValue = 0. 
)

Changes number of components in this field. If newNbOfComp is less than this->getNumberOfComponents() then each tuple is truncated to have newNbOfComp components, keeping first components. If newNbOfComp is more than this->getNumberOfComponents() then each tuple is populated with dftValue to have newNbOfComp components.

Parameters
[in]newNbOfComp- number of components for the new field to have.
[in]dftValue- value assigned to new values added to this field.
Exceptions
Ifthis is not allocated.

References MEDCoupling::MEDCouplingTimeDiscretization::changeNbOfComponents().

◆ keepSelectedComponents()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::keepSelectedComponents ( const std::vector< std::size_t > &  compoIds) const

Creates a new MEDCouplingFieldDouble composed of selected components of this field. The new MEDCouplingFieldDouble has the same number of tuples but includes components specified by compoIds parameter. So that getNbOfElems() of the result field can be either less, same or more than this->getNumberOfValues().

Parameters
[in]compoIds- sequence of zero based indices of components to include into the new field.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble that the caller is to delete using decrRef() as it is no more needed.
Exceptions
Ifa component index (i) is not valid: i < 0 || i >= this->getNumberOfComponents().

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), and MEDCoupling::MEDCouplingField::getNature().

◆ setSelectedComponents()

void MEDCouplingFieldDouble::setSelectedComponents ( const MEDCouplingFieldDouble f,
const std::vector< std::size_t > &  compoIds 
)

Copy all components in a specified order from another field. The number of tuples in this and the other field can be different.

Parameters
[in]f- the field to copy data from.
[in]compoIds- sequence of zero based indices of components, data of which is to be copied.
Exceptions
Ifthe two fields have different number of data arrays.
Ifa data array is set in one of fields and is not set in the other.
IfcompoIds.size() != a->getNumberOfComponents().
IfcompoIds[i] < 0 or compoIds[i] > this->getNumberOfComponents().

References MEDCoupling::MEDCouplingTimeDiscretization::setSelectedComponents().

◆ sortPerTuple()

void MEDCouplingFieldDouble::sortPerTuple ( bool  asc)

Sorts value within every tuple of this field.

Parameters
[in]asc- if true, the values are sorted in ascending order, else, in descending order.
Exceptions
Ifa data array is not allocated.

References MEDCoupling::MEDCouplingTimeDiscretization::sortPerTuple().

◆ MergeFields() [1/2]

MEDCouplingFieldDouble * MEDCouplingFieldDouble::MergeFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Creates a new MEDCouplingFieldDouble by concatenating two given fields. Values of the first field precede values of the second field within the result field.

Parameters
[in]f1- the first field.
[in]f2- the second field.
Returns
MEDCouplingFieldDouble * - the result field. It is a new instance of MEDCouplingFieldDouble. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe fields are not compatible for the merge.
Ifthe spatial discretization of f1 is NULL.
Ifthe time discretization of f1 is NULL.

Here is a C++ example.
Here is a Python example.

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildCellFieldOnRecurseWithoutOverlapWithoutGhost().

◆ MergeFields() [2/2]

MEDCouplingFieldDouble * MEDCouplingFieldDouble::MergeFields ( const std::vector< const MEDCouplingFieldDouble * > &  a)
static

Creates a new MEDCouplingFieldDouble by concatenating all given fields. Values of the i-th field precede values of the (i+1)-th field within the result. If there is only one field in a, a deepCopy() (except time information of mesh and field) of the field is returned. Generally speaking the first field in a is used to assign tiny attributes of the returned field.

Parameters
[in]a- a vector of fields (MEDCouplingFieldDouble) to concatenate.
Returns
MEDCouplingFieldDouble * - the result field. It is a new instance of MEDCouplingFieldDouble. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifa is empty.
Ifthe fields are not compatible for the merge.

Here is a C++ example.
Here is a Python example.

References areCompatibleForMerge(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getDescription(), MEDCoupling::MEDCouplingField::getDiscretization(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), MEDCoupling::MEDCouplingField::getNature(), and MEDCoupling::MEDCouplingUMesh::MergeUMeshes().

◆ MeldFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::MeldFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Creates a new MEDCouplingFieldDouble by concatenating components of two given fields. The number of components in the result field is a sum of the number of components of given fields. The number of tuples in the result field is same as that of each of given arrays. Number of tuples in the given fields must be the same.

Parameters
[in]f1- a field to include in the result field.
[in]f2- another field to include in the result field.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifthe fields are not compatible for a meld (areCompatibleForMeld()).
Ifany of data arrays is not allocated.
Iff1->getNumberOfTuples() != f2->getNumberOfTuples()

References MEDCoupling::MEDCouplingField::_type, areCompatibleForMeld(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getNature(), and MEDCoupling::MEDCouplingTimeDiscretization::meld().

◆ DotFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::DotFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing a dot product of two given fields, so that the i-th tuple of the result field is a sum of products of j-th components of i-th tuples of given fields ( $ f_i = \sum_{j=1}^n f1_j * f2_j $). Number of tuples and components in the given fields must be the same.

Parameters
[in]f1- a given field.
[in]f2- another given field.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areStrictlyCompatibleForMulDiv(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingTimeDiscretization::dot(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by dot().

◆ dot()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::dot ( const MEDCouplingFieldDouble other) const

References DotFields().

◆ CrossProductFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::CrossProductFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing a cross product of two given fields, so that the i-th tuple of the result field is a 3D vector which is a cross product of two vectors defined by the i-th tuples of given fields. Number of tuples in the given fields must be the same. Number of components in the given fields must be 3.

Parameters
[in]f1- a given field.
[in]f2- another given field.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Iff1->getNumberOfComponents() != 3
Iff2->getNumberOfComponents() != 3
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areStrictlyCompatibleForMulDiv(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingTimeDiscretization::crossProduct(), and MEDCoupling::MEDCouplingField::getMesh().

Referenced by crossProduct().

◆ crossProduct()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::crossProduct ( const MEDCouplingFieldDouble other) const

References CrossProductFields().

◆ MaxFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::MaxFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing maximal values of two given fields. Number of tuples and components in the given fields must be the same.

Parameters
[in]f1- a field to compare values with another one.
[in]f2- another field to compare values with the first one.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areStrictlyCompatible(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getNature(), and MEDCoupling::MEDCouplingTimeDiscretization::max().

Referenced by max().

◆ max()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::max ( const MEDCouplingFieldDouble other) const

References MaxFields().

◆ MinFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::MinFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing minimal values of two given fields. Number of tuples and components in the given fields must be the same.

Parameters
[in]f1- a field to compare values with another one.
[in]f2- another field to compare values with the first one.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areStrictlyCompatible(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getNature(), and MEDCoupling::MEDCouplingTimeDiscretization::min().

Referenced by min().

◆ min()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::min ( const MEDCouplingFieldDouble other) const

References MinFields().

◆ negate()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::negate ( ) const

Returns a copy of this field in which sign of all values is reversed.

Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble containing the same number of tuples and components as this field. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifthe spatial discretization of this field is NULL.
Ifa data array is not allocated.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

◆ operator+()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator+ ( const MEDCouplingFieldDouble other) const

References AddFields().

◆ operator+=()

const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator+= ( const MEDCouplingFieldDouble other)

Adds values of another MEDCouplingFieldDouble to values of this one ( this [ i, j ] += other [ i, j ] ) using DataArrayDouble::addEqual(). The two fields must have same number of tuples, components and same underlying mesh.

Parameters
[in]other- the field to add to this one.
Returns
const MEDCouplingFieldDouble & - a reference to this field.
Exceptions
Ifother is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

References MEDCoupling::MEDCouplingTimeDiscretization::addEqual(), and MEDCoupling::MEDCouplingFieldT< double >::areStrictlyCompatible().

◆ AddFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::AddFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing sum values of corresponding values of two given fields ( f [ i, j ] = f1 [ i, j ] + f2 [ i, j ] ). Number of tuples and components in the given fields must be the same.

Parameters
[in]f1- a field to sum up.
[in]f2- another field to sum up.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretization::add(), MEDCoupling::MEDCouplingFieldT< T >::areStrictlyCompatible(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingField::getNature().

Referenced by operator+().

◆ operator-()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator- ( const MEDCouplingFieldDouble other) const

References SubstractFields().

◆ operator-=()

const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator-= ( const MEDCouplingFieldDouble other)

Subtract values of another MEDCouplingFieldDouble from values of this one ( this [ i, j ] -= other [ i, j ] ) using DataArrayDouble::substractEqual(). The two fields must have same number of tuples, components and same underlying mesh.

Parameters
[in]other- the field to subtract from this one.
Returns
const MEDCouplingFieldDouble & - a reference to this field.
Exceptions
Ifother is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

References MEDCoupling::MEDCouplingFieldT< double >::areStrictlyCompatible(), and MEDCoupling::MEDCouplingTimeDiscretization::substractEqual().

Referenced by substractInPlaceDM().

◆ SubstractFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::SubstractFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing subtraction of corresponding values of two given fields ( f [ i, j ] = f1 [ i, j ] - f2 [ i, j ] ). Number of tuples and components in the given fields must be the same.

Parameters
[in]f1- a field to subtract from.
[in]f2- a field to subtract.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areStrictlyCompatible(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getNature(), and MEDCoupling::MEDCouplingTimeDiscretization::substract().

Referenced by operator-().

◆ operator*()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator* ( const MEDCouplingFieldDouble other) const

References MultiplyFields().

◆ operator*=()

const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator*= ( const MEDCouplingFieldDouble other)

Multiply values of another MEDCouplingFieldDouble to values of this one using DataArrayDouble::multiplyEqual(). The two fields must have same number of tuples and same underlying mesh. There are 2 valid cases.

  1. The fields have same number of components. Then each value of other is multiplied to the corresponding value of this field, i.e. this [ i, j ] *= other [ i, j ].
  2. The other field has one component. Then this [ i, j ] *= other [ i, 0 ].

The two fields must have same number of tuples and same underlying mesh.

Parameters
[in]other- an field to multiply to this one.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, with no nature set. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifother is NULL.
Ifthe fields are not strictly compatible for multiplication (areCompatibleForMul()), i.e. they differ not only in values and possibly in number of components.

References MEDCoupling::MEDCouplingField::_nature, MEDCoupling::MEDCouplingFieldT< double >::areCompatibleForMul(), and MEDCoupling::MEDCouplingTimeDiscretization::multiplyEqual().

◆ MultiplyFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::MultiplyFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing product values of two given fields. There are 2 valid cases.

  1. The fields have same number of tuples and components. Then each value of the result field (f) is a product of the corresponding values of f1 and f2, i.e. f [ i, j ] = f1 [ i, j ] * f2 [ i, j ].
  2. The fields have same number of tuples and one field, say f2, has one component. Then f [ i, j ] = f1 [ i, j ] * f2 [ i, 0 ].

The two fields must have same number of tuples and same underlying mesh.

Parameters
[in]f1- a factor field.
[in]f2- another factor field.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, with no nature set. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not compatible for multiplication (areCompatibleForMul()), i.e. they differ not only in values and possibly number of components.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areCompatibleForMul(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), and MEDCoupling::MEDCouplingTimeDiscretization::multiply().

Referenced by operator*().

◆ operator/()

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator/ ( const MEDCouplingFieldDouble other) const

References DivideFields().

◆ operator/=()

const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator/= ( const MEDCouplingFieldDouble other)

Divide values of this field by values of another MEDCouplingFieldDouble using DataArrayDouble::divideEqual(). The two fields must have same number of tuples and same underlying mesh. There are 2 valid cases.

  1. The fields have same number of components. Then each value of this field is divided by the corresponding value of other one, i.e. this [ i, j ] /= other [ i, j ].
  2. The other field has one component. Then this [ i, j ] /= other [ i, 0 ].

    Warning
    No check of division by zero is performed!
    Parameters
    [in]other- an field to divide this one by.
    Exceptions
    Ifother is NULL.
    Ifthe fields are not compatible for division (areCompatibleForDiv()), i.e. they differ not only in values and possibly in number of components.

References MEDCoupling::MEDCouplingField::_nature, MEDCoupling::MEDCouplingFieldT< double >::areCompatibleForDiv(), and MEDCoupling::MEDCouplingTimeDiscretization::divideEqual().

◆ DivideFields()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::DivideFields ( const MEDCouplingFieldDouble f1,
const MEDCouplingFieldDouble f2 
)
static

Returns a new MEDCouplingFieldDouble containing division of two given fields. There are 2 valid cases.

  1. The fields have same number of tuples and components. Then each value of the result field (f) is a division of the corresponding values of f1 and f2, i.e. f [ i, j ] = f1 [ i, j ] / f2 [ i, j ].
  2. The fields have same number of tuples and f2 has one component. Then f [ i, j ] = f1 [ i, j ] / f2 [ i, 0 ].
Parameters
[in]f1- a numerator field.
[in]f2- a denominator field.
Returns
MEDCouplingFieldDouble * - the new instance of MEDCouplingFieldDouble, with no nature set. The caller is to delete this result field using decrRef() as it is no more needed.
Exceptions
Ifeither f1 or f2 is NULL.
Ifthe fields are not compatible for division (areCompatibleForDiv()), i.e. they differ not only in values and possibly in number of components.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areCompatibleForDiv(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingTimeDiscretization::divide(), and MEDCoupling::MEDCouplingField::getMesh().

Referenced by operator/().

◆ operator^()

MEDCouplingFieldDouble * MEDCouplingFieldDouble::operator^ ( const MEDCouplingFieldDouble other) const

Directly call MEDCouplingFieldDouble::PowFields static method.

See also
MEDCouplingFieldDouble::PowFields

References PowFields().

◆ operator^=()

◆ PowFields()

◆ WriteVTK()

std::string MEDCouplingFieldDouble::WriteVTK ( const std::string &  fileName,
const std::vector< const MEDCouplingFieldDouble * > &  fs,
bool  isBinary = true 
)
static

Writes the field series fs and the mesh the fields lie on in the VTK file fileName. If fs is empty no file is written. The result file is valid provided that no exception is thrown.

Warning
All the fields must be named and lie on the same non NULL mesh.
Parameters
[in]fileName- the name of a VTK file to write in.
[in]fs- the fields to write.
[in]isBinary- specifies the VTK format of the written file. By default true (Binary mode)
Exceptions
Iffs[ 0 ] == NULL.
Ifthe fields lie not on the same mesh.
Ifthe mesh is not set.
Ifany of the fields has no name.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingFieldT< T >::getArray(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), MEDCoupling::MEDCouplingField::getTypeOfField(), MEDCoupling::MEDCouplingMesh::getVTKFileNameOf(), MEDCoupling::DataArrayByte::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ON_NODES.

Referenced by MEDCoupling::MEDCouplingAMRAttribute::writeVTHB(), and writeVTK().

◆ getClassName()

std::string MEDCoupling::MEDCouplingFieldDouble::getClassName ( ) const
overridevirtual

Reimplemented from MEDCoupling::BigMemoryObject.

◆ getTimeDiscretizationUnderGround() [1/2]

const MEDCouplingTimeDiscretization* MEDCoupling::MEDCouplingFieldDouble::getTimeDiscretizationUnderGround ( ) const

◆ getTimeDiscretizationUnderGround() [2/2]

MEDCouplingTimeDiscretization* MEDCoupling::MEDCouplingFieldDouble::getTimeDiscretizationUnderGround ( )