Version: 9.12.0
MEDCoupling::DataArray Class Referenceabstract
Inheritance diagram for MEDCoupling::DataArray:
Collaboration diagram for MEDCoupling::DataArray:

Public Member Functions

virtual void alloc (std::size_t nbOfTuple, std::size_t nbOfCompo=1)=0
 
bool areInfoEquals (const DataArray &other) const
 
bool areInfoEqualsIfNotWhy (const DataArray &other, std::string &reason) const
 
virtual DataArraybuildNewEmptyInstance () const =0
 
virtual void checkAllocated () const =0
 
void checkNbOfComps (std::size_t nbOfCompo, const std::string &msg) const
 
void checkNbOfElems (mcIdType nbOfElems, const std::string &msg) const
 
void checkNbOfTuples (mcIdType nbOfTuples, const std::string &msg) const
 
void checkNbOfTuplesAndComp (const DataArray &other, const std::string &msg) const
 
void checkNbOfTuplesAndComp (mcIdType nbOfTuples, std::size_t nbOfCompo, const std::string &msg) const
 
virtual void circularPermutation (mcIdType nbOfShift=1)=0
 
virtual void circularPermutationPerTuple (mcIdType nbOfShift=1)=0
 
void copyPartOfStringInfoFrom (const DataArray &other, const std::vector< std::size_t > &compoIds)
 
void copyPartOfStringInfoFrom2 (const std::vector< std::size_t > &compoIds, const DataArray &other)
 
virtual DataArraycopySorted (bool asc=true) const =0
 
void copyStringInfoFrom (const DataArray &other)
 
std::string cppRepr (const std::string &varName) const
 
virtual DataArraydeepCopy () const =0
 
virtual void desallocate ()=0
 
std::vector< const BigMemoryObject * > getDirectChildrenWithNull () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
std::string getInfoOnComponent (std::size_t i) const
 
std::vector< std::string > & getInfoOnComponents ()
 
const std::vector< std::string > & getInfoOnComponents () const
 
std::string getName () const
 
virtual std::size_t getNbOfElemAllocated () const =0
 
virtual mcIdType getNbOfElems () const =0
 
std::size_t getNumberOfComponents () const
 
virtual mcIdType getNumberOfTuples () const =0
 
std::string getUnitOnComponent (std::size_t i) const
 
std::vector< std::string > getUnitsOnComponent () const
 
std::string getVarOnComponent (std::size_t i) const
 
std::vector< std::string > getVarsOnComponent () const
 
virtual void * getVoidStarPointer ()=0
 
virtual bool isAllocated () const =0
 
virtual DataArraykeepSelectedComponents (const std::vector< std::size_t > &compoIds) const =0
 
virtual void reAlloc (std::size_t newNbOfTuple)=0
 
virtual void rearrange (std::size_t newNbOfCompo)=0
 
virtual void renumberInPlace (const mcIdType *old2New)=0
 
virtual void renumberInPlaceR (const mcIdType *new2Old)=0
 
virtual void reprCppStream (const std::string &varName, std::ostream &stream) const =0
 
virtual void reprQuickOverview (std::ostream &stream) const =0
 
virtual void reprQuickOverviewData (std::ostream &stream, std::size_t maxNbOfByteInRepr) const =0
 
virtual void reprStream (std::ostream &stream) const =0
 
virtual void reprWithoutNameStream (std::ostream &stream) const
 
virtual void reprZipStream (std::ostream &stream) const =0
 
virtual void reprZipWithoutNameStream (std::ostream &stream) const =0
 
virtual void reversePerTuple ()=0
 
virtual DataArrayselectByTupleId (const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const =0
 
virtual DataArrayselectByTupleIdSafe (const mcIdType *new2OldBg, const mcIdType *new2OldEnd) const =0
 
virtual DataArrayselectByTupleIdSafeSlice (mcIdType bg, mcIdType end2, mcIdType step) const =0
 
virtual DataArrayselectByTupleRanges (const std::vector< std::pair< mcIdType, mcIdType > > &ranges) const =0
 
virtual void setContigPartOfSelectedValues (mcIdType tupleIdStart, const DataArray *aBase, const DataArrayIdType *tuplesSelec)=0
 
virtual void setContigPartOfSelectedValuesSlice (mcIdType tupleIdStart, const DataArray *aBase, mcIdType bg, mcIdType end2, mcIdType step)=0
 
void setInfoAndChangeNbOfCompo (const std::vector< std::string > &info)
 
void setInfoOnComponent (std::size_t i, const std::string &info)
 
void setInfoOnComponents (const std::vector< std::string > &info)
 
void setName (const std::string &name)
 
void setPartOfValuesBase3 (const DataArray *aBase, const mcIdType *bgTuples, const mcIdType *endTuples, mcIdType bgComp, mcIdType endComp, mcIdType stepComp, bool strictCompoCompare=true)
 
- Public Member Functions inherited from MEDCoupling::RefCountObjectOnly
bool decrRef () const
 
int getRCValue () const
 
void incrRef () const
 
RefCountObjectOnlyoperator= (const RefCountObjectOnly &other)
 
- Public Member Functions inherited from MEDCoupling::BigMemoryObject
std::string debugHeapMemorySize () const
 
std::vector< const BigMemoryObject * > getAllTheProgeny () const
 
virtual std::string getClassName () const
 
std::vector< const BigMemoryObject * > getDirectChildren () const
 
std::size_t getHeapMemorySize () const
 
std::string getHeapMemorySizeStr () const
 
bool isObjectInTheProgeny (const BigMemoryObject *obj) const
 
virtual ~BigMemoryObject ()
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 
 TimeLabel (const TimeLabel &other)=default
 
virtual void updateTime () const =0
 

Static Public Member Functions

static DataArrayAggregate (const std::vector< const DataArray * > &arrs)
 
static std::string BuildInfoFromVarAndUnit (const std::string &var, const std::string &unit)
 
static std::string GetAxisTypeRepr (MEDCouplingAxisType at)
 
static mcIdType GetNumberOfItemGivenBES (mcIdType begin, mcIdType end, mcIdType step, const std::string &msg)
 
static mcIdType GetNumberOfItemGivenBESRelative (mcIdType begin, mcIdType end, mcIdType step, const std::string &msg)
 
static mcIdType GetPosOfItemGivenBESRelativeNoThrow (mcIdType value, mcIdType begin, mcIdType end, mcIdType step)
 
static void GetSlice (mcIdType start, mcIdType stop, mcIdType step, mcIdType sliceId, mcIdType nbOfSlices, mcIdType &startSlice, mcIdType &stopSlice)
 
static std::string GetUnitFromInfo (const std::string &info)
 
static std::string GetVarNameFromInfo (const std::string &info)
 
static std::vector< std::string > SplitStringInChuncks (const std::string st, std::size_t sz)
 
- Static Public Member Functions inherited from MEDCoupling::BigMemoryObject
static std::size_t GetHeapMemorySizeOfObjs (const std::vector< const BigMemoryObject * > &objs)
 

Protected Member Functions

 DataArray ()
 
 ~DataArray ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObjectOnly
 RefCountObjectOnly ()
 
 RefCountObjectOnly (const RefCountObjectOnly &other)
 
virtual ~RefCountObjectOnly ()
 
- Protected Member Functions inherited from MEDCoupling::TimeLabel
void forceTimeOfThis (const TimeLabel &other) const
 
 TimeLabel ()
 
void updateTimeWith (const TimeLabel &other) const
 
virtual ~TimeLabel ()
 

Static Protected Member Functions

static void CheckClosingParInRange (mcIdType ref, mcIdType value, const std::string &msg)
 
static void CheckValueInRange (mcIdType ref, mcIdType value, const std::string &msg)
 
static void CheckValueInRangeEx (mcIdType value, mcIdType start, mcIdType end, const std::string &msg)
 
static mcIdType EffectiveCircPerm (mcIdType nbOfShift, mcIdType nbOfTuples)
 

Protected Attributes

std::vector< std::string > _info_on_compo
 
std::string _name
 

Constructor & Destructor Documentation

◆ DataArray()

MEDCoupling::DataArray::DataArray ( )
protected

◆ ~DataArray()

MEDCoupling::DataArray::~DataArray ( )
protected

Member Function Documentation

◆ getHeapMemorySizeWithoutChildren()

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

◆ getDirectChildrenWithNull()

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

◆ setName()

void DataArray::setName ( const std::string &  name)

Sets the attribute _name of this array. See DataArrays infos for more information.

Parameters
[in]name- new array name

References _name.

Referenced by MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::finishUnserialization(), and MEDCoupling::MEDCouplingPointSet::unserialization().

◆ copyStringInfoFrom()

void DataArray::copyStringInfoFrom ( const DataArray other)

Copies textual data from an other DataArray. The copied data are

  • the name attribute,
  • the information of components.

For more information on these data see DataArrays infos.

Parameters
[in]other- another instance of DataArray to copy the textual data from.
Exceptions
Ifnumber of components of this array differs from that of the other.

References _info_on_compo, and _name.

Referenced by MEDCoupling::MEDCouplingCMesh::copyTinyStringsFrom(), MEDCoupling::MEDCouplingPointSet::copyTinyStringsFrom(), MEDCoupling::MEDCouplingTwoTimeSteps::copyTinyStringsFrom(), MEDCoupling::DataArrayDouble::CrossProduct(), and MEDCoupling::MEDCouplingPointSet::renumberNodesCenter().

◆ copyPartOfStringInfoFrom()

void DataArray::copyPartOfStringInfoFrom ( const DataArray other,
const std::vector< std::size_t > &  compoIds 
)

◆ copyPartOfStringInfoFrom2()

void DataArray::copyPartOfStringInfoFrom2 ( const std::vector< std::size_t > &  compoIds,
const DataArray other 
)

◆ areInfoEqualsIfNotWhy()

bool DataArray::areInfoEqualsIfNotWhy ( const DataArray other,
std::string &  reason 
) const

◆ areInfoEquals()

bool DataArray::areInfoEquals ( const DataArray other) const

Compares textual information of this DataArray with that of an other one. The compared data are

  • the name attribute,
  • the information of components.

For more information on these data see DataArrays infos.

Parameters
[in]other- another instance of DataArray to compare the textual data of.
Returns
bool - true if the textual information is same, false else.

References areInfoEqualsIfNotWhy().

◆ cppRepr()

std::string DataArray::cppRepr ( const std::string &  varName) const

References reprCppStream().

◆ getName()

◆ getInfoOnComponents() [1/2]

◆ getInfoOnComponents() [2/2]

std::vector<std::string>& MEDCoupling::DataArray::getInfoOnComponents ( )

◆ setInfoOnComponents()

void DataArray::setInfoOnComponents ( const std::vector< std::string > &  info)

Sets information on all components. To know more on format of this information see DataArrays infos.

Parameters
[in]info- a vector of strings.
Exceptions
Ifsize of info differs from the number of components of this.

References _info_on_compo, and getNumberOfComponents().

Referenced by MEDCoupling::DataArrayDouble::applyFuncOnThis(), and MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::setInfo().

◆ setInfoAndChangeNbOfCompo()

void DataArray::setInfoAndChangeNbOfCompo ( const std::vector< std::string > &  info)

Sets information on all components. This method can change number of components at certain conditions; if the conditions are not respected, an exception is thrown. The number of components can be changed in this only if this is not allocated. The condition of number of components must not be changed.

To know more on format of the component information see DataArrays infos.

Parameters
[in]info- a vector of component infos.
Exceptions
Ifthis->getNumberOfComponents() != info.size() && this->isAllocated()

References _info_on_compo, getNumberOfComponents(), and isAllocated().

Referenced by MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::copyTinyInfoFrom(), MEDCoupling::MEDFileField1TSWithoutSDA::MEDFileField1TSWithoutSDA(), MEDCoupling::MEDFileFloatField1TSWithoutSDA::MEDFileFloatField1TSWithoutSDA(), MEDCoupling::MEDFileInt32Field1TSWithoutSDA::MEDFileInt32Field1TSWithoutSDA(), and MEDCoupling::MEDFileInt64Field1TSWithoutSDA::MEDFileInt64Field1TSWithoutSDA().

◆ getVarsOnComponent()

std::vector< std::string > DataArray::getVarsOnComponent ( ) const

◆ getUnitsOnComponent()

std::vector< std::string > DataArray::getUnitsOnComponent ( ) const

◆ getInfoOnComponent()

std::string DataArray::getInfoOnComponent ( std::size_t  i) const

◆ getVarOnComponent()

std::string DataArray::getVarOnComponent ( std::size_t  i) const

Returns the var part of the full information of the i-th component. For example, if getInfoOnComponent(0) returns "SIGXY [N/m^2]", then getVarOnComponent(0) returns "SIGXY". If a unit part of information is not detected by presence of two square brackets, then the full information is returned. To read more about the component information format, see DataArrays infos.

Parameters
[in]i- the index (zero based) of the component of interest.
Returns
std::string - a string containing the var information, or the full info.
Exceptions
Ifi is not a valid component index.

References _info_on_compo, and GetVarNameFromInfo().

Referenced by getVarsOnComponent().

◆ getUnitOnComponent()

std::string DataArray::getUnitOnComponent ( std::size_t  i) const

Returns the unit part of the full information of the i-th component. For example, if getInfoOnComponent(0) returns "SIGXY [ N/m^2]", then getUnitOnComponent(0) returns " N/m^2". If a unit part of information is not detected by presence of two square brackets, then an empty string is returned. To read more about the component information format, see DataArrays infos.

Parameters
[in]i- the index (zero based) of the component of interest.
Returns
std::string - a string containing the unit information, if any, or "".
Exceptions
Ifi is not a valid component index.

References _info_on_compo, and GetUnitFromInfo().

Referenced by getUnitsOnComponent().

◆ setInfoOnComponent()

void DataArray::setInfoOnComponent ( std::size_t  i,
const std::string &  info 
)

Sets information on a component specified by an index. To know more on format of this information see DataArrays infos.

Warning
Don't pass NULL as info!
Parameters
[in]i- the index (zero based) of the component of interest.
[in]info- the string containing the information.
Exceptions
Ifi is not a valid component index.

References _info_on_compo.

Referenced by MEDCoupling::MEDCouplingCMesh::computeCellCenterOfMass(), copyPartOfStringInfoFrom(), copyPartOfStringInfoFrom2(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::finishUnserialization(), MEDCoupling::DataArrayDouble::fromCylToCart(), and MEDCoupling::MEDCouplingPointSet::unserialization().

◆ getNumberOfComponents()

std::size_t MEDCoupling::DataArray::getNumberOfComponents ( ) const

Referenced by MEDCoupling::DataArrayDouble::accumulate(), MEDCoupling::DataArrayDouble::accumulatePerChunck(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::allocNotFromFile(), MEDCoupling::DataArrayDouble::applyFunc(), MEDCoupling::DataArrayDouble::applyFuncFast32(), MEDCoupling::DataArrayDouble::applyFuncFast64(), MEDCoupling::DataArrayDouble::applyFuncNamedCompo(), MEDCoupling::DataArrayDouble::applyFuncOnThis(), MEDCoupling::DataArrayDouble::applyInv(), MEDCoupling::MEDCouplingLinearTime::areCompatible(), MEDCoupling::DataArrayDouble::areIncludedInMe(), MEDCoupling::MEDCouplingLinearTime::areStrictlyCompatibleForDiv(), MEDCoupling::DataArrayDouble::asArcOfCircle(), MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrix(), MEDCoupling::DataArrayDouble::buildEuclidianDistanceDenseMatrixWith(), MEDCoupling::DataArrayDouble::cartesianize(), MEDCoupling::MEDCouplingCMesh::checkConsistencyLight(), MEDCoupling::MEDCouplingCurveLinearMesh::checkConsistencyLight(), MEDCoupling::MEDCouplingTwoTimeSteps::checkConsistencyLight(), checkNbOfComps(), checkNbOfTuplesAndComp(), MEDCoupling::DataArrayDouble::computeBBoxPerTuple(), MEDCoupling::DataArrayDouble::computeNbOfInteractionsWith(), MEDCoupling::DataArrayDouble::computeTupleIdsNearTuples(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarseGhost(), MEDCoupling::DataArrayInt64::convertToInt32Arr(), MEDCoupling::DataArrayInt32::convertToInt64Arr(), copyPartOfStringInfoFrom(), copyPartOfStringInfoFrom2(), MEDCoupling::DataArrayDouble::count(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch(), MEDCoupling::DataArrayDouble::CrossProduct(), MEDCoupling::DataArrayDouble::determinant(), MEDCoupling::DataArrayDouble::deviator(), MEDCoupling::MEDCouplingUMesh::distanceToPoints(), MEDCoupling::DataArrayDouble::distanceToTuple(), MEDCoupling::DataArrayDouble::Dot(), MEDCoupling::DataArrayDouble::doublyContractedProduct(), MEDCoupling::DataArrayDouble::eigenValues(), MEDCoupling::DataArrayDouble::eigenVectors(), MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(), MEDCoupling::DataArrayDouble::findClosestTupleId(), MEDCoupling::DataArrayDouble::findCommonTuples(), MEDCoupling::DataArrayDouble::findIdsInRange(), MEDCoupling::DataArrayDouble::findIdsNotInRange(), MEDCoupling::DataArrayDouble::finishUnserialization(), MEDCoupling::DataArrayDouble::fromCartToCyl(), MEDCoupling::DataArrayDouble::fromCartToCylGiven(), MEDCoupling::DataArrayDouble::fromCartToPolar(), MEDCoupling::DataArrayDouble::fromCartToSpher(), MEDCoupling::DataArrayDouble::fromCylToCart(), MEDCoupling::DataArrayDouble::fromPolarToCart(), MEDCoupling::DataArrayDouble::fromSpherToCart(), MEDCoupling::DataArrayDouble::getAverageValue(), MEDCoupling::MEDCouplingCurveLinearMesh::getCoordinatesOfNode(), MEDCoupling::DataArrayDouble::getMinMaxPerComponent(), MEDCoupling::MEDCouplingCMesh::getNodeGridStructure(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::MEDCouplingCurveLinearMesh::getSpaceDimension(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDFileUMesh::getSpaceDimension(), MEDCoupling::DataArrayDouble::getTinySerializationIntInformation(), MEDCoupling::MEDCouplingTwoTimeSteps::getTinySerializationIntInformation(), MEDCoupling::DataArrayDouble::getTinySerializationStrInformation(), MEDCoupling::MEDCouplingFieldDiscretizationP1::getValueInCell(), MEDCoupling::MEDCouplingFieldDiscretizationP0::getValueOnMulti(), MEDCoupling::MEDCouplingFieldDiscretizationP1::getValueOnMulti(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::getValueOnMulti(), MEDCoupling::MEDCouplingFieldDiscretization::integral(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::integral(), MEDCoupling::DataArrayDouble::inverse(), MEDCoupling::DataArrayDouble::isMonotonic(), MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell(), MEDCoupling::DataArrayDouble::magnitude(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::makeReduction(), MEDCoupling::DataArrayDouble::Max(), MEDCoupling::DataArrayDouble::maxPerTupleWithCompoId(), MEDCoupling::MEDCoupling1DGTUMesh::Merge1DGTUMeshes(), MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes(), MEDCoupling::MEDCouplingUMesh::MergeUMeshes(), MEDCoupling::DataArrayDouble::Min(), MEDCoupling::DataArrayDouble::minimalDistanceTo(), MEDCoupling::MEDCouplingStructuredMesh::MultiplyPartOf(), MEDCoupling::MEDCouplingFieldDiscretization::normL1(), MEDCoupling::MEDCouplingFieldDiscretization::normL2(), MEDCoupling::DataArrayDouble::normMaxPerComponent(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::performDrift(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftOfVec(), MEDCoupling::MEDCouplingFieldDiscretizationKriging::PerformDriftRect(), MEDCoupling::DataArrayDouble::Pow(), MEDCoupling::DataArrayDouble::powEqual(), MEDCoupling::DataArrayDouble::recenterForMaxPrecision(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromN2OArr(), MEDCoupling::MEDCouplingFieldDiscretization::RenumberEntitiesFromO2NArr(), MEDCoupling::DataArrayDouble::reprCppStream(), MEDCoupling::MEDCoupling1SGTUMesh::reprQuickOverview(), MEDCoupling::MEDCoupling1DGTUMesh::reprQuickOverview(), MEDCoupling::MEDCouplingCMesh::reprQuickOverview(), MEDCoupling::MEDCouplingCurveLinearMesh::reprQuickOverview(), MEDCoupling::MEDCouplingUMesh::reprQuickOverview(), reprWithoutNameStream(), MEDCoupling::MEDCouplingCurveLinearMesh::scale(), setInfoAndChangeNbOfCompo(), setInfoOnComponents(), MEDCoupling::DataArrayDouble::setSelectedComponents(), MEDCoupling::DataArrayDouble::sortPerTuple(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::splitComponents(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhost(), MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhostZone(), MEDCoupling::DataArrayDouble::symmetry3DPlane(), MEDCoupling::DataArrayDouble::toVectorOfBool(), MEDCoupling::DataArrayDouble::trace(), MEDCoupling::MEDFileStructuredMesh::writeStructuredLL(), and MEDCoupling::DataArrayDouble::writeVTK().

◆ setPartOfValuesBase3()

void DataArray::setPartOfValuesBase3 ( const DataArray aBase,
const mcIdType *  bgTuples,
const mcIdType *  endTuples,
mcIdType  bgComp,
mcIdType  endComp,
mcIdType  stepComp,
bool  strictCompoCompare = true 
)

This method is only a dispatcher towards DataArrayDouble::setPartOfValues3, DataArrayInt::setPartOfValues3, DataArrayChar::setPartOfValues3 depending on the true type of this and aBase.

Exceptions
IfaBase and this do not have the same type.
See also
DataArrayDouble::setPartOfValues3, DataArrayInt::setPartOfValues3, DataArrayChar::setPartOfValues3.

References MEDCoupling::DataArrayTemplate< T >::setPartOfValues3().

◆ getVoidStarPointer()

virtual void* MEDCoupling::DataArray::getVoidStarPointer ( )
pure virtual

◆ deepCopy()

◆ copySorted()

virtual DataArray* MEDCoupling::DataArray::copySorted ( bool  asc = true) const
pure virtual

◆ buildNewEmptyInstance()

◆ isAllocated()

◆ checkAllocated()

virtual void MEDCoupling::DataArray::checkAllocated ( ) const
pure virtual

◆ desallocate()

virtual void MEDCoupling::DataArray::desallocate ( )
pure virtual

◆ getNumberOfTuples()

◆ getNbOfElems()

virtual mcIdType MEDCoupling::DataArray::getNbOfElems ( ) const
pure virtual

◆ getNbOfElemAllocated()

virtual std::size_t MEDCoupling::DataArray::getNbOfElemAllocated ( ) const
pure virtual

◆ alloc()

virtual void MEDCoupling::DataArray::alloc ( std::size_t  nbOfTuple,
std::size_t  nbOfCompo = 1 
)
pure virtual

◆ reAlloc()

virtual void MEDCoupling::DataArray::reAlloc ( std::size_t  newNbOfTuple)
pure virtual

◆ renumberInPlace()

virtual void MEDCoupling::DataArray::renumberInPlace ( const mcIdType *  old2New)
pure virtual

◆ renumberInPlaceR()

virtual void MEDCoupling::DataArray::renumberInPlaceR ( const mcIdType *  new2Old)
pure virtual

◆ setContigPartOfSelectedValues()

virtual void MEDCoupling::DataArray::setContigPartOfSelectedValues ( mcIdType  tupleIdStart,
const DataArray aBase,
const DataArrayIdType *  tuplesSelec 
)
pure virtual

◆ setContigPartOfSelectedValuesSlice()

virtual void MEDCoupling::DataArray::setContigPartOfSelectedValuesSlice ( mcIdType  tupleIdStart,
const DataArray aBase,
mcIdType  bg,
mcIdType  end2,
mcIdType  step 
)
pure virtual

◆ selectByTupleRanges()

virtual DataArray* MEDCoupling::DataArray::selectByTupleRanges ( const std::vector< std::pair< mcIdType, mcIdType > > &  ranges) const
pure virtual

◆ keepSelectedComponents()

virtual DataArray* MEDCoupling::DataArray::keepSelectedComponents ( const std::vector< std::size_t > &  compoIds) const
pure virtual

◆ selectByTupleId()

virtual DataArray* MEDCoupling::DataArray::selectByTupleId ( const mcIdType *  new2OldBg,
const mcIdType *  new2OldEnd 
) const
pure virtual

◆ selectByTupleIdSafe()

virtual DataArray* MEDCoupling::DataArray::selectByTupleIdSafe ( const mcIdType *  new2OldBg,
const mcIdType *  new2OldEnd 
) const
pure virtual

◆ selectByTupleIdSafeSlice()

virtual DataArray* MEDCoupling::DataArray::selectByTupleIdSafeSlice ( mcIdType  bg,
mcIdType  end2,
mcIdType  step 
) const
pure virtual

◆ rearrange()

virtual void MEDCoupling::DataArray::rearrange ( std::size_t  newNbOfCompo)
pure virtual

◆ circularPermutation()

virtual void MEDCoupling::DataArray::circularPermutation ( mcIdType  nbOfShift = 1)
pure virtual

◆ circularPermutationPerTuple()

virtual void MEDCoupling::DataArray::circularPermutationPerTuple ( mcIdType  nbOfShift = 1)
pure virtual

◆ reversePerTuple()

virtual void MEDCoupling::DataArray::reversePerTuple ( )
pure virtual

◆ checkNbOfTuples()

void DataArray::checkNbOfTuples ( mcIdType  nbOfTuples,
const std::string &  msg 
) const

References getNumberOfTuples().

Referenced by checkNbOfTuplesAndComp().

◆ checkNbOfComps()

void DataArray::checkNbOfComps ( std::size_t  nbOfCompo,
const std::string &  msg 
) const

◆ checkNbOfTuplesAndComp() [1/2]

void DataArray::checkNbOfTuplesAndComp ( const DataArray other,
const std::string &  msg 
) const

◆ checkNbOfTuplesAndComp() [2/2]

void DataArray::checkNbOfTuplesAndComp ( mcIdType  nbOfTuples,
std::size_t  nbOfCompo,
const std::string &  msg 
) const

◆ checkNbOfElems()

void DataArray::checkNbOfElems ( mcIdType  nbOfElems,
const std::string &  msg 
) const

References getNbOfElems().

◆ GetSlice()

void DataArray::GetSlice ( mcIdType  start,
mcIdType  stop,
mcIdType  step,
mcIdType  sliceId,
mcIdType  nbOfSlices,
mcIdType &  startSlice,
mcIdType &  stopSlice 
)
static

This method is useful to slice work among a pool of threads or processes. begin, end step is the input whole slice of work to perform, typically it is a whole slice of tuples of DataArray or cells, nodes of a mesh...

The input sliceId should be an id in [0, nbOfSlices) that specifies the slice of work.

Parameters
[in]start- the start of the input slice of the whole work to perform split into slices.
[in]stop- the stop of the input slice of the whole work to perform split into slices.
[in]step- the step (that can be <0) of the input slice of the whole work to perform split into slices.
[in]sliceId- the slice id considered
[in]nbOfSlices- the number of slices (typically the number of cores on which the work is expected to be sliced)
[out]startSlice- the start of the slice considered
[out]stopSlice- the stop of the slice consided
Exceptions
Ifstep == 0
IfnbOfSlices not > 0
IfsliceId not in [0,nbOfSlices)

References MEDCoupling::DataArrayTools< T >::GetSlice().

Referenced by MEDCoupling::CommInterface::SplitArrayOfLength().

◆ GetNumberOfItemGivenBES()

mcIdType DataArray::GetNumberOfItemGivenBES ( mcIdType  begin,
mcIdType  end,
mcIdType  step,
const std::string &  msg 
)
static

◆ GetNumberOfItemGivenBESRelative()

mcIdType DataArray::GetNumberOfItemGivenBESRelative ( mcIdType  begin,
mcIdType  end,
mcIdType  step,
const std::string &  msg 
)
static

◆ GetPosOfItemGivenBESRelativeNoThrow()

mcIdType DataArray::GetPosOfItemGivenBESRelativeNoThrow ( mcIdType  value,
mcIdType  begin,
mcIdType  end,
mcIdType  step 
)
static

◆ SplitStringInChuncks()

std::vector< std::string > DataArray::SplitStringInChuncks ( const std::string  st,
std::size_t  sz 
)
static

Split st string into chunks of sz characters each. Size of input st must a be a multiple of sz. If not an exception is thrown.

◆ GetVarNameFromInfo()

std::string DataArray::GetVarNameFromInfo ( const std::string &  info)
static

Returns the var part of the full component information. For example, if info == "SIGXY [N/m^2]", then this method returns "SIGXY". If a unit part of information is not detected by presence of two square brackets, then the whole info is returned. To read more about the component information format, see DataArrays infos.

Parameters
[in]info- the full component information.
Returns
std::string - a string containing only var information, or the info.

Referenced by getVarOnComponent().

◆ GetUnitFromInfo()

std::string DataArray::GetUnitFromInfo ( const std::string &  info)
static

Returns the unit part of the full component information. For example, if info == "SIGXY [ N/m^2]", then this method returns " N/m^2". If a unit part of information is not detected by presence of two square brackets, then an empty string is returned. To read more about the component information format, see DataArrays infos.

Parameters
[in]info- the full component information.
Returns
std::string - a string containing only unit information, if any, or "".

Referenced by getUnitOnComponent().

◆ BuildInfoFromVarAndUnit()

std::string DataArray::BuildInfoFromVarAndUnit ( const std::string &  var,
const std::string &  unit 
)
static

This method put in info format the result of the merge of var and unit. The standard format for that is "var [unit]". Inversely you can retrieve the var part or the unit part of info string using resp. GetVarNameFromInfo and GetUnitFromInfo.

◆ GetAxisTypeRepr()

std::string DataArray::GetAxisTypeRepr ( MEDCouplingAxisType  at)
static

◆ Aggregate()

DataArray * DataArray::Aggregate ( const std::vector< const DataArray * > &  arrs)
static

Returns a new DataArray by concatenating all given arrays, so that (1) the number of tuples in the result array is a sum of the number of tuples of given arrays and (2) the number of component in the result array is same as that of each of given arrays. Info on components is copied from the first of the given arrays. Number of components in the given arrays must be the same.

Parameters
[in]arrs- a sequence of arrays to include in the result array. All arrays must have the same type.
Returns
DataArray * - the new instance of DataArray (that can be either DataArrayInt, DataArrayDouble, DataArrayChar). The caller is to delete this result array using decrRef() as it is no more needed.
Exceptions
Ifall arrays within arrs are NULL.
Ifall not null arrays in arrs have not the same type.
IfgetNumberOfComponents() of arrays within arrs.

References MEDCoupling::DataArrayChar::Aggregate(), and MEDCoupling::DataArrayDouble::Aggregate().

◆ reprStream()

virtual void MEDCoupling::DataArray::reprStream ( std::ostream &  stream) const
pure virtual

◆ reprZipStream()

virtual void MEDCoupling::DataArray::reprZipStream ( std::ostream &  stream) const
pure virtual

◆ reprWithoutNameStream()

void DataArray::reprWithoutNameStream ( std::ostream &  stream) const
virtual

◆ reprZipWithoutNameStream()

virtual void MEDCoupling::DataArray::reprZipWithoutNameStream ( std::ostream &  stream) const
pure virtual

◆ reprCppStream()

virtual void MEDCoupling::DataArray::reprCppStream ( const std::string &  varName,
std::ostream &  stream 
) const
pure virtual

◆ reprQuickOverview()

virtual void MEDCoupling::DataArray::reprQuickOverview ( std::ostream &  stream) const
pure virtual

◆ reprQuickOverviewData()

virtual void MEDCoupling::DataArray::reprQuickOverviewData ( std::ostream &  stream,
std::size_t  maxNbOfByteInRepr 
) const
pure virtual

◆ CheckValueInRange()

void DataArray::CheckValueInRange ( mcIdType  ref,
mcIdType  value,
const std::string &  msg 
)
staticprotected

Simply this method checks that value is in [0,ref).

◆ CheckValueInRangeEx()

void DataArray::CheckValueInRangeEx ( mcIdType  value,
mcIdType  start,
mcIdType  end,
const std::string &  msg 
)
staticprotected

This method checks that [start, end) is compliant with ref length value. typically start in [0,value) and end in [0,value). If value==start and start==end, it is supported.

◆ CheckClosingParInRange()

void DataArray::CheckClosingParInRange ( mcIdType  ref,
mcIdType  value,
const std::string &  msg 
)
staticprotected

◆ EffectiveCircPerm()

mcIdType DataArray::EffectiveCircPerm ( mcIdType  nbOfShift,
mcIdType  nbOfTuples 
)
staticprotected

Member Data Documentation

◆ _name

std::string MEDCoupling::DataArray::_name
protected

◆ _info_on_compo