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