xc
ElasticPlateProto.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 //ElasticPlateProto.h
29 
30 #ifndef ElasticPlateProto_h
31 #define ElasticPlateProto_h
32 
33 
34 #include "ElasticPlateBase.h"
35 #include <utility/matrix/Vector.h>
36 #include <utility/matrix/Matrix.h>
37 #include "utility/actor/actor/MovableVector.h"
38 
39 
40 namespace XC {
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(Communicator &);
53  int recvData(const Communicator &);
54  public :
55  ElasticPlateProto(int tag,int classTag);
56  ElasticPlateProto(int classTag);
57  ElasticPlateProto(int tag,int classTag, double E, double nu, double h, double rho);
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  double rho)
98  : ElasticPlateBase(tag,classTag,young,poisson,thickness, rho), trialStrain(SZ), initialStrain(SZ) {}
99 
100 template <int SZ>
102  { return SZ; }
103 
104 //get the strain
105 template <int SZ>
107  {
108  initialStrain= strain;
109  return 0;
110  }
111 
112 //get the strain
113 template <int SZ>
115  {
116  trialStrain= strain;
117  return 0;
118  }
119 
120 //send back the strain
121 template <int SZ>
123  {
124  static Vector retval;
125  retval= trialStrain-initialStrain;
126  return retval;
127  }
128 
129 //@ brief Revert the material to its initial state.
130 template <int SZ>
132  {
133  trialStrain.Zero();
134  initialStrain.Zero();
136  }
137 
139 template <int SZ>
141  {
142  int res= ElasticPlateBase::sendData(comm);
143  res+= comm.sendVector(trialStrain,getDbTagData(),CommMetaData(6));
144  res+= comm.sendVector(initialStrain,getDbTagData(),CommMetaData(7));
145  return res;
146  }
147 
149 template <int SZ>
151  {
152  int res= ElasticPlateBase::recvData(comm);
153  res+= comm.receiveVector(trialStrain,getDbTagData(),CommMetaData(6));
154  res+= comm.receiveVector(initialStrain,getDbTagData(),CommMetaData(7));
155  return res;
156  }
157 
158 } // end of XC namespace
159 
160 #endif
int revertToStart(void)
revert the material to its initial state.
Definition: ElasticPlateProto.h:131
double E
elastic modulus
Definition: ElasticPlateBase.h:46
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
double nu
poisson ratio
Definition: ElasticPlateBase.h:47
Data about the index, size,,...
Definition: CommMetaData.h:39
void Zero(void)
Zeros out the Vector, i.e.
Definition: Vector.h:263
int recvData(const Communicator &)
Receive data through the communicator argument.
Definition: ElasticPlateProto.h:150
int recvData(const Communicator &comm)
Receive data through the communicator argument.
Definition: ElasticPlateBase.cc:75
virtual DbTagData & getDbTagData(void) const
Returns a vector to store class dbTags.
Definition: DistributedBase.cc:43
int revertToStart(void)
revert the material to its initial state.
Definition: ElasticPlateBase.cc:63
int receiveVector(Vector &v, const int &) const
Receives el vector.
Definition: Communicator.cc:426
int sendData(Communicator &)
Send data through the communicator argument.
Definition: ElasticPlateProto.h:140
int setTrialSectionDeformation(const Vector &strain_from_element)
Set the value of the trial section deformation vector, to be {def}.
Definition: ElasticPlateProto.h:114
ElasticPlateBase(int tag, int classTag)
Constructor.
Definition: ElasticPlateBase.cc:38
int getOrder(void) const
Return the number of response quantities provided by the section.
Definition: ElasticPlateProto.h:101
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
double h
plate thickness
Definition: PlateBase.h:49
Base class for ElasticPlateSection and ElasticMembranePlateSection.
Definition: ElasticPlateProto.h:44
Base class for elastic plate materials.
Definition: ElasticPlateBase.h:43
int sendData(Communicator &comm)
Send data through the communicator argument.
Definition: ElasticPlateBase.cc:67
const Vector & getSectionDeformation(void) const
Return the section deformation vector, .
Definition: ElasticPlateProto.h:122
int sendVector(const Vector &, const int &)
Sends vector.
Definition: Communicator.cc:419