Back to index

salome-med  6.5.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
ParaMEDMEM::MEDCouplingUMesh Class Reference

#include <MEDCouplingUMesh.hxx>

Inheritance diagram for ParaMEDMEM::MEDCouplingUMesh:
Inheritance graph
[legend]
Collaboration diagram for ParaMEDMEM::MEDCouplingUMesh:
Collaboration graph
[legend]

List of all members.

Public Member Functions

MEDCOUPLING_EXPORT
MEDCouplingMesh
deepCpy () const
MEDCOUPLING_EXPORT
MEDCouplingUMesh
clone (bool recDeepCpy) const
MEDCOUPLING_EXPORT void updateTime () const
MEDCOUPLING_EXPORT
MEDCouplingMeshType 
getType () const
MEDCOUPLING_EXPORT bool isEqual (const MEDCouplingMesh *other, double prec) const
 This method is a method that compares 'this' and 'other'.
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr (const MEDCouplingMesh *other, double prec) const
MEDCOUPLING_EXPORT void checkDeepEquivalWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw (INTERP_KERNEL::Exception)
 This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter.
MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor) const throw (INTERP_KERNEL::Exception)
 This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter.
MEDCOUPLING_EXPORT void checkFastEquivalWith (const MEDCouplingMesh *other, double prec) const throw (INTERP_KERNEL::Exception)
 This method checks fastly that 'this' and 'other' are equal.
MEDCOUPLING_EXPORT void checkCoherency () const throw (INTERP_KERNEL::Exception)
 This method checks that this is correctly designed.
MEDCOUPLING_EXPORT void checkCoherency1 (double eps=1e-12) const throw (INTERP_KERNEL::Exception)
 This method performs deeper checking in 'this' than MEDCouplingUMesh::checkCoherency does.
MEDCOUPLING_EXPORT void checkCoherency2 (double eps=1e-12) const throw (INTERP_KERNEL::Exception)
MEDCOUPLING_EXPORT void setMeshDimension (int meshDim)
MEDCOUPLING_EXPORT void allocateCells (int nbOfCells)
MEDCOUPLING_EXPORT void insertNextCell (INTERP_KERNEL::NormalizedCellType type, int size, const int *nodalConnOfCell) throw (INTERP_KERNEL::Exception)
 Appends a cell in connectivity array.
MEDCOUPLING_EXPORT void finishInsertingCells ()
 Method to be called to cloture the insertion of cells using this->insertNextCell.
MEDCOUPLING_EXPORT
MEDCouplingUMeshCellIterator
cellIterator ()
 Entry point for iteration over cells of this.
MEDCOUPLING_EXPORT
MEDCouplingUMeshCellByTypeEntry
cellsByType () throw (INTERP_KERNEL::Exception)
 Entry point for iteration over cells groups geo types per geotypes.
MEDCOUPLING_EXPORT const
std::set
< INTERP_KERNEL::NormalizedCellType > & 
getAllTypes () const
MEDCOUPLING_EXPORT std::set
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const
MEDCOUPLING_EXPORT std::set
< INTERP_KERNEL::NormalizedCellType
getTypesOfPart (const int *begin, const int *end) const throw (INTERP_KERNEL::Exception)
 This method is equivalent to MEDCouplingUMesh::getAllTypes excecpt that it returns only types of submesh which cell ids are in [begin,end).
MEDCOUPLING_EXPORT void setConnectivity (DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true)
 Method reserved for advanced users having prepared their connectivity before.
MEDCOUPLING_EXPORT const
DataArrayInt
getNodalConnectivity () const
MEDCOUPLING_EXPORT const
DataArrayInt
getNodalConnectivityIndex () const
MEDCOUPLING_EXPORT DataArrayIntgetNodalConnectivity ()
MEDCOUPLING_EXPORT DataArrayIntgetNodalConnectivityIndex ()
MEDCOUPLING_EXPORT
INTERP_KERNEL::NormalizedCellType 
getTypeOfCell (int cellId) const
 Returns the cell type of cell with id 'cellId'.
MEDCOUPLING_EXPORT int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 Returns nb of cells having the geometric type 'type'.
MEDCOUPLING_EXPORT void getNodeIdsOfCell (int cellId, std::vector< int > &conn) const
 Appends the nodal connectivity in 'conn' of cell with id 'cellId'.
MEDCOUPLING_EXPORT DataArrayIntgetCellIdsFullyIncludedInNodeIds (const int *partBg, const int *partEnd) const
MEDCOUPLING_EXPORT std::string simpleRepr () const
MEDCOUPLING_EXPORT std::string advancedRepr () const
MEDCOUPLING_EXPORT std::string reprConnectivityOfThis () const
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildSetInstanceFromThis (int spaceDim) const throw (INTERP_KERNEL::Exception)
 This method builds a newly allocated instance (with the same name than 'this') that the caller has the responsability to deal with.
MEDCOUPLING_EXPORT int getNumberOfNodesInCell (int cellId) const
MEDCOUPLING_EXPORT int getNumberOfCells () const
MEDCOUPLING_EXPORT int getMeshDimension () const
MEDCOUPLING_EXPORT int getMeshLength () const
 This method is for test reason.
MEDCOUPLING_EXPORT void computeTypes ()
 This method recomputes all cell types of 'this'.
MEDCOUPLING_EXPORT void getTinySerializationInformation (std::vector< double > &tinyInfoD, std::vector< int > &tinyInfo, std::vector< std::string > &littleStrings) const
 size of returned tinyInfo must be always the same.
MEDCOUPLING_EXPORT bool isEmptyMesh (const std::vector< int > &tinyInfo) const
 First step of unserialization process.
MEDCOUPLING_EXPORT void resizeForUnserialization (const std::vector< int > &tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector< std::string > &littleStrings) const
 Second step of serialization process.
MEDCOUPLING_EXPORT void serialize (DataArrayInt *&a1, DataArrayDouble *&a2) const
 Third and final step of serialization process.
MEDCOUPLING_EXPORT void unserialization (const std::vector< double > &tinyInfoD, const std::vector< int > &tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector< std::string > &littleStrings)
 Second and final unserialization process.
MEDCOUPLING_EXPORT std::string getVTKDataSetType () const throw (INTERP_KERNEL::Exception)
MEDCOUPLING_EXPORT void writeVTKLL (std::ostream &ofs, const std::string &cellData, const std::string &pointData) const throw (INTERP_KERNEL::Exception)
MEDCOUPLING_EXPORT bool areCellsEqual (int cell1, int cell2, int compType) const
 This method stands if 'cell1' and 'cell2' are equals regarding 'compType' policy.
MEDCOUPLING_EXPORT bool areCellsEqual0 (int cell1, int cell2) const
 This method is the last step of the MEDCouplingUMesh::zipConnectivityTraducer with policy 0.
MEDCOUPLING_EXPORT bool areCellsEqual1 (int cell1, int cell2) const
 This method is the last step of the MEDCouplingUMesh::zipConnectivityTraducer with policy 1.
MEDCOUPLING_EXPORT bool areCellsEqual2 (int cell1, int cell2) const
 This method is the last step of the MEDCouplingUMesh::zipConnectivityTraducer with policy 2.
MEDCOUPLING_EXPORT bool areCellsFrom2MeshEqual (const MEDCouplingUMesh *other, int cellId, double prec) const
 This method compares 2 cells coming from two unstructured meshes : 'this' and 'other'.
MEDCOUPLING_EXPORT void convertToPolyTypes (const int *cellIdsToConvertBg, const int *cellIdsToConvertEnd)
 This method convert cell with ids in ['cellIdsToConvertBg','cellIdsToConvertEnd') into 'this' into dynamic types without changing geometry.
MEDCOUPLING_EXPORT void convertAllToPoly ()
 This method converts all cells into poly type if possible.
MEDCOUPLING_EXPORT void convertExtrudedPolyhedra () throw (INTERP_KERNEL::Exception)
 This method expects that 'this' has a spacedim equal to 3 and a mesh dimension equal to 3 too, if not an exception will be thrown.
MEDCOUPLING_EXPORT void unPolyze ()
 This method is the opposite of ParaMEDMEM::MEDCouplingUMesh::convertToPolyTypes method.
MEDCOUPLING_EXPORT DataArrayIntgetNodeIdsInUse (int &nbrOfNodesInUse) const throw (INTERP_KERNEL::Exception)
 Array returned is the correspondance in old to new format (that's why 'nbrOfNodesInUse' is returned too).
MEDCOUPLING_EXPORT DataArrayIntzipCoordsTraducer () throw (INTERP_KERNEL::Exception)
 Array returned is the correspondance in old to new format.
MEDCOUPLING_EXPORT DataArrayIntzipConnectivityTraducer (int compType) throw (INTERP_KERNEL::Exception)
 This method could potentially modify 'this'.
MEDCOUPLING_EXPORT bool areCellsIncludedIn (const MEDCouplingUMesh *other, int compType, DataArrayInt *&arr) const throw (INTERP_KERNEL::Exception)
 This method makes the assumption that 'this' and 'other' share the same coords.
MEDCOUPLING_EXPORT void getReverseNodalConnectivity (DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw (INTERP_KERNEL::Exception)
 WARNING this method do the assumption that connectivity lies on the coordinates set.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildDescendingConnectivity (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw (INTERP_KERNEL::Exception)
 WARNING this method do the assumption that connectivity lies on the coordinates set.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildDescendingConnectivity2 (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw (INTERP_KERNEL::Exception)
 WARNING this method do the assumption that connectivity lies on the coordinates set.
MEDCOUPLING_EXPORT void computeNeighborsOfCells (DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const throw (INTERP_KERNEL::Exception)
 WARNING this method do the assumption that connectivity lies on the coordinates set.
MEDCOUPLING_EXPORT DataArrayIntmergeNodes (double precision, bool &areNodesMerged, int &newNbOfNodes)
MEDCOUPLING_EXPORT DataArrayIntmergeNodes2 (double precision, bool &areNodesMerged, int &newNbOfNodes)
 Idem ParaMEDMEM::MEDCouplingUMesh::mergeNodes method except that the merged nodes are meld into the barycenter of them.
MEDCOUPLING_EXPORT void tryToShareSameCoordsPermute (const MEDCouplingPointSet &other, double epsilon) throw (INTERP_KERNEL::Exception)
 This method tries to use 'other' coords and use it for 'this'.
MEDCOUPLING_EXPORT
MEDCouplingPointSet
buildPartOfMySelf (const int *begin, const int *end, bool keepCoords) const
 build a sub part of 'this'.
MEDCOUPLING_EXPORT
MEDCouplingPointSet
buildPartOfMySelfNode (const int *begin, const int *end, bool fullyIn) const
 Keeps from 'this' only cells which constituing point id are in the ids specified by ['begin','end').
MEDCOUPLING_EXPORT DataArrayIntgetCellIdsLyingOnNodes (const int *begin, const int *end, bool fullyIn) const
 This method is very close too MEDCouplingUMesh::buildPartOfMySelfNode.
MEDCOUPLING_EXPORT
MEDCouplingPointSet
buildFacePartOfMySelfNode (const int *begin, const int *end, bool fullyIn) const
 Contrary to MEDCouplingUMesh::buildPartOfMySelfNode method this method builds a mesh with a meshDimension equal to this->getMeshDimension()-1.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildUnstructured () const throw (INTERP_KERNEL::Exception)
MEDCOUPLING_EXPORT void findBoundaryNodes (std::vector< int > &nodes) const
 This methods returns set of nodes lying on the boundary of this.
MEDCOUPLING_EXPORT
MEDCouplingPointSet
buildBoundaryMesh (bool keepCoords) const
 This method returns a mesh with meshDim=this->getMeshDimension()-1.
MEDCOUPLING_EXPORT DataArrayIntfindCellsIdsOnBoundary () const throw (INTERP_KERNEL::Exception)
 This method returns a newly created DataArrayInt instance containing ids of cells located in boundary.
MEDCOUPLING_EXPORT void renumberNodes (const int *newNodeNumbers, int newNbOfNodes)
MEDCOUPLING_EXPORT void renumberNodes2 (const int *newNodeNumbers, int newNbOfNodes)
MEDCOUPLING_EXPORT void renumberNodesInConn (const int *newNodeNumbersO2N)
 This method renumbers nodes in connectivity only without any reference to coords.
MEDCOUPLING_EXPORT void shiftNodeNumbersInConn (int delta) throw (INTERP_KERNEL::Exception)
 This method renumbers nodes in connectivity only without any reference to coords.
MEDCOUPLING_EXPORT void renumberCells (const int *old2NewBg, bool check) throw (INTERP_KERNEL::Exception)
 This method renumbers cells of 'this' using the array specified by [old2NewBg;old2NewBg+getNumberOfCells())
MEDCOUPLING_EXPORT void getCellsInBoundingBox (const double *bbox, double eps, std::vector< int > &elems) const
 Given a boundary box 'bbox' returns elements 'elems' contained in this 'bbox'.
MEDCOUPLING_EXPORT void getCellsInBoundingBox (const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector< int > &elems)
 Given a boundary box 'bbox' returns elements 'elems' contained in this 'bbox' or touching 'bbox' (within 'eps' distance).
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
getMeasureField (bool isAbs) const
 brief returns the volumes of the cells underlying the field field
MEDCOUPLING_EXPORT
DataArrayDouble
getPartMeasureField (bool isAbs, const int *begin, const int *end) const
 This method is equivalent to MEDCouplingUMesh::getMeasureField except that only part defined by [begin,end) is returned ! This method avoids to build explicitely part of this to perform the work.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
getMeasureFieldOnNode (bool isAbs) const
 This methods returns a field on nodes and no time.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
buildOrthogonalField () const
 This methods returns a vector field on cells that represents the orthogonal vector normalized of each 2D cell of this.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
buildPartOrthogonalField (const int *begin, const int *end) const
 This method is equivalent to MEDCouplingUMesh::buildOrthogonalField except that only part defined by [begin,end) is returned ! This method avoids to build explicitely part of this to perform the work.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
buildDirectionVectorField () const
 This methods returns a vector newly created field on cells that represents the direction vector of each 1D cell of this.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildSlice3D (const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const throw (INTERP_KERNEL::Exception)
 This method expects that 'this' is fully defined and has a spaceDim==3 and a meshDim==3.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildSlice3DSurf (const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const throw (INTERP_KERNEL::Exception)
 This method expects that 'this' is fully defined and has a spaceDim==3 and a meshDim==2.
MEDCOUPLING_EXPORT DataArrayIntgetCellIdsCrossingPlane (const double *origin, const double *vec, double eps) const throw (INTERP_KERNEL::Exception)
 This method expects that 'this' is fully defined and has a spaceDim==3.
MEDCOUPLING_EXPORT bool isContiguous1D () const throw (INTERP_KERNEL::Exception)
 This method checks that 'this' is a contiguous mesh.
MEDCOUPLING_EXPORT void project1D (const double *pt, const double *v, double eps, double *res) const
 This method is only callable on mesh with meshdim == 1 containing only SEG2 and spaceDim==3.
MEDCOUPLING_EXPORT int getCellContainingPoint (const double *pos, double eps) const
 Returns a cell if any that contains the point located on 'pos' with precison eps.
MEDCOUPLING_EXPORT void getCellsContainingPoint (const double *pos, double eps, std::vector< int > &elts) const
 Returns all cellIds in 'elts' of point 'pos' with eps accuracy.
MEDCOUPLING_EXPORT void getCellsContainingPoints (const double *pos, int nbOfPoints, double eps, std::vector< int > &elts, std::vector< int > &eltsIndex) const
 This method is an extension of MEDCouplingUMesh::getCellContainingPoint and MEDCouplingUMesh::getCellsContainingPoint.
MEDCOUPLING_EXPORT void checkButterflyCells (std::vector< int > &cells, double eps=1e-12) const
 This method is only available for a mesh with meshDim==2 and spaceDim==2||spaceDim==3.
MEDCOUPLING_EXPORT void findAndCorrectBadOriented3DExtrudedCells (std::vector< int > &cells) throw (INTERP_KERNEL::Exception)
 This method is expected to be applied on a mesh with spaceDim==3 and meshDim==3.
MEDCOUPLING_EXPORT void getBoundingBoxForBBTree (std::vector< double > &bbox) const
 This method aggregate the bbox of each cell and put it into bbox parameter.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
buildExtrudedMesh (const MEDCouplingUMesh *mesh1D, int policy)
 This method is NOT const because it can modify 'this'.
MEDCOUPLING_EXPORT bool isFullyQuadratic () const
 This method returns if 'this' is constituted by only quadratic cells.
MEDCOUPLING_EXPORT bool isPresenceOfQuadratic () const
 This method returns if there is at least one quadratic cell.
MEDCOUPLING_EXPORT void convertQuadraticCellsToLinear () throw (INTERP_KERNEL::Exception)
 This method convert quadratic cells to linear cells if any was found.
MEDCOUPLING_EXPORT void tessellate2D (double eps) throw (INTERP_KERNEL::Exception)
 This method tessallates 'this' so that the number of cells remains the same.
MEDCOUPLING_EXPORT void tessellate2DCurve (double eps) throw (INTERP_KERNEL::Exception)
 This method tessallates 'this' so that the number of cells remains the same.
MEDCOUPLING_EXPORT DataArrayIntsimplexize (int policy) throw (INTERP_KERNEL::Exception)
 This methods modify this by converting each cells into simplex cell, that is too say triangle for meshdim==2 or tetra for meshdim==3.
MEDCOUPLING_EXPORT bool areOnlySimplexCells () const throw (INTERP_KERNEL::Exception)
MEDCOUPLING_EXPORT void convertDegeneratedCells () throw (INTERP_KERNEL::Exception)
 This method converts all degenerated cells to simpler cells.
MEDCOUPLING_EXPORT void are2DCellsNotCorrectlyOriented (const double *vec, bool polyOnly, std::vector< int > &cells) const throw (INTERP_KERNEL::Exception)
 This method checks that all or only polygons (depending 'polyOnly' parameter) 2D cells are correctly oriented relative to 'vec' vector.
MEDCOUPLING_EXPORT void orientCorrectly2DCells (const double *vec, bool polyOnly) throw (INTERP_KERNEL::Exception)
 This method orient correctly (if needed) all or only polygons (depending 'polyOnly' parameter) 2D cells are correctly oriented relative to 'vec' vector.
MEDCOUPLING_EXPORT void arePolyhedronsNotCorrectlyOriented (std::vector< int > &cells) const throw (INTERP_KERNEL::Exception)
 This method checks that all polyhedrons cells have correctly oriented faces.
MEDCOUPLING_EXPORT void orientCorrectlyPolyhedrons () throw (INTERP_KERNEL::Exception)
 This method tries to orient correctly polhedrons cells.
MEDCOUPLING_EXPORT void getFastAveragePlaneOfThis (double *vec, double *pos) const throw (INTERP_KERNEL::Exception)
 This method has a sense for meshes with spaceDim==3 and meshDim==2.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
getEdgeRatioField () const throw (INTERP_KERNEL::Exception)
 The returned newly created field has to be managed by the caller.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
getAspectRatioField () const throw (INTERP_KERNEL::Exception)
 The returned newly created field has to be managed by the caller.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
getWarpField () const throw (INTERP_KERNEL::Exception)
 The returned newly created field has to be managed by the caller.
MEDCOUPLING_EXPORT
MEDCouplingFieldDouble
getSkewField () const throw (INTERP_KERNEL::Exception)
 The returned newly created field has to be managed by the caller.
MEDCOUPLING_EXPORT std::vector
< int > 
getDistributionOfTypes () const throw (INTERP_KERNEL::Exception)
 This method expects that 'this' is sorted by types.
MEDCOUPLING_EXPORT DataArrayIntcheckTypeConsistencyAndContig (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const throw (INTERP_KERNEL::Exception)
 This method is used to check that this has contiguous cell type in same order than described in 'code'.
MEDCOUPLING_EXPORT void splitProfilePerType (const DataArrayInt *profile, std::vector< int > &code, std::vector< DataArrayInt * > &idsInPflPerType, std::vector< DataArrayInt * > &idsPerType) const throw (INTERP_KERNEL::Exception)
 This method makes the hypothesis that 'this' is sorted by type.
MEDCOUPLING_EXPORT
MEDCouplingUMesh
emulateMEDMEMBDC (const MEDCouplingUMesh *nM1LevMesh, DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *&revDesc, DataArrayInt *&revDescIndx, DataArrayInt *&nM1LevMeshIds, DataArrayInt *&meshnM1Old2New) const throw (INTERP_KERNEL::Exception)
 This method is here too emulate the MEDMEM behaviour on BDC (buildDescendingConnectivity).
MEDCOUPLING_EXPORT DataArrayIntsortCellsInMEDFileFrmt () throw (INTERP_KERNEL::Exception)
 This method sorts cell in this so that cells are sorted by cell type specified by MEDMEM and so for MED file.
MEDCOUPLING_EXPORT bool checkConsecutiveCellTypes () const
 This methods checks that cells are sorted by their types.
MEDCOUPLING_EXPORT bool checkConsecutiveCellTypesAndOrder (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
 This method performs the same job as checkConsecutiveCellTypes except that the order of types sequence is analyzed to check that the order is specified in array defined by [orderBg,orderEnd).
MEDCOUPLING_EXPORT DataArrayIntgetLevArrPerCellTypes (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd, DataArrayInt *&nbPerType) const throw (INTERP_KERNEL::Exception)
 This method returns 2 newly allocated DataArrayInt instances.
MEDCOUPLING_EXPORT DataArrayIntgetRenumArrForConsecutiveCellTypesSpec (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const throw (INTERP_KERNEL::Exception)
 This method is similar to method MEDCouplingUMesh::rearrange2ConsecutiveCellTypes except that the type order is specfied by [orderBg,orderEnd) (as MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder method) and that this method is const and performs NO permutation in 'this'.
MEDCOUPLING_EXPORT DataArrayIntrearrange2ConsecutiveCellTypes ()
 This method reorganize the cells of 'this' so that the cells with same geometric types are put together.
MEDCOUPLING_EXPORT std::vector
< MEDCouplingUMesh * > 
splitByType () const
 This method splits 'this' into as mush as untructured meshes that consecutive set of same type cells.
MEDCOUPLING_EXPORT DataArrayIntkeepCellIdsByType (INTERP_KERNEL::NormalizedCellType type, const int *begin, const int *end) const throw (INTERP_KERNEL::Exception)
 This method returns a newly created DataArrayInt instance.
MEDCOUPLING_EXPORT DataArrayIntconvertCellArrayPerGeoType (const DataArrayInt *da) const throw (INTERP_KERNEL::Exception)
 This method makes the assumption that da->getNumberOfTuples()<this->getNumberOfCells().
MEDCOUPLING_EXPORT
MEDCouplingUMesh
keepSpecifiedCells (INTERP_KERNEL::NormalizedCellType type, const int *idsPerGeoTypeBg, const int *idsPerGeoTypeEnd) const
 This method reduced number of cells of this by keeping cells whose type is different from 'type' and if type=='type' cells whose ids is in 'idsPerGeoType' array.
MEDCOUPLING_EXPORT std::vector
< bool > 
getQuadraticStatus () const throw (INTERP_KERNEL::Exception)
 This method returns a vector of size 'this->getNumberOfCells()'.
MEDCOUPLING_EXPORT
MEDCouplingMesh
mergeMyselfWith (const MEDCouplingMesh *other) const
 Returns a newly created mesh (with ref count ==1) that contains merge of 'this' and 'other'.
MEDCOUPLING_EXPORT
DataArrayDouble
getBarycenterAndOwner () const
 Returns an array with this->getNumberOfCells() tuples and this->getSpaceDimension() dimension.
MEDCOUPLING_EXPORT
DataArrayDouble
getPartBarycenterAndOwner (const int *begin, const int *end) const
 This method is similar to MEDCouplingUMesh::getBarycenterAndOwner except that it works on subPart of 'this' without building explicitely it.
def __init__
def New
def clone
def updateTime
def checkCoherency
def setMeshDimension
def allocateCells
def finishInsertingCells
def cellsByType
def setConnectivity
def getTypeOfCell
def getNumberOfNodesInCell
def getMeshLength
def computeTypes
def reprConnectivityOfThis
def buildSetInstanceFromThis
def shiftNodeNumbersInConn
def getQuadraticStatus
def findCellsIdsOnBoundary
def checkConsecutiveCellTypes
def rearrange2ConsecutiveCellTypes
def sortCellsInMEDFileFrmt
def convertCellArrayPerGeoType
def zipConnectivityTraducer
def orientCorrectlyPolyhedrons
def isPresenceOfQuadratic
def buildDirectionVectorField
def isContiguous1D
def tessellate2D
def tessellate2DCurve
def convertQuadraticCellsToLinear
def convertDegeneratedCells
def areOnlySimplexCells
def getEdgeRatioField
def getAspectRatioField
def getWarpField
def getSkewField
def Build0DMeshFromCoords
def __str__
def __iter__
def __getitem__
def insertNextCell
def getNodalConnectivity
def getNodalConnectivityIndex
def getAllTypes
def mergeNodes
def mergeNodes2
def checkButterflyCells
def splitByType
def keepSpecifiedCells
def checkConsecutiveCellTypesAndOrder
def getRenumArrForConsecutiveCellTypesSpec
def renumberNodesInConn
def getLevArrPerCellTypes
def MergeUMeshesOnSameCoords
def FuseUMeshesOnSameCoords
def PutUMeshesOnSameAggregatedCoords
def MergeNodesOnUMeshesSharingSameCoords
def are2DCellsNotCorrectlyOriented
def orientCorrectly2DCells
def arePolyhedronsNotCorrectlyOriented
def findAndCorrectBadOriented3DExtrudedCells
def getFastAveragePlaneOfThis
def MergeUMeshes
def areCellsIncludedIn
def buildDescendingConnectivity
def buildDescendingConnectivity2
def computeNeighborsOfCells
def emulateMEDMEMBDC
def getReverseNodalConnectivity
def getPartBarycenterAndOwner
def getPartMeasureField
def buildPartOrthogonalField
def getTypesOfPart
def keepCellIdsByType
def getCellIdsLyingOnNodes
def getNodeIdsInUse
def Intersect2DMeshes
def buildSlice3D
def buildSlice3DSurf
def getCellIdsCrossingPlane
def convertToPolyTypes
def convertAllToPoly
def convertExtrudedPolyhedra
def unPolyze
def buildExtrudedMesh
def setCoords
def getCoordinatesAndOwner
def areCoordsEqual
def zipCoords
def getCaracteristicDimension
def changeSpaceDimension
def tryToShareSameCoords
def tryToShareSameCoordsPermute
def MergeNodesArray
def BuildInstanceFromMeshType
def buildBoundaryMesh
def isEmptyMesh
def getTinySerializationInformation
def resizeForUnserialization
def serialize
def unserialization
def zipCoordsTraducer
def buildNewNumberingFromCommonNodesFormat
def findCommonNodes
def getCoords
def buildPartOfMySelf
def buildPartOfMySelfNode
def buildFacePartOfMySelfNode
def findBoundaryNodes
def renumberNodes
def renumberNodes2
def findNodesOnLine
def findNodesOnPlane
def getNodeIdsNearPoint
def getNodeIdsNearPoints
def getCellsInBoundingBox
def Rotate2DAlg
def Rotate3DAlg
def setName
def getName
def setDescription
def getDescription
def setTime
def setTimeUnit
def getTimeUnit
def getType
def isStructured
def deepCpy
def isEqual
def isEqualWithoutConsideringStr
def copyTinyStringsFrom
def copyTinyInfoFrom
def checkCoherency1
def checkCoherency2
def getNumberOfCells
def getNumberOfNodes
def getSpaceDimension
def getMeshDimension
def getBarycenterAndOwner
def getNumberOfCellsWithType
def simpleRepr
def advancedRepr
def writeVTK
def getMeasureField
def getMeasureFieldOnNode
def fillFromAnalytic
def fillFromAnalytic2
def fillFromAnalytic3
def buildOrthogonalField
def buildUnstructured
def mergeMyselfWith
def areCompatibleForMerge
def simplexize
def getTime
def getCellContainingPoint
def getCellsContainingPoints
def getCellsContainingPoint
def renumberCells
def checkGeoEquivalWith
def getCellIdsFullyIncludedInNodeIds
def getNodeIdsOfCell
def getCoordinatesOfNode
def scale
def getBoundingBox
def buildPart
def buildPartAndReduceNodes
def getDistributionOfTypes
def checkTypeConsistencyAndContig
def splitProfilePerType
def translate
def rotate
def getAllGeoTypes
def MergeMeshes
def incrRef
def getHiddenCppPointer
def assign
def declareAsNew
def getTimeOfThis

Static Public Member Functions

static MEDCOUPLING_EXPORT
MEDCouplingUMesh
New ()
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
New (const char *meshName, int meshDim)
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
Build0DMeshFromCoords (DataArrayDouble *da) throw (INTERP_KERNEL::Exception)
 This method expects as input a DataArrayDouble non nul instance 'da' that should be allocated.
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
MergeUMeshes (const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw (INTERP_KERNEL::Exception)
 Returns a newly created mesh (with ref count ==1) that contains merge of 'mesh1' and 'other'.
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
MergeUMeshes (std::vector< const MEDCouplingUMesh * > &a) throw (INTERP_KERNEL::Exception)
 This method returns in case of success a mesh constitued from union of all meshes in 'a'.
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
MergeUMeshesOnSameCoords (const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw (INTERP_KERNEL::Exception)
 Idem MergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim.
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
MergeUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes)
 Idem MergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim.
static MEDCOUPLING_EXPORT
MEDCouplingUMesh
FuseUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes, int compType, std::vector< DataArrayInt * > &corr)
 This method fuses meshes 'meshes' and returns the fused mesh and the correspondances arrays for each mesh in 'meshes' in returned mesh.
static MEDCOUPLING_EXPORT void PutUMeshesOnSameAggregatedCoords (const std::vector< MEDCouplingUMesh * > &meshes) throw (INTERP_KERNEL::Exception)
 This method takes in input meshes meshes containing no null reference.
static MEDCOUPLING_EXPORT void MergeNodesOnUMeshesSharingSameCoords (const std::vector< MEDCouplingUMesh * > &meshes, double eps) throw (INTERP_KERNEL::Exception)
 This method takes in input meshes meshes containing no null reference.
static MEDCOUPLING_EXPORT bool IsPolygonWellOriented (bool isQuadratic, const double *vec, const int *begin, const int *end, const double *coords)
 This static operates only for coords in 3D.
static MEDCOUPLING_EXPORT bool IsPolyhedronWellOriented (const int *begin, const int *end, const double *coords)
 The polyhedron is specfied by its connectivity nodes in [begin,end).
static MEDCOUPLING_EXPORT void TryToCorrectPolyhedronOrientation (int *begin, int *end, const double *coords) throw (INTERP_KERNEL::Exception)
 This method tries to obtain a well oriented polyhedron.

Static Public Attributes

static double EPS_FOR_POLYH_ORIENTATION = 1.e-14

Private Member Functions

 MEDCouplingUMesh ()
 MEDCouplingUMesh (const MEDCouplingUMesh &other, bool deepCopy)
 Copy constructor.
 ~MEDCouplingUMesh ()
void checkFullyDefined () const throw (INTERP_KERNEL::Exception)
 This method checks that all arrays are set.
void checkConnectivityFullyDefined () const throw (INTERP_KERNEL::Exception)
 This method checks that all connectivity arrays are set.
void reprConnectivityOfThisLL (std::ostringstream &stream) const
DataArrayIntsimplexizePol0 () throw (INTERP_KERNEL::Exception)
 This method implements policy 0 of virtual method ParaMEDMEM::MEDCouplingUMesh::simplexize.
DataArrayIntsimplexizePol1 () throw (INTERP_KERNEL::Exception)
 This method implements policy 1 of virtual method ParaMEDMEM::MEDCouplingUMesh::simplexize.
void subDivide2DMesh (const int *nodeSubdived, const int *nodeIndxSubdived, const int *desc, const int *descIndex) throw (INTERP_KERNEL::Exception)
 This private method is used to subdivide edges of a mesh with meshdim==2.
void fillCellIdsToKeepFromNodeIds (const int *begin, const int *end, bool fullyIn, std::vector< int > &cellIdsKept) const
 Keeps from 'this' only cells which constituing point id are in the ids specified by ['begin','end').
void split3DCurveWithPlane (const double *origin, const double *vec, double eps, std::vector< int > &cut3DCurve) throw (INTERP_KERNEL::Exception)
 This method works on a 3D curve linear mesh that is to say (meshDim==1 and spaceDim==3).
MEDCouplingUMeshbuildExtrudedMeshFromThisLowLev (int nbOfNodesOf1Lev, bool isQuad) const
 This method is private because not easy to use for end user.
DataArrayDoublefillExtCoordsUsingTranslation (const MEDCouplingUMesh *mesh1D, bool isQuad) const
 This method incarnates the policy 0 for MEDCouplingUMesh::buildExtrudedMesh method.
DataArrayDoublefillExtCoordsUsingTranslAndAutoRotation (const MEDCouplingUMesh *mesh1D, bool isQuad) const throw (INTERP_KERNEL::Exception)
 This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.
DataArrayDoublefillExtCoordsUsingTranslAndAutoRotation2D (const MEDCouplingUMesh *mesh1D, bool isQuad) const throw (INTERP_KERNEL::Exception)
 This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.
DataArrayDoublefillExtCoordsUsingTranslAndAutoRotation3D (const MEDCouplingUMesh *mesh1D, bool isQuad) const throw (INTERP_KERNEL::Exception)
 This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.
template<int SPACEDIM>
void findCommonCellsBase (int compType, std::vector< int > &res, std::vector< int > &resI) const
 This method common cells base regarding 'compType' comparison policy described in ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer for details.
bool areCellsEqualInPool (const std::vector< int > &candidates, int compType, std::vector< int > &result) const
 This method find in candidate pool defined by 'candidates' the cells equal following the polycy 'compType'.
MEDCouplingUMeshbuildPartOfMySelfKeepCoords (const int *begin, const int *end) const
 This is the low algorithm of buildPartOfMySelf.
template<int SPACEDIM>
void getCellsContainingPointsAlg (const double *coords, const double *pos, int nbOfPoints, double eps, std::vector< int > &elts, std::vector< int > &eltsIndex) const

Private Attributes

int _iterator
int _mesh_dim
DataArrayInt_nodal_connec
DataArrayInt_nodal_connec_index
std::set
< INTERP_KERNEL::NormalizedCellType
_types

Static Private Attributes

static const char PART_OF_NAME [] = "PartOf_"
dictionary __swig_setmethods__ = {}
tuple __setattr__ = lambdaself,name,value:_swig_setattr(self, MEDCouplingUMesh, name, value)
dictionary __swig_getmethods__ = {}
tuple __getattr__ = lambdaself,name:_swig_getattr(self, MEDCouplingUMesh, name)
 __repr__ = _swig_repr
 __swig_destroy__ = _ParaMEDMEM.delete_MEDCouplingUMesh

Detailed Description

1

Definition at line 36 of file MEDCouplingUMesh.hxx.


Constructor & Destructor Documentation

Definition at line 88 of file MEDCouplingUMesh.cxx.

Here is the caller graph for this function:

MEDCouplingUMesh::MEDCouplingUMesh ( const MEDCouplingUMesh other,
bool  deepCopy 
) [private]

Copy constructor.

If 'deepCpy' is false 'this' is a shallow copy of other. If 'deeCpy' is true all arrays (coordinates and connectivities) are deeply copied.

Definition at line 2046 of file MEDCouplingUMesh.cxx.

Here is the call graph for this function:

Definition at line 2056 of file MEDCouplingUMesh.cxx.

def ParaMEDMEM.MEDCouplingUMesh.__init__ (   self,
  args,
  kwargs 
)

Reimplemented from ParaMEDMEM.MEDCouplingPointSet.

Definition at line 8717 of file ParaMEDMEM.py.

08717 
    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")

Member Function Documentation

def ParaMEDMEM.MEDCouplingUMesh.__getitem__ (   self,
  args 
)
__getitem__(self, PyObject listOrDataArrI) -> MEDCouplingPointSet

1

Definition at line 9037 of file ParaMEDMEM.py.

09037 
09038     def __getitem__(self, *args):
09039         """
09040         __getitem__(self, PyObject listOrDataArrI) -> MEDCouplingPointSet
09041 
09042         1
09043         """
09044         return _ParaMEDMEM.MEDCouplingUMesh___getitem__(self, *args)

__iter__(self) -> MEDCouplingUMeshCellIterator

1

Definition at line 9029 of file ParaMEDMEM.py.

09029 
09030     def __iter__(self):
09031         """
09032         __iter__(self) -> MEDCouplingUMeshCellIterator
09033 
09034         1
09035         """
09036         return _ParaMEDMEM.MEDCouplingUMesh___iter__(self)

__str__(self) -> string

1

Reimplemented from ParaMEDMEM.MEDCouplingPointSet.

Definition at line 9021 of file ParaMEDMEM.py.

09021 
09022     def __str__(self):
09023         """
09024         __str__(self) -> string
09025 
09026         1
09027         """
09028         return _ParaMEDMEM.MEDCouplingUMesh___str__(self)

std::string MEDCouplingUMesh::advancedRepr ( ) const

Definition at line 1912 of file MEDCouplingUMesh.cxx.

{
  std::ostringstream ret;
  ret << simpleRepr();
  ret << "\nCoordinates array : \n___________________\n\n";
  if(_coords)
    _coords->reprWithoutNameStream(ret);
  else
    ret << "No array set !\n";
  ret << "\n\nConnectivity arrays : \n_____________________\n\n";
  reprConnectivityOfThisLL(ret);
  return ret.str();
}

Here is the call graph for this function:

def ParaMEDMEM.MEDCouplingMesh.advancedRepr (   self) [inherited]
advancedRepr(self) -> string

1

Definition at line 580 of file ParaMEDMEM.py.

00580 
00581     def advancedRepr(self):
00582         """
00583         advancedRepr(self) -> string
00584 
00585         1
00586         """
00587         return _ParaMEDMEM.MEDCouplingMesh_advancedRepr(self)

Here is the caller graph for this function:

void MEDCouplingUMesh::allocateCells ( int  nbOfCells)

Definition at line 202 of file MEDCouplingUMesh.cxx.

Here is the call graph for this function:

def ParaMEDMEM.MEDCouplingUMesh.allocateCells (   self,
  args 
)
allocateCells(self, int nbOfCells)

1

Definition at line 8762 of file ParaMEDMEM.py.

08762 
08763     def allocateCells(self, *args):
08764         """
08765         allocateCells(self, int nbOfCells)
08766 
08767         1
08768         """
08769         return _ParaMEDMEM.MEDCouplingUMesh_allocateCells(self, *args)

Here is the call graph for this function:

void MEDCouplingUMesh::are2DCellsNotCorrectlyOriented ( const double *  vec,
bool  polyOnly,
std::vector< int > &  cells 
) const throw (INTERP_KERNEL::Exception)

This method checks that all or only polygons (depending 'polyOnly' parameter) 2D cells are correctly oriented relative to 'vec' vector.

The 'vec' vector has to have a non nul norm. If not 'cells' parameter will be appended with cellIds of incorrect cells.

Exceptions:
when'this' is not a mesh with meshdim==2 and spacedim==3

Definition at line 3925 of file MEDCouplingUMesh.cxx.

{
  if(getMeshDimension()!=2 || getSpaceDimension()!=3)
    throw INTERP_KERNEL::Exception("Invalid mesh to apply are2DCellsNotCorrectlyOriented on it : must be meshDim==2 and spaceDim==3 !");
  int nbOfCells=getNumberOfCells();
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  const double *coordsPtr=_coords->getConstPointer();
  for(int i=0;i<nbOfCells;i++)
    {
      INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
      if(!polyOnly || (type==INTERP_KERNEL::NORM_POLYGON || type==INTERP_KERNEL::NORM_QPOLYG))
        {
          bool isQuadratic=INTERP_KERNEL::CellModel::GetCellModel(type).isQuadratic();
          if(!IsPolygonWellOriented(isQuadratic,vec,conn+connI[i]+1,conn+connI[i+1],coordsPtr))
            cells.push_back(i);
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

are2DCellsNotCorrectlyOriented(self, PyObject vec, bool polyOnly) -> PyObject

1

Definition at line 9192 of file ParaMEDMEM.py.

09192 
09193     def are2DCellsNotCorrectlyOriented(self, *args):
09194         """
09195         are2DCellsNotCorrectlyOriented(self, PyObject vec, bool polyOnly) -> PyObject
09196 
09197         1
09198         """
09199         return _ParaMEDMEM.MEDCouplingUMesh_are2DCellsNotCorrectlyOriented(self, *args)

Here is the call graph for this function:

bool MEDCouplingUMesh::areCellsEqual ( int  cell1,
int  cell2,
int  compType 
) const

This method stands if 'cell1' and 'cell2' are equals regarding 'compType' policy.

The semantic of 'compType' is specified in MEDCouplingUMesh::zipConnectivityTraducer method.

Definition at line 1015 of file MEDCouplingUMesh.cxx.

{
  switch(compType)
    {
    case 0:
      return areCellsEqual0(cell1,cell2);
    case 1:
      return areCellsEqual1(cell1,cell2);
    case 2:
      return areCellsEqual2(cell1,cell2);
    }
  throw INTERP_KERNEL::Exception("Unknown comparison asked ! Must be in 0,1 or 2.");
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool MEDCouplingUMesh::areCellsEqual0 ( int  cell1,
int  cell2 
) const

This method is the last step of the MEDCouplingUMesh::zipConnectivityTraducer with policy 0.

Definition at line 1032 of file MEDCouplingUMesh.cxx.

{
  const int *conn=getNodalConnectivity()->getConstPointer();
  const int *connI=getNodalConnectivityIndex()->getConstPointer();
  if(connI[cell1+1]-connI[cell1]==connI[cell2+1]-connI[cell2])
    return std::equal(conn+connI[cell1]+1,conn+connI[cell1+1],conn+connI[cell2]+1);
  return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool MEDCouplingUMesh::areCellsEqual1 ( int  cell1,
int  cell2 
) const

This method is the last step of the MEDCouplingUMesh::zipConnectivityTraducer with policy 1.

Definition at line 1044 of file MEDCouplingUMesh.cxx.

{
  const int *conn=getNodalConnectivity()->getConstPointer();
  const int *connI=getNodalConnectivityIndex()->getConstPointer();
  int sz=connI[cell1+1]-connI[cell1];
  if(sz==connI[cell2+1]-connI[cell2])
    {
      if(conn[connI[cell1]]==conn[connI[cell2]])
        {
          const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connI[cell1]]);
          unsigned dim=cm.getDimension();
          if(dim!=3)
            {
              if(dim!=1)
                {
                  int sz1=2*(sz-1);
                  int *tmp=new int[sz1];
                  int *work=std::copy(conn+connI[cell1]+1,conn+connI[cell1+1],tmp);
                  std::copy(conn+connI[cell1]+1,conn+connI[cell1+1],work);
                  work=std::search(tmp,tmp+sz1,conn+connI[cell2]+1,conn+connI[cell2+1]);
                  delete [] tmp;
                  return work!=tmp+sz1;
                }
              else
                return std::equal(conn+connI[cell1]+1,conn+connI[cell1+1],conn+connI[cell2]+1);//case of SEG2 and SEG3
            }
          else
            throw INTERP_KERNEL::Exception("MEDCouplingUMesh::areCellsEqual1 : not implemented yet for meshdim == 3 !");
        }
    }
  return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool MEDCouplingUMesh::areCellsEqual2 ( int  cell1,
int  cell2 
) const

This method is the last step of the MEDCouplingUMesh::zipConnectivityTraducer with policy 2.

Definition at line 1080 of file MEDCouplingUMesh.cxx.

{
  const int *conn=getNodalConnectivity()->getConstPointer();
  const int *connI=getNodalConnectivityIndex()->getConstPointer();
  if(connI[cell1+1]-connI[cell1]==connI[cell2+1]-connI[cell2])
    {
      if(conn[connI[cell1]]==conn[connI[cell2]])
        {
          std::set<int> s1(conn+connI[cell1]+1,conn+connI[cell1+1]);
          std::set<int> s2(conn+connI[cell2]+1,conn+connI[cell2+1]);
          return s1==s2;
        }
    }
  return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool MEDCouplingUMesh::areCellsEqualInPool ( const std::vector< int > &  candidates,
int  compType,
std::vector< int > &  result 
) const [private]

This method find in candidate pool defined by 'candidates' the cells equal following the polycy 'compType'.

If any true is returned and the results will be put at the end of 'result' output parameter. If not false is returned and result remains unchanged. The semantic of 'compType' is specified in MEDCouplingUMesh::zipConnectivityTraducer method. If in 'candidates' pool -1 value is considered as an empty value. WARNING this method returns only ONE set of result !

Definition at line 1131 of file MEDCouplingUMesh.cxx.

{
  std::set<int> cand(candidates.begin(),candidates.end());
  cand.erase(-1);
  if(cand.size()<=1)
    return false;
  std::set<int>::const_iterator end=cand.end(); end--;
  bool ret=false;
  for(std::set<int>::const_iterator iter=cand.begin();iter!=end && !ret;iter++)
    {
      std::set<int>::const_iterator begin2=iter; begin2++;
      for(std::set<int>::const_iterator iter2=begin2;iter2!=cand.end();iter2++)
        {
          if(areCellsEqual(*iter,*iter2,compType))
            {
              if(!ret)
                {
                  result.push_back(*iter);
                  ret=true;
                }
              result.push_back(*iter2);
            }
        }
    }
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool MEDCouplingUMesh::areCellsFrom2MeshEqual ( const MEDCouplingUMesh other,
int  cellId,
double  prec 
) const

This method compares 2 cells coming from two unstructured meshes : 'this' and 'other'.

This method compares 2 cells having the same id 'cellId' in 'this' and 'other'.

Definition at line 1100 of file MEDCouplingUMesh.cxx.

{
  if(getTypeOfCell(cellId)!=other->getTypeOfCell(cellId))
    return false;
  std::vector<int> c1,c2;
  getNodeIdsOfCell(cellId,c1);
  other->getNodeIdsOfCell(cellId,c2);
  std::size_t sz=c1.size();
  if(sz!=c2.size())
    return false;
  for(std::size_t i=0;i<sz;i++)
    {
      std::vector<double> n1,n2;
      getCoordinatesOfNode(c1[0],n1);
      other->getCoordinatesOfNode(c2[0],n2);
      std::transform(n1.begin(),n1.end(),n2.begin(),n1.begin(),std::minus<double>());
      std::transform(n1.begin(),n1.end(),n1.begin(),std::ptr_fun<double,double>(fabs));
      if(*std::max_element(n1.begin(),n1.end())>prec)
        return false;
    }
  return true;
}

Here is the call graph for this function:

bool MEDCouplingUMesh::areCellsIncludedIn ( const MEDCouplingUMesh other,
int  compType,
DataArrayInt *&  arr 
) const throw (INTERP_KERNEL::Exception)

This method makes the assumption that 'this' and 'other' share the same coords.

If not an exception will be thrown ! This method tries to determine if 'other' is fully included in 'this'. To compute that, this method works with connectivity as MEDCouplingUMesh::zipConnectivityTraducer method does. This method is close to MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith or MEDCouplingMesh::checkGeoEquivalWith with policy 20,21,or 22. The main difference is that this method is not expected to throw exception. This method has two outputs :

Parameters:
compTypeis the comparison type. The possible values of this parameter are described in ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer method
arris an output parameter that returns a newly created instance. This array is of size 'other->getNumberOfCells()'.
Returns:
If 'other' is fully included in 'this 'true is returned. If not false is returned.

Definition at line 1306 of file MEDCouplingUMesh.cxx.

{
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mesh=MergeUMeshesOnSameCoords(this,other);
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2n=mesh->zipConnectivityTraducer(compType);
  int nbOfCells=getNumberOfCells();
  arr=o2n->substr(nbOfCells);
  arr->setName(other->getName());
  int tmp;
  if(other->getNumberOfCells()==0)
    return true;
  return arr->getMaxValue(tmp)<nbOfCells;
}

Here is the call graph for this function:

Here is the caller graph for this function:

areCellsIncludedIn(self, MEDCouplingUMesh other, int compType) -> PyObject

1

Definition at line 9243 of file ParaMEDMEM.py.

09243 
09244     def areCellsIncludedIn(self, *args):
09245         """
09246         areCellsIncludedIn(self, MEDCouplingUMesh other, int compType) -> PyObject
09247 
09248         1
09249         """
09250         return _ParaMEDMEM.MEDCouplingUMesh_areCellsIncludedIn(self, *args)

Here is the call graph for this function:

def ParaMEDMEM.MEDCouplingMesh.areCompatibleForMerge (   self,
  args 
) [inherited]
areCompatibleForMerge(self, MEDCouplingMesh other) -> bool

1

Definition at line 660 of file ParaMEDMEM.py.

00660 
00661     def areCompatibleForMerge(self, *args):
00662         """
00663         areCompatibleForMerge(self, MEDCouplingMesh other) -> bool
00664 
00665         1
00666         """
00667         return _ParaMEDMEM.MEDCouplingMesh_areCompatibleForMerge(self, *args)

def ParaMEDMEM.MEDCouplingPointSet.areCoordsEqual (   self,
  args 
) [inherited]
areCoordsEqual(self, MEDCouplingPointSet other, double prec) -> bool

1

Definition at line 8263 of file ParaMEDMEM.py.

08263 
08264     def areCoordsEqual(self, *args):
08265         """
08266         areCoordsEqual(self, MEDCouplingPointSet other, double prec) -> bool
08267 
08268         1
08269         """
08270         return _ParaMEDMEM.MEDCouplingPointSet_areCoordsEqual(self, *args)

bool MEDCouplingUMesh::areOnlySimplexCells ( ) const throw (INTERP_KERNEL::Exception)

Definition at line 3668 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  if(getMeshDimension()<1)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::areOnlySimplexCells : only available with meshes having a meshdim >= 1 !");
  int nbCells=getNumberOfCells();
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  for(int i=0;i<nbCells;i++)
    {
      const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connI[i]]);
      if(!cm.isSimplex())
        return false;
    }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

areOnlySimplexCells(self) -> bool

1

Definition at line 8971 of file ParaMEDMEM.py.

08971 
08972     def areOnlySimplexCells(self):
08973         """
08974         areOnlySimplexCells(self) -> bool
08975 
08976         1
08977         """
08978         return _ParaMEDMEM.MEDCouplingUMesh_areOnlySimplexCells(self)

Here is the call graph for this function:

void MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented ( std::vector< int > &  cells) const throw (INTERP_KERNEL::Exception)

This method checks that all polyhedrons cells have correctly oriented faces.

If not, 'cells' parameter will be appended with cellIds of incorrect cells.

Exceptions:
when'this' is not a mesh with meshdim==3 and spacedim==3

Definition at line 3984 of file MEDCouplingUMesh.cxx.

{
  if(getMeshDimension()!=3 || getSpaceDimension()!=3)
    throw INTERP_KERNEL::Exception("Invalid mesh to apply arePolyhedronsNotCorrectlyOriented on it : must be meshDim==3 and spaceDim==3 !");
  int nbOfCells=getNumberOfCells();
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  const double *coordsPtr=_coords->getConstPointer();
  for(int i=0;i<nbOfCells;i++)
    {
      INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]];
      if(type==INTERP_KERNEL::NORM_POLYHED)
        {
          if(!IsPolyhedronWellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr))
            cells.push_back(i);
        }
    }
}

Here is the caller graph for this function:

arePolyhedronsNotCorrectlyOriented(self) -> PyObject

1

Definition at line 9208 of file ParaMEDMEM.py.

09208 
09209     def arePolyhedronsNotCorrectlyOriented(self):
09210         """
09211         arePolyhedronsNotCorrectlyOriented(self) -> PyObject
09212 
09213         1
09214         """
09215         return _ParaMEDMEM.MEDCouplingUMesh_arePolyhedronsNotCorrectlyOriented(self)

Here is the call graph for this function:

def ParaMEDMEM.TimeLabel.assign (   self,
  args 
) [inherited]
assign(self, TimeLabel other) -> TimeLabel

1

Reimplemented in ParaMEDMEM.MEDCouplingFieldDouble.

Definition at line 284 of file ParaMEDMEM.py.

00284 
00285     def assign(self, *args):
00286         """
00287         assign(self, TimeLabel other) -> TimeLabel
00288 
00289         1
00290         """
00291         return _ParaMEDMEM.TimeLabel_assign(self, *args)

MEDCouplingUMesh * MEDCouplingUMesh::Build0DMeshFromCoords ( DataArrayDouble da) throw (INTERP_KERNEL::Exception) [static]

This method expects as input a DataArrayDouble non nul instance 'da' that should be allocated.

If not an exception is thrown.

Definition at line 4904 of file MEDCouplingUMesh.cxx.

{
  if(!da)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::Build0DMeshFromCoords : instance of DataArrayDouble must be not null !");
  da->checkAllocated();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(da->getName().c_str(),0);
  ret->setCoords(da);
  int nbOfTuples=da->getNumberOfTuples();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::New();
  c->alloc(2*nbOfTuples,1);
  cI->alloc(nbOfTuples+1,1);
  int *cp=c->getPointer();
  int *cip=cI->getPointer();
  *cip++=0;
  for(int i=0;i<nbOfTuples;i++)
    {
      *cp++=INTERP_KERNEL::NORM_POINT1;
      *cp++=i;
      *cip++=2*(i+1);
    }
  ret->setConnectivity(c,cI,true);
  ret->incrRef();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Build0DMeshFromCoords(DataArrayDouble da) -> MEDCouplingUMesh

1

Definition at line 9011 of file ParaMEDMEM.py.

09011 
09012     def Build0DMeshFromCoords(*args):
09013         """
09014         Build0DMeshFromCoords(DataArrayDouble da) -> MEDCouplingUMesh
09015 
09016         1
09017         """
09018         return _ParaMEDMEM.MEDCouplingUMesh_Build0DMeshFromCoords(*args)

Here is the call graph for this function:

This method returns a mesh with meshDim=this->getMeshDimension()-1.

This returned mesh contains cells that are linked with one and only one cell of this.

Parameters:
keepCoordsspecifies if ParaMEDMEM::MEDCouplingUMesh::zipCoords is called on returned mesh before being returned. If true zipCoords is NOT called, if false, zipCoords is called.
Returns:
mesh with ref counter equal to 1.

Definition at line 1494 of file MEDCouplingUMesh.cxx.

{
  DataArrayInt *desc=DataArrayInt::New();
  DataArrayInt *descIndx=DataArrayInt::New();
  DataArrayInt *revDesc=DataArrayInt::New();
  DataArrayInt *revDescIndx=DataArrayInt::New();
  //
  MEDCouplingUMesh *meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
  revDesc->decrRef();
  desc->decrRef();
  descIndx->decrRef();
  int nbOfCells=meshDM1->getNumberOfCells();
  const int *revDescIndxC=revDescIndx->getConstPointer();
  std::vector<int> boundaryCells;
  for(int i=0;i<nbOfCells;i++)
    if(revDescIndxC[i+1]-revDescIndxC[i]==1)
      boundaryCells.push_back(i);
  revDescIndx->decrRef();
  MEDCouplingPointSet *ret=meshDM1->buildPartOfMySelf(&boundaryCells[0],&boundaryCells[0]+boundaryCells.size(),keepCoords);
  meshDM1->decrRef();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingPointSet.buildBoundaryMesh (   self,
  args 
) [inherited]
buildBoundaryMesh(self, bool keepCoords) -> MEDCouplingPointSet

1

Definition at line 8332 of file ParaMEDMEM.py.

08332 
08333     def buildBoundaryMesh(self, *args):
08334         """
08335         buildBoundaryMesh(self, bool keepCoords) -> MEDCouplingPointSet
08336 
08337         1
08338         """
08339         return _ParaMEDMEM.MEDCouplingPointSet_buildBoundaryMesh(self, *args)

MEDCouplingUMesh * MEDCouplingUMesh::buildDescendingConnectivity ( DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt revDesc,
DataArrayInt revDescIndx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set.

For speed reasons no check of this will be done. Given 'this' with spacedim equal to s and meshdim equal to p, this method returns a new allocated mesh lying on the same coordinates than 'this' and having a meshdim equal to p-1. The algorithm to compute this p-1 mesh is the following : For each cell in 'this' it splits into p-1 elements. If this p-1 element does not already exists it is appended to the returned mesh If this p-1 element already exists, it is not appended. This method returns or 4 arrays plus the returned mesh. 'desc' and 'descIndx' are the descending connectivity. These 2 arrays tell for each cell in 'this', to wich p-1 dimension cell in returned mesh it refers. For a cell with a cellid c in 'this' it is constituted of cells in [desc+descIndx[c],desc+descIndex[c+1])

Reversely 'revDesc' and 'revDescIndx' are the reverse descending connectivity. These 2 arrays tell for each cell in returned mesh, to wich cell in 'this' it refers. For a cell with a cellid d in returned p-1 mesh it is shared by the following cells in 'this' [revDesc+revDescIndx[d],revDesc+revDescIndx[d+1])

Definition at line 552 of file MEDCouplingUMesh.cxx.

{
  return buildDescendingConnectivityGen(desc,descIndx,revDesc,revDescIndx,MEDCouplingFastNbrer);
}

Here is the caller graph for this function:

buildDescendingConnectivity(self, DataArrayInt desc, DataArrayInt descIndx, DataArrayInt revDesc, 
    DataArrayInt revDescIndx) -> MEDCouplingUMesh
buildDescendingConnectivity(self) -> PyObject

1

Definition at line 9251 of file ParaMEDMEM.py.

09251 
09252     def buildDescendingConnectivity(self, *args):
09253         """
09254         buildDescendingConnectivity(self, DataArrayInt desc, DataArrayInt descIndx, DataArrayInt revDesc, 
09255             DataArrayInt revDescIndx) -> MEDCouplingUMesh
09256         buildDescendingConnectivity(self) -> PyObject
09257 
09258         1
09259         """
09260         return _ParaMEDMEM.MEDCouplingUMesh_buildDescendingConnectivity(self, *args)

Here is the call graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildDescendingConnectivity2 ( DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt revDesc,
DataArrayInt revDescIndx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set.

For speed reasons no check of this will be done. This method differs from MEDCouplingUMesh::buildDescendingConnectivity method in that 'desc' is in different format. This method is more precise because it returns in descending connectivity giving the direction. If value is positive the n-1 dim element is taken in the same direction, if it is in the opposite direction it is retrieved negative. So the problem is for elemt #0 in C convention. That's why this method is the only one that retrieves an array in relative "FORTRAN" mode.

Definition at line 565 of file MEDCouplingUMesh.cxx.

{
  return buildDescendingConnectivityGen(desc,descIndx,revDesc,revDescIndx,MEDCouplingOrientationSensitiveNbrer);
}

Here is the caller graph for this function:

buildDescendingConnectivity2(self, DataArrayInt desc, DataArrayInt descIndx, DataArrayInt revDesc, 
    DataArrayInt revDescIndx) -> MEDCouplingUMesh
buildDescendingConnectivity2(self) -> PyObject

1

Definition at line 9261 of file ParaMEDMEM.py.

09261 
09262     def buildDescendingConnectivity2(self, *args):
09263         """
09264         buildDescendingConnectivity2(self, DataArrayInt desc, DataArrayInt descIndx, DataArrayInt revDesc, 
09265             DataArrayInt revDescIndx) -> MEDCouplingUMesh
09266         buildDescendingConnectivity2(self) -> PyObject
09267 
09268         1
09269         """
09270         return _ParaMEDMEM.MEDCouplingUMesh_buildDescendingConnectivity2(self, *args)

Here is the call graph for this function:

This methods returns a vector newly created field on cells that represents the direction vector of each 1D cell of this.

This method is only callable on mesh with meshdim == 1 containing only SEG2.

Definition at line 2500 of file MEDCouplingUMesh.cxx.

{
   if(getMeshDimension()!=1)
    throw INTERP_KERNEL::Exception("Expected a umesh with meshDim == 1 for buildDirectionVectorField !");
   if(_types.size()!=1 || *(_types.begin())!=INTERP_KERNEL::NORM_SEG2)
     throw INTERP_KERNEL::Exception("Expected a umesh with only NORM_SEG2 type of elements for buildDirectionVectorField !");
   MEDCouplingFieldDouble *ret=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
   DataArrayDouble *array=DataArrayDouble::New();
   int nbOfCells=getNumberOfCells();
   int spaceDim=getSpaceDimension();
   array->alloc(nbOfCells,spaceDim);
   double *pt=array->getPointer();
   const double *coo=getCoords()->getConstPointer();
   std::vector<int> conn;
   conn.reserve(2);
   for(int i=0;i<nbOfCells;i++)
     {
       conn.resize(0);
       getNodeIdsOfCell(i,conn);
       pt=std::transform(coo+conn[1]*spaceDim,coo+(conn[1]+1)*spaceDim,coo+conn[0]*spaceDim,pt,std::minus<double>());
     }
   ret->setArray(array);
   array->decrRef();
   ret->setMesh(this);
   return ret;   
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildDirectionVectorField(self) -> MEDCouplingFieldDouble

1

Definition at line 8923 of file ParaMEDMEM.py.

08923 
08924     def buildDirectionVectorField(self):
08925         """
08926         buildDirectionVectorField(self) -> MEDCouplingFieldDouble
08927 
08928         1
08929         """
08930         return _ParaMEDMEM.MEDCouplingUMesh_buildDirectionVectorField(self)

Here is the call graph for this function:

This method is NOT const because it can modify 'this'.

'this' is expected to be an unstructured mesh with meshDim==2 and spaceDim==3. If not an exception will be thrown.

Parameters:
mesh1Dis an unstructured mesh with MeshDim==1 and spaceDim==3. If not an exception will be thrown.
policyspecifies the type of extrusion chosen. 0 for translation (most simple), 1 for translation and rotation around point of 'mesh1D'.
Returns:
an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than 'this'.

Definition at line 3109 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  mesh1D->checkFullyDefined();
  if(!mesh1D->isContiguous1D())
    throw INTERP_KERNEL::Exception("buildExtrudedMesh : 1D mesh passed in parameter is not contiguous !");
  if(getSpaceDimension()!=mesh1D->getSpaceDimension())
    throw INTERP_KERNEL::Exception("Invalid call to buildExtrudedMesh this and mesh1D must have same dimension !");
  if((getMeshDimension()!=2 || getSpaceDimension()!=3) && (getMeshDimension()!=1 || getSpaceDimension()!=2))
    throw INTERP_KERNEL::Exception("Invalid 'this' for buildExtrudedMesh method : must be (meshDim==2 and spaceDim==3) or (meshDim==1 and spaceDim==2) !");
  if(mesh1D->getMeshDimension()!=1)
    throw INTERP_KERNEL::Exception("Invalid 'mesh1D' for buildExtrudedMesh method : must be meshDim==1 !");
  bool isQuad=false;
  if(isPresenceOfQuadratic())
    {
      if(mesh1D->isFullyQuadratic())
        isQuad=true;
      else
        throw INTERP_KERNEL::Exception("Invalid 2D mesh and 1D mesh because 2D mesh has quadratic cells and 1D is not fully quadratic !");
    }
  zipCoords();
  int oldNbOfNodes=getNumberOfNodes();
  DataArrayDouble *newCoords=0;
  switch(policy)
    {
    case 0:
      {
        newCoords=fillExtCoordsUsingTranslation(mesh1D,isQuad);
        break;
      }
    case 1:
      {
        newCoords=fillExtCoordsUsingTranslAndAutoRotation(mesh1D,isQuad);
        break;
      }
    default:
      throw INTERP_KERNEL::Exception("Not implemented extrusion policy : must be in (0) !");
    }
  setCoords(newCoords);
  newCoords->decrRef();
  MEDCouplingUMesh *ret=buildExtrudedMeshFromThisLowLev(oldNbOfNodes,isQuad);
  updateTime();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildExtrudedMesh(self, MEDCouplingUMesh mesh1D, int policy) -> MEDCouplingUMesh

1

Definition at line 9417 of file ParaMEDMEM.py.

09417 
09418     def buildExtrudedMesh(self, *args):
09419         """
09420         buildExtrudedMesh(self, MEDCouplingUMesh mesh1D, int policy) -> MEDCouplingUMesh
09421 
09422         1
09423         """
09424         return _ParaMEDMEM.MEDCouplingUMesh_buildExtrudedMesh(self, *args)

Here is the call graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildExtrudedMeshFromThisLowLev ( int  nbOfNodesOf1Lev,
bool  isQuad 
) const [private]

This method is private because not easy to use for end user.

This method is const contrary to MEDCouplingUMesh::buildExtrudedMesh method because this->_coords are expected to contain the coords sorted slice by slice.

Parameters:
isQuadspecifies presence of quadratic cells.

Definition at line 3402 of file MEDCouplingUMesh.cxx.

{
  int nbOf1DCells=getNumberOfNodes()/nbOfNodesOf1Lev-1;
  int nbOf2DCells=getNumberOfCells();
  int nbOf3DCells=nbOf2DCells*nbOf1DCells;
  MEDCouplingUMesh *ret=MEDCouplingUMesh::New("Extruded",getMeshDimension()+1);
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  DataArrayInt *newConn=DataArrayInt::New();
  DataArrayInt *newConnI=DataArrayInt::New();
  newConnI->alloc(nbOf3DCells+1,1);
  int *newConnIPtr=newConnI->getPointer();
  *newConnIPtr++=0;
  std::vector<int> newc;
  for(int j=0;j<nbOf2DCells;j++)
    {
      AppendExtrudedCell(conn+connI[j],conn+connI[j+1],nbOfNodesOf1Lev,isQuad,newc);
      *newConnIPtr++=(int)newc.size();
    }
  newConn->alloc((int)(newc.size())*nbOf1DCells,1);
  int *newConnPtr=newConn->getPointer();
  int deltaPerLev=isQuad?2*nbOfNodesOf1Lev:nbOfNodesOf1Lev;
  newConnIPtr=newConnI->getPointer();
  for(int iz=0;iz<nbOf1DCells;iz++)
    {
      if(iz!=0)
        std::transform(newConnIPtr+1,newConnIPtr+1+nbOf2DCells,newConnIPtr+1+iz*nbOf2DCells,std::bind2nd(std::plus<int>(),newConnIPtr[iz*nbOf2DCells]));
      for(std::vector<int>::const_iterator iter=newc.begin();iter!=newc.end();iter++,newConnPtr++)
        {
          int icell=(int)(iter-newc.begin());
          if(std::find(newConnIPtr,newConnIPtr+nbOf2DCells,icell)==newConnIPtr+nbOf2DCells)
            {
              if(*iter!=-1)
                *newConnPtr=(*iter)+iz*deltaPerLev;
              else
                *newConnPtr=-1;
            }
          else
            *newConnPtr=(*iter);
        }
    }
  ret->setConnectivity(newConn,newConnI,true);
  newConn->decrRef();
  newConnI->decrRef();
  ret->setCoords(getCoords());
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

MEDCouplingPointSet * MEDCouplingUMesh::buildFacePartOfMySelfNode ( const int *  begin,
const int *  end,
bool  fullyIn 
) const

Contrary to MEDCouplingUMesh::buildPartOfMySelfNode method this method builds a mesh with a meshDimension equal to this->getMeshDimension()-1.

The return newly allocated mesh will share the same coordinates as 'this'. Parameter 'fullyIn' specifies if a face that has part of its nodes in ids array is kept or not. If 'fullyIn' is true only faces whose ids are fully contained in ['begin','end') tab will be kept.

Definition at line 1479 of file MEDCouplingUMesh.cxx.

{
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc,descIndx,revDesc,revDescIndx;
  desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=DataArrayInt::New(); revDescIndx=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
  desc=0; descIndx=0; revDesc=0; revDescIndx=0;
  return subMesh->buildPartOfMySelfNode(begin,end,fullyIn);
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingPointSet.buildFacePartOfMySelfNode (   self,
  args 
) [inherited]
buildFacePartOfMySelfNode(self, PyObject li, bool fullyIn) -> PyObject

1

Definition at line 8439 of file ParaMEDMEM.py.

08439 
08440     def buildFacePartOfMySelfNode(self, *args):
08441         """
08442         buildFacePartOfMySelfNode(self, PyObject li, bool fullyIn) -> PyObject
08443 
08444         1
08445         """
08446         return _ParaMEDMEM.MEDCouplingPointSet_buildFacePartOfMySelfNode(self, *args)

BuildInstanceFromMeshType(MEDCouplingMeshType type) -> MEDCouplingPointSet

1

Definition at line 8322 of file ParaMEDMEM.py.

08322 
08323     def BuildInstanceFromMeshType(*args):
08324         """
08325         BuildInstanceFromMeshType(MEDCouplingMeshType type) -> MEDCouplingPointSet
08326 
08327         1
08328         """
08329         return _ParaMEDMEM.MEDCouplingPointSet_BuildInstanceFromMeshType(*args)

Here is the caller graph for this function:

buildNewNumberingFromCommonNodesFormat(self, DataArrayInt comm, DataArrayInt commIndex) -> PyObject

1

Definition at line 8398 of file ParaMEDMEM.py.

08398 
08399     def buildNewNumberingFromCommonNodesFormat(self, *args):
08400         """
08401         buildNewNumberingFromCommonNodesFormat(self, DataArrayInt comm, DataArrayInt commIndex) -> PyObject
08402 
08403         1
08404         """
08405         return _ParaMEDMEM.MEDCouplingPointSet_buildNewNumberingFromCommonNodesFormat(self, *args)

Here is the caller graph for this function:

This methods returns a vector field on cells that represents the orthogonal vector normalized of each 2D cell of this.

This method is only callable on mesh with meshdim == 2 and spacedim==2 or 3.

Definition at line 2386 of file MEDCouplingUMesh.cxx.

{
  if((getMeshDimension()!=2) && (getMeshDimension()!=1 || getSpaceDimension()!=2))
    throw INTERP_KERNEL::Exception("Expected a umesh with ( meshDim == 2 spaceDim == 2 or 3 ) or ( meshDim == 1 spaceDim == 2 ) !");
  MEDCouplingFieldDouble *ret=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
  DataArrayDouble *array=DataArrayDouble::New();
  int nbOfCells=getNumberOfCells();
  int nbComp=getMeshDimension()+1;
  array->alloc(nbOfCells,nbComp);
  double *vals=array->getPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  const int *conn=_nodal_connec->getConstPointer();
  const double *coords=_coords->getConstPointer();
  if(getMeshDimension()==2)
    {
      if(getSpaceDimension()==3)
        {
          DataArrayDouble *loc=getBarycenterAndOwner();
          const double *locPtr=loc->getConstPointer();
          for(int i=0;i<nbOfCells;i++,vals+=3)
            {
              int offset=connI[i];
              INTERP_KERNEL::crossprod<3>(locPtr+3*i,coords+3*conn[offset+1],coords+3*conn[offset+2],vals);
              double n=INTERP_KERNEL::norm<3>(vals);
              std::transform(vals,vals+3,vals,std::bind2nd(std::multiplies<double>(),1./n));
            }
          loc->decrRef();
        }
      else
        {
          for(int i=0;i<nbOfCells;i++)
            { vals[3*i]=0.; vals[3*i+1]=0.; vals[3*i+2]=1.; }
        }
    }
  else//meshdimension==1
    {
      double tmp[2];
      for(int i=0;i<nbOfCells;i++)
        {
          int offset=connI[i];
          std::transform(coords+2*conn[offset+2],coords+2*conn[offset+2]+2,coords+2*conn[offset+1],tmp,std::minus<double>());
          double n=INTERP_KERNEL::norm<2>(tmp);
          std::transform(tmp,tmp+2,tmp,std::bind2nd(std::multiplies<double>(),1./n));
          *vals++=-tmp[1];
          *vals++=tmp[0];
        }
    }
  ret->setArray(array);
  array->decrRef();
  ret->setMesh(this);
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildOrthogonalField(self) -> MEDCouplingFieldDouble

1

Definition at line 636 of file ParaMEDMEM.py.

00636 
00637     def buildOrthogonalField(self):
00638         """
00639         buildOrthogonalField(self) -> MEDCouplingFieldDouble
00640 
00641         1
00642         """
00643         return _ParaMEDMEM.MEDCouplingMesh_buildOrthogonalField(self)

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.buildPart (   self,
  args 
) [inherited]
buildPart(self, PyObject li) -> PyObject

1

Definition at line 772 of file ParaMEDMEM.py.

00772 
00773     def buildPart(self, *args):
00774         """
00775         buildPart(self, PyObject li) -> PyObject
00776 
00777         1
00778         """
00779         return _ParaMEDMEM.MEDCouplingMesh_buildPart(self, *args)

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.buildPartAndReduceNodes (   self,
  args 
) [inherited]
buildPartAndReduceNodes(self, PyObject li) -> PyObject

1

Definition at line 780 of file ParaMEDMEM.py.

00780 
00781     def buildPartAndReduceNodes(self, *args):
00782         """
00783         buildPartAndReduceNodes(self, PyObject li) -> PyObject
00784 
00785         1
00786         """
00787         return _ParaMEDMEM.MEDCouplingMesh_buildPartAndReduceNodes(self, *args)

Here is the caller graph for this function:

MEDCouplingPointSet * MEDCouplingUMesh::buildPartOfMySelf ( const int *  begin,
const int *  end,
bool  keepCoords 
) const

build a sub part of 'this'.

This sub part is defined by the cell ids contained in the array in [begin,end).

Parameters:
beginbegin of array containing the cell ids to keep.
endend of array of cell ids to keep. WARNING end param is not included ! Idem STL standard definitions.
keepCoordsthat specifies if you want or not to keep coords as this or zip it (see ParaMEDMEM::MEDCouplingUMesh::zipCoords). If true zipCoords is NOT called, if false, zipCoords is called.

Definition at line 1386 of file MEDCouplingUMesh.cxx.

{
  if(getMeshDimension()!=-1)
    {
      MEDCouplingUMesh *ret=buildPartOfMySelfKeepCoords(begin,end);
      if(!keepCoords)
        ret->zipCoords();
      return ret;
    }
  else
    {
      if(end-begin!=1)
        throw INTERP_KERNEL::Exception("-1D mesh has only one cell !");
      if(begin[0]!=0)
        throw INTERP_KERNEL::Exception("-1D mesh has only one cell : 0 !");
      incrRef();
      return const_cast<MEDCouplingUMesh *>(this);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingPointSet.buildPartOfMySelf (   self,
  args 
) [inherited]
buildPartOfMySelf(self, PyObject li, bool keepCoords) -> PyObject

1

Definition at line 8423 of file ParaMEDMEM.py.

08423 
08424     def buildPartOfMySelf(self, *args):
08425         """
08426         buildPartOfMySelf(self, PyObject li, bool keepCoords) -> PyObject
08427 
08428         1
08429         """
08430         return _ParaMEDMEM.MEDCouplingPointSet_buildPartOfMySelf(self, *args)

Here is the caller graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildPartOfMySelfKeepCoords ( const int *  begin,
const int *  end 
) const [private]

This is the low algorithm of buildPartOfMySelf.

Keeps from 'this' only cells which constituing point id are in the ids specified by ['begin','end'). The return newly allocated mesh will share the same coordinates as 'this'.

Definition at line 2209 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  int ncell=getNumberOfCells();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
  ret->_mesh_dim=_mesh_dim;
  ret->setCoords(_coords);
  std::size_t nbOfElemsRet=std::distance(begin,end);
  int *connIndexRet=new int[nbOfElemsRet+1];
  connIndexRet[0]=0;
  const int *conn=_nodal_connec->getConstPointer();
  const int *connIndex=_nodal_connec_index->getConstPointer();
  int newNbring=0;
  for(const int *work=begin;work!=end;work++,newNbring++)
    {
      if(*work>=0 && *work<ncell)
        connIndexRet[newNbring+1]=connIndexRet[newNbring]+connIndex[*work+1]-connIndex[*work];
      else
        {
          delete [] connIndexRet;
          std::ostringstream oss; oss << "MEDCouplingUMesh::buildPartOfMySelfKeepCoords : On pos #" << std::distance(begin,work) << " input cell id =" << *work << " should be in [0," << ncell << ") !";
          throw INTERP_KERNEL::Exception(oss.str().c_str());
        }
    }
  int *connRet=new int[connIndexRet[nbOfElemsRet]];
  int *connRetWork=connRet;
  std::set<INTERP_KERNEL::NormalizedCellType> types;
  for(const int *work=begin;work!=end;work++)
    {
      types.insert((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*work]]);
      connRetWork=std::copy(conn+connIndex[*work],conn+connIndex[*work+1],connRetWork);
    }
  DataArrayInt *connRetArr=DataArrayInt::New();
  connRetArr->useArray(connRet,true,CPP_DEALLOC,connIndexRet[nbOfElemsRet],1);
  DataArrayInt *connIndexRetArr=DataArrayInt::New();
  connIndexRetArr->useArray(connIndexRet,true,CPP_DEALLOC,(int)nbOfElemsRet+1,1);
  ret->setConnectivity(connRetArr,connIndexRetArr,false);
  ret->_types=types;
  connRetArr->decrRef();
  connIndexRetArr->decrRef();
  ret->copyTinyInfoFrom(this);
  std::string name(getName());
  std::size_t sz=strlen(PART_OF_NAME);
  if(name.length()>=sz)
    name=name.substr(0,sz);
  if(name!=PART_OF_NAME)
    {
      std::ostringstream stream; stream << PART_OF_NAME << getName();
      ret->setName(stream.str().c_str());
    }
  else
    ret->setName(getName());
  ret->incrRef();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

MEDCouplingPointSet * MEDCouplingUMesh::buildPartOfMySelfNode ( const int *  begin,
const int *  end,
bool  fullyIn 
) const

Keeps from 'this' only cells which constituing point id are in the ids specified by ['begin','end').

The return newly allocated mesh will share the same coordinates as 'this'. Parameter 'fullyIn' specifies if a cell that has part of its nodes in ids array is kept or not. If 'fullyIn' is true only cells whose ids are fully contained in ['begin','end') tab will be kept.

Definition at line 1466 of file MEDCouplingUMesh.cxx.

{
  std::vector<int> cellIdsKept;
  fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept);
  return buildPartOfMySelf(&cellIdsKept[0],&cellIdsKept[0]+cellIdsKept.size(),true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingPointSet.buildPartOfMySelfNode (   self,
  args 
) [inherited]
buildPartOfMySelfNode(self, PyObject li, bool fullyIn) -> PyObject

1

Definition at line 8431 of file ParaMEDMEM.py.

08431 
08432     def buildPartOfMySelfNode(self, *args):
08433         """
08434         buildPartOfMySelfNode(self, PyObject li, bool fullyIn) -> PyObject
08435 
08436         1
08437         """
08438         return _ParaMEDMEM.MEDCouplingPointSet_buildPartOfMySelfNode(self, *args)

MEDCouplingFieldDouble * MEDCouplingUMesh::buildPartOrthogonalField ( const int *  begin,
const int *  end 
) const

This method is equivalent to MEDCouplingUMesh::buildOrthogonalField except that only part defined by [begin,end) is returned ! This method avoids to build explicitely part of this to perform the work.

Definition at line 2443 of file MEDCouplingUMesh.cxx.

{
  if((getMeshDimension()!=2) && (getMeshDimension()!=1 || getSpaceDimension()!=2))
    throw INTERP_KERNEL::Exception("Expected a umesh with ( meshDim == 2 spaceDim == 2 or 3 ) or ( meshDim == 1 spaceDim == 2 ) !");
  MEDCouplingFieldDouble *ret=MEDCouplingFieldDouble::New(ON_CELLS,NO_TIME);
  DataArrayDouble *array=DataArrayDouble::New();
  std::size_t nbelems=std::distance(begin,end);
  int nbComp=getMeshDimension()+1;
  array->alloc((int)nbelems,nbComp);
  double *vals=array->getPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  const int *conn=_nodal_connec->getConstPointer();
  const double *coords=_coords->getConstPointer();
  if(getMeshDimension()==2)
    {
      if(getSpaceDimension()==3)
        {
          DataArrayDouble *loc=getPartBarycenterAndOwner(begin,end);
          const double *locPtr=loc->getConstPointer();
          for(const int *i=begin;i!=end;i++,vals+=3,locPtr+=3)
            {
              int offset=connI[*i];
              INTERP_KERNEL::crossprod<3>(locPtr,coords+3*conn[offset+1],coords+3*conn[offset+2],vals);
              double n=INTERP_KERNEL::norm<3>(vals);
              std::transform(vals,vals+3,vals,std::bind2nd(std::multiplies<double>(),1./n));
            }
          loc->decrRef();
        }
      else
        {
          for(std::size_t i=0;i<nbelems;i++)
            { vals[3*i]=0.; vals[3*i+1]=0.; vals[3*i+2]=1.; }
        }
    }
  else//meshdimension==1
    {
      double tmp[2];
      for(const int *i=begin;i!=end;i++)
        {
          int offset=connI[*i];
          std::transform(coords+2*conn[offset+2],coords+2*conn[offset+2]+2,coords+2*conn[offset+1],tmp,std::minus<double>());
          double n=INTERP_KERNEL::norm<2>(tmp);
          std::transform(tmp,tmp+2,tmp,std::bind2nd(std::multiplies<double>(),1./n));
          *vals++=-tmp[1];
          *vals++=tmp[0];
        }
    }
  ret->setArray(array);
  array->decrRef();
  ret->setMesh(this);
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildPartOrthogonalField(self, DataArrayInt da) -> MEDCouplingFieldDouble

1

Definition at line 9311 of file ParaMEDMEM.py.

09311 
09312     def buildPartOrthogonalField(self, *args):
09313         """
09314         buildPartOrthogonalField(self, DataArrayInt da) -> MEDCouplingFieldDouble
09315 
09316         1
09317         """
09318         return _ParaMEDMEM.MEDCouplingUMesh_buildPartOrthogonalField(self, *args)

Here is the call graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildSetInstanceFromThis ( int  spaceDim) const throw (INTERP_KERNEL::Exception)

This method builds a newly allocated instance (with the same name than 'this') that the caller has the responsability to deal with.

This method returns an instance with all arrays allocated (connectivity, connectivity index, coordinates) but with length of these arrays set to 0. It allows to define an "empty" mesh (with nor cells nor nodes but compliant with some algos).

This method expects that 'this' has a mesh dimension set and higher or equal to 0. If not an exception will be thrown. This method analyzes the 3 arrays of 'this'. For each the following behaviour is done : if the array is null a newly one is created with number of tuples set to 0, if not the array is taken as this in the returned instance.

Definition at line 1943 of file MEDCouplingUMesh.cxx.

{
  int mdim=getMeshDimension();
  if(mdim<0)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSetInstanceFromThis : invalid mesh dimension ! Should be >= 0 !");
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
  bool needToCpyCT=true;
  if(!_nodal_connec)
    {
      tmp1=DataArrayInt::New(); tmp1->alloc(0,1);
      needToCpyCT=false;
    }
  else
    {
      tmp1=_nodal_connec;
      tmp1->incrRef();
    }
  if(!_nodal_connec_index)
    {
      tmp2=DataArrayInt::New(); tmp2->alloc(1,1); tmp2->setIJ(0,0,0);
      needToCpyCT=false;
    }
  else
    {
      tmp2=_nodal_connec_index;
      tmp2->incrRef();
    }
  ret->setConnectivity(tmp1,tmp2,false);
  if(needToCpyCT)
    ret->_types=_types;
  if(!_coords)
    {
      MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> coords=DataArrayDouble::New(); coords->alloc(0,spaceDim);
      ret->setCoords(coords);
    }
  else
    ret->setCoords(_coords);
  ret->incrRef();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildSetInstanceFromThis(self, int spaceDim) -> MEDCouplingUMesh

1

Definition at line 8835 of file ParaMEDMEM.py.

08835 
08836     def buildSetInstanceFromThis(self, *args):
08837         """
08838         buildSetInstanceFromThis(self, int spaceDim) -> MEDCouplingUMesh
08839 
08840         1
08841         """
08842         return _ParaMEDMEM.MEDCouplingUMesh_buildSetInstanceFromThis(self, *args)

Here is the call graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3D ( const double *  origin,
const double *  vec,
double  eps,
DataArrayInt *&  cellIds 
) const throw (INTERP_KERNEL::Exception)

This method expects that 'this' is fully defined and has a spaceDim==3 and a meshDim==3.

If it is not the case an exception will be thrown. This method returns 2 objects :

  • a newly created mesh instance containing the result of the slice lying on different coords than 'this' and with a meshdim == 2
  • a newly created dataarray having number of tuples equal to the number of cells in returned mesh that tells for each 2D cell in returned mesh the 3D cell id is 'this' it comes from. This method works only for linear meshes (non quadratic). If plane crosses within 'eps' a face in 'this' shared by more than 1 cell, 2 output faces will be generated. The 2 faces having the same geometry than intersecting face. Only 'cellIds' parameter can distinguish the 2.
    Parameters:
    originis the origin of the plane. It should be an array of length 3.
    vecis the direction vector of the plane. It should be an array of length 3. Norm of 'vec' should be > 1e-6.
    epsis the precision. It is used by called method MEDCouplingUMesh::getCellIdsCrossingPlane for the first 3D cell selection (in absolute). 'eps' is also used to state if new points should be created or already existing points are reused. 'eps' is also used to tells if plane overlaps a face, edge or nodes (in absolute).

Definition at line 2541 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  if(getMeshDimension()!=3 || getSpaceDimension()!=3)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
  if(candidates->empty())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane considering bounding boxes !");
  std::vector<int> nodes;
  std::vector<int> cellIds2D,cellIds1D;
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
  subMesh->findNodesOnPlane(origin,vec,eps,nodes);
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1=DataArrayInt::New(),desc2=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx1=DataArrayInt::New(),descIndx2=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc1=DataArrayInt::New(),revDesc2=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx1=DataArrayInt::New(),revDescIndx2=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc2=subMesh->buildDescendingConnectivity(desc2,descIndx2,revDesc2,revDescIndx2);//meshDim==2 spaceDim==3
  revDesc2=0; revDescIndx2=0;
  mDesc2->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds2D);
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc1=mDesc2->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
  revDesc1=0; revDescIndx1=0;
  mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
  //
  std::vector<int> cut3DCurve(mDesc1->getNumberOfCells(),-2);
  for(std::vector<int>::const_iterator it=cellIds1D.begin();it!=cellIds1D.end();it++)
    cut3DCurve[*it]=-1;
  mDesc1->split3DCurveWithPlane(origin,vec,eps,cut3DCurve);
  std::vector< std::pair<int,int> > cut3DSurf(mDesc2->getNumberOfCells());
  AssemblyForSplitFrom3DCurve(cut3DCurve,nodes,mDesc2->getNodalConnectivity()->getConstPointer(),mDesc2->getNodalConnectivityIndex()->getConstPointer(),
                              mDesc1->getNodalConnectivity()->getConstPointer(),mDesc1->getNodalConnectivityIndex()->getConstPointer(),
                              desc1->getConstPointer(),descIndx1->getConstPointer(),cut3DSurf);
  std::vector<int> conn,connI,cellIds2;
  connI.push_back(0);
  subMesh->assemblyForSplitFrom3DSurf(cut3DSurf,desc2->getConstPointer(),descIndx2->getConstPointer(),conn,connI,cellIds2);
  if(cellIds2.empty())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane !");
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("Slice3D",2);
  ret->setCoords(mDesc1->getCoords());
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
  c->alloc((int)conn.size(),1); std::copy(conn.begin(),conn.end(),c->getPointer());
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::New();
  cI->alloc((int)connI.size(),1); std::copy(connI.begin(),connI.end(),cI->getPointer());
  ret->setConnectivity(c,cI,true);
  cellIds=candidates->selectByTupleId(&cellIds2[0],&cellIds2[0]+cellIds2.size());
  ret->incrRef();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingUMesh.buildSlice3D (   self,
  args 
)
buildSlice3D(self, PyObject origin, PyObject vec, double eps) -> PyObject

1

Definition at line 9361 of file ParaMEDMEM.py.

09361 
09362     def buildSlice3D(self, *args):
09363         """
09364         buildSlice3D(self, PyObject origin, PyObject vec, double eps) -> PyObject
09365 
09366         1
09367         """
09368         return _ParaMEDMEM.MEDCouplingUMesh_buildSlice3D(self, *args)

Here is the call graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3DSurf ( const double *  origin,
const double *  vec,
double  eps,
DataArrayInt *&  cellIds 
) const throw (INTERP_KERNEL::Exception)

This method expects that 'this' is fully defined and has a spaceDim==3 and a meshDim==2.

If it is not the case an exception will be thrown. This method returns 2 objects :

  • a newly created mesh instance containing the result of the slice lying on different coords than 'this' and with a meshdim == 1
  • a newly created dataarray having number of tuples equal to the number of cells in returned mesh that tells for each 2D cell in returned mesh the 3DSurf cell id is 'this' it comes from. This method works only for linear meshes (non quadratic). If plane crosses within 'eps' a face in 'this' shared by more than 1 cell, 2 output faces will be generated. The 2 faces having the same geometry than intersecting face. Only 'cellIds' parameter can distinguish the 2.
    Parameters:
    originis the origin of the plane. It should be an array of length 3.
    vecis the direction vector of the plane. It should be an array of length 3. Norm of 'vec' should be > 1e-6.
    epsis the precision. It is used by called method MEDCouplingUMesh::getCellIdsCrossingPlane for the first 3DSurf cell selection (in absolute). 'eps' is also used to state if new points should be created or already existing points are reused. 'eps' is also used to tells if plane overlaps a face, edge or nodes (in absolute).

Definition at line 2603 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  if(getMeshDimension()!=2 || getSpaceDimension()!=3)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D works on umeshes with meshdim equal to 2 and spaceDim equal to 3 !");
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> candidates=getCellIdsCrossingPlane(origin,vec,eps);
  if(candidates->empty())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3D : No 3D cells in this intercepts the specified plane considering bounding boxes !");
  std::vector<int> nodes;
  std::vector<int> cellIds1D;
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=static_cast<MEDCouplingUMesh*>(buildPartOfMySelf(candidates->begin(),candidates->end(),false));
  subMesh->findNodesOnPlane(origin,vec,eps,nodes);
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc1=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx1=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc1=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx1=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> mDesc1=subMesh->buildDescendingConnectivity(desc1,descIndx1,revDesc1,revDescIndx1);//meshDim==1 spaceDim==3
  mDesc1->fillCellIdsToKeepFromNodeIds(&nodes[0],&nodes[0]+nodes.size(),true,cellIds1D);
  //
  std::vector<int> cut3DCurve(mDesc1->getNumberOfCells(),-2);
  for(std::vector<int>::const_iterator it=cellIds1D.begin();it!=cellIds1D.end();it++)
    cut3DCurve[*it]=-1;
  mDesc1->split3DCurveWithPlane(origin,vec,eps,cut3DCurve);
  int ncellsSub=subMesh->getNumberOfCells();
  std::vector< std::pair<int,int> > cut3DSurf(ncellsSub);
  AssemblyForSplitFrom3DCurve(cut3DCurve,nodes,subMesh->getNodalConnectivity()->getConstPointer(),subMesh->getNodalConnectivityIndex()->getConstPointer(),
                              mDesc1->getNodalConnectivity()->getConstPointer(),mDesc1->getNodalConnectivityIndex()->getConstPointer(),
                              desc1->getConstPointer(),descIndx1->getConstPointer(),cut3DSurf);
  std::vector<int> conn,connI,cellIds2; connI.push_back(0);
  const int *nodal=subMesh->getNodalConnectivity()->getConstPointer();
  const int *nodalI=subMesh->getNodalConnectivityIndex()->getConstPointer();
  for(int i=0;i<ncellsSub;i++)
    {
      if(cut3DSurf[i].first!=-1 && cut3DSurf[i].second!=-1)
        {
          if(cut3DSurf[i].first!=-2)
            {
              conn.push_back((int)INTERP_KERNEL::NORM_SEG2); conn.push_back(cut3DSurf[i].first); conn.push_back(cut3DSurf[i].second);
              connI.push_back((int)conn.size());
              cellIds2.push_back(i);
            }
          else
            {
              int cellId3DSurf=cut3DSurf[i].second;
              int offset=nodalI[cellId3DSurf]+1;
              int nbOfEdges=nodalI[cellId3DSurf+1]-offset;
              for(int j=0;j<nbOfEdges;j++)
                {
                  conn.push_back((int)INTERP_KERNEL::NORM_SEG2); conn.push_back(nodal[offset+j]); conn.push_back(nodal[offset+(j+1)%nbOfEdges]);
                  connI.push_back((int)conn.size());
                  cellIds2.push_back(cellId3DSurf);
                }
            }
        }
    }
  if(cellIds2.empty())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSlice3DSurf : No 3DSurf cells in this intercepts the specified plane !");
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New("Slice3DSurf",1);
  ret->setCoords(mDesc1->getCoords());
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=DataArrayInt::New();
  c->alloc((int)conn.size(),1); std::copy(conn.begin(),conn.end(),c->getPointer());
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cI=DataArrayInt::New();
  cI->alloc((int)connI.size(),1); std::copy(connI.begin(),connI.end(),cI->getPointer());
  ret->setConnectivity(c,cI,true);
  cellIds=candidates->selectByTupleId(&cellIds2[0],&cellIds2[0]+cellIds2.size());
  ret->incrRef();
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildSlice3DSurf(self, PyObject origin, PyObject vec, double eps) -> PyObject

1

Definition at line 9369 of file ParaMEDMEM.py.

09369 
09370     def buildSlice3DSurf(self, *args):
09371         """
09372         buildSlice3DSurf(self, PyObject origin, PyObject vec, double eps) -> PyObject
09373 
09374         1
09375         """
09376         return _ParaMEDMEM.MEDCouplingUMesh_buildSlice3DSurf(self, *args)

Here is the call graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::buildUnstructured ( ) const throw (INTERP_KERNEL::Exception)

Definition at line 1588 of file MEDCouplingUMesh.cxx.

{
  incrRef();
  return const_cast<MEDCouplingUMesh *>(this);
}

Here is the call graph for this function:

Here is the caller graph for this function:

buildUnstructured(self) -> MEDCouplingUMesh

1

Definition at line 644 of file ParaMEDMEM.py.

00644 
00645     def buildUnstructured(self):
00646         """
00647         buildUnstructured(self) -> MEDCouplingUMesh
00648 
00649         1
00650         """
00651         return _ParaMEDMEM.MEDCouplingMesh_buildUnstructured(self)

Here is the caller graph for this function:

Entry point for iteration over cells of this.

Warning the returned cell iterator should be deallocated. Useful for python users.

Definition at line 276 of file MEDCouplingUMesh.cxx.

{
  return new MEDCouplingUMeshCellIterator(this);
}
MEDCouplingUMeshCellByTypeEntry * MEDCouplingUMesh::cellsByType ( ) throw (INTERP_KERNEL::Exception)

Entry point for iteration over cells groups geo types per geotypes.

Warning the returned cell iterator should be deallocated. If 'this' is not so that that cells are grouped by geo types this method will throw an exception. In this case MEDCouplingUMesh::sortCellsInMEDFileFrmt or MEDCouplingUMesh::rearrange2ConsecutiveCellTypes methods for example can be called before invoking this method. Useful for python users.

Definition at line 287 of file MEDCouplingUMesh.cxx.

{
  if(!checkConsecutiveCellTypes())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::cellsByType : this mesh is not sorted by type !");
  return new MEDCouplingUMeshCellByTypeEntry(this);
}

Here is the call graph for this function:

Here is the caller graph for this function:

cellsByType(self) -> MEDCouplingUMeshCellByTypeEntry

1

Definition at line 8778 of file ParaMEDMEM.py.

08778 
08779     def cellsByType(self):
08780         """
08781         cellsByType(self) -> MEDCouplingUMeshCellByTypeEntry
08782 
08783         1
08784         """
08785         return _ParaMEDMEM.MEDCouplingUMesh_cellsByType(self)

Here is the call graph for this function:

def ParaMEDMEM.MEDCouplingPointSet.changeSpaceDimension (   self,
  args 
) [inherited]
changeSpaceDimension(self, int newSpaceDim, double dftVal = 0.)
changeSpaceDimension(self, int newSpaceDim)

1

Definition at line 8287 of file ParaMEDMEM.py.

08287 
08288     def changeSpaceDimension(self, *args):
08289         """
08290         changeSpaceDimension(self, int newSpaceDim, double dftVal = 0.)
08291         changeSpaceDimension(self, int newSpaceDim)
08292 
08293         1
08294         """
08295         return _ParaMEDMEM.MEDCouplingPointSet_changeSpaceDimension(self, *args)

Here is the caller graph for this function:

void MEDCouplingUMesh::checkButterflyCells ( std::vector< int > &  cells,
double  eps = 1e-12 
) const

This method is only available for a mesh with meshDim==2 and spaceDim==2||spaceDim==3.

This method returns a vector 'cells' where all detected butterfly cells have been added to cells. A 2D cell is considered to be butterfly if it exists at least one pair of distinct edges of it that intersect each other anywhere excepted their extremities. An INTERP_KERNEL::NORM_NORI3 could not be butterfly.

Definition at line 3029 of file MEDCouplingUMesh.cxx.

{
  const char msg[]="Butterfly detection work only for 2D cells with spaceDim==2 or 3!";
  if(getMeshDimension()!=2)
    throw INTERP_KERNEL::Exception(msg);
  int spaceDim=getSpaceDimension();
  if(spaceDim!=2 && spaceDim!=3)
    throw INTERP_KERNEL::Exception(msg);
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  int nbOfCells=getNumberOfCells();
  std::vector<double> cell2DinS2;
  for(int i=0;i<nbOfCells;i++)
    {
      int offset=connI[i];
      int nbOfNodesForCell=connI[i+1]-offset-1;
      if(nbOfNodesForCell<=3)
        continue;
      bool isQuad=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[offset]).isQuadratic();
      project2DCellOnXY(conn+offset+1,conn+connI[i+1],cell2DinS2);
      if(isButterfly2DCell(cell2DinS2,isQuad,eps))
        cells.push_back(i);
      cell2DinS2.clear();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingUMesh.checkButterflyCells (   self,
  eps = 1e-12 
)
checkButterflyCells(self, double eps = 1e-12) -> PyObject
checkButterflyCells(self) -> PyObject

1

Definition at line 9094 of file ParaMEDMEM.py.

09094 
09095     def checkButterflyCells(self, eps = 1e-12):
09096         """
09097         checkButterflyCells(self, double eps = 1e-12) -> PyObject
09098         checkButterflyCells(self) -> PyObject
09099 
09100         1
09101         """
09102         return _ParaMEDMEM.MEDCouplingUMesh_checkButterflyCells(self, eps)

Here is the call graph for this function:

void MEDCouplingUMesh::checkCoherency ( ) const throw (INTERP_KERNEL::Exception)

This method checks that this is correctly designed.

For example le coordinates are set, nodal connectivity. When this method returns without throwing any exception, 'this' is expected to be writable, exchangeable and to be available for most of algorithm. When a mesh has been constructed from scratch it is a good habits to call this method to check that all is in order in 'this'.

Definition at line 99 of file MEDCouplingUMesh.cxx.

{
  if(_mesh_dim<-1)
    throw INTERP_KERNEL::Exception("No mesh dimension specified !");
  for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iter=_types.begin();iter!=_types.end();iter++)
    {
      if((int)INTERP_KERNEL::CellModel::GetCellModel(*iter).getDimension()!=_mesh_dim)
        {
          std::ostringstream message;
          message << "Mesh invalid because dimension is " << _mesh_dim << " and there is presence of cell(s) with type " << (*iter);
          throw INTERP_KERNEL::Exception(message.str().c_str());
        }
    }
  if(_nodal_connec)
    {
      if(_nodal_connec->getNumberOfComponents()!=1)
        throw INTERP_KERNEL::Exception("Nodal connectivity array is expected to be with number of components set to one !");
      if(_nodal_connec->getInfoOnComponent(0)!="")
        throw INTERP_KERNEL::Exception("Nodal connectivity array is expected to have no info on its single component !");
    }
  if(_nodal_connec_index)
    {
      if(_nodal_connec_index->getNumberOfComponents()!=1)
        throw INTERP_KERNEL::Exception("Nodal connectivity index array is expected to be with number of components set to one !");
      if(_nodal_connec_index->getInfoOnComponent(0)!="")
        throw INTERP_KERNEL::Exception("Nodal connectivity index array is expected to have no info on its single component !");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

checkCoherency(self)

1

Reimplemented from ParaMEDMEM.MEDCouplingMesh.

Definition at line 8746 of file ParaMEDMEM.py.

08746 
08747     def checkCoherency(self):
08748         """
08749         checkCoherency(self)
08750 
08751         1
08752         """
08753         return _ParaMEDMEM.MEDCouplingUMesh_checkCoherency(self)

Here is the call graph for this function:

void MEDCouplingUMesh::checkCoherency1 ( double  eps = 1e-12) const throw (INTERP_KERNEL::Exception)

This method performs deeper checking in 'this' than MEDCouplingUMesh::checkCoherency does.

So this method is more time-consuming. This method checks that nodal connectivity points to valid node ids. No geometrical aspects are checked here. These aspects are done in MEDCouplingUMesh::checkCoherency2.

Definition at line 133 of file MEDCouplingUMesh.cxx.

{
  checkCoherency();
  if(_mesh_dim==-1)
    return ;
  int meshDim=getMeshDimension();
  int nbOfNodes=getNumberOfNodes();
  int nbOfCells=getNumberOfCells();
  const int *ptr=_nodal_connec->getConstPointer();
  const int *ptrI=_nodal_connec_index->getConstPointer();
  for(int i=0;i<nbOfCells;i++)
    {
      const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)ptr[ptrI[i]]);
      if((int)cm.getDimension()!=meshDim)
        {
          std::ostringstream oss;
          oss << "MEDCouplingUMesh::checkCoherency1 : cell << #" << i<< " with type Type " << cm.getRepr() << " in 'this' whereas meshdim == " << meshDim << " !";
          throw INTERP_KERNEL::Exception(oss.str().c_str());
        }
      int nbOfNodesInCell=ptrI[i+1]-ptrI[i]-1;
      if(!cm.isDynamic())
        if(nbOfNodesInCell!=(int)cm.getNumberOfNodes())
          {
            std::ostringstream oss;
            oss << "MEDCouplingUMesh::checkCoherency1 : cell #" << i << " with static Type '" << cm.getRepr() << "' has " <<  cm.getNumberOfNodes();
            oss << " nodes whereas in connectivity there is " << nbOfNodesInCell << " nodes ! Looks very bad !";
            throw INTERP_KERNEL::Exception(oss.str().c_str());
          }
      for(const int *w=ptr+ptrI[i]+1;w!=ptr+ptrI[i+1];w++)
        {
          int nodeId=*w;
          if(nodeId>=0)
            {
              if(nodeId>=nbOfNodes)
                {
                  std::ostringstream oss; oss << "Cell #" << i << " is consituted of node #" << nodeId << " whereas there are only " << nbOfNodes << " nodes !";
                  throw INTERP_KERNEL::Exception(oss.str().c_str());
                }
            }
          else if(nodeId<-1)
            {
              std::ostringstream oss; oss << "Cell #" << i << " is consituted of node #" << nodeId << " in connectivity ! sounds bad !";
              throw INTERP_KERNEL::Exception(oss.str().c_str());
            }
          else
            {
              if((INTERP_KERNEL::NormalizedCellType)(ptr[ptrI[i]])!=INTERP_KERNEL::NORM_POLYHED)
                {
                  std::ostringstream oss; oss << "Cell #" << i << " is consituted of node #-1 in connectivity ! sounds bad !";
                  throw INTERP_KERNEL::Exception(oss.str().c_str());
                }
            }
        }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.checkCoherency1 (   self,
  eps = 1e-12 
) [inherited]
checkCoherency1(self, double eps = 1e-12)
checkCoherency1(self)

1

Definition at line 490 of file ParaMEDMEM.py.

00490 
00491     def checkCoherency1(self, eps = 1e-12):
00492         """
00493         checkCoherency1(self, double eps = 1e-12)
00494         checkCoherency1(self)
00495 
00496         1
00497         """
00498         return _ParaMEDMEM.MEDCouplingMesh_checkCoherency1(self, eps)

Here is the caller graph for this function:

void MEDCouplingUMesh::checkCoherency2 ( double  eps = 1e-12) const throw (INTERP_KERNEL::Exception)

Definition at line 189 of file MEDCouplingUMesh.cxx.

{
  checkCoherency1(eps);
}

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.checkCoherency2 (   self,
  eps = 1e-12 
) [inherited]
checkCoherency2(self, double eps = 1e-12)
checkCoherency2(self)

1

Definition at line 499 of file ParaMEDMEM.py.

00499 
00500     def checkCoherency2(self, eps = 1e-12):
00501         """
00502         checkCoherency2(self, double eps = 1e-12)
00503         checkCoherency2(self)
00504 
00505         1
00506         """
00507         return _ParaMEDMEM.MEDCouplingMesh_checkCoherency2(self, eps)

Here is the caller graph for this function:

void MEDCouplingUMesh::checkConnectivityFullyDefined ( ) const throw (INTERP_KERNEL::Exception) [private]

This method checks that all connectivity arrays are set.

If yes nothing done if no an exception is thrown.

Definition at line 2092 of file MEDCouplingUMesh.cxx.

{
  if(!_nodal_connec_index || !_nodal_connec)
    throw INTERP_KERNEL::Exception("Reverse nodal connectivity computation requires full connectivity set in unstructured mesh.");
}

Here is the caller graph for this function:

This methods checks that cells are sorted by their types.

This method makes asumption (no check) that connectivity is correctly set before calling.

Definition at line 4574 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  int nbOfCells=getNumberOfCells();
  std::set<INTERP_KERNEL::NormalizedCellType> types;
  for(const int *i=connI;i!=connI+nbOfCells;)
    {
      INTERP_KERNEL::NormalizedCellType curType=(INTERP_KERNEL::NormalizedCellType)conn[*i];
      if(types.find(curType)!=types.end())
        return false;
      types.insert(curType);
      i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
    }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

checkConsecutiveCellTypes(self) -> bool

1

Definition at line 8867 of file ParaMEDMEM.py.

08867 
08868     def checkConsecutiveCellTypes(self):
08869         """
08870         checkConsecutiveCellTypes(self) -> bool
08871 
08872         1
08873         """
08874         return _ParaMEDMEM.MEDCouplingUMesh_checkConsecutiveCellTypes(self)

Here is the call graph for this function:

This method performs the same job as checkConsecutiveCellTypes except that the order of types sequence is analyzed to check that the order is specified in array defined by [orderBg,orderEnd).

Definition at line 4596 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  int nbOfCells=getNumberOfCells();
  int lastPos=-1;
  for(const int *i=connI;i!=connI+nbOfCells;)
    {
      INTERP_KERNEL::NormalizedCellType curType=(INTERP_KERNEL::NormalizedCellType)conn[*i];
      int pos=(int)std::distance(orderBg,std::find(orderBg,orderEnd,curType));
      if(pos<=lastPos)
        return false;
      lastPos=pos;
      i=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)curType));
    }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

checkConsecutiveCellTypesAndOrder(self, PyObject li) -> bool

1

Definition at line 9119 of file ParaMEDMEM.py.

09119 
09120     def checkConsecutiveCellTypesAndOrder(self, *args):
09121         """
09122         checkConsecutiveCellTypesAndOrder(self, PyObject li) -> bool
09123 
09124         1
09125         """
09126         return _ParaMEDMEM.MEDCouplingUMesh_checkConsecutiveCellTypesAndOrder(self, *args)

Here is the call graph for this function:

void MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor 
) const throw (INTERP_KERNEL::Exception)

This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter.

The difference with MEDCouplingUMesh::checkDeepEquivalWith method is that coordinates of 'this' and 'other' are expected to be the same. If not an exception will be thrown. This method is close to MEDCouplingUMesh::areCellsIncludedIn except that this method throws exception !

In case of success cellCor are informed both.

Parameters:
cellCompPolvalues are described in MEDCouplingUMesh::zipConnectivityTraducer method.
cellCoroutput array giving the correspondance of cells from 'other' to 'this'.

Definition at line 422 of file MEDCouplingUMesh.cxx.

{
  const MEDCouplingUMesh *otherC=dynamic_cast<const MEDCouplingUMesh *>(other);
  if(!otherC)
    throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : Two meshes are not not unstructured !");
  MEDCouplingMesh::checkFastEquivalWith(other,prec);
  if(_types!=otherC->_types)
    throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : Types are not equal !");
  if(_coords!=otherC->_coords)
    throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : meshes do not share the same coordinates ! Use tryToShareSameCoordinates or call checkDeepEquivalWith !");
  std::vector<const MEDCouplingUMesh *> ms(2);
  ms[0]=this;
  ms[1]=otherC;
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MergeUMeshesOnSameCoords(ms);
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->zipConnectivityTraducer(cellCompPol);
  int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
  const int *pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),maxId));
  if(pt!=da->getConstPointer()+da->getNbOfElems())
    {
      throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : some cells in other are not in this !");
    }
  cellCor=DataArrayInt::New();
  cellCor->alloc(otherC->getNumberOfCells(),1);
  std::copy(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),cellCor->getPointer());
  if(cellCor->isIdentity())
    {
      cellCor->decrRef();
      cellCor=0;
    }
}

Here is the call graph for this function:

void MEDCouplingUMesh::checkDeepEquivalWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor,
DataArrayInt *&  nodeCor 
) const throw (INTERP_KERNEL::Exception)

This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter.

In case of success cellCor and nodeCor are informed both.

Parameters:
cellCompPolvalues are described in MEDCouplingUMesh::zipConnectivityTraducer method.
cellCoroutput array giving the correspondance of cells from 'other' to 'this'.
nodeCoroutput array giving the correspondance of nodes from 'other' to 'this'.

Definition at line 364 of file MEDCouplingUMesh.cxx.

{
  const MEDCouplingUMesh *otherC=dynamic_cast<const MEDCouplingUMesh *>(other);
  if(!otherC)
    throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Two meshes are not not unstructured !");
  MEDCouplingMesh::checkFastEquivalWith(other,prec);
  if(_types!=otherC->_types)
    throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Types are not equal !");
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MergeUMeshes(this,otherC);
  bool areNodesMerged;
  int newNbOfNodes;
  int oldNbOfNodes=getNumberOfNodes();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->buildPermArrayForMergeNode(prec,oldNbOfNodes,areNodesMerged,newNbOfNodes);
  //mergeNodes
  if(!areNodesMerged)
    throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Nodes are incompatible ! ");
  const int *pt=std::find_if(da->getConstPointer()+oldNbOfNodes,da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),oldNbOfNodes-1));
  if(pt!=da->getConstPointer()+da->getNbOfElems())
    throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some nodes in other are not in this !");
  m->renumberNodes(da->getConstPointer(),newNbOfNodes);
  //
  nodeCor=da->substr(oldNbOfNodes);
  da=m->mergeNodes(prec,areNodesMerged,newNbOfNodes);
  if(nodeCor->isIdentity())
    {
      nodeCor->decrRef();
      nodeCor=0;
    }
  //
  da=m->zipConnectivityTraducer(cellCompPol);
  int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
  pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),maxId));
  if(pt!=da->getConstPointer()+da->getNbOfElems())
    {
      nodeCor->decrRef(); nodeCor=0;
      throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !");
    }
  cellCor=DataArrayInt::New();
  cellCor->alloc(otherC->getNumberOfCells(),1);
  std::copy(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),cellCor->getPointer());
  if(cellCor->isIdentity())
    {
      cellCor->decrRef();
      cellCor=0;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void MEDCouplingUMesh::checkFastEquivalWith ( const MEDCouplingMesh other,
double  prec 
) const throw (INTERP_KERNEL::Exception)

This method checks fastly that 'this' and 'other' are equal.

Definition at line 457 of file MEDCouplingUMesh.cxx.

{
  const MEDCouplingUMesh *otherC=dynamic_cast<const MEDCouplingUMesh *>(other);
  if(!otherC)
    throw INTERP_KERNEL::Exception("checkFastEquivalWith : Two meshes are not not unstructured !");
  MEDCouplingPointSet::checkFastEquivalWith(other,prec);
  int nbOfCells=getNumberOfCells();
  if(nbOfCells<1)
    return ;
  bool status=true;
  status&=areCellsFrom2MeshEqual(otherC,0,prec);
  status&=areCellsFrom2MeshEqual(otherC,nbOfCells/2,prec);
  status&=areCellsFrom2MeshEqual(otherC,nbOfCells-1,prec);
  if(!status)
    throw INTERP_KERNEL::Exception("checkFastEquivalWith : Two meshes are not equal because on 3 test cells some difference have been detected !");
}
void MEDCouplingUMesh::checkFullyDefined ( ) const throw (INTERP_KERNEL::Exception) [private]

This method checks that all arrays are set.

If yes nothing done if no an exception is thrown.

Definition at line 2083 of file MEDCouplingUMesh.cxx.

{
  if(!_nodal_connec_index || !_nodal_connec || !_coords)
    throw INTERP_KERNEL::Exception("Reverse nodal connectivity computation requires full connectivity and coordinates set in unstructured mesh.");
}

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.checkGeoEquivalWith (   self,
  args 
) [inherited]
checkGeoEquivalWith(self, MEDCouplingMesh other, int levOfCheck, double prec) -> PyObject

1

Definition at line 724 of file ParaMEDMEM.py.

00724 
00725     def checkGeoEquivalWith(self, *args):
00726         """
00727         checkGeoEquivalWith(self, MEDCouplingMesh other, int levOfCheck, double prec) -> PyObject
00728 
00729         1
00730         """
00731         return _ParaMEDMEM.MEDCouplingMesh_checkGeoEquivalWith(self, *args)

Here is the caller graph for this function:

DataArrayInt * MEDCouplingUMesh::checkTypeConsistencyAndContig ( const std::vector< int > &  code,
const std::vector< const DataArrayInt * > &  idsPerType 
) const throw (INTERP_KERNEL::Exception)

This method is used to check that this has contiguous cell type in same order than described in 'code'.

only for types cell, type node is not managed. Format of 'code' is the following. 'code' should be of size 3*n and non empty. If not an exception is thrown. foreach k in [0,n) on 3*k pos represent the geometric type and 3*k+1 number of elements of type 3*k. 3*k+2 refers if different from -1 the pos in 'idsPerType' to get the corresponding array. If 2 or more same geometric type is in 'code' and exception is thrown too.

This method firstly checks If it exists k so that 3*k geometric type is not in geometric types of this an exception will be thrown. If it exists k so that 3*k geometric type exists but the number of consecutive cell types does not match, an exception is thrown too.

If all geometric types in 'code' are exactly those in 'this' null pointer is returned. If it exists a geometric type in 'this' not in 'code' no exception is thrown and a DataArrayInt instance is returned that the user has the responsability to deallocate.

Definition at line 4379 of file MEDCouplingUMesh.cxx.

{
  if(code.empty())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkTypeConsistencyAndContig : code is empty, should not !");
  std::size_t sz=code.size();
  std::size_t n=sz/3;
  if(sz%3!=0)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkTypeConsistencyAndContig : code size is NOT %3 !");
  std::vector<INTERP_KERNEL::NormalizedCellType> types;
  int nb=0;
  for(std::size_t i=0;i<n;i++)
    if(std::find(types.begin(),types.end(),(INTERP_KERNEL::NormalizedCellType)code[3*i])==types.end())
      {
        types.push_back((INTERP_KERNEL::NormalizedCellType)code[3*i]);
        nb+=code[3*i+1];
        if(_types.find((INTERP_KERNEL::NormalizedCellType)code[3*i])==_types.end())
          throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkTypeConsistencyAndContig : expected geo types not in this !");
      }
  if(types.size()!=n)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkTypeConsistencyAndContig : code contains duplication of types in unstructured mesh !");
  if(idsPerType.empty())
    {
      if(!checkConsecutiveCellTypesAndOrder(&types[0],&types[0]+types.size()))
        throw INTERP_KERNEL::Exception("MEDCouplingUMesh::checkTypeConsistencyAndContig : non contiguous type !");
      if(types.size()==_types.size())
        return 0;
    }
  DataArrayInt *ret=DataArrayInt::New();
  ret->alloc(nb,1);
  int *retPtr=ret->getPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  const int *conn=_nodal_connec->getConstPointer();
  int nbOfCells=getNumberOfCells();
  const int *i=connI;
  int kk=0;
  for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator it=types.begin();it!=types.end();it++,kk++)
    {
      i=std::find_if(i,connI+nbOfCells,ParaMEDMEMImpl::ConnReader2(conn,(int)(*it)));
      int offset=(int)std::distance(connI,i);
      if(code[3*kk+2]==-1)
        {
          const int *j=std::find_if(i+1,connI+nbOfCells,ParaMEDMEMImpl::ConnReader(conn,(int)(*it)));
          std::size_t pos2=std::distance(i,j);
          for(std::size_t k=0;k<pos2;k++)
            *retPtr++=(int)k+offset;
          i=j;
        }
      else
        {
          retPtr=std::transform(idsPerType[code[3*kk+2]]->getConstPointer(),idsPerType[code[3*kk+2]]->getConstPointer()+idsPerType[code[3*kk+2]]->getNbOfElems(),
                                retPtr,std::bind2nd(std::plus<int>(),offset));
        }
    }
  return ret;
}

Here is the call graph for this function:

def ParaMEDMEM.MEDCouplingMesh.checkTypeConsistencyAndContig (   self,
  args 
) [inherited]
checkTypeConsistencyAndContig(self, PyObject li, PyObject li2) -> DataArrayInt

1

Definition at line 796 of file ParaMEDMEM.py.

00796 
00797     def checkTypeConsistencyAndContig(self, *args):
00798         """
00799         checkTypeConsistencyAndContig(self, PyObject li, PyObject li2) -> DataArrayInt
00800 
00801         1
00802         """
00803         return _ParaMEDMEM.MEDCouplingMesh_checkTypeConsistencyAndContig(self, *args)

Here is the caller graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::clone ( bool  recDeepCpy) const

Definition at line 70 of file MEDCouplingUMesh.cxx.

{
  return new MEDCouplingUMesh(*this,recDeepCpy);
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingUMesh.clone (   self,
  args 
)
clone(self, bool recDeepCpy) -> MEDCouplingUMesh

1

Definition at line 8730 of file ParaMEDMEM.py.

08730 
08731     def clone(self, *args):
08732         """
08733         clone(self, bool recDeepCpy) -> MEDCouplingUMesh
08734 
08735         1
08736         """
08737         return _ParaMEDMEM.MEDCouplingUMesh_clone(self, *args)

Here is the call graph for this function:

void MEDCouplingUMesh::computeNeighborsOfCells ( DataArrayInt *&  neighbors,
DataArrayInt *&  neighborsIdx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set.

For speed reasons no check of this will be done. This method calls MEDCouplingUMesh::buildDescendingConnectivity to compute the result. This method lists cell by cell in this which are its neighbors. To compute the result only connectivities are considered. The a cell with id 'cellId' its neighbors are neighbors[neighborsIdx[cellId]:neighborsIdx[cellId+1]].

Parameters:
[out]neighborsis an array storing all the neighbors of all cells in this. This array is newly allocated and should be dealt by the caller. neighborsIdx 2nd output parameter allows to select the right part in this array. The number of tuples is equal to the last values in neighborsIdx.
[out]neighborsIdxis an array of size this->getNumberOfCells()+1 newly allocated and should be dealt by the caller. This arrays allow to use the first output parameter neighbors.

Definition at line 580 of file MEDCouplingUMesh.cxx.

{
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> desc=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> descIndx=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDesc=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> revDescIndx=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> meshDM1=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
  meshDM1=0;
  const int *descPtr=desc->getConstPointer();
  const int *descIPtr=descIndx->getConstPointer();
  const int *revDescPtr=revDesc->getConstPointer();
  const int *revDescIPtr=revDescIndx->getConstPointer();
  //
  int nbCells=getNumberOfCells();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> out0=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> out1=DataArrayInt::New(); out1->alloc(nbCells+1,1);
  int *out1Ptr=out1->getPointer();
  *out1Ptr++=0;
  std::vector<int> out0v;
  out0v.reserve(desc->getNumberOfTuples());
  for(int i=0;i<nbCells;i++,descIPtr++,out1Ptr++)
    {
      for(const int *w1=descPtr+descIPtr[0];w1!=descPtr+descIPtr[1];w1++)
        {
          std::set<int> s(revDescPtr+revDescIPtr[*w1],revDescPtr+revDescIPtr[(*w1)+1]);
          s.erase(i);
          out0v.insert(out0v.end(),s.begin(),s.end());
        }
      *out1Ptr=out0v.size();
    }
  out0->alloc((int)out0v.size(),1);
  std::copy(out0v.begin(),out0v.end(),out0->getPointer());
  neighbors=out0; out0->incrRef();
  neighborsIdx=out1; out1->incrRef();
}

Here is the call graph for this function:

Here is the caller graph for this function:

computeNeighborsOfCells(self) -> PyObject

1

Definition at line 9271 of file ParaMEDMEM.py.

09271 
09272     def computeNeighborsOfCells(self):
09273         """
09274         computeNeighborsOfCells(self) -> PyObject
09275 
09276         1
09277         """
09278         return _ParaMEDMEM.MEDCouplingUMesh_computeNeighborsOfCells(self)

Here is the call graph for this function:

This method recomputes all cell types of 'this'.

Definition at line 2067 of file MEDCouplingUMesh.cxx.

{
  if(_nodal_connec && _nodal_connec_index)
    {
      _types.clear();
      const int *conn=_nodal_connec->getConstPointer();
      const int *connIndex=_nodal_connec_index->getConstPointer();
      int nbOfElem=_nodal_connec_index->getNbOfElems()-1;
      for(const int *pt=connIndex;pt!=connIndex+nbOfElem;pt++)
        _types.insert((INTERP_KERNEL::NormalizedCellType)conn[*pt]);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

computeTypes(self)

1

Definition at line 8819 of file ParaMEDMEM.py.

08819 
08820     def computeTypes(self):
08821         """
08822         computeTypes(self)
08823 
08824         1
08825         """
08826         return _ParaMEDMEM.MEDCouplingUMesh_computeTypes(self)

Here is the call graph for this function:

This method converts all cells into poly type if possible.

This method is purely for userfriendliness. As this method can be costly in Memory, no optimization is done to avoid construction of useless vector.

Definition at line 825 of file MEDCouplingUMesh.cxx.

{
  int nbOfCells=getNumberOfCells();
  std::vector<int> cellIds(nbOfCells);
  for(int i=0;i<nbOfCells;i++)
    cellIds[i]=i;
  convertToPolyTypes(&cellIds[0],&cellIds[0]+cellIds.size());
}

Here is the call graph for this function:

Here is the caller graph for this function:

convertAllToPoly(self)

1

Definition at line 9393 of file ParaMEDMEM.py.

09393 
09394     def convertAllToPoly(self):
09395         """
09396         convertAllToPoly(self)
09397 
09398         1
09399         """
09400         return _ParaMEDMEM.MEDCouplingUMesh_convertAllToPoly(self)

Here is the call graph for this function:

DataArrayInt * MEDCouplingUMesh::convertCellArrayPerGeoType ( const DataArrayInt da) const throw (INTERP_KERNEL::Exception)

This method makes the assumption that da->getNumberOfTuples()<this->getNumberOfCells().

This method makes the assumption that ids contained in 'da' are in [0:getNumberOfCells())

Definition at line 4760 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  const int *conn=_nodal_connec->getConstPointer();
  const int *connI=_nodal_connec_index->getConstPointer();
  int nbOfCells=getNumberOfCells();
  std::set<INTERP_KERNEL::NormalizedCellType> types=getAllTypes();
  int *tmp=new int[nbOfCells];
  for(std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iter=types.begin();iter!=types.end();iter++)
    {
      int j=0;
      for(const int *i=connI;i!=connI+nbOfCells;i++)
        if((INTERP_KERNEL::NormalizedCellType)conn[*i]==(*iter))
          tmp[std::distance(connI,i)]=j++;
    }
  DataArrayInt *ret=DataArrayInt::New();
  ret->alloc(da->getNumberOfTuples(),da->getNumberOfComponents());
  ret->copyStringInfoFrom(*da);
  int *retPtr=ret->getPointer();
  const int *daPtr=da->getConstPointer();
  int nbOfElems=da->getNbOfElems();
  for(int k=0;k<nbOfElems;k++)
    retPtr[k]=tmp[daPtr[k]];
  delete [] tmp;
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

convertCellArrayPerGeoType(self, DataArrayInt da) -> DataArrayInt

1

Definition at line 8891 of file ParaMEDMEM.py.

08891 
08892     def convertCellArrayPerGeoType(self, *args):
08893         """
08894         convertCellArrayPerGeoType(self, DataArrayInt da) -> DataArrayInt
08895 
08896         1
08897         """
08898         return _ParaMEDMEM.MEDCouplingUMesh_convertCellArrayPerGeoType(self, *args)

Here is the call graph for this function:

void MEDCouplingUMesh::convertDegeneratedCells ( ) throw (INTERP_KERNEL::Exception)

This method converts all degenerated cells to simpler cells.

For example a NORM_QUAD4 cell consituted from 2 same node id in its nodal connectivity will be transform to a NORM_TRI3 cell. This method works only on linear cells. This method works on nodes ids, that is to say a call to ParaMEDMEM::MEDCouplingUMesh::mergeNodes method could be usefull before calling this method in case of presence of several pair of nodes located on same position. This method throws an exception if 'this' is not fully defined (connectivity). This method throws an exception too if a "too" degenerated cell is detected. For example a NORM_TRI3 with 3 times the same node id.

Definition at line 3888 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  if(getMeshDimension()<=1)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertDegeneratedCells works on umeshes with meshdim equals to 2 or 3 !");
  int nbOfCells=getNumberOfCells();
  if(nbOfCells<1)
    return ;
  int initMeshLgth=getMeshLength();
  int *conn=_nodal_connec->getPointer();
  int *index=_nodal_connec_index->getPointer();
  int posOfCurCell=0;
  int newPos=0;
  int lgthOfCurCell;
  for(int i=0;i<nbOfCells;i++)
    {
      lgthOfCurCell=index[i+1]-posOfCurCell;
      INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[posOfCurCell];
      int newLgth;
      INTERP_KERNEL::NormalizedCellType newType=INTERP_KERNEL::CellSimplify::simplifyDegeneratedCell(type,conn+posOfCurCell+1,lgthOfCurCell-1,
                                                                                                     conn+newPos+1,newLgth);
      conn[newPos]=newType;
      newPos+=newLgth+1;
      posOfCurCell=index[i+1];
      index[i+1]=newPos;
    }
  if(newPos!=initMeshLgth)
    _nodal_connec->reAlloc(newPos);
  computeTypes();
}

Here is the call graph for this function:

Here is the caller graph for this function:

convertDegeneratedCells(self)

1

Definition at line 8963 of file ParaMEDMEM.py.

08963 
08964     def convertDegeneratedCells(self):
08965         """
08966         convertDegeneratedCells(self)
08967 
08968         1
08969         """
08970         return _ParaMEDMEM.MEDCouplingUMesh_convertDegeneratedCells(self)

Here is the call graph for this function:

void MEDCouplingUMesh::convertExtrudedPolyhedra ( ) throw (INTERP_KERNEL::Exception)

This method expects that 'this' has a spacedim equal to 3 and a mesh dimension equal to 3 too, if not an exception will be thrown.

This method work only on cells with type NORM_POLYHED, all other cells with different type, are remains unchanged. For such polyhedra, they are expected to have only 1 face (containing 2 faces in opposition), having 2*n number of nodes (n nodes on each 2 faces hidden in the single face of polyhedron). The first face is expected to be right oriented because all faces of this polyhedron will be deduced. When called 'this' is an invalid mesh on MED sense. This method will correct that for polyhedra. In case of presence of polyhedron that has not the extruded aspect (2 faces with the same number of nodes) an exception is thrown and 'this' remains unchanged. This method is usefull only for users that wants to build extruded unstructured mesh. This method is a convenient one that avoids boring polyhedra setting during insertNextCell process. In case of success, 'this' has be corrected contains the same number of cells and is valid in MED sense.

Definition at line 847 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  if(getMeshDimension()!=3 || getSpaceDimension()!=3)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertExtrudedPolyhedra works on umeshes with meshdim equal to 3 and spaceDim equal to 3 too!");
  int nbOfCells=getNumberOfCells();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newCi=DataArrayInt::New();
  newCi->alloc(nbOfCells+1,1);
  int *newci=newCi->getPointer();
  const int *ci=_nodal_connec_index->getConstPointer();
  const int *c=_nodal_connec->getConstPointer();
  newci[0]=0;
  for(int i=0;i<nbOfCells;i++)
    {
      INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)c[ci[i]];
      if(type==INTERP_KERNEL::NORM_POLYHED)
        {
          if(std::count(c+ci[i]+1,c+ci[i+1],-1)!=0)
            {
              std::ostringstream oss; oss << "MEDCouplingUMesh::convertExtrudedPolyhedra : cell # " << i << " is a polhedron BUT it has NOT exactly 1 face !";
              throw INTERP_KERNEL::Exception(oss.str().c_str());
            }
          std::size_t n2=std::distance(c+ci[i]+1,c+ci[i+1]);
          if(n2%2!=0)
            {
              std::ostringstream oss; oss << "MEDCouplingUMesh::convertExtrudedPolyhedra : cell # " << i << " is a polhedron with 1 face but there is a mismatch of number of nodes in face should be even !";
              throw INTERP_KERNEL::Exception(oss.str().c_str());
            }
          int n1=(int)(n2/2);
          newci[i+1]=7*n1+2+newci[i];//6*n1 (nodal length) + n1+2 (number of faces) - 1 (number of '-1' separator is equal to number of faces -1) + 1 (for cell type)
        }
      else
        newci[i+1]=(ci[i+1]-ci[i])+newci[i];
    }
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newC=DataArrayInt::New();
  newC->alloc(newci[nbOfCells],1);
  int *newc=newC->getPointer();
  for(int i=0;i<nbOfCells;i++)
    {
      INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)c[ci[i]];
      if(type==INTERP_KERNEL::NORM_POLYHED)
        {
          std::size_t n1=std::distance(c+ci[i]+1,c+ci[i+1])/2;
          newc=std::copy(c+ci[i],c+ci[i]+n1+1,newc);
          *newc++=-1;
          for(std::size_t j=0;j<n1;j++)
            {
              newc[j]=c[ci[i]+1+n1+(n1-j)%n1];
              newc[n1+5*j]=-1;
              newc[n1+5*j+1]=c[ci[i]+1+j];
              newc[n1+5*j+2]=c[ci[i]+1+(j+1)%n1];
              newc[n1+5*j+3]=c[ci[i]+1+(j+1)%n1+n1];
              newc[n1+5*j+4]=c[ci[i]+1+j+n1];
            }
          newc+=n1*6;
        }
      else
        newc=std::copy(c+ci[i],c+ci[i+1],newc);
    }
  _nodal_connec_index->decrRef(); _nodal_connec_index=newCi;
  _nodal_connec->decrRef(); _nodal_connec=newC;
  newC->incrRef(); newCi->incrRef();
}

Here is the call graph for this function:

Here is the caller graph for this function:

convertExtrudedPolyhedra(self)

1

Definition at line 9401 of file ParaMEDMEM.py.

09401 
09402     def convertExtrudedPolyhedra(self):
09403         """
09404         convertExtrudedPolyhedra(self)
09405 
09406         1
09407         """
09408         return _ParaMEDMEM.MEDCouplingUMesh_convertExtrudedPolyhedra(self)

Here is the call graph for this function:

void MEDCouplingUMesh::convertQuadraticCellsToLinear ( ) throw (INTERP_KERNEL::Exception)

This method convert quadratic cells to linear cells if any was found.

If no such cells exists 'this' remains unchanged.

Definition at line 3488 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  int nbOfCells=getNumberOfCells();
  int delta=0;
  for(int i=0;i<nbOfCells;i++)
    {
      INTERP_KERNEL::NormalizedCellType type=getTypeOfCell(i);
      const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(type);
      if(cm.isQuadratic())
        {
          INTERP_KERNEL::NormalizedCellType typel=cm.getLinearType();
          const INTERP_KERNEL::CellModel& cml=INTERP_KERNEL::CellModel::GetCellModel(typel);
          delta+=cm.getNumberOfNodes()-cml.getNumberOfNodes();
        }
    }
  if(delta==0)
    return ;
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConn=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> newConnI=DataArrayInt::New();
  newConn->alloc(getMeshLength()-delta,1);
  newConnI->alloc(nbOfCells+1,1);
  const int *icptr=_nodal_connec->getConstPointer();
  const int *iciptr=_nodal_connec_index->getConstPointer();
  int *ocptr=newConn->getPointer();
  int *ociptr=newConnI->getPointer();
  *ociptr=0;
  _types.clear();
  for(int i=0;i<nbOfCells;i++,ociptr++)
    {
      INTERP_KERNEL::NormalizedCellType type=getTypeOfCell(i);
      const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(type);
      if(!cm.isQuadratic())
        {
          _types.insert(type);
          ocptr=std::copy(icptr+iciptr[i],icptr+iciptr[i+1],ocptr);
          ociptr[1]=ociptr[0]+iciptr[i+1]-iciptr[i];
        }
      else
        {
          INTERP_KERNEL::NormalizedCellType typel=cm.getLinearType();
          _types.insert(typel);
          const INTERP_KERNEL::CellModel& cml=INTERP_KERNEL::CellModel::GetCellModel(typel);
          int newNbOfNodes=cml.getNumberOfNodes();
          *ocptr++=(int)typel;
          ocptr=std::copy(icptr+iciptr[i]+1,icptr+iciptr[i]+newNbOfNodes+1,ocptr);
          ociptr[1]=ociptr[0]+newNbOfNodes+1;
        }
    }
  setConnectivity(newConn,newConnI,false);
}

Here is the call graph for this function:

Here is the caller graph for this function:

convertQuadraticCellsToLinear(self)

1

Definition at line 8955 of file ParaMEDMEM.py.

08955 
08956     def convertQuadraticCellsToLinear(self):
08957         """
08958         convertQuadraticCellsToLinear(self)
08959 
08960         1
08961         """
08962         return _ParaMEDMEM.MEDCouplingUMesh_convertQuadraticCellsToLinear(self)

Here is the call graph for this function:

void MEDCouplingUMesh::convertToPolyTypes ( const int *  cellIdsToConvertBg,
const int *  cellIdsToConvertEnd 
)

This method convert cell with ids in ['cellIdsToConvertBg','cellIdsToConvertEnd') into 'this' into dynamic types without changing geometry.

That is to say if 'this' is a 2D, mesh after the invocation of this method it will contain only polygons. If 'this' is a 3D mesh after the invocation of this method it will contain only polyhedra. If mesh dimension is not in [2,3] an exception is thrown. Of course pay attention that the resulting mesh is slower than previous one. If in ['cellIdsToConvertBg','cellIdsToConvertEnd') there is a cell id not in [0,'this->getNumberOfCells()') an exception will be thrown. In this case if meshDim==2 the mesh is still valid and only cells treated before throw will be converted into polygon. If mesh==3, after throw the mesh is unconsistent ! This method is above all designed to test more extensively algorithms able to deal with polygons/polyhedra.

Definition at line 744 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  int dim=getMeshDimension();
  if(dim<2 || dim>3)
    throw INTERP_KERNEL::Exception("Invalid mesh dimension : must be 2 or 3 !");
  int nbOfCells=getNumberOfCells();
  if(dim==2)
    {
      const int *connIndex=_nodal_connec_index->getConstPointer();
      int *conn=_nodal_connec->getPointer();
      for(const int *iter=cellIdsToConvertBg;iter!=cellIdsToConvertEnd;iter++)
        {
          if(*iter>=0 && *iter<nbOfCells)
            {
              const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)conn[connIndex[*iter]]);
              if(!cm.isDynamic())
                conn[connIndex[*iter]]=INTERP_KERNEL::NORM_POLYGON;
              else
                conn[connIndex[*iter]]=INTERP_KERNEL::NORM_QPOLYG;
            }
          else
            {
              std::ostringstream oss; oss << "MEDCouplingUMesh::convertToPolyTypes : On rank #" << std::distance(cellIdsToConvertBg,iter) << " value is " << *iter << " which is not";
              oss << " in range [0," << nbOfCells << ") !";
              throw INTERP_KERNEL::Exception(oss.str().c_str());
            }
        }
    }
  else
    {
      int *connIndex=_nodal_connec_index->getPointer();
      int connIndexLgth=_nodal_connec_index->getNbOfElems();
      const int *connOld=_nodal_connec->getConstPointer();
      int connOldLgth=_nodal_connec->getNbOfElems();
      std::vector<int> connNew(connOld,connOld+connOldLgth);
      for(const int *iter=cellIdsToConvertBg;iter!=cellIdsToConvertEnd;iter++)
        {
          if(*iter>=0 && *iter<nbOfCells)
            {
              int pos=connIndex[*iter];
              int posP1=connIndex[(*iter)+1];
              int lgthOld=posP1-pos-1;
              const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel((INTERP_KERNEL::NormalizedCellType)connNew[pos]);
              connNew[pos]=INTERP_KERNEL::NORM_POLYHED;
              unsigned nbOfFaces=cm.getNumberOfSons2(&connNew[pos+1],lgthOld);
              int *tmp=new int[nbOfFaces*lgthOld];
              int *work=tmp;
              for(int j=0;j<(int)nbOfFaces;j++)
                {
                  INTERP_KERNEL::NormalizedCellType type;
                  unsigned offset=cm.fillSonCellNodalConnectivity2(j,&connNew[pos+1],lgthOld,work,type);
                  work+=offset;
                  *work++=-1;
                }
              std::size_t newLgth=std::distance(tmp,work)-1;
              std::size_t delta=newLgth-lgthOld;
              std::transform(connIndex+(*iter)+1,connIndex+connIndexLgth,connIndex+(*iter)+1,std::bind2nd(std::plus<int>(),delta));
              connNew.insert(connNew.begin()+posP1,tmp+lgthOld,tmp+newLgth);
              std::copy(tmp,tmp+lgthOld,connNew.begin()+pos+1);
              delete [] tmp;
            }
          else
            {
              std::ostringstream oss; oss << "MEDCouplingUMesh::convertToPolyTypes : On rank #" << std::distance(cellIdsToConvertBg,iter) << " value is " << *iter << " which is not";
              oss << " in range [0," << nbOfCells << ") !";
              throw INTERP_KERNEL::Exception(oss.str().c_str());
            }
        }
      _nodal_connec->alloc((int)connNew.size(),1);
      int *newConnPtr=_nodal_connec->getPointer();
      std::copy(connNew.begin(),connNew.end(),newConnPtr);
    }
  computeTypes();
}

Here is the call graph for this function:

Here is the caller graph for this function:

convertToPolyTypes(self, PyObject li)

1

Definition at line 9385 of file ParaMEDMEM.py.

09385 
09386     def convertToPolyTypes(self, *args):
09387         """
09388         convertToPolyTypes(self, PyObject li)
09389 
09390         1
09391         """
09392         return _ParaMEDMEM.MEDCouplingUMesh_convertToPolyTypes(self, *args)

Here is the call graph for this function:

def ParaMEDMEM.MEDCouplingMesh.copyTinyInfoFrom (   self,
  args 
) [inherited]
copyTinyInfoFrom(self, MEDCouplingMesh other)

1

Definition at line 474 of file ParaMEDMEM.py.

00474 
00475     def copyTinyInfoFrom(self, *args):
00476         """
00477         copyTinyInfoFrom(self, MEDCouplingMesh other)
00478 
00479         1
00480         """
00481         return _ParaMEDMEM.MEDCouplingMesh_copyTinyInfoFrom(self, *args)

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.copyTinyStringsFrom (   self,
  args 
) [inherited]
copyTinyStringsFrom(self, MEDCouplingMesh other)

1

Definition at line 466 of file ParaMEDMEM.py.

00466 
00467     def copyTinyStringsFrom(self, *args):
00468         """
00469         copyTinyStringsFrom(self, MEDCouplingMesh other)
00470 
00471         1
00472         """
00473         return _ParaMEDMEM.MEDCouplingMesh_copyTinyStringsFrom(self, *args)

Here is the caller graph for this function:

def ParaMEDMEM.TimeLabel.declareAsNew (   self) [inherited]
declareAsNew(self)

1

Definition at line 292 of file ParaMEDMEM.py.

00292 
00293     def declareAsNew(self):
00294         """
00295         declareAsNew(self)
00296 
00297         1
00298         """
00299         return _ParaMEDMEM.TimeLabel_declareAsNew(self)

Here is the caller graph for this function:

Definition at line 65 of file MEDCouplingUMesh.cxx.

{
  return clone(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

def ParaMEDMEM.MEDCouplingMesh.deepCpy (   self) [inherited]
deepCpy(self) -> MEDCouplingMesh

1

Definition at line 442 of file ParaMEDMEM.py.

00442 
00443     def deepCpy(self):
00444         """
00445         deepCpy(self) -> MEDCouplingMesh
00446 
00447         1
00448         """
00449         return _ParaMEDMEM.MEDCouplingMesh_deepCpy(self)

Here is the caller graph for this function:

MEDCouplingUMesh * MEDCouplingUMesh::emulateMEDMEMBDC ( const MEDCouplingUMesh nM1LevMesh,
DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt *&  revDesc,
DataArrayInt *&  revDescIndx,
DataArrayInt *&  nM1LevMeshIds,
DataArrayInt *&  meshnM1Old2New 
) const throw (INTERP_KERNEL::Exception)

This method is here too emulate the MEDMEM behaviour on BDC (buildDescendingConnectivity).

Hoping this method becomes deprecated very soon. This method make the assumption that 'this' and 'nM1LevMesh' mesh lyies on same coords (same pointer) as MED and MEDMEM does. The following equality should be verified 'nM1LevMesh->getMeshDimension()==this->getMeshDimension()-1' This method returns 5+2 elements. 'desc', 'descIndx', 'revDesc', 'revDescIndx' and 'meshnM1' behaves exactly as ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity except the content as described after. The returned array specifies the n-1 mesh reordered by type as MEDMEM does. 'nM1LevMeshIds' contains the ids in returned 'meshnM1'. Finally 'meshnM1Old2New' contains numbering old2new that is to say the cell #k in coarse 'nM1LevMesh' will have the number ret[k] in returned mesh 'nM1LevMesh' MEDMEM reordered.

Definition at line 4516 of file MEDCouplingUMesh.cxx.

{
  checkFullyDefined();
  nM1LevMesh->checkFullyDefined();
  if(getMeshDimension()-1!=nM1LevMesh->getMeshDimension())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::emulateMEDMEMBDC : The mesh passed as first argument should have a meshDim equal to this->getMeshDimension()-1 !" );
  if(_coords!=nM1LevMesh->getCoords())
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::emulateMEDMEMBDC : 'this' and mesh in first argument should share the same coords : Use tryToShareSameCoords method !");
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp0=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1=DataArrayInt::New();
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret1=buildDescendingConnectivity(desc,descIndx,tmp0,tmp1);
  MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ret0=ret1->sortCellsInMEDFileFrmt();
  desc->transformWithIndArr(ret0->getConstPointer(),ret0->getConstPointer()+ret0->getNbOfElems());
  MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp=MEDCouplingUMesh::New();
  tmp->setConnectivity(tmp0,tmp1);
  tmp->renumberCells(ret0->getConstPointer(),false);
  revDesc=tmp->getNodalConnectivity();
  revDescIndx=tmp->getNodalConnectivityIndex();
  DataArrayInt *ret=0;
  if(!ret1->areCellsIncludedIn(nM1LevMesh,2,ret))
    {
      int tmp2;
      ret->getMaxValue(tmp2);
      ret->decrRef();
      std::ostringstream oss; oss << "MEDCouplingUMesh::emulateMEDMEMBDC : input N-1 mesh present a cell not in descending mesh ... Id of cell is " << tmp2 << " !";
      throw INTERP_KERNEL::Exception(oss.str().c_str());
    }
  nM1LevMeshIds=ret;
  //
  revDesc->incrRef();
  revDescIndx->incrRef();
  ret1->incrRef();
  ret0->incrRef();
  meshnM1Old2New=ret0;
  return ret1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

emulateMEDMEMBDC(self, MEDCouplingUMesh nM1LevMesh) -> PyObject

1

Definition at line 9279 of file ParaMEDMEM.py.

09279 
09280     def emulateMEDMEMBDC(self, *args):
09281         """
09282         emulateMEDMEMBDC(self, MEDCouplingUMesh nM1LevMesh) -> PyObject
09283 
09284         1
09285         """
09286         return _ParaMEDMEM.MEDCouplingUMesh_emulateMEDMEMBDC(self, *args)

Here is the call graph for this function:

void MEDCouplingUMesh::fillCellIdsToKeepFromNodeIds ( const int *  begin,
const int *  end,
bool  fullyIn,
std::vector< int > &  cellIdsKept 
) const [private]

Keeps from 'this' only cells which constituing point id are in the ids specified by ['begin','end').

The resulting cell ids are stored at the end of the 'cellIdsKept' parameter. Parameter 'fullyIn' specifies if a cell that has part of its nodes in ids array is kept or not. If 'fullyIn' is true only cells whose ids are fully contained in ['begin','end') tab will be kept.

Parameters:
begininput start of array of node ids.
endinput end of array of node ids.
fullyIninput that specifies if all node ids must be in ['begin','end') array to consider cell to be in.
cellIdsKeptin/out array where all candidate cell ids are put at the end.

Definition at line 1427 of file MEDCouplingUMesh.cxx.

{
  std::set<int> fastFinder(begin,end);
  int nbOfCells=getNumberOfCells();
  const int *conn=getNodalConnectivity()->getConstPointer();
  const int *connIndex=getNodalConnectivityIndex()->getConstPointer();
  for(int i=0;i<nbOfCells;i++)
    {
      std::set<int> connOfCell(conn+connIndex[i]+1,conn+connIndex[i+1]);
      connOfCell.erase(-1);//polyhedron separator
      int refLgth=(int)connOfCell.size();
      std::set<int> locMerge;
      std::insert_iterator< std::set<int> > it(locMerge,locMerge.begin());
      std::set_intersection(connOfCell.begin(),connOfCell.end(),fastFinder.begin(),fastFinder.end(),it);
      if(((int)locMerge.size()==refLgth && fullyIn) || (locMerge.size()!=0 && !fullyIn))
        cellIdsKept.push_back(i);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

DataArrayDouble * MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation ( const MEDCouplingUMesh mesh1D,
bool  isQuad 
) const throw (INTERP_KERNEL::Exception) [private]

This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.

Parameters:
mesh1Dis the input 1D mesh used for translation and automatic rotation computation.
Returns:
newCoords new coords filled by this method.

Definition at line 3272 of file MEDCouplingUMesh.cxx.

{
  if(mesh1D->getSpaceDimension()==2)
    return fillExtCoordsUsingTranslAndAutoRotation2D(mesh1D,isQuad);
  if(mesh1D->getSpaceDimension()==3)
    return fillExtCoordsUsingTranslAndAutoRotation3D(mesh1D,isQuad);
  throw INTERP_KERNEL::Exception("Not implemented rotation and translation alg. for spacedim other than 2 and 3 !");
}

Here is the caller graph for this function:

DataArrayDouble * MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation2D ( const MEDCouplingUMesh mesh1D,
bool  isQuad 
) const throw (INTERP_KERNEL::Exception) [private]

This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.

Parameters:
mesh1Dis the input 1D mesh used for translation and automatic rotation computation.
Returns:
newCoords new coords filled by this method.

Definition at line 3286 of file MEDCouplingUMesh.cxx.

{
  if(isQuad)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoRotation2D : not implemented for quadratic cells !");
  int oldNbOfNodes=getNumberOfNodes();
  int nbOf1DCells=mesh1D->getNumberOfCells();
  if(nbOf1DCells<2)
    throw INTERP_KERNEL::Exception("MEDCouplingUMesh::fillExtCoordsUsingTranslAndAutoR