xc
stresst.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: stress tensor with all necessary functions #
33 //# CLASS: stresstensor #
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 22 '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 //# 13 septembar '96 added reportAnim :) #
49 //# #
50 //# #
51 //# #
52 //# #
53 //# #
54 //#############################################################################
55 //*/
56 
57 #ifndef STRESSTENSOR_H
58 #define STRESSTENSOR_H
59 
60 #include "stress_strain_tensor.h"
61 #include "tmpl_operators.h"
62 
63 namespace XC {
64 class Material_Model;
65 
66 
71  {
72  public:
73  friend class Material_Model;
74  public:
75  // just send appropriate arguments to the base constructor
76  stresstensor(double initval=0.0); // default constructor
77  stresstensor(const boost::python::list &l);
78  stresstensor(const double *values );
79  stresstensor(const std::vector<double> &values );
80  explicit stresstensor(const Vector &);
81 
82  stresstensor(const stresstensor & x );
83  explicit stresstensor(const BJtensor & x); // copy-initializer
84  explicit stresstensor(const nDarray & x); // copy-initializer
85 
86  //~stresstensor( );
87 
88 
89  stresstensor operator=(const stresstensor & rval);// stresstensor assignment
90  stresstensor operator=(const BJtensor & rval);// tensor assignment to stresstensor
91  stresstensor &operator+=(const stresstensor & rval); // stresstensor addition
92  stresstensor &operator-=(const stresstensor & rval); // stresstensor subtraction
93 
94  stresstensor &operator*=(const double &rval); // product
95  stresstensor operator*(const double &rval) const;
96 
97  //ini // use "from" and initialize already allocated stress tensor from "from" values
98  //ini void Initialize( const stresstensor & from );
99 
100  //___// operator() overloading for 3D Gauss points!
101  //___ stresstensor & operator()(short ir, short is, short it,
102  //___ short tr, short ts, short tt );
103 
104 
105  stresstensor deviator( ) const;
106  stresstensor principal( ) const;
107 
108  double xi( ) const;
109 
110  BJtensor dpoverds( void ) const;
111  BJtensor dqoverds( void ) const;
112  BJtensor dthetaoverds( void ) const;
113  BJtensor d2poverds2( void ) const;
114  BJtensor d2qoverds2( void ) const;
115  BJtensor d2thetaoverds2( void ) const;
116 
117 
118 
119  //-- stresstensor yield_surface_cross(stresstensor & end_stress,
120  //-- Material_Model & YC);
121 
122  stresstensor pqtheta2stress( double, double, double );
123 
124  void report(const std::string &) const;
125  void reportshort(const std::string &) const;
126  void reportshortpqtheta(const std::string &) const;
127  void reportSHORTpqtheta(const std::string &) const;
128  void reportSHORTs1s2s3(const std::string &) const;
129  void reportKLOTpqtheta(const std::string &) const;
130  void reportshortI1J2J3(const std::string &) const;
131  void reportAnim(void) const;
132  void reportTensor(const std::string &) const;
133 
134  //================================================================================
135  // Overloaded Insertion Operator ZHaohui Added Aug. 13, 2000
136  // prints an stresstensor's contents
137  //================================================================================
138  friend std::ostream &operator<<(std::ostream &, const stresstensor &);
139 
140  // // routine used by root finder, takes an alfa and returns the
141  // // yield function value for that alfa
142  // public:
143  // double func( stresstensor & start_stress,
144  // stresstensor & end_stress,
145  // Material_Model & YC,
146  // double alfa );
147  //
148  //
149  // //..// polynomial root solver friend functions definitions
150  // //..public:
151  // //..friend void laguer(complex *, int , complex *, double , int );
152  // //..friend void zroots(complex *, int , complex *, int );
153  // //..
154  //
155  // zero of function
156  friend double zbrentstress(stresstensor & start_stress,
157  stresstensor & end_stress,
158  Material_Model & YC,
159  double x1, double x2, double tol);
160 
161  // friend double zbrent(double x1, double x2, double tol);
162  //
163  //
164  };
165 
166 std::ostream &operator<<(std::ostream &, const stresstensor &);
167 template stresstensor operator*(const double & , const stresstensor & );
168 template stresstensor operator+(const stresstensor & , const stresstensor & );
169 template stresstensor operator-(const stresstensor & , const stresstensor & );
170 BJtensor operator+(const BJtensor &, const stresstensor &);
171 BJtensor operator-(const BJtensor &, const stresstensor &);
172 BJtensor operator+(const stresstensor &, const BJtensor &);
173 BJtensor operator-(const stresstensor &, const BJtensor &);
174 
175 } // end of XC namespace
176 
177 #endif
178 
nDarray operator-()
unary minus
Definition: nDarray.cpp:798
BJtensor d2poverds2(void) const
.........................................................................
Definition: stresst.cpp:342
Float vector abstraction.
Definition: Vector.h:94
Base class for strain and stress tensors.
Definition: stress_strain_tensor.h:42
stresstensor & operator+=(const stresstensor &rval)
stresstensor addition
Definition: stresst.cpp:174
stresstensor operator*(const double &rval) const
Scalar multiplication.
Definition: stresst.cpp:195
Stress tensor.
Definition: stresst.h:70
Boris Jeremic tensor class.
Definition: BJtensor.h:112
n-dimensional array.
Definition: nDarray.h:242
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
stresstensor & operator-=(const stresstensor &rval)
stresstensor subtraction
Definition: stresst.cpp:181
nDarray operator+(const double &rval)
scalar addition
Definition: nDarray.cpp:730
stresstensor & operator*=(const double &rval)
product.
Definition: stresst.cpp:188