XC Open source finite element analysis program
ElasticPlateProto.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 //ElasticPlateProto.h
28 
29 #ifndef ElasticPlateProto_h
30 #define ElasticPlateProto_h
31 
32 
33 #include "ElasticPlateBase.h"
34 #include <utility/matrix/Vector.h>
35 #include <utility/matrix/Matrix.h>
36 #include "utility/actor/actor/MovableVector.h"
37 
38 
39 namespace XC {
41 //
43 template <int SZ>
45  {
46  protected:
47  Vector trialStrain;
48  Vector initialStrain;
49  static Vector stress;
50  static Matrix tangent;
51 
52  int sendData(CommParameters &);
53  int recvData(const CommParameters &);
54  public :
55  ElasticPlateProto(int tag,int classTag);
56  ElasticPlateProto(int classTag);
57  ElasticPlateProto(int tag,int classTag, double E, double nu, double h);
58 
59  //send back order of strain in vector form
60  int getOrder(void) const;
61 
62  //get the strain and integrate plasticity equations
63  int setInitialSectionDeformation(const Vector &strain);
64  int setTrialSectionDeformation(const Vector &strain_from_element);
65  //send back the strain
66  void zeroInitialSectionDeformation(void)
67  { initialStrain.Zero(); }
68  inline const Vector &getInitialSectionDeformation(void) const
69  { return initialStrain; }
70  const Vector& getSectionDeformation(void) const;
71 
72  int revertToStart(void);
73  };
74 
75 //static vector and matrices
76 template <int SZ>
78 template <int SZ>
80 
81 
82 template <int SZ>
84  : ElasticPlateBase(tag, classTag), trialStrain(SZ), initialStrain(SZ) {}
85 
86 //null constructor
87 template <int SZ>
88 XC::ElasticPlateProto<SZ>::ElasticPlateProto(int classTag)
89  : ElasticPlateBase( 0, classTag), trialStrain(SZ), initialStrain(SZ) {}
90 
91 //full constructor
92 template <int SZ>
93 XC::ElasticPlateProto<SZ>::ElasticPlateProto(int tag, int classTag,
94  double young,
95  double poisson,
96  double thickness)
97  : ElasticPlateBase(tag,classTag,young,poisson,thickness), trialStrain(SZ), initialStrain(SZ) {}
98 
99 template <int SZ>
101  { return SZ; }
102 
103 //get the strain
104 template <int SZ>
106  {
107  initialStrain= strain;
108  return 0;
109  }
110 
111 //get the strain
112 template <int SZ>
114  {
115  trialStrain= strain;
116  return 0;
117  }
118 
119 //send back the strain
120 template <int SZ>
122  {
123  static Vector retval;
124  retval= trialStrain-initialStrain;
125  return retval;
126  }
127 
128 //@ brief revert to start
129 template <int SZ>
131  {
132  trialStrain.Zero();
133  initialStrain.Zero();
135  }
136 
138 template <int SZ>
140  {
141  int res= ElasticPlateBase::sendData(cp);
142  res+= cp.sendVector(trialStrain,getDbTagData(),CommMetaData(6));
143  res+= cp.sendVector(initialStrain,getDbTagData(),CommMetaData(7));
144  return res;
145  }
146 
148 template <int SZ>
150  {
151  int res= ElasticPlateBase::recvData(cp);
152  res+= cp.receiveVector(trialStrain,getDbTagData(),CommMetaData(6));
153  res+= cp.receiveVector(initialStrain,getDbTagData(),CommMetaData(7));
154  return res;
155  }
156 
157 } // end of XC namespace
158 
159 #endif
double nu
poisson ratio
Definition: ElasticPlateBase.h:45
int receiveVector(Vector &v, const int &) const
Recibe el vector.
Definition: CommParameters.cc:407
virtual DbTagData & getDbTagData(void) const
Returns a vector to store class dbTags.
Definition: DistributedBase.cc:39
int sendVector(const Vector &, const int &)
Sends vector.
Definition: CommParameters.cc:400
int sendData(CommParameters &cp)
Send data through the channel being passed as parameter.
Definition: ElasticPlateBase.cc:66
int revertToStart(void)
revert to start
Definition: ElasticPlateBase.cc:62
ElasticPlateBase(int tag, int classTag)
Constructor.
Definition: ElasticPlateBase.cc:38
Definition: Vector.h:82
int recvData(const CommParameters &cp)
Receive data through the channel being passed as parameter.
Definition: ElasticPlateBase.cc:74
int recvData(const CommParameters &)
Receive data through the channel being passed as parameter.
Definition: ElasticPlateProto.h:149
int revertToStart(void)
revert to start
Definition: ElasticPlateProto.h:130
double h
plate thickness
Definition: PlateBase.h:49
Definition: Matrix.h:82
int sendData(CommParameters &)
Send data through the channel being passed as parameter.
Definition: ElasticPlateProto.h:139
Communication parameters between processes.
Definition: CommParameters.h:65
Base class for elastic plate materials.
Definition: ElasticPlateBase.h:41
================================================================================
Definition: ContinuaReprComponent.h:34
??.
Definition: ElasticPlateProto.h:44
Data about the index, size,,... of the object to transmit.
Definition: CommMetaData.h:38
double E
elastic modulus
Definition: ElasticPlateBase.h:44