XC Open source finite element analysis program
ConstrContainer.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 //ConstrContainer.h
28 
29 #ifndef ConstrContainer_h
30 #define ConstrContainer_h
31 
32 #include "domain/mesh/MeshComponentContainer.h"
33 #include "MapCasosActivos.h"
34 #include <deque>
35 
36 namespace XC {
37 class SFreedom_Constraint;
38 class MFreedom_Constraint;
39 class MRMFreedom_Constraint;
40 class NodalLoad;
41 class ElementalLoad;
42 class LoadPattern;
43 class NodeLocker;
44 class SFreedom_ConstraintIter;
45 class MFreedom_ConstraintIter;
46 class MRMFreedom_ConstraintIter;
47 class LoadPatternIter;
48 class NodeLockerIter;
49 
50 class SingleDomSFreedom_Iter;
51 class SingleDomMFreedom_Iter;
52 class SingleDomMRMFreedom_Iter;
53 class SingleDomAllSFreedom_Iter;
54 class FEM_ObjectBroker;
55 
56 class TaggedObjectStorage;
57 
59 //
62  {
63  private:
64  TaggedObjectStorage *theSPs;
65  TaggedObjectStorage *theMPs;
66  TaggedObjectStorage *theMRMPs;
67  MapCasosActivos<NodeLocker> activeNodeLockers;
68  MapCasosActivos<LoadPattern> activeLoadPatterns;
69 
70  SingleDomSFreedom_Iter *theSFreedom_Iter;
71  SingleDomMFreedom_Iter *theMFreedom_Iter;
72  SingleDomMRMFreedom_Iter *theMRMFreedom_Iter;
73  SingleDomAllSFreedom_Iter *allSFreedom_Iter;
74 
75  void alloc_contenedores(void);
76  void alloc_iters(void);
77  bool check_contenedores(void) const;
78  protected:
79  friend class Domain;
80  // methods to populate containers
84  virtual bool addLoadPattern(LoadPattern *);
85  virtual bool addNodeLocker(NodeLocker *);
86 
87  // methods to add components to a LoadPattern object
88  virtual bool addSFreedom_Constraint(SFreedom_Constraint *, int loadPatternTag);
89  virtual bool addNodalLoad(NodalLoad *, int loadPatternTag);
90  virtual bool addElementalLoad(ElementalLoad *, int loadPatternTag);
91 
92  // methods to remove the components
93  virtual void clearAll(void);
94  virtual bool removeSFreedom_Constraint(int theNode, int theDOF, int loadPatternTag);
95  virtual bool removeSFreedom_Constraint(int tag);
96  virtual bool removeMFreedom_Constraint(int tag);
97  virtual bool removeMRMFreedom_Constraint(int tag);
98  virtual bool removeLoadPattern(int loadTag,int &numSPs);
99  virtual bool removeNodeLocker(int spcpTag,int &numSPs);
100  int removeLPs(void);
101  int removeNLs(void);
102 
103  virtual bool removeNodalLoad(int tag, int loadPattern);
104  virtual bool removeElementalLoad(int tag, int loadPattern);
105  virtual bool removeSFreedom_Constraint(int tag, int loadPattern);
106 
107  void libera(void);
108  DbTagData &getDbTagData(void) const;
109  int sendLPatternsTags(const int &,const int &,CommParameters &);
110  int recvLPatternsTags(const int &,const int &,const CommParameters &);
111  int sendNLockersTags(const int &,const int &,CommParameters &cp);
112  int recvNLockersTags(const int &,const int &,const CommParameters &cp);
113  int sendData(CommParameters &cp);
114  int recvData(const CommParameters &cp);
115  public:
116  ConstrContainer(Domain *owr);
117 
118  virtual ~ConstrContainer(void);
119 
120  // methods to access the components
121  virtual SFreedom_ConstraintIter &getSPs();
122  virtual MFreedom_ConstraintIter &getMPs();
124  const std::map<int,LoadPattern *> &getLoadPatterns(void) const;
125  const std::map<int,NodeLocker *> &getNodeLockers(void) const;
126  std::map<int,LoadPattern *> &getLoadPatterns(void);
127  std::map<int,NodeLocker *> &getNodeLockers(void);
129 
133  LoadPattern *getLoadPattern(const int &);
134  const LoadPattern *getLoadPattern(const int &) const;
135  NodeLocker *getNodeLocker(const int &);
136  const NodeLocker *getNodeLocker(const int &) const;
137 
138  // methods to update the domain
139  virtual void applyLoad(double pseudoTime);
140  virtual void setLoadConstant(void);
141 
142  // methods to query the state of the ConstrContainer
143  virtual int getNumSPs(void) const;
144  virtual int getNumMPs(void) const;
145  virtual int getNumMRMPs(void) const;
146  virtual int getNumLoadPatterns(void) const;
147  virtual int getNumNodeLockers(void) const;
148 
149  std::deque<int> getTagsSPsNode(int , int ) const;
150  std::deque<int> getTagsSPsNode(int ) const;
151  std::deque<int> getTagsMPsNode(int , int ) const;
152  std::deque<int> getTagsMPsNode(int ) const;
153  std::deque<int> getTagsLPs(void) const;
154  std::deque<int> getTagsNLs(void) const;
155  bool nodeAffectedBySPs(int ) const;
156  bool nodeAffectedByMPs(int ) const;
157  bool nodeAffectedByMRMPs(int ) const;
158  bool nodeAffectedBySPsOMPs(int ) const;
159  std::string getLoadPatternsNames(void) const;
160 
161  virtual int calculateNodalReactions(bool inclInertia, const double &);
162 
163  virtual int sendSelf(CommParameters &);
164  virtual int recvSelf(const CommParameters &);
165 
166  virtual void Print(std::ostream &s, int flag =0);
167  friend std::ostream &operator<<(std::ostream &s, ConstrContainer &cc);
168  };
169 } // end of XC namespace
170 
171 #endif
172 
173 
Iterator over multi-freedom constraints.
Definition: MFreedom_ConstraintIter.h:73
A LoadPattern object is used to to store reference loads and single point constraints and a TimeSerie...
Definition: LoadPattern.h:87
Base class for the element and constraint containers.
Definition: MeshComponentContainer.h:40
Single freedom constraints that make part of a load pattern.
Definition: NodeLocker.h:44
Iterador over multiple retained nodal constraints.
Definition: MRMFreedom_ConstraintIter.h:73
NodeLocker * getNodeLocker(const int &)
Returns a pointer to the node locker whose identifier is being passed as parameter.
Definition: ConstrContainer.cc:614
virtual MRMFreedom_ConstraintIter & getMRMPs()
Domain multi-row multi-freedom constraints iterator.
Definition: ConstrContainer.cc:526
Definition: SingleDomMFreedom_Iter.h:72
const std::map< int, NodeLocker * > & getNodeLockers(void) const
Returns the active node lockers container.
Definition: ConstrContainer.cc:546
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
virtual bool removeSFreedom_Constraint(int theNode, int theDOF, int loadPatternTag)
Removes a single freedom constraint from this container or from a load pattern.
Definition: ConstrContainer.cc:333
bool nodeAffectedByMPs(int) const
Returns true if the node is affected by one or more multi-freedom constraints.
Definition: ConstrContainer.cc:797
Vector que almacena los dbTags de los miembros de la clase.
Definition: DbTagData.h:43
virtual SFreedom_ConstraintIter & getSPs()
Domain single freedom constraints iterator.
Definition: ConstrContainer.cc:505
virtual bool addMRMFreedom_Constraint(MRMFreedom_Constraint *)
Appends a multi-retained nodes constraint.
Definition: ConstrContainer.cc:200
virtual bool removeMRMFreedom_Constraint(int tag)
Removes the multi-row multi-freedom constraint whose identifier is being passed as parameter...
Definition: ConstrContainer.cc:375
Definition: SingleDomSFreedom_Iter.h:72
virtual SFreedom_ConstraintIter & getDomainAndLoadPatternSPs()
All (domain and load cases) single freedom constraints iterator.
Definition: ConstrContainer.cc:512
std::string getLoadPatternsNames(void) const
Loop over all the load patterns that are currently added to the domain getting their names...
Definition: ConstrContainer.cc:739
virtual bool removeLoadPattern(int loadTag, int &numSPs)
Removes the load pattern whose identifier is being passed as parameter.
Definition: ConstrContainer.cc:384
bool nodeAffectedBySPs(int) const
Returns true if the node is affected by one or more single freedom constraints.
Definition: ConstrContainer.cc:781
int sendNLockersTags(const int &, const int &, CommParameters &cp)
Send the node lockers tags through the channel being passed as parameter.
Definition: ConstrContainer.cc:936
int removeLPs(void)
Removes all load patterns.
Definition: ConstrContainer.cc:436
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: ConstrContainer.cc:1026
virtual int getNumNodeLockers(void) const
Returns the number of node lockers.
Definition: ConstrContainer.cc:658
int removeNLs(void)
Removes all nodel lockers.
Definition: ConstrContainer.cc:450
virtual bool addElementalLoad(ElementalLoad *, int loadPatternTag)
Appends an elemental load to a load pattern.
Definition: ConstrContainer.cc:311
Base class for loads over elements.
Definition: ElementalLoad.h:73
Definition: SingleDomAllSFreedom_Iter.h:84
LoadPattern * getLoadPattern(const int &)
Returns a pointer to the load pattern whose identifier is being passed as parameter.
Definition: ConstrContainer.cc:587
virtual bool removeElementalLoad(int tag, int loadPattern)
Removes a load over elements from a load pattern.
Definition: ConstrContainer.cc:481
virtual bool removeMFreedom_Constraint(int tag)
Removes the multi-freedom constraint whose identifier is being passed as parameter.
Definition: ConstrContainer.cc:366
virtual void setLoadConstant(void)
Set as constant all the active load patterns (used in pushover analysis).
Definition: ConstrContainer.cc:840
virtual bool removeNodalLoad(int tag, int loadPattern)
Removes a nodal load from a load pattern.
Definition: ConstrContainer.cc:466
int sendData(CommParameters &cp)
Send object members through the channel being passed as parameter.
Definition: ConstrContainer.cc:988
std::deque< int > getTagsNLs(void) const
Loop over all the load patterns that are currently added to the domain getting their tag...
Definition: ConstrContainer.cc:769
virtual MRMFreedom_Constraint * getMRMFreedom_Constraint(int tag)
Returns a pointer to the multi-row multi-freedom constraint whose identifier is being passed as param...
Definition: ConstrContainer.cc:577
std::deque< int > getTagsLPs(void) const
Loop over all the load patterns that are currently added to the domain getting their tag...
Definition: ConstrContainer.cc:729
int sendLPatternsTags(const int &, const int &, CommParameters &)
Send the active load patterns tags through the channel being passed as parameter. ...
Definition: ConstrContainer.cc:870
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:58
virtual bool addNodeLocker(NodeLocker *)
Appends a node locker.
Definition: ConstrContainer.cc:241
virtual bool removeNodeLocker(int spcpTag, int &numSPs)
Removes the node locker whose identifier is being passed as parameter.
Definition: ConstrContainer.cc:410
int recvData(const CommParameters &cp)
Receives object members through the channel being passed as parameter.
Definition: ConstrContainer.cc:1000
TaggedObjectStorage. A TaggedObjectStorage object a container object used to hold objects of type Tag...
Definition: TaggedObjectStorage.h:76
virtual MFreedom_ConstraintIter & getMPs()
Domain multi-freedom constraints iterator.
Definition: ConstrContainer.cc:519
Definition: SingleDomMRMFreedom_Iter.h:48
bool nodeAffectedByMRMPs(int) const
Returns true if the node is affected by one or more multi-row multi-freedom constraints.
Definition: ConstrContainer.cc:813
virtual void clearAll(void)
Deletes all the members of the container.
Definition: ConstrContainer.cc:133
virtual int getNumMPs(void) const
Returns the number of multi-freedom constraints.
Definition: ConstrContainer.cc:646
int recvNLockersTags(const int &, const int &, const CommParameters &cp)
Receives the node lockers tags through the channel being passed as parameter.
Definition: ConstrContainer.cc:956
bool nodeAffectedBySPsOMPs(int) const
Returns true if the node is affected by any constraint.
Definition: ConstrContainer.cc:829
virtual bool addMFreedom_Constraint(MFreedom_Constraint *)
Appends a multiple freedom constraint.
Definition: ConstrContainer.cc:180
virtual ~ConstrContainer(void)
Destructor.
Definition: ConstrContainer.cc:152
virtual void Print(std::ostream &s, int flag=0)
Prints object information.
Definition: ConstrContainer.cc:1040
const std::map< int, LoadPattern * > & getLoadPatterns(void) const
Returns the active load patterns container.
Definition: ConstrContainer.cc:542
virtual int calculateNodalReactions(bool inclInertia, const double &)
Reactions due to constraints.
Definition: ConstrContainer.cc:847
virtual int getNumSPs(void) const
Returns the number of single freedom constraints.
Definition: ConstrContainer.cc:642
Multi-freedom constraint. Objectt of this class store the information for a multifreedom constraint...
Definition: MFreedom_Constraint.h:84
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: ConstrContainer.cc:1011
virtual bool addNodalLoad(NodalLoad *, int loadPatternTag)
Appends a nodal load to a load pattern.
Definition: ConstrContainer.cc:279
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of class members.
Definition: ConstrContainer.cc:863
Communication parameters between processes.
Definition: CommParameters.h:65
Load over a node.
Definition: NodalLoad.h:76
Definition: MapCasosActivos.h:39
virtual void applyLoad(double pseudoTime)
Apply loads from active node lockers.
Definition: ConstrContainer.cc:662
ConstrContainer(Domain *owr)
Constructor.
Definition: ConstrContainer.cc:122
================================================================================
Definition: ContinuaReprComponent.h:34
virtual bool addLoadPattern(LoadPattern *)
Appends a load pattern.
Definition: ConstrContainer.cc:220
Constraint (essential and natural boundary conditions) container.
Definition: ConstrContainer.h:61
int recvLPatternsTags(const int &, const int &, const CommParameters &)
Receives the active load patterns tags through the channel being passed as parameter.
Definition: ConstrContainer.cc:890
std::deque< int > getTagsMPsNode(int, int) const
Search on the container all the multi-freedom constraints with the node and degree of freedom being p...
Definition: ConstrContainer.cc:711
virtual bool addSFreedom_Constraint(SFreedom_Constraint *)
Appends a single freedom constraint.
Definition: ConstrContainer.cc:158
virtual int getNumMRMPs(void) const
Returns the number of multi-row multi-freedom constraints.
Definition: ConstrContainer.cc:650
Iterator over single freedom constraints.
Definition: SFreedom_ConstraintIter.h:75
virtual MFreedom_Constraint * getMFreedom_Constraint(int tag)
Returns a pointer to the multi-freedom constraint whose identifier is being passed as parameter...
Definition: ConstrContainer.cc:567
virtual SFreedom_Constraint * getSFreedom_Constraint(int tag)
Returns a pointer to the single freedom constraint whose identifier is being passed as parameter...
Definition: ConstrContainer.cc:557
std::deque< int > getTagsSPsNode(int, int) const
Search on the container all the single freedom constraints with the node and degree of freedom being ...
Definition: ConstrContainer.cc:697
virtual int getNumLoadPatterns(void) const
Returns the number of load patterns.
Definition: ConstrContainer.cc:654