XC Open source finite element analysis program
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 multipoint 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  virtual int applyConstraint(double pseudoTime);
100 
101  int addResistingForceToNodalReaction(bool inclInertia);
102 
103  // methods for output
104  virtual int sendSelf(CommParameters &);
105  virtual int recvSelf(const CommParameters &);
106 
107  int getVtkCellType(void) const;
108  int getMEDCellType(void) const;
109 
110  virtual void Print(std::ostream &s, int flag =0);
111 
112  };
113 } // end of XC namespace
114 
115 #endif
116 
int sendData(CommParameters &cp)
Send data through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:219
virtual const ID & getConstrainedDOFs(void) const
Returns the identifiers of the constrained degrees of fredom.
Definition: MFreedom_ConstraintBase.cc:106
int getMEDCellType(void) const
Interfce with Salome MED format.
Definition: MRMFreedom_Constraint.cc:282
bool affectsNode(int) const
Returns true if the constraint affect the node identified by the tag being passed as parameter...
Definition: MRMFreedom_Constraint.cc:136
Mesh node.
Definition: Node.h:99
virtual int applyConstraint(double pseudoTime)
Applies the constraint.
Definition: MRMFreedom_Constraint.cc:168
Base calass for the finite elements.
Definition: Element.h:104
int getNumDofs(void) const
Number of the degrees of freedom affected by the constraint.
Definition: MRMFreedom_Constraint.cc:116
std::vector< XC::Node * > getPointersToRetainedNodes(void) const
Returns a vector with the pointers to the retained nodes.
Definition: MRMFreedom_Constraint.cc:156
int getNumDofGroups(void) const
Returns the number of DOF groups.
Definition: MRMFreedom_Constraint.cc:112
virtual const ID & getRetainedNodeTags(void) const
Returns the tags of the retained nodes.
Definition: MRMFreedom_Constraint.h:82
Definition: ID.h:77
virtual ID & getRetainedNodeTags(void)
Returns the tags of the retained nodes.
Definition: MRMFreedom_Constraint.h:85
virtual void Print(std::ostream &s, int flag=0)
Printing.
Definition: MRMFreedom_Constraint.cc:263
virtual int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:235
Multiple retained nodes constraint.
Definition: MRMFreedom_Constraint.h:58
int getNumConstrainedDofs(void) const
Number of constrained DOFs.
Definition: MRMFreedom_Constraint.cc:130
int addResistingForceToNodalReaction(bool inclInertia)
Add reactions to nodes. See "Calculation within MSC/Nastran of the forces transmitted by multipoint c...
Definition: MRMFreedom_Constraint.cc:178
Definition: Matrix.h:82
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:57
virtual int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:249
int getNumRetainedDofs(void) const
Number of retained DOFs.
Definition: MRMFreedom_Constraint.cc:126
ID retainedNodeTags
Retained nodes tags.
Definition: MRMFreedom_Constraint.h:61
int getVtkCellType(void) const
Interfaz con VTK.
Definition: MRMFreedom_Constraint.cc:274
MRMFreedom_Constraint(int tag, int classTag)
Constructor. // Arash.
Definition: MRMFreedom_Constraint.cc:57
int getNumLagrangeDofs(void) const
Number of affected DOFs for Lagrange handler numConstrainedDOFs+numRetainedDOFs+numLangrangeDOFs. numLagrangeDOFs= numConstrainedDOFs.
Definition: MRMFreedom_Constraint.cc:122
virtual const ID & getRetainedDOFs(void) const
Returns the indexes of the degrees of freedom.
Definition: MRMFreedom_Constraint.h:88
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
int recvData(const CommParameters &cp)
Receive data through the channel being passed as parameter.
Definition: MRMFreedom_Constraint.cc:227