xc
MRMFreedom_Constraint.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 
28 #ifndef MRMFreedom_Constraint_h
29 #define MRMFreedom_Constraint_h
30 
31 // File: ~/domain/constraints/MRMFreedom_Constraint.h
32 //
33 // Written: fmk
34 // Created: 11/96
35 // Revision: A
36 //
37 // Purpose: This file contains the class definition for MRMFreedom_Constraint.
38 // MRMFreedom_Constraint is a class which stores the information for a multiple
39 // retained nodes constraint. A multifreedom constraint relates certain dofs at
40 // a constrained node to be related to certains dofs at multiple retained nodes:
41 
42 // The MRMFreedom_Constraint class assumes time invariant constraints, i.e. the
43 // constraint matrix does not change over time. All the methods are declared
44 // as pure virtual, which will allow subclasses for time varying constraints.
45 //
46 
47 #include "MFreedom_ConstraintBase.h"
48 #include <utility/matrix/Matrix.h>
49 
50 
51 namespace XC {
52 class Matrix;
53 class ID;
54 
56 //
59  {
60  protected:
62 
63  protected:
64  int sendData(CommParameters &cp);
65  int recvData(const CommParameters &cp);
66  public:
67  // constructors
68  MRMFreedom_Constraint(int tag , int classTag ); // Arash
69  MRMFreedom_Constraint(int tag); // LCPT
70 
71  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, int classTag);
72 
73  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, const ID &constrainedDOF);
74  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, const ID &constrainedDOF,int classTag);
75 
76  MRMFreedom_Constraint(int tag,const ID &, int nodeConstr, const Matrix &, const ID &constrainedDOF);
77  MRMFreedom_Constraint(int tag,const Element &, const Node &, const ID &);
78 
79 
80  // method to get information about the constraint
82  virtual inline const ID &getRetainedNodeTags(void) const
83  { return retainedNodeTags; }
85  virtual inline ID &getRetainedNodeTags(void)
86  { return retainedNodeTags; }
88  inline virtual const ID &getRetainedDOFs(void) const
89  { return getConstrainedDOFs(); } //Same as constrained.
90  virtual size_t getNumRetainedNodes(void) const
91  { return retainedNodeTags.size(); }
92  std::vector<XC::Node *> getPointersToRetainedNodes(void) const;
93  int getNumDofGroups(void) const;
94  int getNumDofs(void) const;
95  int getNumRetainedDofs(void) const;
96  int getNumConstrainedDofs(void) const;
97  int getNumLagrangeDofs(void) const;
98  bool affectsNode(int ) const;
99  bool affectsNodeAndDOF(int , int ) const;
100  virtual int applyConstraint(double pseudoTime);
101 
102  int addResistingForceToNodalReaction(bool inclInertia);
103 
104  // methods for output
105  virtual int sendSelf(CommParameters &);
106  virtual int recvSelf(const CommParameters &);
107 
108  int getVtkCellType(void) const;
109 
110  virtual void Print(std::ostream &s, int flag =0);
111 
112  };
113 } // end of XC namespace
114 
115 #endif
116 
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:57
int getNumDofGroups(void) const
Returns the number of DOF groups.
Definition: MRMFreedom_Constraint.cc:111
int getNumRetainedDofs(void) const
Number of retained DOFs.
Definition: MRMFreedom_Constraint.cc:125
int sendData(CommParameters &cp)
Send data through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:240
MRMFreedom_Constraint(int tag, int classTag)
Constructor.
Definition: MRMFreedom_Constraint.cc:56
virtual ID & getRetainedNodeTags(void)
Returns the tags of the retained nodes.
Definition: MRMFreedom_Constraint.h:85
bool affectsNode(int) const
Returns true if the constraint affect the node identified by the tag being passed as parameter...
Definition: MRMFreedom_Constraint.cc:135
Vector of integers.
Definition: ID.h:93
std::vector< XC::Node * > getPointersToRetainedNodes(void) const
Returns a vector with the pointers to the retained nodes.
Definition: MRMFreedom_Constraint.cc:177
int addResistingForceToNodalReaction(bool inclInertia)
Add to nodes the actions due to this constraint.
Definition: MRMFreedom_Constraint.cc:199
int recvData(const CommParameters &cp)
Receive data through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:248
virtual int applyConstraint(double pseudoTime)
Applies the constraint.
Definition: MRMFreedom_Constraint.cc:189
Base class for the finite elements.
Definition: Element.h:109
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:270
int getNumLagrangeDofs(void) const
Number of affected DOFs for Lagrange handler numConstrainedDOFs+numRetainedDOFs+numLangrangeDOFs.
Definition: MRMFreedom_Constraint.cc:121
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:256
int getNumConstrainedDofs(void) const
Number of constrained DOFs.
Definition: MRMFreedom_Constraint.cc:129
bool affectsNodeAndDOF(int, int) const
Returns true if the constraint affects the node and DOF arguments.
Definition: MRMFreedom_Constraint.cc:155
virtual const ID & getConstrainedDOFs(void) const
Returns the identifiers of the constrained degrees of fredom.
Definition: MFreedom_ConstraintBase.cc:118
int getVtkCellType(void) const
Interfaz con VTK.
Definition: MRMFreedom_Constraint.cc:295
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:58
virtual void Print(std::ostream &s, int flag=0)
Printing.
Definition: MRMFreedom_Constraint.cc:284
int getNumDofs(void) const
Number of the degrees of freedom affected by the constraint.
Definition: MRMFreedom_Constraint.cc:115
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
virtual const ID & getRetainedDOFs(void) const
Returns the indexes of the degrees of freedom.
Definition: MRMFreedom_Constraint.h:88
Mesh node.
Definition: Node.h:110
ID retainedNodeTags
Retained nodes tags.
Definition: MRMFreedom_Constraint.h:61
virtual const ID & getRetainedNodeTags(void) const
Returns the tags of the retained nodes.
Definition: MRMFreedom_Constraint.h:82