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

Classes

struct  CommonData
 [Common data] More...
 
struct  OpBoundaryMassMatrix_UU
 
struct  OpCalculateLogStressTangent
 
struct  OpCentrifugalForce
 
struct  OpEdgeForceRhs
 [Postprocessing] More...
 
struct  OpEssentialRHS_U
 
struct  OpForceRhs
 
struct  OpInternalForceRhs
 
struct  OpLogStrain
 
struct  OpLogStrainMatrixLhs
 
struct  OpPostProcElastic
 
struct  OpRotatingFrameBoundaryLhs
 
struct  OpRotatingFrameBoundaryRhs
 
struct  OpRotatingFrameLhs
 
struct  OpRotatingFrameRhs
 
struct  OpSaveReactionForces
 [Operators definitions] More...
 
struct  OpStiffnessMatrixLhs
 
struct  OpStrain
 
struct  OpStress
 

Typedefs

typedef boost::function< FTensor::Tensor1< double, 2 >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

FTensor::Index< 'i', 2 > i
 [Common data] More...
 
FTensor::Index< 'j', 2 > j
 
FTensor::Index< 'k', 2 > k
 
FTensor::Index< 'l', 2 > l
 

Typedef Documentation

◆ VectorFun

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

[Operators definitions]

Definition at line 33 of file ElasticOps.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 744 of file ElasticOperators.hpp.

745  {
746  Tensor4<double, 3, 3, 3, 3> my_D;
747  for (int k = 0; k != 3; ++k) {
748  for (int l = 0; l != 3; ++l) {
749  auto d_stress = getFiniteDiff(k, l, common_data, F, t_stress);
750  for (int i = 0; i != 3; ++i) {
751  for (int j = 0; j != 3; ++j) {
752  my_D(i, j, k, l) = d_stress(i, j);
753  }
754  }
755  }
756  }
757  return my_D;
758 };
static Index< 'l', 3 > l
static Index< 'i', 3 > i
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)
static Index< 'j', 3 > j
static Index< 'k', 3 > k

◆ 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 681 of file ElasticOperators.hpp.

682  {
684  Tensor2<double, 3, 3> out;
685 
686  Tensor2<double, 3, 3> strainPl;
687  Tensor2<double, 3, 3> strainMin;
688  strainPl(i, j) = F(i, j);
689  strainMin(i, j) = F(i, j);
690  const double h = 1e-8;
691  strainPl(kk, ll) += h;
692  strainMin(kk, ll) -= h;
693  Tensor4<PackPtr<double *, 1>, 3, 3, 3, 3> dummy;
694 
695  auto calculate_stress = [&](auto &F) {
696  Tensor2<double, 3, 3> Piola;
697  Tensor2_symmetric<double, 3> stress_sym;
698  Tensor2_symmetric<double, 3> C;
699  Tensor2_symmetric<double, 3> strain;
700 
701  C(i, j) = F(m, i) ^ F(m, j);
702 
703  Tensor1<double, 3> lambda;
704  Tensor2<double, 3, 3> eig_vec;
705  CHKERR get_eigen_val_and_proj_lapack(C, lambda, eig_vec);
706 
707  auto lnC = get_ln_X_lapack(C, lambda, eig_vec);
708  // auto lnC = get_log_map(C);
709  strain(i, j) = 0.5 * lnC(i, j);
710 
711  // if (with_plasticity)
712  // strain(i, j) -= cur_plastic_strains(i, j); //FIXME:
713 
714  stress_sym(i, j) = common_data.tD(i, j, k, l) * strain(k, l);
715  auto stress_tmp = to_non_symm(stress_sym);
716 
717  // Tensor4<double, 3, 3, 3, 3> D2;
718  // constexpr auto t_kd = Kronecker_Delta<int>();
719  // Tensor4<double, 3, 3, 3, 3> dC_dF;
720  // dC_dF(i, j, k, l) = (t_kd(i, l) * F(k, j)) + (t_kd(j, l) * F(k, i));
721  // auto t_L = get_diff_log_map(C);
722  // t_L(i, j, k, l) *= 0.5;
723  // D2(i, j, k, l) = t_L(i, j, m, n) * dC_dF(m, n, k, l);
724 
725  auto D2 = calculate_nominal_moduli_TL(C, F, stress_sym, lambda, eig_vec,
726  dummy, false);
727 
728  Piola(k, l) = stress_tmp(i, j) * D2(i, j, k, l);
729 
730  return Piola;
731  };
732 
733  auto StressPlusH = calculate_stress(strainPl);
734  // auto StressMinusH = calculate_stress(strainMin);
735  out(i, j) = (StressPlusH(i, j) - t_stress(i, j)) / (h);
736 
737  // out(i, j) = (StressPlusH(i, j) - StressMinusH(i, j)) / (2 * h);
738 
739  return out;
740 }
auto get_ln_X_lapack(const Tensor2_symmetric< T1, 3 > &X, Tensor1< T2, 3 > &lambda, Tensor2< T3, 3, 3 > &eig_vec)
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 MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
static Index< 'l', 3 > l
MoFEMErrorCode get_eigen_val_and_proj_lapack(const Tensor2_symmetric< T, 3 > &X, Tensor1< T, 3 > &lambda, Tensor2< T, 3, 3 > &eig_vec)
static Index< 'm', 3 > m
static Index< 'i', 3 > i
static Index< 'j', 3 > j
#define CHKERR
Inline error check.
Definition: definitions.h:604
static Index< 'k', 3 > k
auto to_non_symm(T &symm)
FTensor::Tensor4< double, 3, 3, 3, 3 > tD

Variable Documentation

◆ i

FTensor::Index<'i', 2> OpElasticTools::i

[Common data]

Definition at line 26 of file ElasticOps.hpp.

◆ j

FTensor::Index<'j', 2> OpElasticTools::j

Definition at line 27 of file ElasticOps.hpp.

◆ k

FTensor::Index<'k', 2> OpElasticTools::k

Definition at line 28 of file ElasticOps.hpp.

◆ l

FTensor::Index<'l', 2> OpElasticTools::l

Definition at line 29 of file ElasticOps.hpp.