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