xc
Set.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 //Set.h
28 
29 #ifndef SET_H
30 #define SET_H
31 
32 #include "preprocessor/set_mgmt/SetMeshComp.h"
33 #include "preprocessor/set_mgmt/SetEntities.h"
34 
35 class Pos3d;
36 
37 namespace XC {
38 class SFreedom_Constraint;
39 class ID;
40 class Element;
41 class Node;
42 class Constraint;
43 
56 class Set: public SetMeshComp
57  {
58  private:
59  Set *alloc_set(void);
60  public:
61  void numera(void);
62 
63  protected:
64  std::string description;
66 
67  void clearAll(void);
68  void create_copy(const std::string &,const Vector3d &v);
69 
70  DbTagData &getDbTagData(void) const;
71  int sendData(CommParameters &);
72  int recvData(const CommParameters &);
73 
74 
75  void mueve(const Vector3d &);
76  public:
77  Set(const std::string &nmb="",Preprocessor *preprocessor= nullptr);
78 
79  inline void setDescription(const std::string &d)
80  { description= d; }
81  const std::string &getDescription(void) const
82  { return description; }
83 
84  void clear(void);
85 
87  virtual const SetEntities::lst_ptr_points &getPoints(void) const
88  { return entities.getPoints(); }
91  { return entities.getPoints(); }
94  { entities.setPoints(pts); }
95  void sel_points_lista(const ID &);
96  bool In(const Pnt *) const;
97  Set pickPointsInside(const std::string &, const GeomObj3d &, const double &tol= 0.0);
98 
100  virtual const SetEntities::lst_line_pointers &getLines(void) const
101  { return entities.getLines(); }
104  { return entities.getLines(); }
107  { entities.setLines(lns); }
108  void sel_lines_list(const ID &);
109  bool In(const Edge *) const;
110  Set pickLinesInside(const std::string &, const GeomObj3d &, const double &tol= 0.0);
111 
113  virtual const SetEntities::lst_surface_ptrs &getSurfaces(void) const
114  { return entities.getSurfaces(); }
117  { return entities.getSurfaces(); }
120  { entities.setSurfaces(sfs); }
121  void sel_surfaces_lst(const ID &);
122  bool In(const Face *) const;
123  Set pickSurfacesInside(const std::string &, const GeomObj3d &, const double &tol= 0.0);
124 
126  virtual const SetEntities::lst_ptr_cuerpos &getBodies(void) const
127  { return entities.getBodies(); }
130  { return entities.getBodies(); }
133  { entities.setBodies(bds); }
134  bool In(const Body *) const;
135  Set pickBodiesInside(const std::string &, const GeomObj3d &, const double &tol= 0.0);
136 
139  { return entities.getUniformGrids(); }
142  { return entities.getUniformGrids(); }
143  bool In(const UniformGrid *) const;
144 
145  BND3d Bnd(const double &) const;
146  Set pickEntitiesInside(const std::string &, const GeomObj3d &, const double &tol= 0.0);
147 
148  void genMesh(meshing_dir dm);
149 
150 
151  void fillUpwards(void);
152  void fillDownwards(void);
153 
154  void Transforma(const TrfGeom &trf);
155  void Transforma(const size_t &indice_trf);
156 
157  virtual int sendSelf(CommParameters &);
158  virtual int recvSelf(const CommParameters &);
159 
160  Set &operator+=(const Set &);
161  Set &operator-=(const Set &);
162  Set &operator*=(const Set &);
163 
164  Set &operator+(const Set &) const;
165  Set &operator-(const Set &) const;
166  Set &operator*(const Set &) const;
167 
168  ~Set(void);
169  };
170 } //end of XC namespace
171 #endif
virtual SetEntities::lst_ptr_uniform_grids & getUniformGrids(void)
Return a reference to the UniformGrids container.
Definition: Set.h:141
void sel_surfaces_lst(const ID &)
Selects the surfaces with the identifiers being passed as parameter.
Definition: Set.cc:329
virtual const lst_ptr_points & getPoints(void) const
Returns a const reference to the point container.
Definition: SetEntities.h:117
Set pickLinesInside(const std::string &, const GeomObj3d &, const double &tol=0.0)
Return a new set that contains the lines that lie insiof the geometric object.
Definition: Set.cc:230
void setSurfaces(const lst_surface_ptrs &sfs)
Assigns the surface set.
Definition: SetEntities.h:149
virtual const lst_line_pointers & getLines(void) const
Return a const reference to the line container.
Definition: SetEntities.h:130
virtual const SetEntities::lst_ptr_points & getPoints(void) const
Returns a const reference to the entities container.
Definition: Set.h:87
~Set(void)
Destructor.
Definition: Set.cc:358
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
virtual const SetEntities::lst_ptr_uniform_grids & getUniformGrids(void) const
Return a const reference to the UniformGrids container.
Definition: Set.h:138
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: Set.cc:334
void genMesh(meshing_dir dm)
Triggers mesh generation from set components.
Definition: Set.cc:200
void sel_lines_list(const ID &)
Select the lines identified by the tags in the parameter.
Definition: Set.cc:325
Set pickEntitiesInside(const std::string &, const GeomObj3d &, const double &tol=0.0)
Return a new set that contains the entities that lie insiof the geometric object. ...
Definition: Set.cc:292
virtual const lst_ptr_cuerpos & getBodies(void) const
Return a const reference to the body container.
Definition: SetEntities.h:156
void numera(void)
Set indices for the set objects (nodes,elements,points...) to its use in VTK.
Definition: Set.cc:132
Finite element model generation tools.
Definition: Preprocessor.h:58
void sel_points_lista(const ID &)
Select the points identified by the tags in the parameter.
Definition: Set.cc:319
void setBodies(const lst_ptr_cuerpos &bds)
Assigns the bodies set.
Definition: SetEntities.h:162
void clearAll(void)
Clears all the objects of the set.
Definition: Set.cc:125
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
Vector of integers.
Definition: ID.h:93
int sendData(CommParameters &)
Send members through the channel being passed as parameter.
Definition: Set.cc:341
std::string description
set description.
Definition: Set.h:64
void setSurfaces(const SetEntities::lst_surface_ptrs &sfs)
Assigns the surface set.
Definition: Set.h:119
void setPoints(const SetEntities::lst_ptr_points &pts)
Assigns the points set.
Definition: Set.h:93
virtual const SetEntities::lst_ptr_cuerpos & getBodies(void) const
Return a const reference to the body container.
Definition: Set.h:126
Set & operator+(const Set &) const
Addition (union) operator.
Definition: Set.cc:87
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: Set.cc:376
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: Set.cc:362
Uniform mesh.
Definition: UniformGrid.h:40
Set pickPointsInside(const std::string &, const GeomObj3d &, const double &tol=0.0)
Return a new set that contains the points that lie insiof the geometric object.
Definition: Set.cc:213
Set & operator-(const Set &) const
Difference operator.
Definition: Set.cc:98
Set of mesh components (nodes, elements and constraints).
Definition: SetMeshComp.h:58
Set & operator*(const Set &) const
Intersection operator.
Definition: Set.cc:109
virtual const lst_surface_ptrs & getSurfaces(void) const
Returns a const reference to the surface container.
Definition: SetEntities.h:143
Object set.
Definition: Set.h:56
void setBodies(const SetEntities::lst_ptr_cuerpos &bds)
Assigns the bodies set.
Definition: Set.h:132
void setPoints(const lst_ptr_points &pts)
Assigns the points set.
Definition: SetEntities.h:123
void clear(void)
Clears the set.
Definition: Set.cc:118
Set & operator+=(const Set &)
Addition assignment operator.
Definition: Set.cc:57
virtual SetEntities::lst_ptr_cuerpos & getBodies(void)
Return a reference to the body container.
Definition: Set.h:129
int recvData(const CommParameters &)
Receives members through the channel being passed as parameter.
Definition: Set.cc:349
Point (KPoint).
Definition: Pnt.h:49
SetEntities entities
points, lines, surfaces, bodies, ...
Definition: Set.h:65
Set pickBodiesInside(const std::string &, const GeomObj3d &, const double &tol=0.0)
Return a new set that contains the bodies that lie insiof the geometric object.
Definition: Set.cc:264
virtual const SetEntities::lst_line_pointers & getLines(void) const
Return a const reference to the line container.
Definition: Set.h:100
BND3d Bnd(const double &) const
Return the set boundary.
Definition: Set.cc:279
void mueve(const Vector3d &)
Moves the objects of the set.
Definition: Set.cc:142
Geometric transformation that can be applied to the components of a set.
Definition: TrfGeom.h:49
bool In(const Pnt *) const
Returns true if the point belongs to the set.
Definition: Set.cc:204
void setLines(const SetEntities::lst_line_pointers &lns)
Assigns the edge set.
Definition: Set.h:106
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
Six-faced solid.
Definition: Body.h:64
Set & operator*=(const Set &)
*= operator (intersection).
Definition: Set.cc:75
virtual SetEntities::lst_line_pointers & getLines(void)
Return a reference to the line container.
Definition: Set.h:103
void Transforma(const TrfGeom &trf)
Applies the transformation to the elements of the set.
Definition: Set.cc:149
void setLines(const lst_line_pointers &lns)
Assigns the edge set.
Definition: SetEntities.h:136
void fillDownwards(void)
Appends to the set being passed as parameter the elements that intervene on the definition of those e...
Definition: Set.cc:302
void fillUpwards(void)
Appends to this set the objects that make reference to one or more of the objects that already make p...
Definition: Set.cc:310
virtual SetEntities::lst_ptr_points & getPoints(void)
Return a reference to the the point container.
Definition: Set.h:90
Set(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: Set.cc:50
Set & operator-=(const Set &)
-= operator.
Definition: Set.cc:66
Surface.
Definition: Face.h:41
virtual const lst_ptr_uniform_grids & getUniformGrids(void) const
Return a const reference to the UniformGrids container.
Definition: SetEntities.h:168
Set pickSurfacesInside(const std::string &, const GeomObj3d &, const double &tol=0.0)
Return a new set that contains the surfaces that lie insiof the geometric object. ...
Definition: Set.cc:247
virtual SetEntities::lst_surface_ptrs & getSurfaces(void)
Returns a reference to the surface container.
Definition: Set.h:116
Object set.
Definition: SetEntities.h:63
void create_copy(const std::string &, const Vector3d &v)
Creates a copy of the elements of the set and put them in another set with the name is being passed a...
Definition: Set.cc:179
virtual const SetEntities::lst_surface_ptrs & getSurfaces(void) const
Returns a const reference to the surface container.
Definition: Set.h:113