XC Open source finite element analysis program
DqUniaxialMaterial.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 //DqUniaxialMaterial.h
28 //deque de pointers (se emplear en la clase Set).
29 
30 
31 #ifndef DQUNIAXIALMATERIAL_H
32 #define DQUNIAXIALMATERIAL_H
33 
34 #include "xc_utils/src/nucleo/EntCmd.h"
35 #include <deque>
36 #include <material/uniaxial/UniaxialMaterial.h>
37 
38 
39 namespace XC {
40 
42 //
44 class DqUniaxialMaterial: public EntCmd, public MovableObject, public std::deque<UniaxialMaterial *>
45  {
46  void libera(void);
47  public:
48  typedef std::deque<UniaxialMaterial *> lst_ptr;
49  typedef lst_ptr::const_iterator const_iterator;
50  typedef lst_ptr::iterator iterator;
51  typedef lst_ptr::reference reference;
52  typedef lst_ptr::const_reference const_reference;
53  typedef lst_ptr::size_type size_type;
54  protected:
55  void copia_lista(const DqUniaxialMaterial &,SectionForceDeformation *s= nullptr);
56  int sendData(CommParameters &);
57  int recvData(const CommParameters &);
58 
59 
60  public:
61  DqUniaxialMaterial(EntCmd *owner= nullptr,const size_t &sz= 0);
62  DqUniaxialMaterial(EntCmd *owner,const UniaxialMaterial &);
63  DqUniaxialMaterial(EntCmd *owner,const UniaxialMaterial &um,const size_t &sz);
64  DqUniaxialMaterial(EntCmd *owner,const UniaxialMaterial *um,const size_t &sz);
68  ~DqUniaxialMaterial(void);
69  void push_back(const UniaxialMaterial *,SectionForceDeformation *s= nullptr);
70  void push_front(const UniaxialMaterial *,SectionForceDeformation *s= nullptr);
71  inline iterator begin(void)
72  { return lst_ptr::begin(); }
73  const_iterator begin(void) const
74  { return lst_ptr::begin(); }
75  iterator end(void)
76  { return lst_ptr::end(); }
77  const_iterator end(void) const
78  { return lst_ptr::end(); }
79  void clear(void);
80  void clearAll(void);
81  inline size_type size(void) const
82  { return lst_ptr::size(); }
83  void resize(const size_t &n);
84 
85  int commitState(void);
86  int revertToLastCommit(void);
87  int revertToStart(void);
88 
89  int zeroInitialStrain(void);
90  int setInitialStrain(const Vector &def,const size_t &offset);
91  int setTrialStrain(const Vector &def,const size_t &offset);
92  int setTrialStrain(const double &strain,const double &strainRate);
93  void getStrain(Vector &,const size_t &offset) const;
94  void getInitialStrain(Vector &,const size_t &offset) const;
95  void getTangent(Matrix &,const size_t &offset) const;
96  void getInitialTangent(Matrix &,const size_t &offset) const;
97  void getFlexibility(Matrix &f,const size_t &offset) const;
98  void getInitialFlexibility(Matrix &f,const size_t &offset) const;
99  void getStress(Vector &,const size_t &offset) const;
100 
101  inline reference operator[](const size_t i)
102  { return lst_ptr::operator[](i); }
103  inline const_reference operator[](const size_t i) const
104  { return lst_ptr::operator[](i); }
105 
106  int sendSelf(CommParameters &);
107  int recvSelf(const CommParameters &);
108 
109  void Print(std::ostream &s, int flag =0) const;
110 
111  };
112 
113 } //end of XC namespace
114 #endif
115 
int setInitialStrain(const Vector &def, const size_t &offset)
Sets initial strain.
Definition: DqUniaxialMaterial.cc:217
Definition: Vector.h:82
void clear(void)
Clears the container.
Definition: DqUniaxialMaterial.cc:140
void getStrain(Vector &, const size_t &offset) const
Returns strains vector.
Definition: DqUniaxialMaterial.cc:258
DqUniaxialMaterial(EntCmd *owner=nullptr, const size_t &sz=0)
Constructor.
Definition: DqUniaxialMaterial.cc:84
void getStress(Vector &, const size_t &offset) const
Returns the tensiones.
Definition: DqUniaxialMaterial.cc:303
void getInitialTangent(Matrix &, const size_t &offset) const
Return the initial tangent stiffness matrix.
Definition: DqUniaxialMaterial.cc:276
Object that can move between processes.
Definition: MovableObject.h:91
int sendSelf(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: DqUniaxialMaterial.cc:381
void getTangent(Matrix &, const size_t &offset) const
Return the tangent stiffness matrix.
Definition: DqUniaxialMaterial.cc:267
int zeroInitialStrain(void)
Zeroes initial strains.
Definition: DqUniaxialMaterial.cc:208
int setTrialStrain(const Vector &def, const size_t &offset)
Sets trial strain.
Definition: DqUniaxialMaterial.cc:228
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: DqUniaxialMaterial.cc:395
void clearAll(void)
Clears the container and deletes object properties.
Definition: DqUniaxialMaterial.cc:147
int commitState(void)
Commit materials state (normally when convergence is achieved).
Definition: DqUniaxialMaterial.cc:154
void getFlexibility(Matrix &f, const size_t &offset) const
Return the matriz de flexibilidad.
Definition: DqUniaxialMaterial.cc:285
int recvData(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: DqUniaxialMaterial.cc:362
void getInitialFlexibility(Matrix &f, const size_t &offset) const
Return the initial flexibility matrix.
Definition: DqUniaxialMaterial.cc:294
Contenedor de pointers to UniaxialMaterial.
Definition: DqUniaxialMaterial.h:44
void Print(std::ostream &s, int flag=0) const
Imprime el objeto.
Definition: DqUniaxialMaterial.cc:409
DqUniaxialMaterial & operator=(const DqUniaxialMaterial &otro)
Assignment operator.
Definition: DqUniaxialMaterial.cc:127
Definition: Matrix.h:82
int revertToStart(void)
Returns to the initial state.
Definition: DqUniaxialMaterial.cc:190
void copia_lista(const DqUniaxialMaterial &, SectionForceDeformation *s=nullptr)
Copia la lista being passed as parameter.
Definition: DqUniaxialMaterial.cc:38
Base class for force deformation section models. Constitutive equations of the section.
Definition: SectionForceDeformation.h:86
int sendData(CommParameters &)
Sends object through the channel being passed as parameter.
Definition: DqUniaxialMaterial.cc:348
Communication parameters between processes.
Definition: CommParameters.h:65
void getInitialStrain(Vector &, const size_t &offset) const
Returns the initial strains.
Definition: DqUniaxialMaterial.cc:249
================================================================================
Definition: ContinuaReprComponent.h:34
int revertToLastCommit(void)
Returns to the last commited state.
Definition: DqUniaxialMaterial.cc:172
~DqUniaxialMaterial(void)
Destructor.
Definition: DqUniaxialMaterial.cc:136
Base class for uniaxial materials.
Definition: UniaxialMaterial.h:88