v0.12.1
Classes | Typedefs | Functions | Variables
OpElasticTools Namespace Reference

Classes

struct  CommonData
 [Common data] More...
 
struct  OpStrain
 
struct  OpLogStrain
 
struct  OpStress
 
struct  OpCalculateLogStressTangent
 
struct  OpCalculateNeoHookeStressTangent
 
struct  OpRotatingFrameRhs
 
struct  OpRotatingFrameBoundaryRhs
 
struct  OpRotatingFrameLhs
 
struct  OpRotatingFrameBoundaryLhs
 
struct  OpVolumeSideGetColData
 
struct  OpInternalForceRhs
 
struct  OpPostProcElastic
 
struct  OpSetMaterialBlock
 
struct  OpSetMaterialBlockBoundary
 
struct  OpSaveReactionForces
 
struct  OpEssentialRHS_U
 
struct  OpEssentialRHS_Rotation
 

Typedefs

typedef boost::function< Tensor1< double, 3 >const double, const double, const double)> VectorFun
 [Operators definitions] More...
 

Functions

template<typename T >
Tensor2< double, 3, 3 > getFiniteDiff (const int &kk, const int &ll, CommonData &common_data, Tensor2< T, 3, 3 > &F, Tensor2< double, 3, 3 > &t_stress)
 
template<typename T >
Tensor4< double, 3, 3, 3, 3 > getDTensorFunction (CommonData &common_data, Tensor2< T, 3, 3 > &F, Tensor2< double, 3, 3 > &t_stress)
 

Variables

constexpr auto VecSetValues = MoFEM::VecSetValues<EssentialBcStorage>
 
constexpr auto MatSetValues = MoFEM::MatSetValues<EssentialBcStorage>
 

Typedef Documentation

◆ VectorFun

typedef boost::function<Tensor1<double, 3>const double, const double, const double)> OpElasticTools::VectorFun

[Operators definitions]

Definition at line 809 of file ElasticOperators.hpp.

Function Documentation

◆ getDTensorFunction()

template<typename T >
Tensor4<double, 3, 3, 3, 3> OpElasticTools::getDTensorFunction ( CommonData common_data,
Tensor2< T, 3, 3 > &  F,
Tensor2< double, 3, 3 > &  t_stress 
)

Definition at line 790 of file ElasticOperators.hpp.

791  {
792  Tensor4<double, 3, 3, 3, 3> my_D;
793  for (int k = 0; k != 3; ++k) {
794  for (int l = 0; l != 3; ++l) {
795  auto d_stress = getFiniteDiff(k, l, common_data, F, t_stress);
796  for (int i = 0; i != 3; ++i) {
797  for (int j = 0; j != 3; ++j) {
798  my_D(i, j, k, l) = d_stress(i, j);
799  }
800  }
801  }
802  }
803  return my_D;
804 };
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'i', 3 > i
FTensor::Index< 'k', 3 > k
Tensor2< double, 3, 3 > getFiniteDiff(const int &kk, const int &ll, CommonData &common_data, Tensor2< T, 3, 3 > &F, Tensor2< double, 3, 3 > &t_stress)

◆ getFiniteDiff()

template<typename T >
Tensor2<double, 3, 3> OpElasticTools::getFiniteDiff ( const int &  kk,
const int &  ll,
CommonData common_data,
Tensor2< T, 3, 3 > &  F,
Tensor2< double, 3, 3 > &  t_stress 
)

Definition at line 730 of file ElasticOperators.hpp.

731  {
733  Tensor2<double, 3, 3> out;
734 
735  Tensor2<double, 3, 3> strainPl;
736  Tensor2<double, 3, 3> strainMin;
737  strainPl(i, j) = F(i, j);
738  strainMin(i, j) = F(i, j);
739  const double h = 1e-8;
740  strainPl(kk, ll) += h;
741  strainMin(kk, ll) -= h;
742  Tensor4<PackPtr<double *, 1>, 3, 3, 3, 3> dummy;
743 
744  auto calculate_stress = [&](auto &F) {
745  Tensor2<double, 3, 3> Piola;
746  Tensor2_symmetric<double, 3> stress_sym;
747  Tensor2_symmetric<double, 3> C;
748  Tensor2_symmetric<double, 3> strain;
749 
750  C(i, j) = F(m, i) ^ F(m, j);
751 
752  Tensor1<double, 3> lambda;
753  Tensor2<double, 3, 3> eig_vec;
754  CHKERR get_eigen_val_and_proj_lapack(C, lambda, eig_vec);
755 
756  auto lnC = get_ln_X_lapack(C, lambda, eig_vec);
757  // auto lnC = get_log_map(C);
758  strain(i, j) = 0.5 * lnC(i, j);
759 
760  stress_sym(i, j) = common_data.tD(i, j, k, l) * strain(k, l);
761  auto stress_tmp = to_non_symm(stress_sym);
762 
763  // Tensor4<double, 3, 3, 3, 3> D2;
764  // constexpr auto t_kd = Kronecker_Delta<int>();
765  // Tensor4<double, 3, 3, 3, 3> dC_dF;
766  // dC_dF(i, j, k, l) = (t_kd(i, l) * F(k, j)) + (t_kd(j, l) * F(k, i));
767  // auto t_L = get_diff_log_map(C);
768  // t_L(i, j, k, l) *= 0.5;
769  // D2(i, j, k, l) = t_L(i, j, m, n) * dC_dF(m, n, k, l);
770 
771  auto D2 = calculate_nominal_moduli_TL(C, F, stress_sym, lambda, eig_vec,
772  dummy, false);
773 
774  Piola(k, l) = stress_tmp(i, j) * D2(i, j, k, l);
775 
776  return Piola;
777  };
778 
779  auto StressPlusH = calculate_stress(strainPl);
780  auto StressMinusH = calculate_stress(strainMin);
781  // out(i, j) = (StressPlusH(i, j) - t_stress(i, j)) / (h);
782 
783  out(i, j) = (StressPlusH(i, j) - StressMinusH(i, j)) / (2 * h);
784 
785  return out;
786 }
static Index< 'm', 3 > m
MoFEMErrorCode get_eigen_val_and_proj_lapack(const Tensor2_symmetric< T, 3 > &X, Tensor1< T, 3 > &lambda, Tensor2< T, 3, 3 > &eig_vec)
auto get_ln_X_lapack(const Tensor2_symmetric< T1, 3 > &X, Tensor1< T2, 3 > &lambda, Tensor2< T3, 3, 3 > &eig_vec)
auto to_non_symm(T &symm)
auto calculate_nominal_moduli_TL(Tensor2_symmetric< T, 3 > &X, Tensor2< TP, 3, 3 > &F, Tensor2_symmetric< TP, 3 > &stress, Tensor1< T, 3 > &lambda, Tensor2< T, 3, 3 > &eig_vec, Tensor4< T3, 3, 3, 3, 3 > &TLs3, bool compute_tangent)
#define CHKERR
Inline error check.
Definition: definitions.h:610
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:515

Variable Documentation

◆ MatSetValues

constexpr auto OpElasticTools::MatSetValues = MoFEM::MatSetValues<EssentialBcStorage>
constexpr

Definition at line 685 of file ElasticOperators.hpp.

◆ VecSetValues

constexpr auto OpElasticTools::VecSetValues = MoFEM::VecSetValues<EssentialBcStorage>
constexpr

Definition at line 684 of file ElasticOperators.hpp.