xc
T2Vector.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 //<<<<<<< T2Vector.h
29 //<<<<<<< T2Vector.h
30 // $Revision: 1.7 $
31 // $Date: 2002/05/16 00:07:47 $
32 //=======
33 // $Revision: 1.7 $
34 // $Date: 2002/05/16 00:07:47 $
35 //>>>>>>> 1.4
36 //=======
37 // $Revision: 1.7 $
38 // $Date: 2002/05/16 00:07:47 $
39 //>>>>>>> 1.6
40 // $Source: /usr/local/cvs/OpenSees/SRC/material/nD/soil/T2Vector.h,v $
41 
42 // Written: ZHY
43 // Created: August 2000
44 
45 //
46 // T2Vector.h
47 // --------
48 //
49 
50 #ifndef _T2Vector_H_
51 #define _T2Vector_H_
52 
53 #include "utility/actor/actor/MovableObject.h"
54 #include "utility/matrix/Vector.h"
55 #include <cfloat>
56 
57 #define UP_LIMIT 1.0e+30
58 #define LOW_LIMIT 20.*DBL_EPSILON
59 
60 namespace XC {
61 double operator &&(const Vector &, const Vector &);
62 
65 class T2Vector: public MovableObject
66  {
67  private:
68  Vector theT2Vector;
69  Vector theDeviator;
70  double theVolume;
71  static Vector engrgStrain;
72  protected:
73  int sendData(Communicator &);
74  int recvData(const Communicator &);
75  public:
76  // constructors
77  T2Vector();
78  T2Vector(const Vector & T2Vector_init, int isEngrgStrain=0);
79  T2Vector(const Vector & deviat_init, double volume_init);
80 
81  void setData(const Vector &init, int isEngrgStrain =0);
82  void setData(const Vector &deviat, double volume);
83 
84  const Vector & t2Vector(int isEngrgStrain=0) const;
85  const Vector & deviator(int isEngrgStrain=0) const;
86  double volume() const {return theVolume; }
87  const Vector &unitT2Vector() const;
88  const Vector &unitDeviator() const;
89  double t2VectorLength() const;
90  double deviatorLength() const;
91  double octahedralShear(int isEngrgStrain=0) const;
92 
93  // = -sqrt(3/2*(S:S))/(p+residualPress)
94  double deviatorRatio(double residualPress=0.) const;
95 
96  //next function return the angle between two T2Vectors in radians (-PI to PI)
97  double angleBetweenT2Vector(const T2Vector &) const;
98 
99  //next function return the angle between deviatoric components of
100  //two vectors in radians (-PI to PI)
101  double angleBetweenDeviator(const T2Vector &) const;
102 
103  int operator == (const T2Vector & a) const;
104  int isZero(void) const;
105  virtual int sendSelf(Communicator &);
106  virtual int recvSelf(const Communicator &);
107  };
108 } // end of XC namespace
109 
110 
111 #endif
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
Object that can move between processes.
Definition: MovableObject.h:100
virtual int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: T2Vector.cpp:327
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Second order tensor vector class.
Definition: T2Vector.h:65
int recvData(const Communicator &)
Receives object members through the communicator argument.
Definition: T2Vector.cpp:317
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: T2Vector.cpp:307
virtual int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: T2Vector.cpp:342