Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::MEDCouplingFieldDouble Class Reference
Inheritance diagram for MEDCoupling::MEDCouplingFieldDouble:
Collaboration diagram for MEDCoupling::MEDCouplingFieldDouble:

Public Member Functions

double accumulate (int compId) const
 
void accumulate (double *res) const
 
std::string advancedRepr () const
 
void applyFunc (int nbOfComp, FunctionToEvaluate func)
 
void applyFunc (int nbOfComp, double val)
 
void applyFunc (int nbOfComp, const std::string &func)
 
void applyFunc (const std::string &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, int compoId)
 
void applyLin (double a, double b)
 
bool areCompatibleForMeld (const MEDCouplingFieldDouble *other) const
 
bool areCompatibleForMerge (const MEDCouplingField *other) const
 
MEDCouplingFieldDoublebuildNewTimeReprFromThis (TypeOfTimeDiscretization td, bool deepCopy) const
 
MEDCouplingFieldDoublebuildSubPart (const DataArrayInt *part) const
 
MEDCouplingFieldDoublebuildSubPart (const int *partBg, const int *partEnd) const
 
MEDCouplingFieldDoublebuildSubPartRange (int begin, int end, int step) const
 
MEDCouplingFieldDoublecellToNodeDiscretization () const
 
void changeNbOfComponents (int newNbOfComp, double dftValue=0.)
 
void changeUnderlyingMesh (const MEDCouplingMesh *other, int levOfCheck, double precOnMesh, double eps=1e-15)
 
void checkForUnserialization (const std::vector< int > &tinyInfoI, const DataArrayInt *dataInt, const std::vector< DataArrayDouble * > &arrays)
 
MEDCouplingFieldDoubleclone (bool recDeepCpy) const
 
MEDCouplingFieldDoublecomputeVectorFieldCyl (const double center[3], const double vect[3]) const
 
MCAuto< MEDCouplingFieldDoubleconvertQuadraticCellsToLinear () const
 
MEDCouplingFieldIntconvertToIntField () 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, FunctionToEvaluate func)
 
void fillFromAnalytic (int nbOfComp, const std::string &func)
 
void fillFromAnalyticCompo (int nbOfComp, const std::string &func)
 
void fillFromAnalyticNamedCompo (int nbOfComp, const std::vector< std::string > &varsOrder, const std::string &func)
 
DataArrayIntfindIdsInRange (double vmin, double vmax) const
 
void finishUnserialization (const std::vector< int > &tinyInfoI, const std::vector< double > &tinyInfoD, const std::vector< std::string > &tinyInfoS)
 
double getAverageValue () const
 
std::vector< const
BigMemoryObject * > 
getDirectChildrenWithNull () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
double getIJK (int cellId, int nodeIdInCell, int compoId) const
 
double getMaxValue () const
 
double getMaxValue2 (DataArrayInt *&tupleIds) const
 
double getMinValue () const
 
double getMinValue2 (DataArrayInt *&tupleIds) const
 
std::size_t getNumberOfComponents () const
 
std::size_t getNumberOfTuples () const
 
std::size_t getNumberOfValues () const
 
const
MEDCouplingTimeDiscretization
getTimeDiscretizationUnderGround () const
 
MEDCouplingTimeDiscretizationgetTimeDiscretizationUnderGround ()
 
void getTinySerializationDbleInformation (std::vector< double > &tinyInfo) const
 
void getTinySerializationIntInformation (std::vector< int > &tinyInfo) const
 
void getTinySerializationStrInformation (std::vector< std::string > &tinyInfo) const
 
void getValueOn (const double *spaceLoc, double *res) const
 
void getValueOn (const double *spaceLoc, double time, double *res) const
 
DataArrayDoublegetValueOnMulti (const double *spaceLoc, int nbOfPoints) const
 
void getValueOnPos (int i, int j, int k, double *res) const
 
void getWeightedAverageValue (double *res, bool isWAbs=true) const
 
double getWeightedAverageValue (int compId, bool isWAbs=true) const
 
double integral (int compId, bool isWAbs) const
 
void integral (bool isWAbs, double *res) const
 
MEDCouplingFieldDoubleinverse () const
 
MEDCouplingFieldDoublekeepSelectedComponents (const std::vector< int > &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
 
double normL1 (int compId) const
 
void normL1 (double *res) const
 
double normL2 (int compId) const
 
void normL2 (double *res) const
 
double normMax () const
 
MEDCouplingFieldDoubleoperator* (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception)
 
const MEDCouplingFieldDoubleoperator*= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator+ (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception)
 
const MEDCouplingFieldDoubleoperator+= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator- (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception)
 
const MEDCouplingFieldDoubleoperator-= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator/ (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception)
 
const MEDCouplingFieldDoubleoperator/= (const MEDCouplingFieldDouble &other)
 
MEDCouplingFieldDoubleoperator= (double value)
 
MEDCouplingFieldDoubleoperator^ (const MEDCouplingFieldDouble &other) const
 
const MEDCouplingFieldDoubleoperator^= (const MEDCouplingFieldDouble &other)
 
void renumberCells (const int *old2NewBg, bool check=true)
 
void renumberCellsWithoutMesh (const int *old2NewBg, bool check=true)
 
void renumberNodes (const int *old2NewBg, double eps=1e-15)
 
void renumberNodesWithoutMesh (const int *old2NewBg, int newNbOfNodes, double eps=1e-15)
 
void resizeForUnserialization (const std::vector< int > &tinyInfoI, DataArrayInt *&dataInt, std::vector< DataArrayDouble * > &arrays)
 
void serialize (DataArrayInt *&dataInt, std::vector< DataArrayDouble * > &arrays) const
 
void setSelectedComponents (const MEDCouplingFieldDouble *f, const std::vector< int > &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
 
void checkConsistencyLight () const
 
Traits< double >::FieldType * cloneWithMesh (bool recDeepCpy) const
 
void copyAllTinyAttrFrom (const MEDCouplingFieldT< double > *other)
 
void copyTinyAttrFrom (const MEDCouplingFieldT< double > *other)
 
void copyTinyStringsFrom (const MEDCouplingField *other)
 
const Traits< double >::ArrayType * getArray () const
 
Traits< double >::ArrayType * getArray ()
 
std::vector< typename Traits
< double >::ArrayType * > 
getArrays () const
 
const Traits< double >::ArrayType * getEndArray () const
 
Traits< double >::ArrayType * getEndArray ()
 
double getEndTime (int &iteration, int &order) const
 
double getIJ (int tupleId, int 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
 
bool isEqualIfNotWhy (const MEDCouplingField *other, double meshPrec, double valsPrec, std::string &reason) const
 
bool isEqualWithoutConsideringStr (const MEDCouplingField *other, double meshPrec, double valsPrec) const
 
void reprQuickOverview (std::ostream &stream) 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 ()
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingField
MEDCouplingFieldDoublebuildMeasureField (bool isAbs) const
 
MEDCouplingMeshbuildSubMeshData (const int *start, const int *end, DataArrayInt *&di) const
 
MEDCouplingMeshbuildSubMeshDataRange (int begin, int end, int step, int &beginOut, int &endOut, int &stepOut, DataArrayInt *&di) const
 
void clearGaussLocalizations ()
 
DataArrayIntcomputeTupleIdsToSelectFromCellIds (const int *startCellIds, const int *endCellIds) const
 
void getCellIdsHavingGaussLocalization (int locId, std::vector< int > &cellIds) const
 
std::string getDescription () const
 
const
MEDCouplingFieldDiscretization
getDiscretization () const
 
MEDCouplingFieldDiscretizationgetDiscretization ()
 
MEDCouplingGaussLocalizationgetGaussLocalization (int locId)
 
const
MEDCouplingGaussLocalization
getGaussLocalization (int locId) const
 
int getGaussLocalizationIdOfOneCell (int cellId) const
 
int getGaussLocalizationIdOfOneType (INTERP_KERNEL::NormalizedCellType type) const
 
std::set< int > getGaussLocalizationIdsOfOneType (INTERP_KERNEL::NormalizedCellType type) const
 
DataArrayDoublegetLocalizationOfDiscr () const
 
const
MEDCoupling::MEDCouplingMesh
getMesh () const
 
MEDCoupling::MEDCouplingMeshgetMesh ()
 
std::string getName () const
 
NatureOfField getNature () const
 
int getNbOfGaussLocalization () const
 
int getNumberOfMeshPlacesExpected () const
 
int getNumberOfTuplesExpected () const
 
int getNumberOfTuplesExpectedRegardingCode (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const
 
TypeOfField getTypeOfField () const
 
virtual bool isEqual (const MEDCouplingField *other, double meshPrec, double valsPrec) const
 
void setDescription (const std::string &desc)
 
void setDiscretization (MEDCouplingFieldDiscretization *newDisc)
 
void setGaussLocalizationOnCells (const int *begin, const int *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::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 

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 (TypeOfField type, TypeOfTimeDiscretization td=ONE_TIME)
 
static MEDCouplingFieldDoubleNew (const MEDCouplingFieldTemplate &ft, 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)
 

Protected Member Functions

 ~MEDCouplingFieldDouble ()
 
- Protected Member Functions inherited from MEDCoupling::MEDCouplingFieldT< double >
 MEDCouplingFieldT (const MEDCouplingFieldT< double > &other, bool deepCopy)
 
 MEDCouplingFieldT (const MEDCouplingField &other, MEDCouplingTimeDiscretizationTemplate< double > *timeDiscr, bool deepCopy=true)
 
 MEDCouplingFieldT (TypeOfField type, MEDCouplingTimeDiscretizationTemplate< double > *timeDiscr)
 
 MEDCouplingFieldT (MEDCouplingFieldDiscretization *type, NatureOfField n, MEDCouplingTimeDiscretizationTemplate< double > *timeDiscr)
 
 ~MEDCouplingFieldT ()
 
- Protected Member Functions inherited from MEDCoupling::MEDCouplingField
 MEDCouplingField (TypeOfField type)
 
 MEDCouplingField (const MEDCouplingField &other, bool deepCopy=true)
 
 MEDCouplingField (MEDCouplingFieldDiscretization *type, NatureOfField nature=NoNature)
 
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
 

Constructor & Destructor Documentation

MEDCoupling::MEDCouplingFieldDouble::~MEDCouplingFieldDouble ( )
protected

Member Function Documentation

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::MEDCouplingStructuredMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingCurveLinearMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingUMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField(), MEDCoupling::MEDCoupling1SGTUMesh::computeDiameterField(), MEDCoupling::MEDCouplingUMesh::computeDiameterField(), MEDCoupling::MEDFileIntField1TS::ConvertFieldIntToFieldDouble(), convertQuadraticCellsToLinear(), MEDCoupling::MEDCouplingFieldInt::convertToDblField(), MEDCoupling::MEDCouplingMesh::fillFromAnalytic(), MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo(), MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo(), MEDCoupling::MEDCouplingUMesh::getAspectRatioField(), MEDCoupling::MEDCouplingUMesh::getEdgeRatioField(), MEDCoupling::MEDCouplingCurveLinearMesh::getMeasureField(), MEDCoupling::MEDCouplingCMesh::getMeasureField(), MEDCoupling::MEDCouplingIMesh::getMeasureField(), MEDCoupling::MEDCouplingMappedExtrudedMesh::getMeasureField(), MEDCoupling::MEDCouplingUMesh::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().

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.
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().

Referenced by MEDCoupling::MEDCouplingUMesh::buildDirectionVectorField(), MEDCoupling::MEDCouplingUMesh::buildOrthogonalField(), MEDCoupling::MEDCouplingUMesh::buildPartOrthogonalField(), MEDCoupling::MEDCouplingMesh::fillFromAnalytic(), MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo(), MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo(), MEDCoupling::MEDCouplingUMesh::getAspectRatioField(), MEDCoupling::MEDCouplingUMesh::getEdgeRatioField(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::getMeasureField(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getSkewField(), and MEDCoupling::MEDCouplingUMesh::getWarpField().

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

References WriteVTK().

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().

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().

void MEDCouplingFieldDouble::renumberCells ( const int *  old2NewBg,
bool  check = true 
)

Permutes values of this field according to a given permutation array for cells renumbering. The underlying mesh is deeply copied and its cells are also permuted. The number of cells remains the same; for that the permutation array old2NewBg should not contain equal ids. ** Warning, this method modifies the mesh aggreagated by this (by performing a deep copy ) **.

Parameters
[in]old2NewBg- the permutation array in "Old to New" mode. Its length is to be equal to this->getMesh()->getNumberOfCells().
[in]check- if true, old2NewBg is transformed to a new permutation array, so that its maximal cell id to correspond to (be less than) the number of cells in mesh. This new array is then used for the renumbering. If check == false, old2NewBg is used as is, that is less secure as validity of ids in old2NewBg is not checked.
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).

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

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingMesh::deepCopy(), MEDCoupling::MEDCouplingMesh::renumberCells(), renumberCellsWithoutMesh(), MEDCoupling::MEDCouplingField::setMesh(), and updateTime().

Referenced by MEDCoupling::ReadFieldsOnSameMesh(), and MEDCoupling::WriteField().

void MEDCouplingFieldDouble::renumberCellsWithoutMesh ( const int *  old2NewBg,
bool  check = true 
)

Permutes values of this field according to a given permutation array for cells renumbering. The underlying mesh is not permuted. The number of cells remains the same; for that the permutation array old2NewBg should not contain equal ids. This method performs a part of job of renumberCells(). 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!
Parameters
[in]old2NewBg- the permutation array in "Old to New" mode. Its length is to be equal to this->getMesh()->getNumberOfCells().
[in]check- if true, old2NewBg is transformed to a new permutation array, so that its maximal cell id to correspond to (be less than) the number of cells in mesh. This new array is then used for the renumbering. If check == false, old2NewBg is used as is, that is less secure as validity of ids in old2NewBg is not checked.
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).

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

Referenced by changeUnderlyingMesh(), and renumberCells().

void MEDCouplingFieldDouble::renumberNodes ( const int *  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 deffer 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().

Referenced by MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel().

void MEDCouplingFieldDouble::renumberNodesWithoutMesh ( const int *  old2NewBg,
int  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 deffer more than eps.

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

Referenced by changeUnderlyingMesh(), and renumberNodes().

DataArrayInt * 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
DataArrayInt * - a new instance of DataArrayInt 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().

MEDCouplingFieldDouble * MEDCouplingFieldDouble::buildSubPart ( const DataArrayInt part) const

Builds a newly created field, that the caller will have the responsability to deal with (decrRef()). This method makes the assumption that the field is correctly defined when this method is called, no check of this will be done. This method returns a restriction of this so that only tuples with ids specified in part will be contained in the returned field. Parameter part specifies cell ids whatever the spatial discretization of this ( ON_CELLS, ON_NODES, ON_GAUSS_PT, ON_GAUSS_NE, ON_NODES_KR).

For example, this is a field on cells lying on a mesh that have 10 cells, part contains following cell ids [3,7,6]. Then the returned field will lie on mesh having 3 cells and the returned field will contain 3 tuples.
Tuple #0 of the result field will refer to the cell #0 of returned mesh. The cell #0 of returned mesh will be equal to the cell #3 of this->getMesh().
Tuple #1 of the result field will refer to the cell #1 of returned mesh. The cell #1 of returned mesh will be equal to the cell #7 of this->getMesh().
Tuple #2 of the result field will refer to the cell #2 of returned mesh. The cell #2 of returned mesh will be equal to the cell #6 of this->getMesh().

Let, for example, this be a field on nodes lying on a mesh that have 10 cells and 11 nodes, and part contains following cellIds [3,7,6]. Thus this currently contains 11 tuples. If the restriction of mesh to 3 cells leads to a mesh with 6 nodes, then the returned field will contain 6 tuples and this field will lie on this restricted mesh.

Parameters
[in]part- an array of cell ids to include to the result 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
MEDCouplingFieldDouble::buildSubPartRange

References MEDCoupling::DataArrayTemplate< T >::begin(), and MEDCoupling::DataArrayTemplate< T >::end().

Referenced by MEDCoupling::MEDFileField1TS::extractPart().

MEDCouplingFieldDouble * MEDCouplingFieldDouble::buildSubPart ( const int *  partBg,
const int *  partEnd 
) const

Builds a newly created field, that the caller will have the responsability to deal with.
This method makes the assumption that this field is correctly defined when this method is called (this->checkConsistencyLight() returns without any exception thrown), no check of this will be done.
This method returns a restriction of this so that only tuple ids specified in [ partBg , partEnd ) will be contained in the returned field.
Parameter [partBg, partEnd ) specifies cell ids whatever the spatial discretization of this ( ON_CELLS, ON_NODES, ON_GAUSS_PT, ON_GAUSS_NE, ON_NODES_KR).

For example, this is a field on cells lying on a mesh that have 10 cells, partBg contains the following cell ids [3,7,6]. Then the returned field will lie on mesh having 3 cells and will contain 3 tuples.

  • Tuple #0 of the result field will refer to the cell #0 of returned mesh. The cell #0 of returned mesh will be equal to the cell #3 of this->getMesh().
  • Tuple #1 of the result field will refer to the cell #1 of returned mesh. The cell #1 of returned mesh will be equal to the cell #7 of this->getMesh().
  • Tuple #2 of the result field will refer to the cell #2 of returned mesh. The cell #2 of returned mesh will be equal to the cell #6 of this->getMesh().

    Let, for example, this be a field on nodes lying on a mesh that have 10 cells and 11 nodes, and partBg contains following cellIds [3,7,6]. Thus this currently contains 11 tuples. If the restriction of mesh to 3 cells leads to a mesh with 6 nodes, then the returned field will contain 6 tuples and this field will lie on this restricted mesh.

Parameters
[in]partBg- start (included) of input range of cell ids to select [ partBg, partEnd )
[in]partEnd- end (not included) of input range of cell ids to select [ partBg, partEnd )
Returns
a newly allocated field the caller should deal with.
Exceptions
ifthere is presence of an invalid cell id in [ partBg, partEnd ) regarding the number of cells of this->getMesh().

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

See Also
MEDCoupling::MEDCouplingFieldDouble::buildSubPart(const DataArrayInt *) const, MEDCouplingFieldDouble::buildSubPartRange

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::DataArrayTemplate< T >::begin(), clone(), MEDCoupling::MEDCouplingFieldDiscretization::clonePart(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), MEDCoupling::MEDCouplingField::getDiscretization(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayDouble::selectByTupleIdSafe(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::setArrays(), MEDCoupling::MEDCouplingField::setDiscretization(), and MEDCoupling::MEDCouplingField::setMesh().

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().

Referenced by MEDCoupling::MEDFileField1TS::extractPart(), MEDCoupling::WriteField(), and MEDCoupling::WriteFieldUsingAlreadyWrittenMesh().

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 buildSubPart(), buildSubPartRange(), cellToNodeDiscretization(), extractSlice3D(), nodeToCellDiscretization(), and MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::setFieldProfile().

MEDCouplingFieldDouble * MEDCouplingFieldDouble::buildNewTimeReprFromThis ( TypeOfTimeDiscretization  td,
bool  deepCopy 
) 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]deepCopy- 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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setDescription(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

MEDCouplingFieldDouble * MEDCouplingFieldDouble::nodeToCellDiscretization ( ) const

This method converts a field on nodes (this) to a cell field (returned field). The convertion is a non conservative remapping ! This method is useful only for users that need a fast convertion 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(), MEDCoupling::ON_NODES, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArrays(), and MEDCoupling::MEDCouplingField::setDiscretization().

MEDCouplingFieldDouble * MEDCouplingFieldDouble::cellToNodeDiscretization ( ) const

This method converts a field on cell (this) to a node field (returned field). The convertion is a non conservative remapping ! This method is useful only for users that need a fast convertion 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::DataArrayDouble::accumulatePerChunck(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), clone(), MEDCoupling::DataArrayInt::deltaShiftIndex(), MEDCoupling::DataArrayDouble::divideEqual(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingFieldT< double >::getArrays(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingMesh::getReverseNodalConnectivity(), MEDCoupling::MEDCouplingField::getTypeOfField(), MEDCoupling::DataArrayInt::New(), MEDCoupling::ON_CELLS, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArrays(), and MEDCoupling::MEDCouplingField::setDiscretization().

double MEDCouplingFieldDouble::getIJK ( int  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().

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().

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().

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().

double MEDCouplingFieldDouble::getMaxValue2 ( DataArrayInt *&  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 DataArrayInt containg 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(), and MEDCoupling::MCAuto< T >::retn().

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().

double MEDCouplingFieldDouble::getMinValue2 ( DataArrayInt *&  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 DataArrayInt containg 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(), and MEDCoupling::MCAuto< T >::retn().

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().

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().

double MEDCouplingFieldDouble::normMax ( ) const

This method returns the max norm of this field.

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

Exceptions
Ifthe data array is not set.

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

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::DataArrayDouble::accumulate(), MEDCoupling::MEDCouplingField::buildMeasureField(), MEDCoupling::MEDCouplingFieldT< double >::getArray(), MEDCoupling::MEDCouplingFieldT< T >::getArray(), and MEDCoupling::DataArrayDouble::multiplyEqual().

Referenced by getWeightedAverageValue().

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().

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().

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().

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().

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().

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().

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().

void MEDCouplingFieldDouble::getValueOnPos ( int  i,
int  j,
int  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().

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().

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().

DataArrayDouble * MEDCouplingFieldDouble::getValueOnMulti ( const double *  spaceLoc,
int  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().

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().

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().

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().

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().

Referenced by MEDCoupling::MEDCouplingMesh::fillFromAnalytic().

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().

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().

Referenced by MEDCoupling::MEDCouplingMesh::fillFromAnalyticCompo().

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().

Referenced by MEDCoupling::MEDCouplingMesh::fillFromAnalyticNamedCompo().

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().

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().

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.,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 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().

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.,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 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().

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().

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().

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().

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().

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().

std::size_t 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::MEDCouplingFieldDiscretizationGauss::getMeasureField(), MEDCoupling::InterpolationMatrix::InterpolationMatrix(), MEDCoupling::ParaFIELD::ParaFIELD(), and MEDCoupling::InterpolationMatrix::prepare().

std::size_t 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().

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().

Referenced by renumberCells(), and renumberCellsWithoutMesh().

std::size_t MEDCouplingFieldDouble::getHeapMemorySizeWithoutChildren ( ) const
virtual
std::vector< const BigMemoryObject * > MEDCouplingFieldDouble::getDirectChildrenWithNull ( ) const
virtual
void MEDCouplingFieldDouble::getTinySerializationIntInformation ( std::vector< int > &  tinyInfo) const

This method retrieves some critical values to resize and prepare remote instance. The first two elements returned in tinyInfo correspond to the parameters to give in constructor.

Parameters
tinyInfoout parameter resized correctly after the call. The length of this vector is tiny.

References MEDCoupling::MEDCouplingField::_nature, MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::getTinySerializationIntInformation().

void MEDCouplingFieldDouble::getTinySerializationDbleInformation ( std::vector< double > &  tinyInfo) const

This method retrieves some critical values to resize and prepare remote instance.

Parameters
tinyInfoout parameter resized correctly after the call. The length of this vector is tiny.

References MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::getTinySerializationDbleInformation().

void MEDCouplingFieldDouble::getTinySerializationStrInformation ( std::vector< std::string > &  tinyInfo) const

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.

References MEDCoupling::MEDCouplingField::_desc, MEDCoupling::MEDCouplingField::_name, MEDCoupling::MEDCouplingFieldT< double >::getTimeUnit(), and MEDCoupling::MEDCouplingTimeDiscretization::getTinySerializationStrInformation().

void MEDCouplingFieldDouble::resizeForUnserialization ( const std::vector< int > &  tinyInfoI,
DataArrayInt *&  dataInt,
std::vector< DataArrayDouble * > &  arrays 
)

This method has to be called to the new instance filled by CORBA, MPI, File...

Parameters
tinyInfoIis the value retrieves from distant result of getTinySerializationIntInformation on source instance to be copied.
dataIntout parameter. If not null the pointer is already owned by this after the call of this method. In this case no decrRef must be applied.
arraysout parameter is a vector resized to the right size. The pointers in the vector is already owned by this after the call of this method. No decrRef must be applied to every instances in returned vector.
See Also
checkForUnserialization

References MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::resizeForUnserialization().

void MEDCouplingFieldDouble::checkForUnserialization ( const std::vector< int > &  tinyInfoI,
const DataArrayInt dataInt,
const std::vector< DataArrayDouble * > &  arrays 
)

This method is extremely close to resizeForUnserialization except that here the arrays in dataInt and in arrays are attached in this after having checked that size is correct. This method is used in python pickeling context to avoid copy of data.

See Also
resizeForUnserialization

References MEDCoupling::MEDCouplingField::_type, and MEDCoupling::MEDCouplingTimeDiscretization::checkForUnserialization().

void MEDCouplingFieldDouble::finishUnserialization ( const std::vector< int > &  tinyInfoI,
const std::vector< double > &  tinyInfoD,
const std::vector< std::string > &  tinyInfoS 
)
void MEDCouplingFieldDouble::serialize ( DataArrayInt *&  dataInt,
std::vector< DataArrayDouble * > &  arrays 
) const

Contrary to MEDCouplingPointSet class the returned arrays are not the responsabilities of the caller. The values returned must be consulted only in readonly mode.

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

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

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) deffer more than eps.

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

References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingMesh::checkGeoEquivalWith(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), renumberCellsWithoutMesh(), renumberNodesWithoutMesh(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by 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) deffer 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-=().

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) deffer more than epsOnVals.

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

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) deffer more than epsOnVals.

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

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) deffer more than epsOnVals.

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

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) deffer more than epsOnVals.

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

MEDCouplingFieldDouble * MEDCouplingFieldDouble::extractSlice3D ( const double *  origin,
const double *  vec,
double  eps 
) const
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().

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().

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. Finaly 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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

void MEDCouplingFieldDouble::changeNbOfComponents ( int  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().

MEDCouplingFieldDouble * MEDCouplingFieldDouble::keepSelectedComponents ( const std::vector< int > &  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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

void MEDCouplingFieldDouble::setSelectedComponents ( const MEDCouplingFieldDouble f,
const std::vector< int > &  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().

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().

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.

References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingTimeDiscretization::aggregate(), areCompatibleForMerge(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getDescription(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setDescription(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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

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 MEDCoupling::MEDCouplingField::_type, areCompatibleForMerge(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingMesh::copyTinyInfoFrom(), MEDCoupling::MEDCouplingField::getDescription(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getName(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MEDCouplingUMesh::MergeUMeshes(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setDescription(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingField::setName().

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(), MEDCoupling::MEDCouplingTimeDiscretization::meld(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

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(), MEDCoupling::NoNature, and MEDCoupling::MEDCouplingField::setMesh().

Referenced by dot().

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

References DotFields().

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(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::NoNature, MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by crossProduct().

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

References CrossProductFields().

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(), MEDCoupling::MEDCouplingTimeDiscretization::max(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by max().

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

References MaxFields().

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(), MEDCoupling::MEDCouplingTimeDiscretization::min(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by min().

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

References MinFields().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator+ ( const MEDCouplingFieldDouble other) const throw (INTERP_KERNEL::Exception)

References AddFields().

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().

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(), MEDCoupling::MEDCouplingField::getNature(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by operator+().

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator- ( const MEDCouplingFieldDouble other) const throw (INTERP_KERNEL::Exception)

References SubstractFields().

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().

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(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingTimeDiscretization::substract().

Referenced by operator-().

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator* ( const MEDCouplingFieldDouble other) const throw (INTERP_KERNEL::Exception)

References MultiplyFields().

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(), MEDCoupling::MEDCouplingTimeDiscretization::multiplyEqual(), and MEDCoupling::NoNature.

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(), MEDCoupling::MEDCouplingTimeDiscretization::multiply(), MEDCoupling::NoNature, MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by operator*().

MEDCouplingFieldDouble* MEDCoupling::MEDCouplingFieldDouble::operator/ ( const MEDCouplingFieldDouble other) const throw (INTERP_KERNEL::Exception)

References DivideFields().

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(), MEDCoupling::MEDCouplingTimeDiscretization::divideEqual(), and MEDCoupling::NoNature.

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(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::NoNature, MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by operator/().

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

Directly call MEDCouplingFieldDouble::PowFields static method.

See Also
MEDCouplingFieldDouble::PowFields

References PowFields().

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().

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