17 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
23 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1> res(
size() *
size());
29 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> epsi(
size(),
size());
30 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> epsj(
size(),
size());
32 for (
long p = 0; p < gradi.rows(); ++p)
38 for (
int di = 0; di <
size(); ++di)
41 epsi.row(di) = gradi.row(p);
42 epsi = ((epsi + epsi.transpose()) / 2).eval();
43 for (
int dj = 0; dj <
size(); ++dj)
46 epsj.row(dj) = gradj.row(p);
47 epsj = ((epsj + epsj.transpose()) / 2.0).eval();
49 res(dj *
size() + di) += 2 * mu * (epsi.array() * epsj.array()).sum() * data.
da(p);
61 const std::function<Eigen::MatrixXd(
const Eigen::MatrixXd &)> &fun)
const
63 const auto &displacement = data.
fun;
65 const auto &bs = data.
bs;
66 const auto &gbs = data.
gbs;
67 const auto el_id = data.
el_id;
70 all.resize(local_pts.rows(), all_size);
71 assert(displacement.cols() == 1);
73 Eigen::MatrixXd displacement_grad(
size(),
size());
78 for (
long p = 0; p < local_pts.rows(); ++p)
84 all.row(p) = fun(displacement_grad + Eigen::MatrixXd::Identity(
size(),
size()));
91 const Eigen::MatrixXd strain = (displacement_grad + displacement_grad.transpose()) / 2;
92 Eigen::MatrixXd stress = 2 * mu * strain + lambda * strain.trace() * Eigen::MatrixXd::Identity(
size(),
size());
99 all.row(p) = fun(stress);
105 std::map<std::string, ParamFunc> res;
112 params.lambda_mu(uv, p, t, e, lambda, mu);
119 params.lambda_mu(uv, p, t, e, lambda, mu);
125 params.lambda_mu(uv, p, t, e, lambda, mu);
128 return mu * (3.0 * lambda + 2.0 * mu) / (lambda + mu);
130 return 2 * mu * (2.0 * lambda + 2.0 * mu) / (lambda + 2.0 * mu);
136 params.lambda_mu(uv, p, t, e, lambda, mu);
139 return lambda / (2.0 * (lambda + mu));
141 return lambda / (lambda + 2.0 * mu);
147 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1>
152 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1> res(
rows() *
cols());
157 assert(psii.size() == gradphij.rows());
158 assert(gradphij.cols() ==
rows());
160 for (
int k = 0; k < gradphij.rows(); ++k)
162 res -= psii(k) * gradphij.row(k) * data.
da(k);
175 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
185 for (
long p = 0; p < data.
da.size(); ++p)
190 res += -phii(p) * phij(p) * data.
da(p) / lambda;
196 return Eigen::Matrix<double, 1, 1>::Constant(res);
ElementAssemblyValues vals
std::string stress() const
stores per element basis values at given quadrature points and geometric mapping
std::vector< AssemblyValues > basis_values
void compute(const int el_index, const bool is_volume, const Eigen::MatrixXd &pts, const basis::ElementBases &basis, const basis::ElementBases &gbasis)
computes the per element values at the local (ref el) points (pts) sets basis_values,...
quadrature::Quadrature quadrature
void add_multimaterial(const int index, const json ¶ms, const Units &units) override
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > assemble(const LinearAssemblerData &data) const override
local assembly function that defines the bilinear form (LHS) computes and returns a single local stif...
std::map< std::string, ParamFunc > parameters() const override
void assign_stress_tensor(const OutputData &data, const int all_size, const ElasticityTensorType &type, Eigen::MatrixXd &all, const std::function< Eigen::MatrixXd(const Eigen::MatrixXd &)> &fun) const override
int rows() const override
int cols() const override
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > assemble(const MixedAssemblerData &data) const override
void add_multimaterial(const int index, const json ¶ms, const Units &units) override
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > assemble(const LinearAssemblerData &data) const override
local assembly function that defines the bilinear form (LHS) computes and returns a single local stif...
void lambda_mu(double px, double py, double pz, double x, double y, double z, double t, int el_id, double &lambda, double &mu) const
void add_multimaterial(const int index, const json ¶ms, const bool is_volume, const std::string &stress_unit)
const ElementAssemblyValues & vals
stores the evaluation for that element
const QuadratureVector & da
contains both the quadrature weight and the change of metric in the integral
const int i
first local order
const int j
second local order
const QuadratureVector & da
contains both the quadrature weight and the change of metric in the integral
const int i
first local order
const int j
second local order
const ElementAssemblyValues & phi_vals
stores the evaluation for that element
const ElementAssemblyValues & psi_vals
stores the evaluation for that element
const basis::ElementBases & bs
const Eigen::MatrixXd & fun
const Eigen::MatrixXd & local_pts
const basis::ElementBases & gbs
Eigen::MatrixXd pk2_from_cauchy(const Eigen::MatrixXd &stress, const Eigen::MatrixXd &F)
void compute_diplacement_grad(const int size, const ElementAssemblyValues &vals, const Eigen::MatrixXd &local_pts, const int p, const Eigen::MatrixXd &displacement, Eigen::MatrixXd &displacement_grad)
Eigen::MatrixXd pk1_from_cauchy(const Eigen::MatrixXd &stress, const Eigen::MatrixXd &F)
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd