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 |
MEDCouplingFieldDouble * | buildNewTimeReprFromThis (TypeOfTimeDiscretization td, bool deepCopy) const |
MEDCouplingFieldDouble * | buildSubPart (const DataArrayInt *part) const |
MEDCouplingFieldDouble * | buildSubPart (const int *partBg, const int *partEnd) const |
MEDCouplingFieldDouble * | buildSubPartRange (int begin, int end, int step) const |
MEDCouplingFieldDouble * | cellToNodeDiscretization () 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) |
MEDCouplingFieldDouble * | clone (bool recDeepCpy) const |
MEDCouplingFieldDouble * | computeVectorFieldCyl (const double center[3], const double vect[3]) const |
MCAuto< MEDCouplingFieldDouble > | convertQuadraticCellsToLinear () const |
MEDCouplingFieldInt * | convertToIntField () const |
MEDCouplingFieldDouble * | crossProduct (const MEDCouplingFieldDouble &other) const |
MEDCouplingFieldDouble * | deepCopy () const |
MEDCouplingFieldDouble * | determinant () const |
MEDCouplingFieldDouble * | deviator () const |
MEDCouplingFieldDouble * | dot (const MEDCouplingFieldDouble &other) const |
MEDCouplingFieldDouble * | doublyContractedProduct () const |
MEDCouplingFieldDouble * | eigenValues () const |
MEDCouplingFieldDouble * | eigenVectors () const |
MEDCouplingFieldDouble * | extractSlice3D (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) |
DataArrayInt * | findIdsInRange (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 |
MEDCouplingTimeDiscretization * | getTimeDiscretizationUnderGround () |
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 |
DataArrayDouble * | getValueOnMulti (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 |
MEDCouplingFieldDouble * | inverse () const |
MEDCouplingFieldDouble * | keepSelectedComponents (const std::vector< int > &compoIds) const |
MEDCouplingFieldDouble * | magnitude () const |
MEDCouplingFieldDouble * | max (const MEDCouplingFieldDouble &other) const |
MEDCouplingFieldDouble * | maxPerTuple () const |
bool | mergeNodes (double eps, double epsOnVals=1e-15) |
bool | mergeNodesCenter (double eps, double epsOnVals=1e-15) |
MEDCouplingFieldDouble * | min (const MEDCouplingFieldDouble &other) const |
MEDCouplingFieldDouble * | negate () const |
MEDCouplingFieldDouble * | nodeToCellDiscretization () 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 |
MEDCouplingFieldDouble * | operator* (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception) |
const MEDCouplingFieldDouble & | operator*= (const MEDCouplingFieldDouble &other) |
MEDCouplingFieldDouble * | operator+ (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception) |
const MEDCouplingFieldDouble & | operator+= (const MEDCouplingFieldDouble &other) |
MEDCouplingFieldDouble * | operator- (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception) |
const MEDCouplingFieldDouble & | operator-= (const MEDCouplingFieldDouble &other) |
MEDCouplingFieldDouble * | operator/ (const MEDCouplingFieldDouble &other) const throw (INTERP_KERNEL::Exception) |
const MEDCouplingFieldDouble & | operator/= (const MEDCouplingFieldDouble &other) |
MEDCouplingFieldDouble & | operator= (double value) |
MEDCouplingFieldDouble * | operator^ (const MEDCouplingFieldDouble &other) const |
const MEDCouplingFieldDouble & | operator^= (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 () |
MEDCouplingFieldDouble * | trace () const |
void | updateTime () const |
MCAuto< MEDCouplingFieldDouble > | voronoize (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 | |
MEDCouplingFieldDouble * | buildMeasureField (bool isAbs) const |
MEDCouplingMesh * | buildSubMeshData (const int *start, const int *end, DataArrayInt *&di) const |
MEDCouplingMesh * | buildSubMeshDataRange (int begin, int end, int step, int &beginOut, int &endOut, int &stepOut, DataArrayInt *&di) const |
void | clearGaussLocalizations () |
DataArrayInt * | computeTupleIdsToSelectFromCellIds (const int *startCellIds, const int *endCellIds) const |
void | getCellIdsHavingGaussLocalization (int locId, std::vector< int > &cellIds) const |
std::string | getDescription () const |
const MEDCouplingFieldDiscretization * | getDiscretization () const |
MEDCouplingFieldDiscretization * | getDiscretization () |
MEDCouplingGaussLocalization & | getGaussLocalization (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 |
DataArrayDouble * | getLocalizationOfDiscr () const |
const MEDCoupling::MEDCouplingMesh * | getMesh () const |
MEDCoupling::MEDCouplingMesh * | getMesh () |
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 |
TimeLabel & | operator= (const TimeLabel &other) |
Additional Inherited Members | |
Protected Attributes inherited from MEDCoupling::MEDCouplingFieldT< double > | |
MEDCouplingTimeDiscretizationTemplate < double > * | _time_discr |
|
protected |
|
static |
Creates a new MEDCouplingFieldDouble, of given spatial type and time discretization. For more info, see Building a field from scratch.
[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). |
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().
|
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.
[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). |
void MEDCouplingFieldDouble::synchronizeTimeWithSupport | ( | ) |
Sets a time unit of this field. For more info, see Building a field from scratch.
[in] | unit | unit (string) in which time is measured. |
Returns a time unit of this field.
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.
If | this->_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::advancedRepr | ( | ) | const |
Returns a string describing this field. The string includes info on
References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingMesh::advancedRepr(), MEDCoupling::MEDCouplingFieldT< double >::getArray(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), MEDCoupling::MEDCouplingField::getDescription(), MEDCoupling::MEDCouplingField::getName(), and MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getStringRepr().
std::string MEDCouplingFieldDouble::writeVTK | ( | const std::string & | fileName, |
bool | isBinary = true |
||
) | const |
References WriteVTK().
|
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 ) **.
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | check == true and old2NewBg contains equal ids. |
If | mesh 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.
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | check == true and old2NewBg contains equal ids. |
If | mesh 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().
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | check == true and old2NewBg contains equal ids. |
If | mesh nature does not allow renumbering (e.g. structured mesh). |
If | values 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.
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | values 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().
[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. |
If | the data array is not set. |
If | this->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.
[in] | part | - an array of cell ids to include to the result field. |
Here is a C++ example.
Here is a Python example.
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 #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.
[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 ) |
if | there 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.
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::buildSubPartRange | ( | int | begin, |
int | end, | ||
int | step | ||
) | const |
This method is equivalent to MEDCouplingFieldDouble::buildSubPart, the only difference is that the input range of cell ids is given using a range given begin, end and step to optimize the part computation.
References MEDCoupling::MEDCouplingField::_mesh, MEDCoupling::MEDCouplingField::_type, MEDCoupling::DataArrayTemplate< T >::begin(), clone(), MEDCoupling::MEDCouplingFieldDiscretization::clonePartRange(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), MEDCoupling::MEDCouplingField::getDiscretization(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayDouble::selectByTupleIdSafe(), MEDCoupling::DataArrayDouble::selectByTupleIdSafeSlice(), 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().
References MEDCoupling::MEDCouplingFieldT< double >::cloneWithMesh().
Referenced by MEDCoupling::MEDFileField1TS::extractPart(), MEDCoupling::WriteField(), and MEDCoupling::WriteFieldUsingAlreadyWrittenMesh().
|
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.
[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. |
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.
[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. |
Here is a C++ example.
Here is a Python example.
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.
If | this spatial discretization is empty or not ON_NODES. |
If | this is not coherent (see MEDCouplingFieldDouble::checkConsistencyLight). |
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.).
If | this spatial discretization is empty or not ON_CELLS. |
If | this is not coherent (see MEDCouplingFieldDouble::checkConsistencyLight). |
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().
MEDCouplingFieldInt * MEDCouplingFieldDouble::convertToIntField | ( | ) | const |
References MEDCoupling::MEDCouplingFieldT< double >::getArray(), MEDCoupling::MEDCouplingFieldT< double >::getTime(), MEDCoupling::MEDCouplingFieldT< double >::getTimeDiscretization(), MEDCoupling::MEDCouplingFieldInt::New(), MEDCoupling::MEDCouplingFieldTemplate::New(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), and MEDCoupling::MEDCouplingFieldT< T >::setTime().
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.
[in] | cellId | - an id of cell of interest. |
[in] | nodeIdInCell | - a node index within the cell. |
[in] | compoId | - an index of component. |
If | the data array is not set. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | this 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.
[in] | compId | - the index of the component of interest. |
If | the data array is not set. |
If | the 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.
[out] | res | - an array of length this->getNumberOfComponents(), allocated by the caller, that is filled by this method with sum value for each component. |
If | the 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.
If | this->getNumberOfComponents() != 1 |
If | the data array is not set. |
If | there 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.
[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. |
If | this->getNumberOfComponents() != 1. |
If | there 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.
If | this->getNumberOfComponents() != 1 |
If | the data array is not set. |
If | there 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.
[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. |
If | this->getNumberOfComponents() != 1. |
If | there 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.
If | this->getNumberOfComponents() != 1 |
If | the 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.
If | the data array is not set. |
References MEDCoupling::MEDCouplingFieldT< double >::getArray().
double MEDCouplingFieldDouble::normMax | ( | ) | const |
This method returns the max norm of this field.
If | the 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().
[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. |
If | the mesh is not set. |
If | the 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().
[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. |
If | the mesh is not set. |
If | the data array is not set. |
If | compId 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:
[in] | compId | - an index of the component of interest. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | compId 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:
[out] | res | - pointer to an array of result values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller. |
If | the mesh is not set. |
If | the 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:
[in] | compId | - an index of the component of interest. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | compId 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:
[out] | res | - pointer to an array of result values, of size at least this->getNumberOfComponents(), that is to be allocated by the caller. |
If | the mesh is not set. |
If | the 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.
[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. |
If | the mesh is not set. |
If | the data array is not set. |
If | compId 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.
[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. |
If | the mesh is not set. |
If | the data array is not set. |
If | the 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.
[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. |
If | the spatial discretization of this field is NULL. |
If | the mesh is not set. |
If | the 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.
[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. |
If | the spatial discretization of this field is NULL. |
If | the mesh is not set. |
If | 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::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.
[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. |
If | the spatial discretization of this field is NULL. |
If | the mesh is not set. |
If | spaceLoc is out of the spatial discretization. |
If | time 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.
[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. |
If | the spatial discretization of this field is NULL. |
If | the mesh is not set. |
If | any 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 .
[in] | a | - the first coefficient of the function. |
[in] | b | - the second coefficient of the function. |
[in] | compoId | - the index of component to modify. |
If | the 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 .
[in] | a | - the first coefficient of the function. |
[in] | b | - the second coefficient of the function. |
If | the 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.
[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. |
If | the mesh is not set. |
If | func returns false . |
If | the spatial discretization of this field is NULL. |
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
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | computing 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
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | computing 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
[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. |
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | computing 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.
[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. |
If | func returns false . |
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=().
[in] | nbOfComp | - the number of components for this field to have. |
[in] | val | - the value to assign to every atomic value of this field. |
If | the spatial discretization of this field is NULL. |
If | the 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
[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. |
If | computing 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
[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. |
If | computing 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
[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. |
If | computing 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
[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. |
If | computing 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.
If | the 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.
If | the mesh is not set. |
If | the spatial discretization of this field is NULL. |
If | the spatial discretization is not fully defined. |
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.
If | the data array is not set. |
References MEDCoupling::MEDCouplingFieldT< double >::getArray().
|
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().
|
virtual |
Reimplemented from MEDCoupling::MEDCouplingField.
References MEDCoupling::MEDCouplingField::getHeapMemorySizeWithoutChildren().
|
virtual |
Reimplemented from MEDCoupling::MEDCouplingField.
References MEDCoupling::MEDCouplingField::getDirectChildrenWithNull().
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.
tinyInfo | out 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.
tinyInfo | out 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.
[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.
[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.
[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. |
If | number 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...
tinyInfoI | is the value retrieves from distant result of getTinySerializationIntInformation on source instance to be copied. |
dataInt | out 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. |
arrays | out 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. |
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.
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.
[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. |
If | the mesh is not set. |
If | other == NULL. |
If | any of the meshes is not well defined. |
If | the two meshes do not match. |
If | field 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".
[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. |
If | f == NULL. |
If | any of the meshes is not set or is not well defined. |
If | the two meshes do not match. |
If | the two fields are not coherent for merge. |
If | field values at merged nodes (if any) deffer more than eps. |
Here is a C++ example.
Here is a Python example.
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.
[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. |
true
if some nodes have been merged and hence this field lies on another mesh. If | the mesh is of type not inheriting from MEDCouplingPointSet. |
If | the mesh is not well defined. |
If | the spatial discretization of this field is NULL. |
If | the data array is not set. |
If | field 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.
[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. |
true
if some nodes have been merged and hence this field lies on another mesh. If | the mesh is of type not inheriting from MEDCouplingPointSet. |
If | the mesh is not well defined. |
If | the spatial discretization of this field is NULL. |
If | the data array is not set. |
If | field 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.
[in] | epsOnVals | - a precision used to compare field values at merged nodes. If the values differ more than epsOnVals, an exception is thrown. |
true
if some nodes have been removed and hence this field lies on another mesh. If | the mesh is of type not inheriting from MEDCouplingPointSet. |
If | the mesh is not well defined. |
If | the spatial discretization of this field is NULL. |
If | the data array is not set. |
If | field 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.
[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. |
true
if some cells have been removed and hence this field lies on another mesh. If | the mesh is not an instance of MEDCouplingUMesh. |
If | the mesh is not well defined. |
If | the spatial discretization of this field is NULL. |
If | the data array is not set. |
If | field 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 |
This method calls MEDCouplingUMesh::buildSlice3D method. So this method makes the assumption that underlying mesh exists. For the moment, this method is implemented for fields on cells.
References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::MEDCouplingMesh::buildUnstructured(), clone(), MEDCoupling::MEDCouplingField::computeTupleIdsToSelectFromCellIds(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::getArrays(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingField::getTypeOfField(), MEDCoupling::ON_CELLS, and MEDCoupling::MCAuto< T >::retn().
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.
[in] | policy | - specifies a pattern used for splitting. For its description, see MEDCouplingUMesh::simplexize(). |
true
if some cells have been divided and hence this field lies on another mesh. If | policy has an invalid value. For valid values, see the description of MEDCouplingUMesh::simplexize(). |
If | MEDCouplingMesh::simplexize() is not applicable to the underlying mesh. |
If | the mesh is not well defined. |
If | the spatial discretization of this field is NULL. |
If | the 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().
MCAuto< MEDCouplingFieldDouble > MEDCouplingFieldDouble::convertQuadraticCellsToLinear | ( | ) | const |
References MEDCoupling::DataArrayInt::Aggregate(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::MEDCouplingMesh::buildUnstructured(), MEDCoupling::MEDCouplingFieldT< double >::checkConsistencyLight(), MEDCoupling::MEDCouplingUMesh::checkConsistencyLight(), MEDCoupling::MEDCouplingUMesh::clone(), MEDCoupling::MEDCouplingUMesh::convertQuadraticCellsToLinear(), MEDCoupling::MEDCouplingFieldT< T >::copyAllTinyAttrFrom(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingFieldT< double >::getArray(), MEDCoupling::MEDCouplingField::getDiscretization(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::getGaussLocalization(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::getGaussLocalizationIdOfOneType(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingField::getTypeOfField(), MEDCoupling::MEDCouplingUMesh::MergeUMeshesOnSameCoords(), New(), MEDCoupling::ON_CELLS, MEDCoupling::ON_GAUSS_PT, MEDCoupling::ON_NODES, MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), MEDCoupling::VecAutoToVecOfCstPt(), MEDCoupling::MEDCouplingPointSet::zipCoords(), and MEDCoupling::MEDCouplingUMesh::zipCoordsTraducer().
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.
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.
If | this->getNumberOfComponents() != 6. |
If | the 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.
If | this->getNumberOfComponents() is not in [4,6,9]. |
If | the 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.
If | this->getNumberOfComponents() != 6. |
If | the 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.
If | this->getNumberOfComponents() != 6. |
If | the 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.
If | this->getNumberOfComponents() is not in [4,6,9]. |
If | the 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.
If | this->getNumberOfComponents() is not in [4,6,9]. |
If | the 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.
If | this->getNumberOfComponents() != 6. |
If | the 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.
If | the 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.
If | the 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.
[in] | newNbOfComp | - number of components for the new field to have. |
[in] | dftValue | - value assigned to new values added to this field. |
If | this 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().
[in] | compoIds | - sequence of zero based indices of components to include into the new field. |
If | a 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.
[in] | f | - the field to copy data from. |
[in] | compoIds | - sequence of zero based indices of components, data of which is to be copied. |
If | the two fields have different number of data arrays. |
If | a data array is set in one of fields and is not set in the other. |
If | compoIds.size() != a->getNumberOfComponents(). |
If | compoIds[i] < 0 or compoIds[i] > this->getNumberOfComponents(). |
References MEDCoupling::MEDCouplingTimeDiscretization::setSelectedComponents().
void MEDCouplingFieldDouble::sortPerTuple | ( | bool | asc | ) |
Sorts value within every tuple of this field.
[in] | asc | - if true, the values are sorted in ascending order, else, in descending order. |
If | a data array is not allocated. |
References MEDCoupling::MEDCouplingTimeDiscretization::sortPerTuple().
|
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.
[in] | f1 | - the first field. |
[in] | f2 | - the second field. |
If | the fields are not compatible for the merge. |
If | the spatial discretization of f1 is NULL. |
If | the 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().
|
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.
[in] | a | - a vector of fields (MEDCouplingFieldDouble) to concatenate. |
If | a is empty. |
If | the 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().
|
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.
[in] | f1 | - a field to include in the result field. |
[in] | f2 | - another field to include in the result field. |
If | the fields are not compatible for a meld (areCompatibleForMeld()). |
If | any of data arrays is not allocated. |
If | f1->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().
|
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 ( ). Number of tuples and components in the given fields must be the same.
[in] | f1 | - a given field. |
[in] | f2 | - another given field. |
If | either f1 or f2 is NULL. |
If | the 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().
|
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.
[in] | f1 | - a given field. |
[in] | f2 | - another given field. |
If | either f1 or f2 is NULL. |
If | f1->getNumberOfComponents() != 3 |
If | f2->getNumberOfComponents() != 3 |
If | the 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().
|
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.
[in] | f1 | - a field to compare values with another one. |
[in] | f2 | - another field to compare values with the first one. |
If | either f1 or f2 is NULL. |
If | the 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().
|
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.
[in] | f1 | - a field to compare values with another one. |
[in] | f2 | - another field to compare values with the first one. |
If | either f1 or f2 is NULL. |
If | the 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.
If | the spatial discretization of this field is NULL. |
If | a 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.
[in] | other | - the field to add to this one. |
If | other is NULL. |
If | the fields are not strictly compatible (areStrictlyCompatible()), i.e. they differ not only in values. |
References MEDCoupling::MEDCouplingTimeDiscretization::addEqual(), and MEDCoupling::MEDCouplingFieldT< double >::areStrictlyCompatible().
|
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.
[in] | f1 | - a field to sum up. |
[in] | f2 | - another field to sum up. |
If | either f1 or f2 is NULL. |
If | the 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.
[in] | other | - the field to subtract from this one. |
If | other is NULL. |
If | the 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().
|
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.
[in] | f1 | - a field to subtract from. |
[in] | f2 | - a field to subtract. |
If | either f1 or f2 is NULL. |
If | the 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.
The two fields must have same number of tuples and same underlying mesh.
[in] | other | - an field to multiply to this one. |
If | other is NULL. |
If | the 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.
|
static |
Returns a new MEDCouplingFieldDouble containing product values of two given fields. There are 2 valid cases.
The two fields must have same number of tuples and same underlying mesh.
[in] | f1 | - a factor field. |
[in] | f2 | - another factor field. |
If | either f1 or f2 is NULL. |
If | the 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.
[in] | other | - an field to divide this one by. |
If | other is NULL. |
If | the 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.
|
static |
Returns a new MEDCouplingFieldDouble containing division of two given fields. There are 2 valid cases.
[in] | f1 | - a numerator field. |
[in] | f2 | - a denominator field. |
If | either f1 or f2 is NULL. |
If | the 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.
References PowFields().
const MEDCouplingFieldDouble & MEDCouplingFieldDouble::operator^= | ( | const MEDCouplingFieldDouble & | other | ) |
|
static |
Directly called by MEDCouplingFieldDouble::operator^.
References MEDCoupling::MEDCouplingField::_type, MEDCoupling::MEDCouplingFieldT< T >::areCompatibleForMul(), MEDCoupling::MEDCouplingTimeDiscretizationTemplate< T >::copyTinyAttrFrom(), MEDCoupling::MEDCouplingField::getMesh(), MEDCoupling::NoNature, MEDCoupling::MEDCouplingTimeDiscretization::pow(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingField::setMesh().
Referenced by operator^().
|
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.
[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) |
If | fs[ 0 ] == NULL. |
If | the fields lie not on the same mesh. |
If | the mesh is not set. |
If | any 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 | ( | ) |