xc
NodeLocker.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 //NodeLocker.h
28 
29 #ifndef NodeLocker_h
30 #define NodeLocker_h
31 
32 #include "domain/component/ForceReprComponent.h"
33 
34 namespace XC {
35 class SFreedom_Constraint;
36 class SingleDomSFreedom_Iter;
37 class SFreedom_ConstraintIter;
38 class TaggedObjectStorage;
39 
41 //
45  {
46  void alloc_containers(void);
47  void alloc_iterators(void);
48  NodeLocker(const NodeLocker &);
49  NodeLocker &operator=(const NodeLocker &);
50  protected:
51  int nextTag;
52  int currentGeoTag;
53  int lastGeoSendTag;
54 
55  // storage objects for the constraints
56  TaggedObjectStorage *theSPs;
57  // iterator objects for the objects added to the storage objects
59 
60  DbTagData &getDbTagData(void) const;
61  int sendData(CommParameters &cp);
62  int recvData(const CommParameters &cp);
63 
64 
65  friend class NodeLockers;
66  friend class FEM_ObjectBroker;
67  NodeLocker(void);
68  NodeLocker(int tag);
69  NodeLocker(int tag, int classTag);
70  virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp);
71  public:
72  virtual ~NodeLocker(void);
73 
74  // method to set the associated Domain
75  virtual void setDomain(Domain *theDomain);
76 
77  // methods to add loads
78  virtual SFreedom_Constraint *addSFreedom_Constraint(const int &nodeTag,const int &dofId,const double &);
79 
80  virtual SFreedom_ConstraintIter &getSPs(void);
81  int getNumSPs(void) const;
82 
83  // methods to remove loads
84  virtual void clearAll(void);
85  SFreedom_Constraint *newSPConstraint(const int &,const int &,const double &);
86  virtual bool removeSFreedom_Constraint(int tag);
87 
88  // methods to apply loads
89  virtual void applyLoad(const double &pseudoTime= 0.0,const double &factor= 1.0);
90 
91  // methods for o/p
92  virtual int sendSelf(CommParameters &);
93  virtual int recvSelf(const CommParameters &);
94 
95  virtual void Print(std::ostream &s, int flag =0);
96 
97  std::deque<int> getTagsSPsNode(int theNode, int theDOF) const;
98  std::deque<int> getTagsSPsNode(int theNode) const;
99  bool nodeAffectedBySPs(int nodeTag) const;
100  };
101 
102 
103 } // end of XC namespace
104 
105 #endif
106 
107 
108 
109 
110 
111 
112 
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags de los miembros of the clase.
Definition: NodeLocker.cc:234
TaggedObjectStorage * theSPs
Constraint container.
Definition: NodeLocker.h:56
NodeLocker container.
Definition: NodeLockers.h:41
Base class for components that represent forces.
Definition: ForceReprComponent.h:37
virtual bool removeSFreedom_Constraint(int tag)
Erases the single freedom constraint identified by the argument.
Definition: NodeLocker.cc:210
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
FEM_ObjectBroker is is an object broker class for the finite element method.
Definition: FEM_ObjectBroker.h:145
NodeLocker(void)
Default constructor.
Definition: NodeLocker.cc:108
int getNumSPs(void) const
Returns the number of single freedom constraints.
Definition: NodeLocker.cc:184
Definition: SingleDomSFreedom_Iter.h:72
virtual ~NodeLocker(void)
Destructor.
Definition: NodeLocker.cc:126
int nextTag
Default tag for next node locker.
Definition: NodeLocker.h:51
virtual void clearAll(void)
Deletes all constraints.
Definition: NodeLocker.cc:193
virtual void Print(std::ostream &s, int flag=0)
Imprime el load pattern.
Definition: NodeLocker.cc:286
Single freedom constraint.
Definition: SFreedom_Constraint.h:84
bool nodeAffectedBySPs(int nodeTag) const
Returns true if the single freedom constraints affect the node which identifier is being passed as pa...
Definition: NodeLocker.cc:338
virtual void setDomain(Domain *theDomain)
Set the domain for the constraints.
Definition: NodeLocker.cc:134
virtual SFreedom_ConstraintIter & getSPs(void)
Returns an iterator to the single freedom constraints.
Definition: NodeLocker.cc:177
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: NodeLocker.cc:273
Single freedom constraints that make part of a load pattern.
Definition: NodeLocker.h:44
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: NodeLocker.cc:260
Iterator over single freedom constraints.
Definition: SFreedom_ConstraintIter.h:75
int sendData(CommParameters &cp)
Send members through the channel being passed as parameter.
Definition: NodeLocker.cc:241
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
int recvData(const CommParameters &cp)
Receives members through the channel being passed as parameter.
Definition: NodeLocker.cc:250
Communication parameters between processes.
Definition: CommParameters.h:65
virtual bool addSFreedom_Constraint(SFreedom_Constraint *theSp)
Adds the single freedom constraint being passed as parameter.
Definition: NodeLocker.cc:158
std::deque< int > getTagsSPsNode(int theNode, int theDOF) const
Returns the constraint that affect the node and DOF being passed as parameter.
Definition: NodeLocker.cc:297
SingleDomSFreedom_Iter * theSpIter
Constraint iterator.
Definition: NodeLocker.h:58
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
SFreedom_Constraint * newSPConstraint(const int &, const int &, const double &)
Creates a single freedom constraint.
Definition: NodeLocker.cc:204
virtual void applyLoad(const double &pseudoTime=0.0, const double &factor=1.0)
Applies the single freedom constraints.
Definition: NodeLocker.cc:224