X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingStructuredMesh.hxx;h=a052bf0d4a7d57b7d322a0a60165b1568dac957b;hb=1da788371d9d21d0d2c5da283a7ff539d8670b4c;hp=ef24a85466ba421609c6330b444f6ff39ce31c8e;hpb=36d31be36964def77645e16e439dcd008eb62339;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingStructuredMesh.hxx b/src/MEDCoupling/MEDCouplingStructuredMesh.hxx index ef24a8546..a052bf0d4 100644 --- a/src/MEDCoupling/MEDCouplingStructuredMesh.hxx +++ b/src/MEDCoupling/MEDCouplingStructuredMesh.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,9 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const; - MEDCOUPLING_EXPORT static void GetPosFromId(int nodeId, int meshDim, const int *split, int *res); + MEDCOUPLING_EXPORT std::vector getLocationFromCellId(int cellId) const; + MEDCOUPLING_EXPORT std::vector getLocationFromNodeId(int nodeId) const; + MEDCOUPLING_EXPORT static void GetPosFromId(int eltId, int meshDim, const int *split, int *res); MEDCOUPLING_EXPORT static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim); MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector& conn) const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; @@ -69,18 +71,35 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT virtual void getSplitNodeValues(int *res) const; MEDCOUPLING_EXPORT virtual std::vector getNodeGridStructure() const = 0; MEDCOUPLING_EXPORT std::vector getCellGridStructure() const; + MEDCOUPLING_EXPORT double computeSquareness() const; MEDCOUPLING_EXPORT virtual MEDCouplingStructuredMesh *buildStructuredSubPart(const std::vector< std::pair >& cellPart) const = 0; MEDCOUPLING_EXPORT static std::vector GetSplitVectFromStruct(const std::vector& strct); MEDCOUPLING_EXPORT static bool IsPartStructured(const int *startIds, const int *stopIds, const std::vector& st, std::vector< std::pair >& partCompactFormat); MEDCOUPLING_EXPORT static std::vector GetDimensionsFromCompactFrmt(const std::vector< std::pair >& partCompactFormat); + MEDCOUPLING_EXPORT static std::vector< std::pair > GetCompactFrmtFromDimensions(const std::vector& dims); + MEDCOUPLING_EXPORT static std::vector< std::pair > IntersectRanges(const std::vector< std::pair >& r1, const std::vector< std::pair >& r2); + MEDCOUPLING_EXPORT static bool AreRangesIntersect(const std::vector< std::pair >& r1, const std::vector< std::pair >& r2); MEDCOUPLING_EXPORT static void SwitchOnIdsFrom(const std::vector& st, const std::vector< std::pair >& partCompactFormat, std::vector& vectToSwitchOn); + MEDCOUPLING_EXPORT static void ExtractFieldOfBoolFrom(const std::vector& st, const std::vector& fieldOfBool, const std::vector< std::pair >& partCompactFormat, std::vector& fieldOut); + MEDCOUPLING_EXPORT static DataArrayDouble *ExtractFieldOfDoubleFrom(const std::vector& st, const DataArrayDouble *fieldOfDbl, const std::vector< std::pair >& partCompactFormat); + MEDCOUPLING_EXPORT static void AssignPartOfFieldOfDoubleUsing(const std::vector& st, DataArrayDouble *fieldOfDbl, const std::vector< std::pair >& partCompactFormat, const DataArrayDouble *other); + MEDCOUPLING_EXPORT static void ChangeReferenceFromGlobalOfCompactFrmt(const std::vector< std::pair >& bigInAbs, const std::vector< std::pair >& partOfBigInAbs, std::vector< std::pair >& partOfBigRelativeToBig, bool check=true); + MEDCOUPLING_EXPORT static void ChangeReferenceToGlobalOfCompactFrmt(const std::vector< std::pair >& bigInAbs, const std::vector< std::pair >& partOfBigRelativeToBig, std::vector< std::pair >& partOfBigInAbs, bool check=true); + MEDCOUPLING_EXPORT static std::vector< std::pair > TranslateCompactFrmt(const std::vector< std::pair >& part, const std::vector& translation); + MEDCOUPLING_EXPORT static std::vector FindTranslationFrom(const std::vector< std::pair >& startingFrom, const std::vector< std::pair >& goingTo); MEDCOUPLING_EXPORT static DataArrayInt *BuildExplicitIdsFrom(const std::vector& st, const std::vector< std::pair >& partCompactFormat); + MEDCOUPLING_EXPORT static void MultiplyPartOf(const std::vector& st, const std::vector< std::pair >& part, double factor, DataArrayDouble *da); + MEDCOUPLING_EXPORT static void MultiplyPartOfByGhost(const std::vector& st, const std::vector< std::pair >& part, int ghostSize, double factor, DataArrayDouble *da); + MEDCOUPLING_EXPORT static void PutInGhostFormat(int ghostSize, const std::vector& st, const std::vector< std::pair >& part, std::vector& stWithGhost, std::vector< std::pair >&partWithGhost); + MEDCOUPLING_EXPORT static void ApplyGhostOnCompactFrmt(std::vector< std::pair >& partBeforeFact, int ghostSize); MEDCOUPLING_EXPORT static DataArrayInt *Build1GTNodalConnectivity(const int *nodeStBg, const int *nodeStEnd); MEDCOUPLING_EXPORT static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(const int *nodeStBg, const int *nodeStEnd); + MEDCOUPLING_EXPORT static DataArrayInt *ComputeCornersGhost(const std::vector& st, int ghostLev); MEDCOUPLING_EXPORT static int DeduceNumberOfGivenRangeInCompactFrmt(const std::vector< std::pair >& partCompactFormat); MEDCOUPLING_EXPORT static int DeduceNumberOfGivenStructure(const std::vector& st); MEDCOUPLING_EXPORT static void FindTheWidestAxisOfGivenRangeInCompactFrmt(const std::vector< std::pair >& partCompactFormat, int& axisId, int& sizeOfRange); - MEDCOUPLING_EXPORT static int FindMinimalPartOf(const std::vector& st, const std::vector& crit, std::vector& reducedCrit, std::vector< std::pair >& partCompactFormat); + MEDCOUPLING_EXPORT static int FindMinimalPartOf(int minPatchLgth, const std::vector& st, const std::vector& crit, std::vector& reducedCrit, std::vector< std::pair >& partCompactFormat); + MEDCOUPLING_EXPORT static std::vector< std::vector > ComputeSignaturePerAxisOf(const std::vector& st, const std::vector& crit); private: static int GetNumberOfCellsOfSubLevelMesh(const std::vector& cgs, int mdim); static void GetReverseNodalConnectivity1(const std::vector& ngs, DataArrayInt *revNodal, DataArrayInt *revNodalIndx); @@ -91,10 +110,9 @@ namespace ParaMEDMEM static DataArrayInt *Build1GTNodalConnectivity3D(const int *nodeStBg); static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh2D(const int *nodeStBg); static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh3D(const int *nodeStBg); - static int FindMinimalPartOf1D(const std::vector& st, const std::vector& crit, std::vector& reducedCrit, std::vector< std::pair >& partCompactFormat); - static int FindMinimalPartOf2D(const std::vector& st, const std::vector& crit, std::vector& reducedCrit, std::vector< std::pair >& partCompactFormat); - static int FindMinimalPartOf3D(const std::vector& st, const std::vector& crit, std::vector& reducedCrit, std::vector< std::pair >& partCompactFormat); - static void ExtractVecOfBool(const std::vector& st, const std::vector& crit, const std::vector< std::pair >& partCompactFormat, std::vector& reducedCrit); + static int FindMinimalPartOf1D(const std::vector& st, const std::vector& crit, std::vector< std::pair >& partCompactFormat); + static int FindMinimalPartOf2D(const std::vector& st, const std::vector& crit, std::vector< std::pair >& partCompactFormat); + static int FindMinimalPartOf3D(const std::vector& st, const std::vector& crit, std::vector< std::pair >& partCompactFormat); protected: static int ZipNodeStructure(const int *nodeStBg, const int *nodeStEnd, int zipNodeSt[3]); protected: