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

Public Member Functions

void addPatch (const std::vector< std::pair< int, int > > &bottomLeftTopRight, const std::vector< int > &factors)
 
MEDCouplingFieldDoublebuildCellFieldOnRecurseWithoutOverlapWithoutGhost (int ghostSz, const std::vector< const DataArrayDouble * > &recurseArrs) const
 
MEDCoupling1SGTUMeshbuildMeshFromPatchEnvelop () const
 
MEDCoupling1SGTUMeshbuildMeshOfDirectChildrenOnly () const
 
std::string buildPythonDumpOfThis () const
 
MEDCouplingUMeshbuildUnstructured () const
 
DataArrayDoublecreateCellFieldOnPatch (int patchId, const DataArrayDouble *cellFieldOnThis) const
 
void createPatchesFromCriterion (const INTERP_KERNEL::BoxSplittingOptions &bso, const std::vector< bool > &criterion, const std::vector< int > &factors)
 
void createPatchesFromCriterion (const INTERP_KERNEL::BoxSplittingOptions &bso, const DataArrayByte *criterion, const std::vector< int > &factors)
 
void createPatchesFromCriterion (const INTERP_KERNEL::BoxSplittingOptions &bso, const DataArrayDouble *criterion, const std::vector< int > &factors, double eps)
 
virtual
MEDCouplingCartesianAMRMeshGen
deepCopy (MEDCouplingCartesianAMRMeshGen *father) const =0
 
virtual void detachFromFather ()=0
 
DataArrayDoubleextractGhostFrom (int ghostSz, const DataArrayDouble *arr) const
 
void fillCellFieldComingFromPatch (int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, bool isConservative=true) const
 
void fillCellFieldComingFromPatchGhost (int patchId, const DataArrayDouble *cellFieldOnPatch, DataArrayDouble *cellFieldOnThis, int ghostLev, bool isConservative=true) const
 
void fillCellFieldOnPatch (int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, bool isConservative=true) const
 
void fillCellFieldOnPatchGhost (int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev, bool isConservative=true) const
 
void fillCellFieldOnPatchGhostAdv (int patchId, const DataArrayDouble *cellFieldOnThis, int ghostLev, const std::vector< const DataArrayDouble * > &arrsOnPatches, bool isConservative=true) const
 
void fillCellFieldOnPatchOnlyGhostAdv (int patchId, int ghostLev, const std::vector< const DataArrayDouble * > &arrsOnPatches) const
 
void fillCellFieldOnPatchOnlyOnGhostZone (int patchId, const DataArrayDouble *cellFieldOnThis, DataArrayDouble *cellFieldOnPatch, int ghostLev) const
 
void fillCellFieldOnPatchOnlyOnGhostZoneWith (int ghostLev, const MEDCouplingCartesianAMRPatch *patchToBeModified, const MEDCouplingCartesianAMRPatch *neighborPatch, DataArrayDouble *cellFieldOnPatch, const DataArrayDouble *cellFieldNeighbor) const
 
DataArrayIntfindPatchesInTheNeighborhoodOf (int patchId, int ghostLev) const
 
virtual int getAbsoluteLevel () const =0
 
virtual int getAbsoluteLevelRelativeTo (const MEDCouplingCartesianAMRMeshGen *ref) const =0
 
const std::vector< int > & getFactors () const
 
virtual const
MEDCouplingCartesianAMRMeshGen
getFather () const =0
 
virtual const
MEDCouplingCartesianAMRMeshGen
getGodFather () const =0
 
const MEDCouplingIMeshgetImageMesh () const
 
int getMaxNumberOfLevelsRelativeToThis () const
 
const
MEDCouplingCartesianAMRMeshGen
getMeshAtPosition (const std::vector< int > &pos) const
 
int getNumberOfCellsAtCurrentLevel () const
 
int getNumberOfCellsAtCurrentLevelGhost (int ghostLev) const
 
int getNumberOfCellsRecursiveWithoutOverlap () const
 
int getNumberOfCellsRecursiveWithOverlap () const
 
int getNumberOfPatches () const
 
const
MEDCouplingCartesianAMRPatch * 
getPatch (int patchId) const
 
const
MEDCouplingCartesianAMRPatch * 
getPatchAtPosition (const std::vector< int > &pos) const
 
std::vector< const
MEDCouplingCartesianAMRPatch * > 
getPatches () const
 
int getPatchIdFromChildMesh (const MEDCouplingCartesianAMRMeshGen *mesh) const
 
std::vector< int > getPatchIdsInTheNeighborhoodOf (int patchId, int ghostLev) const
 
std::vector< int > getPositionRelativeTo (const MEDCouplingCartesianAMRMeshGen *ref) const
 
virtual void getPositionRelativeToInternal (const MEDCouplingCartesianAMRMeshGen *ref, std::vector< int > &ret) const =0
 
int getSpaceDimension () const
 
bool isPatchInNeighborhoodOf (int patchId1, int patchId2, int ghostLev) const
 
virtual std::vector< std::pair
< int, int > > 
positionRelativeToGodFather (std::vector< int > &st) const =0
 
void removeAllPatches ()
 
void removePatch (int patchId)
 
virtual std::vector
< MEDCouplingCartesianAMRPatchGen * > 
retrieveGridsAt (int absoluteLev) const
 
void setFactors (const std::vector< int > &newFactors)
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 

Protected Member Functions

void checkFactorsAndIfNotSetAssign (const std::vector< int > &factors)
 
void checkPatchId (int 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 int *nodeStrctStart, const int *nodeStrctStop, const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop)
 
 MEDCouplingCartesianAMRMeshGen (MEDCouplingIMesh *mesh)
 
void retrieveGridsAtInternal (int 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 int GetGhostLevelInFineRef (int ghostLev, const std::vector< int > &factors)
 

Protected Attributes

std::vector< int > _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::MEDCouplingCartesianAMRMeshGen ( const MEDCouplingCartesianAMRMeshGen other)
protected
MEDCouplingCartesianAMRMeshGen::MEDCouplingCartesianAMRMeshGen ( const std::string &  meshName,
int  spaceDim,
const int *  nodeStrctStart,
const int *  nodeStrctStop,
const double *  originStart,
const double *  originStop,
const double *  dxyzStart,
const double *  dxyzStop 
)
protected
MEDCouplingCartesianAMRMeshGen::MEDCouplingCartesianAMRMeshGen ( MEDCouplingIMesh mesh)
protected

Member Function Documentation

virtual MEDCouplingCartesianAMRMeshGen* MEDCoupling::MEDCouplingCartesianAMRMeshGen::deepCopy ( MEDCouplingCartesianAMRMeshGen father) const
pure virtual
int MEDCouplingCartesianAMRMeshGen::getSpaceDimension ( ) const
void MEDCouplingCartesianAMRMeshGen::setFactors ( const std::vector< int > &  newFactors)
int MEDCouplingCartesianAMRMeshGen::getMaxNumberOfLevelsRelativeToThis ( ) const
int 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().

int MEDCouplingCartesianAMRMeshGen::getNumberOfCellsAtCurrentLevelGhost ( int  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.

int 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.

int 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.

virtual const MEDCouplingCartesianAMRMeshGen* MEDCoupling::MEDCouplingCartesianAMRMeshGen::getFather ( ) const
pure virtual
virtual const MEDCouplingCartesianAMRMeshGen* MEDCoupling::MEDCouplingCartesianAMRMeshGen::getGodFather ( ) const
pure virtual
virtual int MEDCoupling::MEDCouplingCartesianAMRMeshGen::getAbsoluteLevel ( ) const
pure virtual
virtual void MEDCoupling::MEDCouplingCartesianAMRMeshGen::detachFromFather ( )
pure virtual
virtual std::vector< std::pair<int,int> > MEDCoupling::MEDCouplingCartesianAMRMeshGen::positionRelativeToGodFather ( std::vector< int > &  st) const
pure virtual
std::vector< int > 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().

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

References getPatch().

std::vector< MEDCouplingCartesianAMRPatchGen * > MEDCouplingCartesianAMRMeshGen::retrieveGridsAt ( int  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().

void MEDCouplingCartesianAMRMeshGen::addPatch ( const std::vector< std::pair< int, int > > &  bottomLeftTopRight,
const std::vector< int > &  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(), MEDCoupling::TimeLabel::declareAsNew(), and MEDCoupling::MEDCouplingIMesh::refineWithFactor().

Referenced by createPatchesFromCriterion().

void MEDCouplingCartesianAMRMeshGen::removeAllPatches ( )
void MEDCouplingCartesianAMRMeshGen::removePatch ( int  patchId)
int MEDCouplingCartesianAMRMeshGen::getNumberOfPatches ( ) const
void MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion ( const INTERP_KERNEL::BoxSplittingOptions &  bso,
const std::vector< bool > &  criterion,
const std::vector< int > &  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().

void MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion ( const INTERP_KERNEL::BoxSplittingOptions &  bso,
const DataArrayByte criterion,
const std::vector< int > &  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().

void MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion ( const INTERP_KERNEL::BoxSplittingOptions &  bso,
const DataArrayDouble criterion,
const std::vector< int > &  factors,
double  eps 
)
int MEDCouplingCartesianAMRMeshGen::getPatchIdFromChildMesh ( const MEDCouplingCartesianAMRMeshGen mesh) const
std::vector< const MEDCouplingCartesianAMRPatch * > MEDCouplingCartesianAMRMeshGen::getPatches ( ) const

References _patches.

bool MEDCouplingCartesianAMRMeshGen::isPatchInNeighborhoodOf ( int  patchId1,
int  patchId2,
int  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().

DataArrayDouble * MEDCouplingCartesianAMRMeshGen::createCellFieldOnPatch ( int  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::DataArray::getNumberOfComponents(), getPatch(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine().

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatch ( int  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().

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhost ( int  patchId,
const DataArrayDouble cellFieldOnThis,
DataArrayDouble cellFieldOnPatch,
int  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().

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchOnlyOnGhostZone ( int  patchId,
const DataArrayDouble cellFieldOnThis,
DataArrayDouble cellFieldOnPatch,
int  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().

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchGhostAdv ( int  patchId,
const DataArrayDouble cellFieldOnThis,
int  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,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 !)
[in]arrsOnPatches- WARNING arrsOnPatches[patchId] is NOT const. All others are const.
See Also
fillCellFieldOnPatchOnlyGhostAdv

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

void MEDCouplingCartesianAMRMeshGen::fillCellFieldOnPatchOnlyGhostAdv ( int  patchId,
int  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().

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

References _factors.

void MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatch ( int  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().

void MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatchGhost ( int  patchId,
const DataArrayDouble cellFieldOnPatch,
DataArrayDouble cellFieldOnThis,
int  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().

DataArrayInt * MEDCouplingCartesianAMRMeshGen::findPatchesInTheNeighborhoodOf ( int  patchId,
int  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
DataArrayInt * - 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 MEDCoupling::DataArrayTemplate< T >::alloc(), getNumberOfPatches(), isPatchInNeighborhoodOf(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), and MEDCoupling::MCAuto< T >::retn().

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

MEDCoupling1SGTUMesh * MEDCouplingCartesianAMRMeshGen::buildMeshOfDirectChildrenOnly ( ) const
DataArrayDouble * MEDCouplingCartesianAMRMeshGen::extractGhostFrom ( int  ghostSz,
const DataArrayDouble arr 
) const

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

References _mesh, MEDCoupling::MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt(), MEDCoupling::MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom(), MEDCoupling::MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions(), and MEDCoupling::MCAuto< T >::retn().

Referenced by buildCellFieldOnRecurseWithoutOverlapWithoutGhost().

std::vector< int > MEDCouplingCartesianAMRMeshGen::getPatchIdsInTheNeighborhoodOf ( int  patchId,
int  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().

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

void MEDCouplingCartesianAMRMeshGen::checkPatchId ( int  patchId) const
protected

References getNumberOfPatches().

Referenced by getPatch(), and removePatch().

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

References _factors, and getSpaceDimension().

Referenced by addPatch().

void MEDCouplingCartesianAMRMeshGen::retrieveGridsAtInternal ( int  lev,
std::vector< MCAuto< MEDCouplingCartesianAMRPatchGen > > &  grids 
) const
protected
int MEDCouplingCartesianAMRMeshGen::GetGhostLevelInFineRef ( int  ghostLev,
const std::vector< int > &  factors 
)
staticprotected
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().

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

References _factors, and _patches.

Referenced by buildPythonDumpOfThis().

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

Referenced by getPositionRelativeTo().

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

Implements MEDCoupling::BigMemoryObject.

References _mesh, and _patches.

void MEDCouplingCartesianAMRMeshGen::updateTime ( ) const
protectedvirtual

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

Implements MEDCoupling::TimeLabel.

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

Member Data Documentation

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