xc
MRMFreedom_Constraint.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 
29 #ifndef MRMFreedom_Constraint_h
30 #define MRMFreedom_Constraint_h
31 
32 // File: ~/domain/constraints/MRMFreedom_Constraint.h
33 //
34 //
35 // Written: lcpt
36 // Created: 03/2015
37 //
38 // Purpose: This file contains the class definition for MRMFreedom_Constraint.
39 // MRMFreedom_Constraint is a class which stores the information for a multiple
40 // retained nodes constraint. A multifreedom constraint relates certain dofs at
41 // a constrained node to be related to certains dofs at multiple retained nodes:
42 
43 // The MRMFreedom_Constraint class assumes time invariant constraints, i.e. the
44 // constraint matrix does not change over time. All the methods are declared
45 // as pure virtual, which will allow subclasses for time varying constraints.
46 //
47 
48 #include "MFreedom_ConstraintBase.h"
49 #include <utility/matrix/Matrix.h>
50 
51 
52 namespace XC {
53 class Matrix;
54 class ID;
55 
57 //
60  {
61  protected:
63  std::vector<Vector> Ur0i;
64 
65  protected:
66  void initializeUr0i(void);
67  void initializeUr0i(const Domain *);
68  DbTagData &getDbTagData(void) const;
69  int sendData(Communicator &comm);
70  int recvData(const Communicator &comm);
71  public:
72  // constructors
73  MRMFreedom_Constraint(int tag , int classTag); // Arash
74  MRMFreedom_Constraint(int tag); // LCPT
75 
76  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, int classTag);
77 
78  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, const ID &constrainedDOF);
79  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, const ID &constrainedDOF,int classTag);
80 
81  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, const Matrix &, const ID &constrainedDOF);
82  MRMFreedom_Constraint(int tag,const Element &, const Node &, const ID &);
83 
84 
85  // method to get information about the constraint
87  virtual inline const ID &getRetainedNodeTags(void) const
88  { return retainedNodeTags; }
90  virtual inline ID &getRetainedNodeTags(void)
91  { return retainedNodeTags; }
93  inline virtual const ID &getRetainedDOFs(void) const
94  { return getConstrainedDOFs(); } //Same as constrained.
95  virtual size_t getNumRetainedNodes(void) const
96  { return retainedNodeTags.size(); }
97  std::vector<Node *> getPointersToRetainedNodes(void);
98  std::vector<const Node *> getPointersToRetainedNodes(void) const;
99  int getNumDofGroups(void) const;
100  int getNumDofs(void) const;
101  int getNumRetainedDofs(void) const;
102  int getNumConstrainedDofs(void) const;
103  int getNumLagrangeDofs(void) const;
104  bool affectsNode(int ) const;
105  bool affectsNodeAndDOF(int , int ) const;
106  virtual int applyConstraint(double pseudoTime);
107  const std::vector<Vector> &getRetainedDOFsInitialDisplacements(void) const;
108  virtual const Vector &getRetainedDOFsInitialDisplacement(const size_t &) const;
109 
110  void setDomain(Domain *);
111 
112  int addResistingForceToNodalReaction(bool inclInertia);
113 
114  // methods for output
115  virtual int sendSelf(Communicator &);
116  virtual int recvSelf(const Communicator &);
117  boost::python::dict getPyDict(void) const;
118  void setPyDict(const boost::python::dict &);
119 
120  int getVtkCellType(void) const;
121 
122  virtual void Print(std::ostream &s, int flag =0) const;
123 
124  };
125 } // end of XC namespace
126 
127 #endif
128 
virtual int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: MRMFreedom_Constraint.cc:414
Float vector abstraction.
Definition: Vector.h:94
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:58
int sendData(Communicator &comm)
Send data through the communicator argument.
Definition: MRMFreedom_Constraint.cc:370
int getNumDofGroups(void) const
Returns the number of DOF groups.
Definition: MRMFreedom_Constraint.cc:191
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: MRMFreedom_Constraint.cc:393
Communication parameters between processes.
Definition: Communicator.h:66
int getNumRetainedDofs(void) const
Number of retained DOFs.
Definition: MRMFreedom_Constraint.cc:205
MRMFreedom_Constraint(int tag, int classTag)
Constructor.
Definition: MRMFreedom_Constraint.cc:104
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: MRMFreedom_Constraint.cc:386
virtual ID & getRetainedNodeTags(void)
Returns the tags of the retained nodes.
Definition: MRMFreedom_Constraint.h:90
virtual int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: MRMFreedom_Constraint.cc:400
bool affectsNode(int) const
Returns true if the constraint affect the node identified by the tag being passed as parameter...
Definition: MRMFreedom_Constraint.cc:215
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Vector of integers.
Definition: ID.h:95
int addResistingForceToNodalReaction(bool inclInertia)
Add to nodes the actions due to this constraint.
Definition: MRMFreedom_Constraint.cc:321
virtual int applyConstraint(double pseudoTime)
Applies the constraint.
Definition: MRMFreedom_Constraint.cc:299
int recvData(const Communicator &comm)
Receive data through the communicator argument.
Definition: MRMFreedom_Constraint.cc:378
Base class for the finite elements.
Definition: Element.h:112
void setDomain(Domain *)
Sets the domain for the constraint.
Definition: MRMFreedom_Constraint.cc:236
int getNumLagrangeDofs(void) const
Number of affected DOFs for Lagrange handler numConstrainedDOFs+numRetainedDOFs+numLangrangeDOFs.
Definition: MRMFreedom_Constraint.cc:201
int getNumConstrainedDofs(void) const
Number of constrained DOFs.
Definition: MRMFreedom_Constraint.cc:209
const std::vector< Vector > & getRetainedDOFsInitialDisplacements(void) const
Return the initial displacements of the retained DOFs for all the retained nodes. ...
Definition: MRMFreedom_Constraint.cc:307
bool affectsNodeAndDOF(int, int) const
Returns true if the constraint affects the node and DOF arguments.
Definition: MRMFreedom_Constraint.cc:253
virtual const ID & getConstrainedDOFs(void) const
Returns the identifiers of the constrained degrees of fredom.
Definition: MFreedom_ConstraintBase.cc:170
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: MRMFreedom_Constraint.cc:363
int getVtkCellType(void) const
Interfaz con VTK.
Definition: MRMFreedom_Constraint.cc:439
std::vector< Node * > getPointersToRetainedNodes(void)
Returns a vector with the pointers to the retained nodes.
Definition: MRMFreedom_Constraint.cc:275
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:59
int getNumDofs(void) const
Number of the degrees of freedom affected by the constraint.
Definition: MRMFreedom_Constraint.cc:195
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
std::vector< Vector > Ur0i
initial displacements at retained nodes (same size as retainDOF)
Definition: MRMFreedom_Constraint.h:63
virtual const ID & getRetainedDOFs(void) const
Returns the indexes of the degrees of freedom.
Definition: MRMFreedom_Constraint.h:93
virtual const Vector & getRetainedDOFsInitialDisplacement(const size_t &) const
Return the initial displacements of the retained DOFs for the j-th node.
Definition: MRMFreedom_Constraint.cc:312
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
virtual void Print(std::ostream &s, int flag=0) const
Printing.
Definition: MRMFreedom_Constraint.cc:428
ID retainedNodeTags
Retained nodes tags.
Definition: MRMFreedom_Constraint.h:62
virtual const ID & getRetainedNodeTags(void) const
Returns the tags of the retained nodes.
Definition: MRMFreedom_Constraint.h:87