xc
SetBase.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //SetBase.h
29 
30 #ifndef SETBASE_H
31 #define SETBASE_H
32 
36 
37 #include "preprocessor/EntMdlrBase.h"
38 #include "preprocessor/MeshingParams.h"
39 #include "utility/matrix/Vector.h"
40 
41 namespace XC {
42 class Constraint;
43 class SFreedom_Constraint;
44 class Face;
45 class Body;
46 class UniformGrid;
47 
51 class SetBase: public EntMdlrBase
52  {
53  Vector color;
54  public:
55  SetBase(const std::string &nmb="",Preprocessor *preprocessor= nullptr);
56  inline virtual ~SetBase(void) {}
57  virtual bool operator==(const SetBase &) const;
58  void setColorComponents(const double &, const double &, const double &);
59  void setColor(const Vector &);
60  const Vector &getColor(void) const;
61  virtual void genMesh(meshing_dir dm);
62  virtual void fix(const SFreedom_Constraint &);
63 
64  virtual std::set<int> getNodeTags(void) const= 0;
65  virtual std::set<int> getElementTags(void) const= 0;
66  const ID &getIdNodeTags(void) const;
67  const ID &getIdElementTags(void) const;
68  boost::python::list getNodeTagsPy(void) const;
69  boost::python::list getElementTagsPy(void) const;
70 
71 
72  bool interiorNode(const Node *) const;
73  virtual bool In(const Node *) const= 0;
74  virtual bool remove(Node *);
75  virtual bool In(const Element *) const= 0;
76  virtual bool remove(Element *);
77  virtual bool remove(Constraint *);
78  virtual bool In(const Pnt *) const;
79  virtual bool In(const Edge *) const;
80  virtual bool In(const Face *) const;
81  virtual bool In(const Body *) const;
82  virtual bool In(const UniformGrid *) const;
83 
84  void resetTributaries(void) const;
85  bool checkTributaries(void) const;
86  void computeTributaryLengths(bool initialGeometry= true) const;
87  void computeTributaryAreas(bool initialGeometry= true) const;
88  void computeTributaryVolumes(bool initialGeometry= true) const;
89 
90  virtual size_t getNumberOfNodes(void) const= 0;
91  virtual size_t getNumberOfElements(void) const= 0;
92  virtual void createInertiaLoads(const Vector &);
93 
94  boost::python::dict getPyDict(void) const;
95  void setPyDict(const boost::python::dict &);
96  };
97 
98 } //end of XC namespace
99 #endif
bool checkTributaries(void) const
Check if the interior nodes of the set have already a tributary area and warns the user about this ci...
Definition: SetBase.cc:284
Float vector abstraction.
Definition: Vector.h:94
void computeTributaryVolumes(bool initialGeometry=true) const
Computes the tributary volumes that correspond to each node of the element set.
Definition: SetBase.cc:384
Base class for one-dimensional geometry objects.
Definition: Edge.h:48
boost::python::list getNodeTagsPy(void) const
Returns the tags of the nodes in a Python list.
Definition: SetBase.cc:146
Finite element model generation tools.
Definition: Preprocessor.h:59
Base class of the preprocessor objects.
Definition: EntMdlrBase.h:46
void setColor(const Vector &)
Set the color of the object [red,green,blue] as integers from 0 to 255.
Definition: SetBase.cc:70
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: SetBase.cc:422
Vector of integers.
Definition: ID.h:95
const ID & getIdElementTags(void) const
Returns the tags of the elements en un vector de enteros.
Definition: SetBase.cc:130
virtual void createInertiaLoads(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: SetBase.cc:96
Base de las clases Set y SetEstruct.
Definition: SetBase.h:51
Base class for the finite elements.
Definition: Element.h:112
Uniform mesh.
Definition: UniformGrid.h:41
boost::python::list getElementTagsPy(void) const
Returns the tags of the elements in a Python list.
Definition: SetBase.cc:160
const Vector & getColor(void) const
Return the color of the object [red,green,blue] as integers from 0 to 255.
Definition: SetBase.cc:82
void computeTributaryAreas(bool initialGeometry=true) const
Computes the tributary areas that correspond to each node of the element set.
Definition: SetBase.cc:354
SetBase(const std::string &nmb="", Preprocessor *preprocessor=nullptr)
Constructor.
Definition: SetBase.cc:44
Single freedom constraint.
Definition: SFreedom_Constraint.h:85
void resetTributaries(void) const
Reset tributary areas (or lengths, or volumes) for the nodes that are connected to the set elements...
Definition: SetBase.cc:255
void computeTributaryLengths(bool initialGeometry=true) const
Computes the tributary lengths that correspond to each node of the element set.
Definition: SetBase.cc:324
Point (KPoint).
Definition: Pnt.h:50
bool interiorNode(const Node *) const
Returns true if the all the elements connected to the given node belong to the set.
Definition: SetBase.cc:175
void setColorComponents(const double &, const double &, const double &)
Set the color of the object (red,green,blue) as integers from 0 to 255.
Definition: SetBase.cc:65
const ID & getIdNodeTags(void) const
Returns the tags of the nodes en un vector de enteros.
Definition: SetBase.cc:114
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual void genMesh(meshing_dir dm)
Generates a finite element mesh from the set components.
Definition: SetBase.cc:86
boost::python::dict getPyDict(void) const
Return a Python dictionary containing the object members values.
Definition: SetBase.cc:413
Six-faced solid.
Definition: Body.h:71
Base class for model constraints.
Definition: Constraint.h:48
Mesh node.
Definition: Node.h:111
virtual void fix(const SFreedom_Constraint &)
Impone desplazamiento nulo for all the nodes of this set.
Definition: SetBase.cc:105
virtual bool operator==(const SetBase &) const
Comparison operator.
Definition: SetBase.cc:49
Surface.
Definition: Face.h:45