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

Public Member Functions

void addPatch (const std::vector< std::pair< mcIdType, mcIdType > > &bottomLeftTopRight, const std::vector< mcIdType > &factors)
 
MEDCouplingFieldDoublebuildCellFieldOnRecurseWithoutOverlapWithoutGhost (mcIdType ghostSz, const std::vector< const DataArrayDouble * > &recurseArrs) const
 
MEDCoupling1SGTUMeshbuildMeshFromPatchEnvelop () const
 
MEDCoupling1SGTUMeshbuildMeshOfDirectChildrenOnly () const
 
std::string buildPythonDumpOfThis () const
 
MEDCouplingUMeshbuildUnstructured () const
 
DataArrayDoublecreateCellFieldOnPatch (mcIdType patchId, const DataArrayDouble *cellFieldOnThis) const
 
void createPatchesFromCriterion (const INTERP_KERNEL::BoxSplittingOptions &bso, const DataArrayByte *criterion, const std::vector< mcIdType > &factors)
 
void createPatchesFromCriterion (const INTERP_KERNEL::BoxSplittingOptions &bso, const DataArrayDouble *criterion, const std::vector< mcIdType > &factors, double eps)
 
void createPatchesFromCriterion (const INTERP_KERNEL::BoxSplittingOptions &bso, const std::vector< bool > &criterion, const std::vector< mcIdType > &factors)
 
virtual MEDCouplingCartesianAMRMeshGendeepCopy (MEDCouplingCartesianAMRMeshGen *father) const =0
 
virtual void detachFromFather ()=0
 
DataArrayDoubleextractGhostFrom (mcIdType ghostSz, const DataArrayDouble *arr) const
 
void fillCellFieldComingFromPatch (mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const
 
void fillCellFieldComingFromPatchGhost (mcIdType patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, bool isConservative=true) const
 
void fillCellFieldOnPatch (mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const
 
void fillCellFieldOnPatchGhost (mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev, bool isConservative=true) const
 
void fillCellFieldOnPatchGhostAdv (mcIdType patchId, const DataArrayDouble *cellFieldOnThis, mcIdType ghostLev, const std::vector< const DataArrayDouble * > &arrsOnPatches, bool isConservative=true) const
 
void fillCellFieldOnPatchOnlyGhostAdv (mcIdType patchId, mcIdType ghostLev, const std::vector< const DataArrayDouble * > &arrsOnPatches) const
 
void fillCellFieldOnPatchOnlyOnGhostZone (mcIdType patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, mcIdType ghostLev) const
 
void fillCellFieldOnPatchOnlyOnGhostZoneWith (mcIdType ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const
 
DataArrayIdType * findPatchesInTheNeighborhoodOf (mcIdType patchId, mcIdType ghostLev) const
 
virtual mcIdType getAbsoluteLevel () const =0
 
virtual mcIdType getAbsoluteLevelRelativeTo (const MEDCouplingCartesianAMRMeshGen *ref) const =0
 
const std::vector< mcIdType > & getFactors () const
 
virtual const MEDCouplingCartesianAMRMeshGengetFather () const =0
 
virtual const MEDCouplingCartesianAMRMeshGengetGodFather () const =0
 
const MEDCouplingIMeshgetImageMesh () const
 
mcIdType getMaxNumberOfLevelsRelativeToThis () const
 
const MEDCouplingCartesianAMRMeshGengetMeshAtPosition (const std::vector< mcIdType > &pos) const
 
mcIdType getNumberOfCellsAtCurrentLevel () const
 
mcIdType getNumberOfCellsAtCurrentLevelGhost (mcIdType ghostLev) const
 
mcIdType getNumberOfCellsRecursiveWithoutOverlap () const
 
mcIdType getNumberOfCellsRecursiveWithOverlap () const
 
mcIdType getNumberOfPatches () const
 
const MEDCouplingCartesianAMRPatch * getPatch (mcIdType patchId) const
 
const MEDCouplingCartesianAMRPatch * getPatchAtPosition (const std::vector< mcIdType > &pos) const
 
std::vector< const MEDCouplingCartesianAMRPatch * > getPatches () const
 
mcIdType getPatchIdFromChildMesh (const MEDCouplingCartesianAMRMeshGen *mesh) const
 
std::vector< mcIdType > getPatchIdsInTheNeighborhoodOf (mcIdType patchId, mcIdType ghostLev) const
 
std::vector< mcIdType > getPositionRelativeTo (const MEDCouplingCartesianAMRMeshGen *ref) const
 
virtual void getPositionRelativeToInternal (const MEDCouplingCartesianAMRMeshGen *ref, std::vector< mcIdType > &ret) const =0
 
int getSpaceDimension () const
 
bool isPatchInNeighborhoodOf (mcIdType patchId1, mcIdType patchId2, mcIdType ghostLev) const
 
virtual std::vector< std::pair< mcIdType, mcIdType > > positionRelativeToGodFather (std::vector< mcIdType > &st) const =0
 
void removeAllPatches ()
 
void removePatch (mcIdType patchId)
 
virtual std::vector< MEDCouplingCartesianAMRPatchGen * > retrieveGridsAt (mcIdType absoluteLev) const
 
void setFactors (const std::vector< mcIdType > &newFactors)
 
- 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
 

Protected Member Functions

void checkFactorsAndIfNotSetAssign (const std::vector< mcIdType > &factors)
 
void checkPatchId (mcIdType patchId) const
 
void dumpPatchesOf (const std::string &varName, std::ostream &oss) const
 
std::vector< const DataArrayDouble * > extractSubTreeFromGlobalFlatten (const MEDCouplingCartesianAMRMeshGen *head, const std::vector< const DataArrayDouble * > &all) const
 
std::vector< const BigMemoryObject * > getDirectChildrenWithNull () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
 MEDCouplingCartesianAMRMeshGen (const MEDCouplingCartesianAMRMeshGen &other)
 
 MEDCouplingCartesianAMRMeshGen (const std::string &meshName, int spaceDim, const mcIdType *nodeStrctStart, const mcIdType *nodeStrctStop, const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop)
 
 MEDCouplingCartesianAMRMeshGen (MEDCouplingIMesh *mesh)
 
void retrieveGridsAtInternal (mcIdType lev, std::vector< MCAuto< MEDCouplingCartesianAMRPatchGen > > &grids) const
 
void updateTime () const
 
- 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 mcIdType GetGhostLevelInFineRef (mcIdType ghostLev, const std::vector< mcIdType > &factors)
 

Protected Attributes

std::vector< mcIdType > _factors
 
MCAuto< MEDCouplingIMesh_mesh
 
std::vector< MCAuto< MEDCouplingCartesianAMRPatch > > _patches
 

Additional Inherited Members

- Static Public Member Functions inherited from MEDCoupling::BigMemoryObject
static std::size_t GetHeapMemorySizeOfObjs (const std::vector< const BigMemoryObject * > &objs)
 

Detailed Description

This class is the base class dedicated to AMR using Adaptative Hierarchical Overlapped image Grid. This class does NOT inherit from MEDCouplingMesh because this class overlaps image grid structured meshes to perform adaptative mesh refinement. But this class aggregates MEDCouplingMesh instances !

Constructor & Destructor Documentation

◆ MEDCouplingCartesianAMRMeshGen() [1/3]

MEDCouplingCartesianAMRMeshGen::MEDCouplingCartesianAMRMeshGen ( const MEDCouplingCartesianAMRMeshGen other)
protected

◆ MEDCouplingCartesianAMRMeshGen() [2/3]

MEDCouplingCartesianAMRMeshGen::MEDCouplingCartesianAMRMeshGen ( const std::string &  meshName,
int  spaceDim,
const mcIdType *  nodeStrctStart,
const mcIdType *  nodeStrctStop,
const double *  originStart,
const double *  originStop,
const double *  dxyzStart,
const double *  dxyzStop 
)
protected

◆ MEDCouplingCartesianAMRMeshGen() [3/3]

MEDCouplingCartesianAMRMeshGen::MEDCouplingCartesianAMRMeshGen ( MEDCouplingIMesh mesh)
protected

Member Function Documentation

◆ deepCopy()

virtual MEDCouplingCartesianAMRMeshGen* MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy ( MEDCouplingCartesianAMRMeshGen father) const
pure virtual

◆ getSpaceDimension()

int MEDCouplingCartesianAMRMeshGen::getSpaceDimension ( ) const

◆ getFactors()

◆ setFactors()

void MEDCouplingCartesianAMRMeshGen::setFactors ( const std::vector< mcIdType > &  newFactors)

◆ getMaxNumberOfLevelsRelativeToThis()

mcIdType MEDCouplingCartesianAMRMeshGen::getMaxNumberOfLevelsRelativeToThis ( ) const

◆ getNumberOfCellsAtCurrentLevel()

mcIdType MEDCouplingCartesianAMRMeshGen::getNumberOfCellsAtCurrentLevel ( ) const

This method returns the number of cells of this with the help of the MEDCouplingIMesh instance representing this. The patches in this are ignored here.

See also
getNumberOfCellsAtCurrentLevelGhost, getNumberOfCellsRecursiveWithOverlap

References _mesh.

Referenced by createPatchesFromCriterion().

◆ getNumberOfCellsAtCurrentLevelGhost()

mcIdType MEDCouplingCartesianAMRMeshGen::getNumberOfCellsAtCurrentLevelGhost ( mcIdType  ghostLev) const

This method returns the number of cells of this with the help of the MEDCouplingIMesh instance representing this enlarged by ghostLev size to take into account of the ghost cells for future computation. The patches in this are ignored here.

See also
getNumberOfCellsAtCurrentLevel

References _mesh.

◆ getNumberOfCellsRecursiveWithOverlap()

mcIdType MEDCouplingCartesianAMRMeshGen::getNumberOfCellsRecursiveWithOverlap ( ) const

This method returns the number of cells including the current level but also including recursively all cells of other levels starting from this. The set of cells which size is returned here are generally overlapping each other.

References _mesh, and _patches.

◆ getNumberOfCellsRecursiveWithoutOverlap()

mcIdType MEDCouplingCartesianAMRMeshGen::getNumberOfCellsRecursiveWithoutOverlap ( ) const

This method returns the max number of cells covering all the space without overlapping. It returns the number of cells of the mesh with the highest resolution. The returned value is equal to the number of cells of mesh returned by buildUnstructured.

See also
buildUnstructured

References _mesh, and _patches.

◆ getImageMesh()

◆ getFather()

virtual const MEDCouplingCartesianAMRMeshGen* MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather ( ) const
pure virtual

◆ getGodFather()

virtual const MEDCouplingCartesianAMRMeshGen* MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather ( ) const
pure virtual

◆ getAbsoluteLevel()

virtual mcIdType MEDCoupling::MEDCouplingCartesianAMRMeshGen::getAbsoluteLevel ( ) const
pure virtual

◆ detachFromFather()

virtual void MEDCoupling::MEDCouplingCartesianAMRMeshGen::detachFromFather ( )
pure virtual

◆ positionRelativeToGodFather()

virtual std::vector< std::pair<mcIdType,mcIdType> > MEDCoupling::MEDCouplingCartesianAMRMeshGen::positionRelativeToGodFather ( std::vector< mcIdType > &  st) const
pure virtual

◆ getAbsoluteLevelRelativeTo()

◆ getPositionRelativeTo()

std::vector< mcIdType > MEDCouplingCartesianAMRMeshGen::getPositionRelativeTo ( const MEDCouplingCartesianAMRMeshGen ref) const

This method returns a vector of size equal to getAbsoluteLevelRelativeTo. It allows to find position an absolute position of this relative to ref (that is typically the god father).

See also
getPatchAtPosition

References getPositionRelativeToInternal().

◆ getPatchAtPosition()

const MEDCouplingCartesianAMRPatch * MEDCouplingCartesianAMRMeshGen::getPatchAtPosition ( const std::vector< mcIdType > &  pos) const

◆ getMeshAtPosition()

const MEDCouplingCartesianAMRMeshGen * MEDCouplingCartesianAMRMeshGen::getMeshAtPosition ( const std::vector< mcIdType > &  pos) const

References getPatch().

◆ retrieveGridsAt()

std::vector< MEDCouplingCartesianAMRPatchGen * > MEDCouplingCartesianAMRMeshGen::retrieveGridsAt ( mcIdType  absoluteLev) const
virtual

This method returns grids relative to god father to specified level absoluteLev.

Returns
std::vector<MEDCouplingCartesianAMRPatchGen *> - objects in vector are to be managed (decrRef) by the caller.

Reimplemented in MEDCoupling::MEDCouplingCartesianAMRMesh.

References getGodFather(), and retrieveGridsAt().

Referenced by retrieveGridsAt().

◆ addPatch()

void MEDCouplingCartesianAMRMeshGen::addPatch ( const std::vector< std::pair< mcIdType, mcIdType > > &  bottomLeftTopRight,
const std::vector< mcIdType > &  factors 
)
Parameters
[in]bottomLeftTopRighta vector equal to the space dimension of mesh that specifies for each dimension, the included cell start of the range for the first element of the pair, a the end cell (excluded) of the range for the second element of the pair.
[in]factorsThe factor of refinement per axis (different from 0).

References _mesh, _patches, checkFactorsAndIfNotSetAssign(), and MEDCoupling::TimeLabel::declareAsNew().

Referenced by createPatchesFromCriterion().

◆ removeAllPatches()

void MEDCouplingCartesianAMRMeshGen::removeAllPatches ( )

◆ removePatch()

void MEDCouplingCartesianAMRMeshGen::removePatch ( mcIdType  patchId)

◆ getNumberOfPatches()

mcIdType MEDCouplingCartesianAMRMeshGen::getNumberOfPatches ( ) const

◆ createPatchesFromCriterion() [1/3]

void MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion ( const INTERP_KERNEL::BoxSplittingOptions &  bso,
const std::vector< bool > &  criterion,
const std::vector< mcIdType > &  factors 
)

This method is a generic algorithm to create patches in this (by destroying the patches if any). This method uses criterion array as a field on cells on this level. This method only create patches at level 0 relative to this.

This generic algorithm can be degenerated into three child ones, depending on the arguments given; in particular depending on whether they are equal to 0 or not. 1/ If minimumPatchLength = maximumPatchLength = maximumPatchVolume = 0, then we have the Berger-Rigoutsos algorithm. This algorithm was developed in 1991 and seems appropriate for sequential programming. 2/ If maximumPatchLength = 0, then we have the Livne algorithm. This algorithm was developed in 2004 and is an improvement of the Berger-Rigoutsos algorithm. 3/ If maximumPatchVolume = 0, the we have the lmin-lmax algorithm. This algorithm was developed by Arthur TALPAERT in 2014 and is an improvement of the Livne algorithm. It is especially appropriate for parallel computing, where one patch would be given to one CPU. See Arthur TALPAERT's 2014 CANUM poster for more information.

References _mesh, _patches, addPatch(), MEDCoupling::TimeLabel::declareAsNew(), MEDCoupling::MEDCouplingStructuredMesh::FindMinimalPartOf(), MEDCoupling::MEDCouplingStructuredMesh::FindTheWidestAxisOfGivenRangeInCompactFrmt(), and getNumberOfCellsAtCurrentLevel().

Referenced by createPatchesFromCriterion(), and MEDCoupling::MEDCouplingCartesianAMRMesh::createPatchesFromCriterionML().

◆ createPatchesFromCriterion() [2/3]

void MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion ( const INTERP_KERNEL::BoxSplittingOptions &  bso,
const DataArrayByte criterion,
const std::vector< mcIdType > &  factors 
)

This method creates patches in this (by destroying the patches if any). This method uses criterion array as a field on cells on this level. This method only create patches at level 0 relative to this.

References createPatchesFromCriterion(), MEDCoupling::TimeLabel::declareAsNew(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::DataArrayByte::toVectorOfBool().

◆ createPatchesFromCriterion() [3/3]

void MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion ( const INTERP_KERNEL::BoxSplittingOptions &  bso,
const DataArrayDouble criterion,
const std::vector< mcIdType > &  factors,
double  eps 
)

◆ getPatchIdFromChildMesh()

mcIdType MEDCouplingCartesianAMRMeshGen::getPatchIdFromChildMesh ( const MEDCouplingCartesianAMRMeshGen mesh) const

◆ getPatches()

std::vector< const MEDCouplingCartesianAMRPatch * > MEDCouplingCartesianAMRMeshGen::getPatches ( ) const

References _patches.

◆ getPatch()

◆ isPatchInNeighborhoodOf()

bool MEDCouplingCartesianAMRMeshGen::isPatchInNeighborhoodOf ( mcIdType  patchId1,
mcIdType  patchId2,
mcIdType  ghostLev 
) const

This method states if patch2 (with id patchId2) is in the neighborhood of patch1 (with id patchId1). The neighborhood size is defined by ghostLev in the reference of this ( not in the reference of patches !).

References getPatch().

Referenced by findPatchesInTheNeighborhoodOf(), and getPatchIdsInTheNeighborhoodOf().

◆ createCellFieldOnPatch()

DataArrayDouble * MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch ( mcIdType  patchId,
const DataArrayDouble cellFieldOnThis 
) const

This method creates a new cell field array on given patchId patch in this starting from a coarse cell field on this cellFieldOnThis. This method can be seen as a fast projection from the cell field cellFieldOnThis on this->getImageMesh() to a refined part of this defined by the patch with id patchId.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnThis- The array of the cell field on this->getImageMesh() to be projected to patch having id patchId.
Returns
DataArrayDouble * - The array of the cell field on the requested patch
Exceptions
ifpatchId is not in [ 0 , this->getNumberOfPatches() )
ifcellFieldOnThis is NULL or not allocated
See also
fillCellFieldOnPatch, MEDCouplingIMesh::SpreadCoarseToFine

References _mesh, getFactors(), MEDCoupling::MEDCouplingStructuredMesh::getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), getPatch(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine().

◆ fillCellFieldOnPatch()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatch ( mcIdType  patchId,
const DataArrayDouble cellFieldOnThis,
DataArrayDouble cellFieldOnPatch,
bool  isConservative = true 
) const

This method is equivalent to MEDCouplingCartesianAMRMesh::createCellFieldOnPatch except that here instead of creating a new instance it fills the value into the cellFieldOnPatch data.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnThis- The array of the cell field on this->getImageMesh() to be projected to patch having id patchId.
[in,out]cellFieldOnPatch- The array of the cell field on the requested patch to be filled.
See also
createCellFieldOnPatch, fillCellFieldComingFromPatch

References _mesh, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(), MEDCoupling::DataArrayTemplate< T >::end(), getFactors(), getPatch(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine().

◆ fillCellFieldOnPatchGhost()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhost ( mcIdType  patchId,
const DataArrayDouble cellFieldOnThis,
DataArrayDouble cellFieldOnPatch,
mcIdType  ghostLev,
bool  isConservative = true 
) const

This method is the generalization of fillCellFieldOnPatch method. This method only projects coarse to fine without considering the potential neighbor patches covered by the ghost cells of patch with id patchId.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnThis- The array of the cell field on this->getImageMesh() to be projected to patch having id patchId.
[in,out]cellFieldOnPatch- The array of the cell field on the requested patch to be filled.
[in]ghostLev- The size of the ghost zone (must be >=0 !)
See also
fillCellFieldOnPatch, fillCellFieldOnPatchGhostAdv

References _mesh, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(), MEDCoupling::DataArrayTemplate< T >::end(), getFactors(), getPatch(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhost().

Referenced by fillCellFieldOnPatchGhostAdv().

◆ fillCellFieldOnPatchOnlyOnGhostZone()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchOnlyOnGhostZone ( mcIdType  patchId,
const DataArrayDouble cellFieldOnThis,
DataArrayDouble cellFieldOnPatch,
mcIdType  ghostLev 
) const

This method is equivalent to fillCellFieldOnPatchGhost except that here ONLY the ghost zone will be updated in cellFieldOnPatch.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnThis- The array of the cell field on this->getImageMesh() to be projected to patch having id patchId.
[in,out]cellFieldOnPatch- The array of the cell field on the requested patch to be filled only in the ghost zone.
[in]ghostLev- The size of the ghost zone (must be >=0 !)

References _mesh, getFactors(), getPatch(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFineGhostZone().

◆ fillCellFieldOnPatchGhostAdv()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhostAdv ( mcIdType  patchId,
const DataArrayDouble cellFieldOnThis,
mcIdType  ghostLev,
const std::vector< const DataArrayDouble * > &  arrsOnPatches,
bool  isConservative = true 
) const

This method is a refinement of fillCellFieldOnPatchGhost. fillCellFieldOnPatchGhost is first called. Then for all other patches than those pointed by patchId that overlap the ghost zone of the patch impact the ghost zone adequately.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnThis- The array of the cell field on this->getImageMesh() to be projected to patch having id patchId.
[in]ghostLev- The size of the ghost zone (must be >=0 !)
[in]arrsOnPatches- WARNING arrsOnPatches[patchId] is NOT const. All others are const.
See also
fillCellFieldOnPatchOnlyGhostAdv

References fillCellFieldOnPatchGhost(), fillCellFieldOnPatchOnlyGhostAdv(), and getNumberOfPatches().

◆ fillCellFieldOnPatchOnlyGhostAdv()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchOnlyGhostAdv ( mcIdType  patchId,
mcIdType  ghostLev,
const std::vector< const DataArrayDouble * > &  arrsOnPatches 
) const

This method updates the patch with id patchId considering the only the all the patches in this to fill ghost zone. So warning, the DataArrayDouble instance arrsOnPatches[patchId] is non const.

See also
getPatchIdsInTheNeighborhoodOf

References _factors, getNumberOfPatches(), getPatch(), and getPatchIdsInTheNeighborhoodOf().

Referenced by fillCellFieldOnPatchGhostAdv().

◆ fillCellFieldOnPatchOnlyOnGhostZoneWith()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchOnlyOnGhostZoneWith ( mcIdType  ghostLev,
const MEDCouplingCartesianAMRPatch *  patchToBeModified,
const MEDCouplingCartesianAMRPatch *  neighborPatch,
DataArrayDouble cellFieldOnPatch,
const DataArrayDouble cellFieldNeighbor 
) const

References _factors.

◆ fillCellFieldComingFromPatch()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatch ( mcIdType  patchId,
const DataArrayDouble cellFieldOnPatch,
DataArrayDouble cellFieldOnThis,
bool  isConservative = true 
) const

This method updates cellFieldOnThis part of values coming from the cell field cellFieldOnPatch lying on patch having id patchId.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnPatch- The array of the cell field on patch with id patchId.
[in,out]cellFieldOnThisThe array of the cell field on this to be updated only on the part concerning the patch with id patchId.
[in]isConservative- true if the field needs to be conserved. false if maximum principle has to be applied.
Exceptions
ifpatchId is not in [ 0 , this->getNumberOfPatches() )
ifcellFieldOnPatch is NULL or not allocated
See also
createCellFieldOnPatch, MEDCouplingIMesh::CondenseFineToCoarse,fillCellFieldComingFromPatchGhost

References _mesh, MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), MEDCoupling::MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(), getFactors(), getPatch(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::MEDCouplingStructuredMesh::MultiplyPartOf().

◆ fillCellFieldComingFromPatchGhost()

void MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatchGhost ( mcIdType  patchId,
const DataArrayDouble cellFieldOnPatch,
DataArrayDouble cellFieldOnThis,
mcIdType  ghostLev,
bool  isConservative = true 
) const

This method is the extension of MEDCouplingCartesianAMRMesh::fillCellFieldComingFromPatch managing the ghost cells. If this method is called with ghostLev equal to 0 it behaves exactly as MEDCouplingCartesianAMRMesh::fillCellFieldComingFromPatch.

Parameters
[in]patchId- The id of the patch cellFieldOnThis has to be put on.
[in]cellFieldOnPatch- The array of the cell field on patch with id patchId.
[in,out]cellFieldOnThisThe array of the cell field on this to be updated only on the part concerning the patch with id patchId.
[in]ghostLevThe size of ghost zone (must be >= 0 !)
[in]isConservative- true if the field needs to be conserved. false if maximum principle has to be applied.
Exceptions
ifpatchId is not in [ 0 , this->getNumberOfPatches() )
ifcellFieldOnPatch is NULL or not allocated
See also
fillCellFieldComingFromPatch

References _mesh, MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarseGhost(), MEDCoupling::MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(), getFactors(), getPatch(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::MEDCouplingStructuredMesh::MultiplyPartOfByGhost().

◆ findPatchesInTheNeighborhoodOf()

DataArrayIdType * MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf ( mcIdType  patchId,
mcIdType  ghostLev 
) const

This method finds all patches (located by their ids) that are in the neighborhood of patch with id patchId. The neighborhood size is defined by ghostLev.

Parameters
[in]patchId- the id of the considered patch.
[in]ghostLev- the size of the neighborhood.
Returns
DataArrayIdType * - the newly allocated array containing the list of patches in the neighborhood of the considered patch. This array is to be deallocated by the caller.

References getNumberOfPatches(), and isPatchInNeighborhoodOf().

◆ buildUnstructured()

◆ buildMeshFromPatchEnvelop()

MEDCoupling1SGTUMesh * MEDCouplingCartesianAMRMeshGen::buildMeshFromPatchEnvelop ( ) const

This method returns a mesh containing as cells that there is patches at the current level. The patches are seen like 'boxes' that is too say the refinement will not appear here.

Returns
MEDCoupling1SGTUMesh * - A new object to be managed by the caller containing as cells as there are patches in this.

References _patches, and MEDCoupling::MEDCoupling1SGTUMesh::Merge1SGTUMeshes().

◆ buildMeshOfDirectChildrenOnly()

MEDCoupling1SGTUMesh * MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly ( ) const

◆ buildCellFieldOnRecurseWithoutOverlapWithoutGhost()

MEDCouplingFieldDouble * MEDCouplingCartesianAMRMeshGen::buildCellFieldOnRecurseWithoutOverlapWithoutGhost ( mcIdType  ghostSz,
const std::vector< const DataArrayDouble * > &  recurseArrs 
) const

This method works same as buildUnstructured except that arrays are given in input to build a field on cell in output.

Returns
MEDCouplingFieldDouble * - a newly created instance the caller has reponsability to deal with.
See also
buildUnstructured

References _mesh, _patches, extractGhostFrom(), extractSubTreeFromGlobalFlatten(), MEDCoupling::MEDCouplingFieldDouble::MergeFields(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::MEDCouplingStructuredMesh::SwitchOnIdsFrom().

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

◆ extractGhostFrom()

DataArrayDouble * MEDCouplingCartesianAMRMeshGen::extractGhostFrom ( mcIdType  ghostSz,
const DataArrayDouble arr 
) const

This method extracts from \arr arr the part inside arr by cutting the ghostSz external part. \arr is expected to be an array having a number of tuples equal to getImageMesh()->buildWithGhost(ghostSz).

References _mesh, MEDCoupling::MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(), MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(), and MEDCoupling::MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions().

Referenced by buildCellFieldOnRecurseWithoutOverlapWithoutGhost().

◆ getPatchIdsInTheNeighborhoodOf()

std::vector< mcIdType > MEDCouplingCartesianAMRMeshGen::getPatchIdsInTheNeighborhoodOf ( mcIdType  patchId,
mcIdType  ghostLev 
) const

This method returns all the patches in this not equal to patchId that are in neighborhood of patch with id patchId.

See also
fillCellFieldOnPatchOnlyGhostAdv

References getNumberOfPatches(), and isPatchInNeighborhoodOf().

Referenced by fillCellFieldOnPatchOnlyGhostAdv().

◆ buildPythonDumpOfThis()

std::string MEDCouplingCartesianAMRMeshGen::buildPythonDumpOfThis ( ) const

This method returns a dump python of this. It is useful for users of createPatchesFromCriterion method for debugging.

See also
dumpPatchesOf, createPatchesFromCriterion, createPatchesFromCriterionML

References dumpPatchesOf(), getImageMesh(), MEDCoupling::MEDCouplingMesh::getName(), and getSpaceDimension().

◆ checkPatchId()

void MEDCouplingCartesianAMRMeshGen::checkPatchId ( mcIdType  patchId) const
protected

References getNumberOfPatches().

Referenced by getPatch(), and removePatch().

◆ checkFactorsAndIfNotSetAssign()

void MEDCouplingCartesianAMRMeshGen::checkFactorsAndIfNotSetAssign ( const std::vector< mcIdType > &  factors)
protected

References _factors, and getSpaceDimension().

Referenced by addPatch().

◆ retrieveGridsAtInternal()

void MEDCouplingCartesianAMRMeshGen::retrieveGridsAtInternal ( mcIdType  lev,
std::vector< MCAuto< MEDCouplingCartesianAMRPatchGen > > &  grids 
) const
protected

◆ GetGhostLevelInFineRef()

mcIdType MEDCouplingCartesianAMRMeshGen::GetGhostLevelInFineRef ( mcIdType  ghostLev,
const std::vector< mcIdType > &  factors 
)
staticprotected

◆ extractSubTreeFromGlobalFlatten()

std::vector< const DataArrayDouble * > MEDCouplingCartesianAMRMeshGen::extractSubTreeFromGlobalFlatten ( const MEDCouplingCartesianAMRMeshGen head,
const std::vector< const DataArrayDouble * > &  all 
) const
protected

This method returns a sub set of all. The subset is defined by the head in the tree defined by this. Elements in all are expected to be sorted from god father to most refined structure.

References getMaxNumberOfLevelsRelativeToThis(), and MEDCoupling::BigMemoryObject::isObjectInTheProgeny().

Referenced by buildCellFieldOnRecurseWithoutOverlapWithoutGhost().

◆ dumpPatchesOf()

void MEDCouplingCartesianAMRMeshGen::dumpPatchesOf ( const std::string &  varName,
std::ostream &  oss 
) const
protected

References _factors, and _patches.

Referenced by buildPythonDumpOfThis().

◆ getPositionRelativeToInternal()

virtual void MEDCoupling::MEDCouplingCartesianAMRMeshGen::getPositionRelativeToInternal ( const MEDCouplingCartesianAMRMeshGen ref,
std::vector< mcIdType > &  ret 
) const
pure virtual

Referenced by getPositionRelativeTo().

◆ getHeapMemorySizeWithoutChildren()

std::size_t MEDCouplingCartesianAMRMeshGen::getHeapMemorySizeWithoutChildren ( ) const
protectedvirtual

◆ getDirectChildrenWithNull()

std::vector< const BigMemoryObject * > MEDCouplingCartesianAMRMeshGen::getDirectChildrenWithNull ( ) const
protectedvirtual

Implements MEDCoupling::BigMemoryObject.

References _mesh, and _patches.

◆ updateTime()

void MEDCouplingCartesianAMRMeshGen::updateTime ( ) const
protectedvirtual

This method should be called on high level classes as Field or Mesh to take into account modifications done in aggregates objects.

Implements MEDCoupling::TimeLabel.

References _mesh, _patches, and MEDCoupling::TimeLabel::updateTimeWith().

Member Data Documentation

◆ _mesh

◆ _patches

◆ _factors

std::vector<mcIdType> MEDCoupling::MEDCouplingCartesianAMRMeshGen::_factors
protected