12#include <boost/math/constants/constants.hpp>
14constexpr double third = boost::math::constants::third<double>();
20 const bool eval_lhs, boost::shared_ptr<DataAtIntegrationPts> &data_ptr,
21 boost::shared_ptr<PhysicalEquations> &physics_ptr)
35 const auto nb_integration_pts = ent_data.
getN().size1();
36 auto iu = getFTensor2SymmetricFromMat<3>(
dataAtPts->streachTensorAtPts);
38 auto iG = getFTensor2FromMat<3, 3>(
dataAtPts->GAtPts);
40 auto create_data_vec = [nb_integration_pts](
auto &
v) {
41 v.resize(nb_integration_pts,
false);
43 auto create_data_mat = [nb_integration_pts](
auto &
m) {
44 m.resize(9, nb_integration_pts,
false);
52 auto r_P = getFTensor2FromMat<3, 3>(
dataAtPts->PAtPts);
53 auto r_Sigma = getFTensor2FromMat<3, 3>(
dataAtPts->SigmaAtPts);
55 auto r_flow = getFTensor2FromMat<3, 3>(
dataAtPts->flowAtPts);
57 for (
unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
60 for (
auto ii : {0, 1, 2})
61 for (
auto jj : {0, 1, 2})
62 t_h(ii, jj) = iu(ii, jj);
65 for (
int ii = 0; ii != 3; ++ii)
69 int r = ::function(
tAg,
physicsPtr->dependentVariables.size(),
75 "ADOL-C function evaluation with error r = %d", r);
98 const int number_of_active_variables =
physicsPtr->activeVariables.size();
99 const int number_of_dependent_variables =
101 std::vector<double *> jac_ptr(number_of_dependent_variables);
102 for (
unsigned int n = 0;
n != number_of_dependent_variables; ++
n) {
105 ->dependentVariablesDirevatives[
n * number_of_active_variables]);
108 const auto nb_integration_pts = ent_data.
getN().size1();
110 auto create_data_mat = [nb_integration_pts](
auto &
m) {
111 m.resize(9, nb_integration_pts,
false);
114 auto create_data_ten = [nb_integration_pts](
auto &
m) {
115 m.resize(27, nb_integration_pts,
false);
139 auto iu = getFTensor2SymmetricFromMat<3>(
dataAtPts->streachTensorAtPts);
140 auto iG = getFTensor2FromMat<3, 3>(
dataAtPts->GAtPts);
154 auto r_phi_dh = getFTensor2FromMat<3, 3>(
dataAtPts->phi_dh);
155 auto r_phi_dH = getFTensor2FromMat<3, 3>(
dataAtPts->phi_dH);
163 for (
unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
166 for (
auto ii : {0, 1, 2})
167 for (
auto jj : {0, 1, 2})
168 t_h(ii, jj) = iu(ii, jj);
171 for (
int ii = 0; ii != 3; ++ii)
176 int r = ::jacobian(
tAg, number_of_dependent_variables,
177 number_of_active_variables,
178 &
physicsPtr->activeVariables[0], &jac_ptr[0]);
181 "ADOL-C function evaluation with error");
237 const double sigma_y)
247 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"stvenant_",
"",
"none");
249 CHKERR PetscOptionsScalar(
"-young_modulus",
"Young modulus",
"",
E, &
E,
251 CHKERR PetscOptionsScalar(
"-poisson_ratio",
"poisson ratio",
"", nu, &nu,
256 ierr = PetscOptionsEnd();
267 const bool eval_rhs,
const bool eval_lhs,
268 boost::shared_ptr<DataAtIntegrationPts> &data_ptr,
269 boost::shared_ptr<PhysicalEquations> &physics_ptr) {
323 ih(
i,
j) = (*t_h_ptr)(
i,
j);
326 for (
auto ii : {0, 1, 2})
331 for (
auto ii : {0, 1, 2})
339 enableMinMaxUsingAbs();
432 const double lambda,
const double sigma_y)
438 const bool eval_rhs,
const bool eval_lhs,
439 boost::shared_ptr<DataAtIntegrationPts> &data_ptr,
440 boost::shared_ptr<PhysicalEquations> &physics_ptr) {
447 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"mooneyrivlin_",
"",
"none");
450 CHKERR PetscOptionsScalar(
"-alpha",
"Alpha",
"",
alpha, &
alpha, PETSC_NULL);
452 CHKERR PetscOptionsScalar(
"-beta",
"Beta",
"",
beta, &
beta, PETSC_NULL);
465 ierr = PetscOptionsEnd();
531 ih(
i,
j) = (*t_h_ptr)(
i,
j);
534 for (
auto ii : {0, 1, 2})
539 for (
auto ii : {0, 1, 2})
547 enableMinMaxUsingAbs();
575 (levi_civita(
I,
J,
K) *
tF(
k,
K));
634 const int tape,
const double lambda,
const double mu,
635 const double sigma_y) {
644 const int tape,
const double alpha,
const double beta,
const double lambda,
645 const double sigma_y) {
Eshelbian plasticity interface.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ MOFEM_OPERATION_UNSUCCESSFUL
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
constexpr double lambda
surface tension
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > getFTensor3FromMat(MatrixDouble &m)
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
constexpr IntegrationType I
constexpr auto field_name
MoFEMErrorCode addMaterial_HMHHStVenantKirchhoff(const int tape, const double lambda, const double mu, const double sigma_y)
MoFEMErrorCode addMaterial_HMHMooneyRivlin(const int tape, const double alpha, const double beta, const double lambda, const double sigma_y)
boost::shared_ptr< PhysicalEquations > physicalEquations
static constexpr int numberOfActiveVariables
static constexpr int numberOfDependentVariables
MoFEMErrorCode recordTape(const int tape, DTensor2Ptr *t_h_ptr)
MoFEMErrorCode getOptions()
virtual OpJacobian * returnOpJacobian(const std::string &field_name, const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, boost::shared_ptr< PhysicalEquations > &physics_ptr)
ATensor2 tPulledPhi_dSigma
HMHPMooneyRivlinWriggersEq63(const double alpha, const double beta, const double lambda, const double sigma_y)
virtual OpJacobian * returnOpJacobian(const std::string &field_name, const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, boost::shared_ptr< PhysicalEquations > &physics_ptr)
static constexpr int numberOfDependentVariables
HMHStVenantKirchhoff(const double lambda, const double mu, const double sigma_y)
MoFEMErrorCode recordTape(const int tape, DTensor2Ptr *t_h_ptr)
MoFEMErrorCode getOptions()
ATensor2 tPulledPhi_dSigma
static constexpr int numberOfActiveVariables
MoFEMErrorCode evaluateLhs(EntData &data)
MoFEMErrorCode evaluateRhs(EntData &data)
OpHMHH(const std::string &field_name, const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, boost::shared_ptr< PhysicalEquations > &physics_ptr)
boost::shared_ptr< PhysicalEquations > physicsPtr
material physical equations
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Data on single entity (This is passed as argument to DataOperator::doWork)
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....