xc
Preprocessor.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 //Preprocessor.h
29 
30 #ifndef PREPROCESSOR_H
31 #define PREPROCESSOR_H
32 
33 #include "utility/kernel/CommandEntity.h"
34 #include "utility/actor/actor/MovableObject.h"
35 #include "prep_handlers/MaterialHandler.h"
36 #include "prep_handlers/BeamIntegratorHandler.h"
37 #include "prep_handlers/TransfCooHandler.h"
38 #include "prep_handlers/NodeHandler.h"
39 #include "prep_handlers/ElementHandler.h"
40 #include "prep_handlers/LoadHandler.h"
41 #include "prep_handlers/BoundaryCondHandler.h"
42 #include "set_mgmt/MapSet.h"
43 #include "multi_block_topology/MultiBlockTopology.h"
44 #include "utility/handler/DataOutputHandler.h"
45 
46 
47 namespace XC {
48 class Domain;
49 class Constraint;
50 class FEProblem;
51 class FE_Datastore;
52 
54 
60  {
61  private:
62  static const int theDbTag= 0;
63 
64  Domain *domain;
65 
66  MaterialHandler materialHandler;
67  TransfCooHandler transf;
68  BeamIntegratorHandler beamIntegrators;
69  NodeHandler nodeHandler;
70  ElementHandler elementHandler;
71  LoadHandler loadHandler;
72  BoundaryCondHandler constraintHandler;
73 
74  MultiBlockTopology mbt;
75 
76  MapSet sets;
77 
78  friend class MultiBlockTopology;
79  friend class SetMeshComp;
80  friend class Set;
81 
82  Preprocessor(const Preprocessor &);
83  Preprocessor &operator=(const Preprocessor &);
84  protected:
85  DbTagData &getDbTagData(void) const;
86  int sendData(Communicator &);
87  int recvData(const Communicator &);
88 
89  friend class EntMdlr;
90  friend class MapSet;
91  friend class SetEstruct;
92  friend class ProtoElementHandler;
93  friend class ElementHandler;
94  friend class BoundaryCondHandler;
95  friend class FEProblem;
96 
97  SetEstruct *find_struct_set(const std::string &nmb);
98  public:
99  Preprocessor(CommandEntity *owr,DataOutputHandler::map_output_handlers *oh= nullptr);
100  FEProblem *getProblem(void);
101  const FEProblem *getProblem(void) const;
102 
103  inline Domain *getDomain(void)
104  { return domain; }
105  inline const Domain *getDomain(void) const
106  { return domain; }
107  FE_Datastore *getDataBase(void);
108 
109  void updateSets(Node *);
110  void removeFromSets(Node *);
112  bool remove(Node *);
113  bool removeNode(const int &);
114  void updateSets(Element *);
115  void removeFromSets(Element *);
117  bool remove(Element *);
118  bool removeElement(const int &);
119  void updateSets(Constraint *);
120  void removeFromSets(Constraint *);
121  bool remove(Constraint *);
122  bool removeSFreedom_Constraint(const int &);
123  bool removeMFreedom_Constraint(const int &);
124  bool removeMRMFreedom_Constraint(const int &);
125 
126  MapSet &get_sets(void)
127  { return sets; }
128  const MapSet &get_sets(void) const
129  { return sets; }
130  MaterialHandler &getMaterialHandler(void)
131  { return materialHandler; }
132  const MaterialHandler &getMaterialHandler(void) const
133  { return materialHandler; }
134  inline NodeHandler &getNodeHandler(void)
135  { return nodeHandler; }
136  inline const NodeHandler &getNodeHandler(void) const
137  { return nodeHandler; }
138  ElementHandler &getElementHandler(void)
139  { return elementHandler; }
140  const ElementHandler &getElementHandler(void) const
141  { return elementHandler; }
142  LoadHandler &getLoadHandler(void)
143  { return loadHandler; }
144  const LoadHandler &getLoadHandler(void) const
145  { return loadHandler; }
146  BoundaryCondHandler &getBoundaryCondHandler(void)
147  { return constraintHandler; }
148  const BoundaryCondHandler &getBoundaryCondHandler(void) const
149  { return constraintHandler; }
150  TransfCooHandler &getTransfCooHandler(void)
151  { return transf; }
152  const TransfCooHandler &getTransfCooHandler(void) const
153  { return transf; }
154  BeamIntegratorHandler &getBeamIntegratorHandler(void)
155  { return beamIntegrators; }
156  const BeamIntegratorHandler &getBeamIntegratorHandler(void) const
157  { return beamIntegrators; }
158 
159  const MultiBlockTopology &getMultiBlockTopology(void) const
160  { return mbt; }
161  MultiBlockTopology &getMultiBlockTopology(void)
162  { return mbt; }
163 
164  void resetLoadCase(void);
165  void clearAll(void);
166 
167  static void setDeadSRF(const double &);
168 
169  virtual int sendSelf(Communicator &);
170  virtual int recvSelf(const Communicator &);
171 
172  boost::python::dict getPyDict(void) const;
173  void setPyDict(const boost::python::dict &);
174 
175  virtual ~Preprocessor(void);
176  };
177 } // end of XC namespace
178 
179 #endif
bool removeMRMFreedom_Constraint(const int &)
Removes the constraint from the problem.
Definition: Preprocessor.cc:251
bool removeMFreedom_Constraint(const int &)
Removes the constraint from the problem.
Definition: Preprocessor.cc:233
SetEstruct * find_struct_set(const std::string &nmb)
Return a pointer to the set or geometric entity with the name being passed as a parameter.
Definition: Preprocessor.cc:309
Sets container.
Definition: MapSet.h:48
Base class for objects that store/restore model information.
Definition: FE_Datastore.h:84
Communication parameters between processes.
Definition: Communicator.h:66
Node creation manager.
Definition: NodeHandler.h:43
virtual ~Preprocessor(void)
Destructor.
Definition: Preprocessor.cc:282
Finite element model generation tools.
Definition: Preprocessor.h:59
Object that can move between processes.
Definition: MovableObject.h:100
virtual int recvSelf(const Communicator &)
Receive object through the communicator argument.
Definition: Preprocessor.cc:415
static void setDeadSRF(const double &)
Assign Stress Reduction Factor for element deactivation.
Definition: Preprocessor.cc:304
Model geometry manager.
Definition: MultiBlockTopology.h:68
int sendData(Communicator &)
Send data through the communicator argument.
Definition: Preprocessor.cc:365
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Constraint cration tools.
Definition: BoundaryCondHandler.h:45
Element creation manager.
Definition: ElementHandler.h:40
DbTagData & getDbTagData(void) const
Return a vector to store the dbTags of the class members.
Definition: Preprocessor.cc:358
Base class for the finite elements.
Definition: Element.h:112
Set of mesh components (nodes, elements and constraints).
Definition: SetMeshComp.h:59
void updateSets(Node *)
Insert the pointer to the node in the "total" set and in the sets that are currently opened...
Definition: Preprocessor.cc:72
void clearAll(void)
Delete all preprocessor entities.
Definition: Preprocessor.cc:331
Object set.
Definition: Set.h:57
void removeFromSets(Node *)
Removes the node from all the sets.
Definition: Preprocessor.cc:99
Objet that can execute python scripts.
Definition: CommandEntity.h:40
FEProblem * getProblem(void)
Return a pointer to the problem that owns this preprocessor.
Definition: Preprocessor.cc:290
Manager for the creation/deletion of coordinate transformations.
Definition: TransfCooHandler.h:50
bool removeSFreedom_Constraint(const int &)
Removes the constraint from the problem.
Definition: Preprocessor.cc:215
Finite element problem.
Definition: FEProblem.h:81
Multiblock topology object (point, line, face, block,...).
Definition: EntMdlr.h:55
Material handler (definition, searching,...).
Definition: MaterialHandler.h:46
structured set, i.
Definition: SetEstruct.h:47
Finite element creation.
Definition: ProtoElementHandler.h:50
bool removeNode(const int &)
Removes the node from the problem.
Definition: Preprocessor.cc:128
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class for model constraints.
Definition: Constraint.h:48
int recvData(const Communicator &)
Receive data through the communicator argument.
Definition: Preprocessor.cc:382
Load definition manager.
Definition: LoadHandler.h:45
void resetLoadCase(void)
Domain setup to solve for a new load pattern.
Definition: Preprocessor.cc:318
Beam integrators handler.
Definition: BeamIntegratorHandler.h:42
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: Preprocessor.cc:456
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
FE_Datastore * getDataBase(void)
Return a pointer to the database.
Definition: Preprocessor.cc:347
void removeFromLoadPatterns(Node *)
Removes the node from all the load patterns.
Definition: Preprocessor.cc:105
bool removeElement(const int &)
Removes the element from the problem.
Definition: Preprocessor.cc:176
virtual int sendSelf(Communicator &)
Send object through the communicator argument.
Definition: Preprocessor.cc:399
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: Preprocessor.cc:438