XC Open source finite element analysis program
MEDMeshing.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // XC is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program.
20 // If not, see <http://www.gnu.org/licenses/>.
21 //----------------------------------------------------------------------------
22 //MEDMeshing.h
23 //Envoltorio para el objeto MESHING de MED (para exportar archivos a «salome»).
24 
25 #ifndef MEDMESHING_H
26 #define MEDMESHING_H
27 
28 #include "MEDObject.h"
29 #include "xc_basic/src/med_xc/MEDMEM_Meshing.hxx"
30 #include "MEDCellInfo.h"
31 #include "MEDVertexInfo.h"
32 #include "MEDGroupInfo.h"
33 #include "MEDFieldInfo.h"
34 #include <deque>
35 
36 namespace XC {
37 class MapSet;
38 class MapFields;
39 class MEDDblFieldInfo;
40 class ProblemaEF;
41 
43 //
45 class MEDMeshing: public MEDObject
46  {
47  const MapSet &sets;
48  const MapFields &fields;
49  MEDVertexInfo vertices;
50  MEDCellInfo cells;
51  mutable std::deque<MEDGroupInfo> med_groups;
52  mutable std::deque<MEDFieldInfo *> med_fields;
53 
54  static const std::string str_node_group;
55  static const std::string str_element_group;
56 
57  mutable MEDMEM::MESHING mesh;
58  MEDMeshing(const MEDMeshing &);
59  MEDMeshing &operator=(const MEDMeshing &);
60  protected:
61  void new_node(size_t i,const std::vector<double> &coo);
62 
63  friend class MEDGroupInfo;
64  MEDMEM::MESHING &getMEDMesh(void) const;
65  MEDGroupInfo *getGroupInfo(const std::string &) const;
66  MEDGroupInfo *getGroupInfo(const Set &,const FieldInfo &) const;
67 
68  void defineMEDGroups(void);
69  void defineMEDGaussModels(const Set &,MEDFieldInfo &) const;
70  void defineMEDDblField(const Set &,const FieldInfo &,MEDGroupInfo *) const;
71  void defineMEDIntField(const Set &,const FieldInfo &,MEDGroupInfo *) const;
72  void defineMEDFields(void) const;
73 
74  public:
75  MEDMeshing(const Mesh &,const MapSet &, const MapFields &);
76  MEDMeshing(const ProblemaEF &);
77  ~MEDMeshing(void);
78 
79  void clear(void);
80  void write(const std::string &);
81 
82  inline const std::string getMeshName(void) const
83  { return mesh.getName(); }
84  inline void setMeshName(const std::string &str) const
85  { return mesh.setName(str); }
86  inline MEDVertexInfo &getVertices(void)
87  { return vertices; }
88  inline void setVertices(const MEDVertexInfo &vtx)
89  { vertices= vtx; }
90  inline MEDCellInfo &getCells(void)
91  { return cells; }
92  inline void setCells(const MEDCellInfo &cls)
93  { cells= cls; }
94 
95  const MEDMapIndices &getMapIndicesVertices(void) const;
96  const MEDMapIndices &getMapIndicesCeldas(void) const;
97 
98 
99  void to_med(void);
100  };
101 } // end of XC namespace
102 #endif
Information about a field defined over a set.
Definition: FieldInfo.h:39
void defineMEDGaussModels(const Set &, MEDFieldInfo &) const
Set the integration Gauss model for the elements on the set.
Definition: MEDMeshing.cc:136
Finite element mesh.
Definition: Mesh.h:64
void defineMEDFields(void) const
Define los campos de MEDMEM correspondientes a los de XC.
Definition: MEDMeshing.cc:182
Information about node and element sets.
Definition: MEDGroupInfo.h:36
Container of field definitions.
Definition: MapFields.h:44
Envoltorio para el objeto MESHING de MED.
Definition: MEDMeshing.h:45
Base class for MED objects.
Definition: MEDObject.h:39
void defineMEDGroups(void)
Define los grupos de MEDMEM correspondientes a the sets de XC.
Definition: MEDMeshing.cc:78
void defineMEDDblField(const Set &, const FieldInfo &, MEDGroupInfo *) const
Defines a field over an element set.
Definition: MEDMeshing.cc:142
Map between the indexes in XC and in MEDMEM.
Definition: MEDMapIndices.h:36
MEDMEM::MESHING & getMEDMesh(void) const
Returns a reference to the MEDMEM mesh.
Definition: MEDMeshing.cc:52
void clear(void)
Erases la mesh.
Definition: MEDMeshing.cc:56
Finite element problem.
Definition: ProblemaEF.h:84
void defineMEDIntField(const Set &, const FieldInfo &, MEDGroupInfo *) const
Defines a field over a set.
Definition: MEDMeshing.cc:162
Information about a field defined over a mesh subset.
Definition: MEDFieldInfo.h:38
Object set.
Definition: Set.h:63
~MEDMeshing(void)
Constructor.
Definition: MEDMeshing.cc:67
void to_med(void)
Dumps vertices and cells definition onto mesh MED.
Definition: MEDMeshing.cc:212
================================================================================
Definition: ContinuaReprComponent.h:34
Sets container.
Definition: MapSet.h:57
Information about mesh vertex.
Definition: MEDVertexInfo.h:37
Information about mesh cells (conectivity,...).
Definition: MEDCellInfo.h:37