xc
RayleighDampingFactors.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 //RayleighDampingFactors.h
29 
30 #ifndef RayleighDampingFactors_h
31 #define RayleighDampingFactors_h
32 
33 #include "utility/kernel/CommandEntity.h"
34 #include "utility/actor/actor/MovableObject.h"
35 
36 class Pos3dArray3d;
37 
38 namespace XC {
39 
40 class Vector;
41 class Information;
42 
44 //
60  {
61  double alphaM;
62  double betaK;
63  double betaK0;
64  double betaKc;
65  protected:
66  int sendData(Communicator &);
67  int recvData(const Communicator &);
68 
69  public:
71  RayleighDampingFactors(const double &alphaM,const double &betaK,const double &betaK0,const double &betaKc);
72  explicit RayleighDampingFactors(const Vector &);
73 
76  inline const double &getAlphaM(void) const
77  { return alphaM; }
80  inline void setAlphaM(const double &d)
81  { alphaM= d; }
84  inline const double &getBetaK(void) const
85  { return betaK; }
88  inline void setBetaK(const double &d)
89  { betaK= d; }
92  inline const double &getBetaK0(void) const
93  { return betaK0; }
96  inline void setBetaK0(const double &d)
97  { betaK0= d; }
100  inline const double &getBetaKc(void) const
101  { return betaKc; }
104  inline void setBetaKc(const double &d)
105  { betaKc= d; }
107  inline bool nullValues(void) const
108  { return (alphaM == 0.0 && nullKValues()); }
110  inline bool nullKValues(void) const
111  { return (betaK == 0.0 && betaK0 == 0.0 && betaKc == 0.0); }
112  int updateParameter(int parameterID, Information &info);
113 
114  double getCurrentDampingRatio(const double &) const;
115  double getInitialDampingRatio(const double &) const;
116  double getCommitedDampingRatio(const double &) const;
117 
118  int sendSelf(Communicator &);
119  int recvSelf(const Communicator &);
120  boost::python::dict getPyDict(void) const;
121  void setPyDict(const boost::python::dict &);
122 
123  void Print(std::ostream &s, int flag= 0) const;
124 
125  };
126 
127 std::ostream &operator<<(std::ostream &,const RayleighDampingFactors &);
128 
129 } // end of XC namespace
130 
131 #endif
132 
double getCommitedDampingRatio(const double &) const
Return the commited damping value for the natural frequency argument (alphaM/(2*w)+betaK*w/2.
Definition: RayleighDampingFactors.cc:84
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: RayleighDampingFactors.cc:88
Float vector abstraction.
Definition: Vector.h:94
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: RayleighDampingFactors.cc:123
void Print(std::ostream &s, int flag=0) const
Print Rayleigh factors values.
Definition: RayleighDampingFactors.cc:52
RayleighDampingFactors(void)
Constructor.
Definition: RayleighDampingFactors.cc:35
Information about an element.
Definition: Information.h:81
void setAlphaM(const double &d)
set the damping factor applied to elements or nodes mass matrix
Definition: RayleighDampingFactors.h:80
Communication parameters between processes.
Definition: Communicator.h:66
Object that can move between processes.
Definition: MovableObject.h:100
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: RayleighDampingFactors.cc:102
const double & getBetaKc(void) const
return the damping factor applied to elements committed stiffness matrix
Definition: RayleighDampingFactors.h:100
void setBetaKc(const double &d)
set the damping factor applied to elements committed stiffness matrix
Definition: RayleighDampingFactors.h:104
void setBetaK(const double &d)
set the damping factor applied to elements current stiffness matrix
Definition: RayleighDampingFactors.h:88
bool nullKValues(void) const
Returns true if all Rayleigh stiffness factors are zero.
Definition: RayleighDampingFactors.h:110
const double & getAlphaM(void) const
return the damping factor applied to elements or nodes mass matrix
Definition: RayleighDampingFactors.h:76
const double & getBetaK0(void) const
return the damping factor applied to elements initial stiffness matrix
Definition: RayleighDampingFactors.h:92
int recvData(const Communicator &)
Receives object members through the communicator argument.
Definition: RayleighDampingFactors.cc:95
Objet that can execute python scripts.
Definition: CommandEntity.h:40
double getInitialDampingRatio(const double &) const
Return the initial damping value for the natural frequency argument (alphaM/(2*w)+betaK*w/2.
Definition: RayleighDampingFactors.cc:80
double getCurrentDampingRatio(const double &) const
Return the current damping value for the natural frequency argument (alphaM/(2*w)+betaK*w/2.
Definition: RayleighDampingFactors.cc:76
Rayleigh damping factors.
Definition: RayleighDampingFactors.h:59
Position array in a three-dimensional space.
Definition: Pos3dArray3d.h:37
const double & getBetaK(void) const
return the damping factor applied to elements current stiffness matrix
Definition: RayleighDampingFactors.h:84
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
bool nullValues(void) const
Returns true if all Rayleigh factors are zero.
Definition: RayleighDampingFactors.h:107
int updateParameter(int parameterID, Information &info)
Update the value of a parameter.
Definition: RayleighDampingFactors.cc:60
void setBetaK0(const double &d)
set the damping factor applied to elements initial stiffness matrix
Definition: RayleighDampingFactors.h:96
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: RayleighDampingFactors.cc:138
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: RayleighDampingFactors.cc:113