xc
SFreedom_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 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.3 $
48 // $Date: 2005/11/22 19:41:17 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/domain/constraints/SFreedom_Constraint.h,v $
50 
51 
52 #ifndef SFreedom_Constraint_h
53 #define SFreedom_Constraint_h
54 
55 // Written: fmk
56 // Created: 11/96
57 // Revision: A
58 //
59 // Purpose: This file contains the class definition for SFreedom_Constraint.
60 // SFreedom_Constraint is a class which stores the information for a single
61 // DOF constraint. Each single point constraint specifies a particular
62 // degree-of-freedom response (displacement, rotation) at a node.
63 // The constraint may be time-varying .. time varying constarints however
64 // must be implemented using subclasses.
65 //
66 // What: "@(#) SFreedom_Constraint, revA"
67 
68 #include "Constraint.h"
69 
70 namespace XC {
71  class ID;
72 
75 //
77 //
85  {
86  protected:
87  int dofNumber;
88  double valueR;
89  double valueC;
90  bool isConstant;
91  int loadPatternTag;
92 
93  DbTagData &getDbTagData(void) const;
94  int sendData(CommParameters &cp);
95  int recvData(const CommParameters &cp);
96 
97  public:
98  // constructors
99  SFreedom_Constraint(int classTag);
100  SFreedom_Constraint(int spTag, int nodeTag);
101  SFreedom_Constraint(int spTag, int nodeTag, int ndof, int classTag);
102  SFreedom_Constraint(int spTag, int nodeTag, int ndof, double value, bool isConstant= true);
103  virtual SFreedom_Constraint *getCopy(void) const;
104  SFreedom_Constraint *getCopy(const int &) const;
105 
106  virtual int getDOF_Number(void) const;
107  virtual bool affectsNodeAndDOF(int , int ) const;
108  virtual int applyConstraint(double loadFactor);
109  virtual double getValue(void) const;
110  virtual bool isHomogeneous(void) const;
111  virtual void setLoadPatternTag(int loadPaternTag);
112  virtual int getLoadPatternTag(void) const;
113 
114  inline void setIsConstant(const bool &b)
115  { isConstant= b; }
116  inline bool getIsConstant(void) const
117  { return isConstant; }
118 
119  int getVtkCellType(void) const;
120 
121  int sendSelf(CommParameters &);
122  int recvSelf(const CommParameters &);
123 
124  virtual void Print(std::ostream &s, int flag =0);
125  };
126 } // end of XC namespace
127 
128 #endif
129 
130 
virtual void setLoadPatternTag(int loadPaternTag)
Sets the load pattern tag for the constraint.
Definition: SFreedom_Constraint.cpp:195
int dofNumber
identifies which of the nodes dof is constrained
Definition: SFreedom_Constraint.h:87
virtual SFreedom_Constraint * getCopy(void) const
Virtual constructor.
Definition: SFreedom_Constraint.cpp:128
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
virtual bool affectsNodeAndDOF(int, int) const
Returns true if the constraint affects the node and DOF arguments.
Definition: SFreedom_Constraint.cpp:145
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the object members.
Definition: SFreedom_Constraint.cpp:203
virtual int applyConstraint(double loadFactor)
Applies the constraint with the load factor being passed as parameter.
Definition: SFreedom_Constraint.cpp:168
SFreedom_Constraint(int classTag)
Default constructor.
Definition: SFreedom_Constraint.cpp:78
virtual void Print(std::ostream &s, int flag=0)
Prints constraint information.
Definition: SFreedom_Constraint.cpp:263
Single freedom constraint.
Definition: SFreedom_Constraint.h:84
virtual double getValue(void) const
Returns the value of the prescribed displacement.
Definition: SFreedom_Constraint.cpp:158
int sendData(CommParameters &cp)
Sends data through the channel being passed as parameter.
Definition: SFreedom_Constraint.cpp:210
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: SFreedom_Constraint.cpp:230
virtual bool isHomogeneous(void) const
Returns true if it&#39;s an homogeneous constraint (prescribed value for the DOF is zero).
Definition: SFreedom_Constraint.cpp:184
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: SFreedom_Constraint.cpp:243
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
int recvData(const CommParameters &cp)
Receives data through the channel being passed as parameter.
Definition: SFreedom_Constraint.cpp:220
int getVtkCellType(void) const
Returns the cell type to be used to represent the object in VTK graphics.
Definition: SFreedom_Constraint.cpp:258
Base class for model constraints.
Definition: Constraint.h:49
virtual int getLoadPatternTag(void) const
Return the load pattern tag of the constraint.
Definition: SFreedom_Constraint.cpp:199
virtual int getDOF_Number(void) const
Returns the constrained DOF number.
Definition: SFreedom_Constraint.cpp:141
double valueR
the reference value
Definition: SFreedom_Constraint.h:88
bool isConstant
flag indicating if constant
Definition: SFreedom_Constraint.h:90
double valueC
if constant = the reference value, if not constant = the reference value * load factor ...
Definition: SFreedom_Constraint.h:89