XC Open source finite element analysis program
KRSeccion.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 //KRSeccion.h
28 
29 #ifndef KRSECCION_H
30 #define KRSECCION_H
31 
32 #include "utility/matrix/Vector.h"
33 #include "utility/matrix/Matrix.h"
34 
35 namespace XC {
36 
38 //
40 class KRSeccion: public EntCmd
41  {
42  friend class DqFibras;
43  double rData[4];
44  Vector *R;
45  double kData[16];
46  Matrix *K;
47 
48  static double value,vas1,vas2,vas1as2;//Para guardar resultados parciales.
49  protected:
50  void libera(void);
51  void alloc(const size_t &dim);
52  void copia(const KRSeccion &otra);
53  inline void updateNMz(const double &f,const double &y)
54  {
55  rData[0]+= f; //N.
56  rData[1]+= f*y; //Mz.
57  }
58  inline void updateNMzMy(const double &f,const double &y,const double &z)
59  {
60  updateNMz(f,y);
61  rData[2]+= f*z; //My.
62  }
63  static inline void updateK2d(double k[],const double &areaFibra,const double &y,const double &tangent)
64  {
65  value= tangent * areaFibra;
66  vas1= y*value;
67 
68  k[0]+= value; //Axial stiffness
69  k[1]+= vas1;
70  k[2]+= vas1 * y;
71  }
72  inline void updateK2d(const double &areaFibra,const double &y,const double &tangent)
73  { updateK2d(kData,areaFibra,y,tangent); }
74  static inline void updateK3d(double k[],const double &areaFibra,const double &y,const double &z,const double &tangent)
75  {
76  value= tangent * areaFibra;
77  vas1= y*value;
78  vas2= z*value;
79  vas1as2= vas1*z;
80 
81  k[0]+= value; //Axial stiffness
82  k[1]+= vas1;
83  k[2]+= vas2;
84 
85  k[4]+= vas1 * y;
86  k[5]+= vas1as2;
87 
88  k[8]+= vas2 * z;
89  }
90  inline void updateK3d(const double &areaFibra,const double &y,const double &z,const double &tangent)
91  { updateK3d(kData,areaFibra,y,z,tangent); }
92  static inline void updateKGJ(double k[],const double &areaFibra,const double &y,const double &z,const double &tangent)
93  {
94  value= tangent * areaFibra;
95  vas1= y*value;
96  vas2= z*value;
97  vas1as2= vas1*z;
98 
99  k[0]+= value; //(0,0)->0
100  k[1]+= vas1; //(0,1)->4 y (1,0)->1
101  k[2]+= vas2; //(0,2)->8 y (2,0)->2
102 
103  k[5]+= vas1 * y; //(1,1)->5
104  k[6]+= vas1as2; //(1,2)->9 y (2,1)->6
105 
106  k[10]+= vas2 * z; //(2,2)->10
107  }
108  inline void updateKGJ(const double &areaFibra,const double &y,const double &z,const double &tangent)
109  { updateKGJ(kData,areaFibra,y,z,tangent); }
110 
111  public:
112  KRSeccion(const size_t &dim);
113  KRSeccion(const KRSeccion &otra);
114  KRSeccion &operator=(const KRSeccion &otro);
115  virtual ~KRSeccion(void);
116 
117  void zero(void);
118  inline size_t dim(void) const
119  { return ((R) ? R->Size():0); }
120 
121  inline const Vector &Resultante(void) const
122  { return *R; }
123  inline Vector &Resultante(void)
124  { return *R; }
125  inline const Matrix &Stiffness(void) const
126  { return *K; }
127  inline Matrix &Stiffness(void)
128  { return *K; }
129  };
130 
131 } // end of XC namespace
132 
133 #endif
Definition: Vector.h:82
KRSeccion(const size_t &dim)
Constructor.
Definition: KRSeccion.cc:83
KRSeccion & operator=(const KRSeccion &otro)
Assignment operator.
Definition: KRSeccion.cc:98
Contenedor de fibras.
Definition: DqFibras.h:66
Definition: Matrix.h:82
================================================================================
Definition: ContinuaReprComponent.h:34
virtual ~KRSeccion(void)
Destructor.
Definition: KRSeccion.cc:105
Stiffness matrix and resultant vector for a section.
Definition: KRSeccion.h:40