XC Open source finite element analysis program
MFreedom_ConstraintBase.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 MFreedom_ConstraintBase_h
29 #define MFreedom_ConstraintBase_h
30 
31 // File: ~/domain/constraints/MFreedom_ConstraintBase.h
32 //
33 // Written: lcpt
34 // Created: 03/2015
35 // Revision: A
36 //
37 // Purpose: This file contains the class definition for MFreedom_ConstraintBase.
38 // MFreedom_ConstraintBase is a base clas for multi node constraints.
39 // A multipoint constraint relates certain dofs at
40 // a constrained node to be related to certain dosf at one or more
41 // retained nodes
42 
43 #include "Constraint.h"
44 #include <utility/matrix/Matrix.h>
45 
46 
47 namespace XC {
48 class Matrix;
49 class ID;
50 
53 //
55 //
58  {
59  protected:
62 
63  void set_constraint(const Matrix &c);
64  void set_constrained_dofs(const ID &);
65  protected:
66  int sendData(CommParameters &cp);
67  int recvData(const CommParameters &cp);
68  public:
69  // constructors
70  MFreedom_ConstraintBase(int tag , int classTag ); // Arash
71 
72  MFreedom_ConstraintBase(int tag, int nodeConstr, int classTag);
73 
74  MFreedom_ConstraintBase(int tag, int nodeConstr, const ID &,int classTag);
75 
76  MFreedom_ConstraintBase(int tag, int nodeConstr, const Matrix &, const ID &, int classTag);
77 
78  // method to get information about the constraint
79  virtual inline const int &getNodeConstrained(void) const
80  { return constrNodeTag; }
81  virtual inline int &getNodeConstrained(void)
82  { return constrNodeTag; }
83  bool affectsNode(int ) const;
84  virtual const ID &getRetainedDOFs(void) const= 0;
85  virtual const ID &getConstrainedDOFs(void) const;
86  virtual const Matrix &getConstraint(void) const;
87  virtual size_t getNumRetainedNodes(void) const= 0;
88  virtual std::vector<XC::Node *> getPointersToRetainedNodes(void) const= 0;
89 
90  bool isTimeVarying(void) const;
91 
92  int addResistingForceToNodalReaction(bool inclInertia);
93 
94  virtual void Print(std::ostream &s, int flag =0);
95 
96  };
97 } // end of XC namespace
98 
99 #endif
100 
Matrix constraintMatrix
Constraint matrix.
Definition: MFreedom_ConstraintBase.h:60
void set_constraint(const Matrix &c)
Set the constraint matrix.
Definition: MFreedom_ConstraintBase.cc:52
virtual const ID & getConstrainedDOFs(void) const
Returns the identifiers of the constrained degrees of fredom.
Definition: MFreedom_ConstraintBase.cc:106
int constrNodeTag
constrained node tag
Definition: Constraint.h:52
virtual void Print(std::ostream &s, int flag=0)
Printing.
Definition: MFreedom_ConstraintBase.cc:149
ID constrDOF
ID of constrained DOF at constrained node.
Definition: MFreedom_ConstraintBase.h:61
Base class for model constraints.
Definition: Constraint.h:49
bool isTimeVarying(void) const
Returns true if the constraint varies with time.
Definition: MFreedom_ConstraintBase.cc:114
int recvData(const CommParameters &cp)
Receive data through the channel being passed as parameter.
Definition: MFreedom_ConstraintBase.cc:140
Definition: ID.h:77
MFreedom_ConstraintBase(int tag, int classTag)
Constructor.
Definition: MFreedom_ConstraintBase.cc:63
Definition: Matrix.h:82
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:57
int sendData(CommParameters &cp)
Send data through the channel being passed as parameter.
Definition: MFreedom_ConstraintBase.cc:131
int addResistingForceToNodalReaction(bool inclInertia)
Add reactions to nodes.
Definition: MFreedom_ConstraintBase.cc:119
bool affectsNode(int) const
Returns true if the constraints affects the node identified by the tag being passed as parameter...
Definition: MFreedom_ConstraintBase.cc:100
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
void set_constrained_dofs(const ID &)
Set the constrained degrees of freedom.
Definition: MFreedom_ConstraintBase.cc:57
virtual const Matrix & getConstraint(void) const
Returns the constraint matrix.
Definition: MFreedom_ConstraintBase.cc:127