Salome HOME
Structure element inside Gauss Points management
[tools/medcoupling.git] / src / MEDLoader / MEDFileBlowStrEltUp.hxx
1 // Copyright (C) 2007-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (EDF R&D)
20
21 #ifndef __MEDFILEBLOWSTRELTUP_HXX__
22 #define __MEDFILEBLOWSTRELTUP_HXX__
23
24 #include "MEDLoaderDefines.hxx"
25 #include "MEDFileUtilities.txx"
26 #include "MEDFileMesh.hxx"
27 #include "MEDFileField.hxx"
28 #include "MEDFileStructureElement.hxx"
29
30 #include "MEDCouplingRefCountObject.hxx"
31
32 namespace MEDCoupling
33
34   class MEDFileBlowStrEltUp
35   {
36   public:
37     MEDFileBlowStrEltUp(const MEDFileFields *fsOnlyOnSE, const MEDFileMeshes *ms, const MEDFileStructureElements *ses);
38     static void DealWithSE(MEDFileFields *fs, MEDFileMeshes *ms, const MEDFileStructureElements *ses);
39     void generate(MEDFileMeshes *msOut, MEDFileFields *allZeOutFields);
40   private:
41     MCAuto<MEDFileEltStruct4Mesh> dealWithSEInMesh(const std::string& seName, MEDFileUMesh *mesh, MCAuto<MEDFileUMesh>& mOut, MCAuto<MEDFileFields>& fsOut) const;
42     MCAuto<MEDFileEltStruct4Mesh> dealWithMEDBALLInMesh(const MEDFileUMesh *mesh, MCAuto<MEDFileUMesh>& mOut, MCAuto<MEDFileFields>& fsOut) const;
43     void dealWithSEInFields(const std::string& seName, const MEDFileFields *fs, const MEDFileEltStruct4Mesh *zeStr, const MEDFileFields *varAtt, MEDFileFields *zeOutputs) const;
44     void dealWithMEDBALLSInFields(const MEDFileFields *fs, const MEDFileEltStruct4Mesh *zeStr, const MEDFileFields *varAtt, MEDFileFields *zeOutputs) const;
45     static std::string BuildNewMeshName(const std::string& meshName, const std::string& seName);
46     static std::string BuildVarAttName(std::size_t iPart, std::size_t totINbParts, std::size_t jPart, std::size_t totJNbParts, const std::string& name);
47   public:
48     static const char MED_BALL_STR[];
49   private:
50     std::vector< MCAuto<MEDFileFields> > _elts;// split by pair(meshName,SEName)
51     MCConstAuto<MEDFileMeshes> _ms;
52     MCConstAuto<MEDFileStructureElements> _ses;
53   };
54 }
55
56 #endif