14 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
20 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1> res(
size() *
size());
26 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> epsi(
size(),
size());
27 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> epsj(
size(),
size());
29 for (
long p = 0; p < gradi.rows(); ++p)
35 for (
int di = 0; di <
size(); ++di)
38 epsi.row(di) = gradi.row(p);
39 epsi = ((epsi + epsi.transpose()) / 2).eval();
40 for (
int dj = 0; dj <
size(); ++dj)
43 epsj.row(dj) = gradj.row(p);
44 epsj = ((epsj + epsj.transpose()) / 2.0).eval();
46 res(dj *
size() + di) += 2 * mu * (epsi.array() * epsj.array()).sum() * data.
da(p);
58 const auto t = data.
t;
64 const MatrixNd strain = (displacement_grad + displacement_grad.transpose()) / 2;
65 output.
native = 2 * mu * strain + lambda * strain.trace() * MatrixNd::Identity(
size(),
size());
71 std::map<std::string, ParamFunc> res;
78 params.lambda_mu(uv, p, t, e, lambda, mu);
85 params.lambda_mu(uv, p, t, e, lambda, mu);
91 params.lambda_mu(uv, p, t, e, lambda, mu);
94 return mu * (3.0 * lambda + 2.0 * mu) / (lambda + mu);
96 return 2 * mu * (2.0 * lambda + 2.0 * mu) / (lambda + 2.0 * mu);
102 params.lambda_mu(uv, p, t, e, lambda, mu);
105 return lambda / (2.0 * (lambda + mu));
107 return lambda / (lambda + 2.0 * mu);
113 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1>
118 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 3, 1> res(
rows() *
cols());
123 assert(psii.size() == gradphij.rows());
124 assert(gradphij.cols() ==
rows());
126 for (
int k = 0; k < gradphij.rows(); ++k)
128 res -= psii(k) * gradphij.row(k) * data.
da(k);
141 Eigen::Matrix<double, Eigen::Dynamic, 1, 0, 9, 1>
151 for (
long p = 0; p < data.
da.size(); ++p)
156 res += -phii(p) * phij(p) * data.
da(p) / lambda;
162 return Eigen::Matrix<double, 1, 1>::Constant(res);
ElementAssemblyValues vals
std::string stress() const
Scratch for one output point. All tensor storage has a fixed 3x3 capacity.
stores per element basis values at given quadrature points and geometric mapping
std::vector< AssemblyValues > basis_values
quadrature::Quadrature quadrature
void add_multimaterial(const int index, const json ¶ms, const Units &units, const io::ResourceIO &resources) 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
bool compute_output_stress(const OutputData &data, const ElementAssemblyValues &vals, Eigen::Index point, const MatrixNd &displacement_gradient, OutputStress &stress) const override
Return false to use a material's legacy assign_stress_tensor implementation.
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, const io::ResourceIO &resources) 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 io::ResourceIO &resources)
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 Eigen::MatrixXd & local_pts
Read-only interface to a hierarchical collection of simulation resources.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 3, 3 > MatrixNd
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd