xc
straint.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 //----------------------------------------------------------------------------
29 //################################################################################
30 //# COPYRIGHT (C): :-)) #
31 //# PROJECT: Object Oriented Finite Element Program #
32 //# PURPOSE: strain tensor with all necessary functions #
33 //# CLASS: straintensor #
34 //# #
35 //# VERSION: #
36 //# LANGUAGE: C++.ver >= 2.0 ( Borland C++ ver=3.00, SUN C++ ver=2.1 ) #
37 //# TARGET OS: DOS || UNIX || . . . #
38 //# DESIGNER(S): Boris Jeremic #
39 //# PROGRAMMER(S): Boris Jeremic #
40 //# #
41 //# #
42 //# DATE: July 25 '93 #
43 //# UPDATE HISTORY: August 22-29 '94 choped to separate files and worked on #
44 //# const and & issues #
45 //# August 30-31 '94 added use_def_dim to full the CC, #
46 //# resolved problem with temoraries for #
47 //# operators + and - ( +=, -= ) #
48 //# #
49 //# #
50 //# #
51 //# #
52 //# #
53 //# #
54 //################################################################################
55 //*/
56 //
57 #ifndef STRAINTENSOR_HH
58 #define STRAINTENSOR_HH
59 
60 #include "stress_strain_tensor.h"
61 #include "tmpl_operators.h"
62 
63 namespace XC {
64 
66 //
69  {
70  public: // just send appropriate arguments to the base constructor
71 // straintensor (int rank_of_tensor=2, double initval=0.00000003141528);
72  straintensor(double initval=0.0);
73 // default constructor // this is just PI/10^8 to check default constructor
74 
75  straintensor(const double *values);
76  straintensor(const std::vector<double> &values);
77  explicit straintensor(const Vector &);
78 
79  straintensor(const straintensor & x );
80  explicit straintensor(const BJtensor & x); // copy-initializer
81  explicit straintensor(const nDarray & x); // copy-initializer
82 
83  straintensor operator=(const straintensor & rval); // straintensor assignment
84  straintensor operator=(const BJtensor & rval);// tensor assignment to straintensor
85  straintensor &operator+=(const straintensor & rval); // straintensor addition
86  straintensor &operator-=(const straintensor & rval); // straintensor subtraction
87 
88  straintensor &operator*=(const double &rval); // product
89  straintensor operator*(const double &rval) const; // scalar multiplication
90 
91 //ini // use "from" and initialize already allocated strain tensor from "from" values
92 //ini void Initialize( const straintensor & from );
93 
94 //___// operator() overloading for 3D Gauss points!
95 //___ straintensor & operator()(short ir, short is, short it,
96 //___ short tr, short ts, short tt );
97 
98 
99  double equivalent(void) const; //Zhaohui added 09-02-2000
100 
101  straintensor deviator(void) const;
102  straintensor principal(void) const;
103 
104 
105 
106  straintensor pqtheta2strain( double, double, double );
107  straintensor evoleq2strain( double, double );
108 
109  void report(const std::string &) const;
110  void reportshort(const std::string &) const;
111 
112  friend std::ostream &operator<<(std::ostream &, const straintensor &);
113 
114 //..// polynomial root solver friend functions definitions
115 //..public:
116 //..friend void laguer(complex *, int , complex *, double , int );
117 //..friend void zroots(complex *, int , complex *, int );
118 //..
119  };
120 
121 std::ostream &operator<<(std::ostream &, const straintensor &);
122 template straintensor operator*(const double & , const straintensor & );
123 template straintensor operator+(const straintensor & , const straintensor & );
124 template straintensor operator-(const straintensor & , const straintensor & );
125 BJtensor operator+(const BJtensor &, const straintensor &);
126 BJtensor operator-(const BJtensor &, const straintensor &);
127 BJtensor operator+(const straintensor &, const BJtensor &);
128 BJtensor operator-(const straintensor &, const BJtensor &);
129 
130 } // end of XC namespace
131 
132 #endif
133 
straintensor & operator-=(const straintensor &rval)
straintensor subtraction
Definition: straint.cpp:123
nDarray operator-()
unary minus
Definition: nDarray.cpp:798
Float vector abstraction.
Definition: Vector.h:94
Base class for strain and stress tensors.
Definition: stress_strain_tensor.h:42
straintensor(double initval=0.0)
Constructor.
Definition: straint.cpp:63
Boris Jeremic tensor class.
Definition: BJtensor.h:112
straintensor operator=(const straintensor &rval)
Assignment operator.
Definition: straint.cpp:99
straintensor operator*(const double &rval) const
Scalar multiplication.
Definition: straint.cpp:137
straintensor & operator*=(const double &rval)
product.
Definition: straint.cpp:130
straintensor & operator+=(const straintensor &rval)
straintensor addition
Definition: straint.cpp:116
n-dimensional array.
Definition: nDarray.h:242
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
nDarray operator+(const double &rval)
scalar addition
Definition: nDarray.cpp:730
Strain tensor.
Definition: straint.h:68