XC Open source finite element analysis program
EntMdlr.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 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 //EntMdlr.h
28 //Multiblock topology entity.
29 
30 #ifndef ENTMDLR_H
31 #define ENTMDLR_H
32 
33 #include "preprocessor/set_mgmt/SetEstruct.h"
34 #include "preprocessor/cad/matrices/TritrizPtrNod.h"
35 #include "preprocessor/cad/matrices/TritrizPtrElem.h"
36 #include "preprocessor/MeshingParams.h"
37 
38 class BND3d;
39 class Pos3d;
40 class MatrizPos3d;
41 class TritrizPos3d;
42 class RangoIndice;
43 class RangoTritriz;
44 
45 namespace XC {
46 class SetFilaI;
47 class SetFilaJ;
48 class SetFilaK;
49 
53 class EntMdlr: public SetEstruct
54  {
55  private:
56  size_t idx;
57  bool doGenMesh;
58  protected:
59  TritrizPtrNod ttzNodes;
60  TritrizPtrElem ttzElements;
61  friend class Set;
62  friend class SetMeshComp;
63  friend class Cad;
64  virtual void actualiza_topologia(void)= 0;
65  void create_nodes(const TritrizPos3d &);
66  Node *create_node(const Pos3d &pos,size_t i=1,size_t j=1, size_t k=1);
67  bool create_elements(meshing_dir dm);
68  Pnt *create_point(const Pos3d &);
69  void create_points(const MatrizPos3d &);
70  SetEstruct *create_set_fila(const RangoTritriz &,const std::string &);
71 
72  void clearAll(void);
73  public:
74  EntMdlr(Preprocessor *m,const size_t &i= 0);
75  EntMdlr(const std::string &nombre= "",const size_t &i= 0,Preprocessor *m= nullptr);
76  EntMdlr(const EntMdlr &otro);
77  EntMdlr &operator=(const EntMdlr &otro);
78 
79  virtual void set_indice(const size_t &i);
81  inline size_t getIdx(void) const
82  { return idx; }
83 
84  inline bool TieneNodos(void) const
85  { return !ttzNodes.empty(); }
86  virtual size_t getNumNodeLayers(void) const
87  { return ttzNodes.GetCapas(); }
88  virtual size_t getNumNodeRows(void) const
89  { return ttzNodes.getNumFilas(); }
90  virtual size_t getNumNodeColumns(void) const
91  { return ttzNodes.getNumCols(); }
92  virtual size_t getNumElementLayers(void) const
93  { return ttzElements.GetCapas(); }
94  virtual size_t getNumElementRows(void) const
95  { return ttzElements.getNumFilas(); }
96  virtual size_t getNumElementColumns(void) const
97  { return ttzElements.getNumCols(); }
98 
99  virtual Node *GetNodo(const size_t &i=1,const size_t &j=1,const size_t &k=1);
100  virtual const Node *GetNodo(const size_t &i=1,const size_t &j=1,const size_t &k=1) const;
101  Node *getNearestNode(const Pos3d &p);
102  const Node *getNearestNode(const Pos3d &p) const;
103  ID getNodeIndices(const Node *) const;
104  virtual Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1);
105  virtual const Element *getElement(const size_t &i=1,const size_t &j=1,const size_t &k=1) const;
106  Node *buscaNodo(const int &tag);
107  const Node *buscaNodo(const int &tag) const;
108  std::vector<int> getTagsNodos(void) const;
109 
110  Element *findElement(const int &);
111  const Element *findElement(const int &) const;
112  Element *getNearestElement(const Pos3d &p);
113  const Element *getNearestElement(const Pos3d &p) const;
114 
115  TritrizPtrNod &getTtzNodes(void)
116  { return ttzNodes; }
117  const TritrizPtrNod &getTtzNodes(void) const
118  { return ttzNodes; }
119  TritrizPtrElem &getTtzElements(void)
120  { return ttzElements; }
121  const TritrizPtrElem &getTtzElements(void) const
122  { return ttzElements; }
124  virtual unsigned short int GetDimension(void) const= 0;
125  virtual BND3d Bnd(void) const= 0;
126 
127  SetFilaI GetVarRefFilaI(size_t f=1,size_t c=1,const std::string &nmb="tmp");
128  SetFilaI GetVarRefFilaI(const RangoIndice &rango_capas,size_t f,size_t c,const std::string &nmb="tmp");
129  SetFilaI GetVarRefFilaI(const RangoTritriz &rango,const std::string &nmb="tmp");
130 
131  SetFilaJ GetVarRefFilaJ(size_t capa=1,size_t c=1,const std::string &nmb="tmp");
132  SetFilaJ GetVarRefFilaJ(size_t capa,const RangoIndice &rango_filas,size_t c,const std::string &nmb="tmp");
133  SetFilaJ GetVarRefFilaJ(const RangoTritriz &rango,const std::string &nmb="tmp");
134 
135  SetFilaK GetVarRefFilaK(size_t capa=1,size_t f=1,const std::string &nmb="tmp");
136  SetFilaK GetVarRefFilaK(size_t capa,size_t f,const RangoIndice &rango_cols,const std::string &nmb="tmp");
137  SetFilaK GetVarRefFilaK(const RangoTritriz &rango,const std::string &nmb="tmp");
138 
139  void fix(const SFreedom_Constraint &);
140 
141  virtual int getMEDCellType(void) const;
142  virtual int getVtkCellType(void) const;
143 
144  void setGenMesh(bool m);
145  const bool &getGenMesh(void) const;
146 
147  virtual std::set<SetBase *> get_sets(void) const= 0;
148 
149  virtual double DistanciaA2(const Pos3d &pt) const;
150  virtual double DistanciaA(const Pos3d &pt) const;
151 
152  Vector getSimpsonWeights(const std::string &,const std::string &,const size_t &f=1,const size_t &c=1, const size_t &n= 10) const;
153 
154  void BorraPtrNodElem(void);
155 
156 
157  virtual ~EntMdlr(void);
158  };
159 
160 } //end of XC namespace
161 
162 #endif
SetEstruct * create_set_fila(const RangoTritriz &, const std::string &)
Creates a set that corresponds to a row of nodes and elements.
Definition: EntMdlr.cc:195
"Tritriz" of pointers to elements.
Definition: TritrizPtrElem.h:43
virtual unsigned short int GetDimension(void) const =0
Return the object dimension (0, 1, 2 or 3).
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:53
size_t getIdx(void) const
Returns the index of the object for it use in VTK arrays.
Definition: EntMdlr.h:81
Vector getSimpsonWeights(const std::string &, const std::string &, const size_t &f=1, const size_t &c=1, const size_t &n=10) const
Return Simpson&#39;s weights.
Definition: EntMdlr.cc:226
"Tritriz" of pointers to elements.
Definition: TritrizPtrNod.h:51
Definition: Vector.h:82
Node * getNearestNode(const Pos3d &p)
Returns the node closest to the point being passed as parameter.
Definition: EntMdlr.cc:128
virtual double DistanciaA2(const Pos3d &pt) const
Returns the squared distance to the position being passed as parameter.
Definition: EntMdlr.cc:373
Node * buscaNodo(const int &tag)
Returns a pointer to the node cuyo identificador is being passed as parameter.
Definition: EntMdlr.cc:177
bool create_elements(meshing_dir dm)
Creates elements on the nodes created in create_nodes.
Definition: EntMdlr.cc:273
EntMdlr(Preprocessor *m, const size_t &i=0)
Constructor.
Definition: EntMdlr.cc:48
Mesh node.
Definition: Node.h:99
EntMdlr & operator=(const EntMdlr &otro)
Assignment operator.
Definition: EntMdlr.cc:64
Set of objecst in a row.
Definition: SetFilaI.h:50
Base calass for the finite elements.
Definition: Element.h:104
void BorraPtrNodElem(void)
Clears pointer to nodes and elements.
Definition: EntMdlr.cc:101
virtual double DistanciaA(const Pos3d &pt) const
Returns the distance to the position being passed as parameter.
Definition: EntMdlr.cc:381
Node * create_node(const Pos3d &pos, size_t i=1, size_t j=1, size_t k=1)
Creates a node at the position being passed as parameter.
Definition: EntMdlr.cc:240
void clearAll(void)
Clears object contents.
Definition: EntMdlr.cc:94
Finite element model generation tools.
Definition: Preprocessor.h:58
Pnt * create_point(const Pos3d &)
Creates a point at the position being passed as parameter.
Definition: EntMdlr.cc:322
Definition: ID.h:77
structured set, i. e. a set that can return a pointer a to a node or an element from its indices i...
Definition: SetEstruct.h:45
Punto (KPoint).
Definition: Pnt.h:49
Set of objects in a row.
Definition: SetFilaK.h:50
Model geometry manager. Management of geometry entities: points, lines, surfaces, bodies...
Definition: Cad.h:69
Objects in a row.
Definition: SetFilaJ.h:50
Element * getNearestElement(const Pos3d &p)
Returns the element closest to the point being passed as parameter.
Definition: EntMdlr.cc:166
void setGenMesh(bool m)
Returns true if the points begins or ends in the line.
Definition: EntMdlr.cc:314
virtual int getMEDCellType(void) const
Interfaz con el formato MED de Salome.
Definition: EntMdlr.cc:87
Set of mesh components (nodes, elements and constraints).
Definition: SetMeshComp.h:58
Object set.
Definition: Set.h:63
ID getNodeIndices(const Node *) const
Returns the indexes of the node being passed as parameter.
Definition: EntMdlr.cc:139
virtual Element * getElement(const size_t &i=1, const size_t &j=1, const size_t &k=1)
Returns a pointer to the element which indexes are being passed as paremeters.
Definition: EntMdlr.cc:148
void create_nodes(const TritrizPos3d &)
Creates nodes at the positions being passed as parameters.
Definition: EntMdlr.cc:248
Element * findElement(const int &)
Returns a pointer to the element identified by the tag being passed as parameter. ...
Definition: EntMdlr.cc:186
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
virtual void set_indice(const size_t &i)
Assigns the objects index for its use in VTK arrays(see numera in Set).
Definition: EntMdlr.cc:76
virtual Node * GetNodo(const size_t &i=1, const size_t &j=1, const size_t &k=1)
Returns a pointer to the node which indexes are being passed as parameters.
Definition: EntMdlr.cc:109
================================================================================
Definition: ContinuaReprComponent.h:34
virtual ~EntMdlr(void)
Destructor.
Definition: EntMdlr.cc:389
void fix(const SFreedom_Constraint &)
Fixes the nodes of the set.
Definition: EntMdlr.cc:385
void create_points(const MatrizPos3d &)
Creates points at the positions being passed as parameters.
Definition: EntMdlr.cc:326
const bool & getGenMesh(void) const
Returns true if the points begins or ends in the line.
Definition: EntMdlr.cc:318
std::vector< int > getTagsNodos(void) const
Returns the tags of the nodes.
Definition: EntMdlr.cc:143
virtual int getVtkCellType(void) const
Interfaz con VTK.
Definition: EntMdlr.cc:80