X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingStructuredMesh.hxx;h=8c839b5abebb19068cf4c935f1eeba8f3e5437e8;hb=5dcdc2b6a915a809dd2d7831e4b2e85ae286328a;hp=70c12d7b9d0fb181c90623ccc4538b2a835b74d7;hpb=bc815fe93de3284ce94632a8fd76acc281c6373e;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingStructuredMesh.hxx b/src/MEDCoupling/MEDCouplingStructuredMesh.hxx index 70c12d7b9..8c839b5ab 100644 --- a/src/MEDCoupling/MEDCouplingStructuredMesh.hxx +++ b/src/MEDCoupling/MEDCouplingStructuredMesh.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2014 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 // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -56,24 +56,55 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const; MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const; //some useful methods + MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *build1SGTSubLevelMesh() const; MEDCOUPLING_EXPORT int getCellIdFromPos(int i, int j, int k) const; MEDCOUPLING_EXPORT int getNodeIdFromPos(int i, int j, int k) const; + MEDCOUPLING_EXPORT int getNumberOfCells() const; + MEDCOUPLING_EXPORT int getNumberOfNodes() const; + MEDCOUPLING_EXPORT int getMeshDimension() const; + MEDCOUPLING_EXPORT int getNumberOfCellsOfSubLevelMesh() const; + MEDCOUPLING_EXPORT int getSpaceDimensionOnNodeStruct() const; MEDCOUPLING_EXPORT virtual void getNodeGridStructure(int *res) const = 0; - MEDCOUPLING_EXPORT virtual void getSplitCellValues(int *res) const = 0; - MEDCOUPLING_EXPORT virtual void getSplitNodeValues(int *res) const = 0; + MEDCOUPLING_EXPORT virtual void getSplitCellValues(int *res) const; + MEDCOUPLING_EXPORT virtual void getSplitNodeValues(int *res) const; MEDCOUPLING_EXPORT virtual std::vector getNodeGridStructure() const = 0; MEDCOUPLING_EXPORT std::vector getCellGridStructure() 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 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 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 DataArrayInt *Build1GTNodalConnectivity(const int *nodeStBg, const int *nodeStEnd); + MEDCOUPLING_EXPORT static DataArrayInt *Build1GTNodalConnectivityOfSubLevelMesh(const int *nodeStBg, const int *nodeStEnd); + 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 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); static void GetReverseNodalConnectivity2(const std::vector& ngs, DataArrayInt *revNodal, DataArrayInt *revNodalIndx); static void GetReverseNodalConnectivity3(const std::vector& ngs, DataArrayInt *revNodal, DataArrayInt *revNodalIndx); static DataArrayInt *Build1GTNodalConnectivity1D(const int *nodeStBg); static DataArrayInt *Build1GTNodalConnectivity2D(const int *nodeStBg); 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< 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: MEDCOUPLING_EXPORT MEDCouplingStructuredMesh(); MEDCOUPLING_EXPORT MEDCouplingStructuredMesh(const MEDCouplingStructuredMesh& other, bool deepCpy);