HaighWestergaard.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2  * _
3  * _ __ ___ __ _ _ __ _ __ ___ ___ | |_
4  * | '_ ` _ \ / _` | '__| '_ ` _ \ / _ \| __|
5  * | | | | | | (_| | | | | | | | | (_) | |_
6  * |_| |_| |_|\__,_|_| |_| |_| |_|\___/ \__|
7  *
8  * Unit of Strength of Materials and Structural Analysis
9  * University of Innsbruck,
10  * 2020 - today
11  *
12  * festigkeitslehre@uibk.ac.at
13  *
14  * Matthias Neuner matthias.neuner@uibk.ac.at
15  * Magdalena Schreter magdalena.schreter@uibk.ac.at
16  * Alexander Dummer alexander.dummer@uibk.ac.at
17  *
18  * This file is part of the MAteRialMOdellingToolbox (marmot).
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * The full text of the license can be found in the file LICENSE.md at
26  * the top level directory of marmot.
27  * ---------------------------------------------------------------------
28  */
29 
30 #pragma once
31 #include "Marmot/MarmotMath.h"
32 #include "Marmot/MarmotTypedefs.h"
33 #include "Marmot/MarmotVoigt.h"
34 
35 namespace Marmot {
36  namespace ContinuumMechanics::HaighWestergaard {
37 
42  template < typename T = double >
44 
46  T xi;
48  T rho;
50  T theta;
51  };
52 
65  template < typename T = double >
66  HaighWestergaardCoordinates< T > haighWestergaard( const Eigen::Matrix< T, 6, 1 >& stress )
67  {
68  using namespace Constants;
71  const auto J2_ = J2( stress );
72  hw.xi = I1( stress ) / sqrt3;
73  hw.rho = sqrt( 2. * J2_ );
74 
75  if ( Marmot::Math::makeReal( hw.rho ) != 0 ) {
76  const T J3_ = J3( stress );
77  const T x = 3. * ( sqrt3 / 2. ) * J3_ / ( pow( J2_, 3. / 2 ) );
78  if ( Marmot::Math::makeReal( x ) <= -1 )
79  hw.theta = 1. / 3 * Pi;
80  else if ( Marmot::Math::makeReal( x ) >= 1 )
81  hw.theta = 0.;
82  else if ( x != x )
83  hw.theta = 1. / 3 * Marmot::Constants::Pi;
84  else
85  hw.theta = 1. / 3 * acos( x );
86  }
87  else
88  hw.theta = 0.;
89 
90  return hw;
91  }
100  HaighWestergaardCoordinates< double > haighWestergaardFromStrain( const Marmot::Vector6d& strain );
101 
102  } // namespace ContinuumMechanics::HaighWestergaard
103 } // namespace Marmot
Marmot::ContinuumMechanics::HaighWestergaard::haighWestergaard
HaighWestergaardCoordinates< T > haighWestergaard(const Eigen::Matrix< T, 6, 1 > &stress)
Definition: HaighWestergaard.h:66
MarmotTypedefs.h
MarmotMath.h
MarmotVoigt.h
Marmot::ContinuumMechanics::VoigtNotation::Invariants::I1
T I1(const Eigen::Matrix< T, 6, 1 > &stress)
Definition: MarmotVoigt.h:400
Marmot::ContinuumMechanics::VoigtNotation::Invariants::J2
T J2(const Eigen::Matrix< T, 6, 1 > &stress)
Definition: MarmotVoigt.h:458
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates
Definition: HaighWestergaard.h:43
Marmot::ContinuumMechanics::VoigtNotation::Invariants
Definition: MarmotVoigt.h:306
Marmot::Math::makeReal
double makeReal(const double &value)
Definition: MarmotMath.cpp:37
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates::xi
T xi
Hydrostatic component .
Definition: HaighWestergaard.h:46
Marmot::ContinuumMechanics::VoigtNotation::Invariants::J3
T J3(const Eigen::Matrix< T, 6, 1 > &stress)
Definition: MarmotVoigt.h:481
Marmot
This file includes functions needed for calculations with stress and strain tensors written in voigt ...
Definition: MarmotTesting.h:30
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates::rho
T rho
Deviatoric radius .
Definition: HaighWestergaard.h:48
Marmot::Vector6d
Eigen::Matrix< double, 6, 1 > Vector6d
Definition: MarmotTypedefs.h:43
Marmot::Constants::sqrt3
constexpr double sqrt3
Definition: MarmotConstants.h:51
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates::theta
T theta
Lode angle specified in radian.
Definition: HaighWestergaard.h:50
Marmot::Constants::Pi
constexpr double Pi
Definition: MarmotConstants.h:34
Marmot::ContinuumMechanics::HaighWestergaard::haighWestergaardFromStrain
HaighWestergaardCoordinates< double > haighWestergaardFromStrain(const Marmot::Vector6d &strain)
Definition: HaighWestergaard.cpp:17