10 using DefGradMatrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3>;
12 template <
typename Derived>
32 const std::function<Eigen::MatrixXd(
const Eigen::MatrixXd &)> &fun)
const override;
35 const Eigen::MatrixXd &mat,
36 Eigen::MatrixXd &stress,
37 Eigen::MatrixXd &result)
const override;
40 Eigen::MatrixXd &stress,
41 Eigen::MatrixXd &result)
const override;
44 const Eigen::MatrixXd &vect,
45 Eigen::MatrixXd &stress,
46 Eigen::MatrixXd &result)
const override;
49 Derived &
derived() {
return static_cast<Derived &
>(*this); }
51 const Derived &
derived()
const {
return static_cast<const Derived &
>(*this); }
63 typedef Eigen::Matrix<T, Eigen::Dynamic, 1>
AutoDiffVect;
64 typedef Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3>
AutoDiffGradMat;
73 const int n_pts = data.
da.size();
74 for (
long p = 0; p < n_pts; ++p)
79 for (
int d = 0; d <
size(); ++d)
80 def_grad(d, d) += T(1);
84 energy +=
val * data.
da(p);
void compute_stress_grad_multiply_stress(const OptAssemblerData &data, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) 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
Derived & derived()
Returns this as a reference to derived class.
const Derived & derived() const
Returns this as a const reference to derived class.
virtual ~GenericElastic()=default
Eigen::MatrixXd assemble_hessian(const NonLinearAssemblerData &data) const override
virtual void add_multimaterial(const int index, const json ¶ms, const Units &units) override=0
void compute_stress_grad_multiply_vect(const OptAssemblerData &data, const Eigen::MatrixXd &vect, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override
Eigen::VectorXd assemble_gradient(const NonLinearAssemblerData &data) const override
bool allow_inversion() const override
double compute_energy(const NonLinearAssemblerData &data) const override
T compute_energy_aux(const NonLinearAssemblerData &data) const
void compute_stress_grad_multiply_mat(const OptAssemblerData &data, const Eigen::MatrixXd &mat, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override
double assemble_energy(const bool is_volume, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const AssemblyValsCache &cache, const double t, const double dt, const Eigen::MatrixXd &displacement, const Eigen::MatrixXd &displacement_prev) const override
void assemble_gradient(const bool is_volume, const int n_basis, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const AssemblyValsCache &cache, const double t, const double dt, const Eigen::MatrixXd &displacement, const Eigen::MatrixXd &displacement_prev, Eigen::MatrixXd &rhs) const override
void assemble_hessian(const bool is_volume, const int n_basis, const bool project_to_psd, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const AssemblyValsCache &cache, const double t, const double dt, const Eigen::MatrixXd &displacement, const Eigen::MatrixXd &displacement_prev, utils::MatrixCache &mat_cache, StiffnessMatrix &grad) const override
const ElementAssemblyValues & vals
const QuadratureVector & da
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3 > DefGradMatrix
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3 > AutoDiffGradMat
Eigen::Matrix< T, Eigen::Dynamic, 1 > AutoDiffVect
void compute_disp_grad_at_quad(const assembler::NonLinearAssemblerData &data, const AutoDiffVect &local_disp, const int p, const int size, AutoDiffGradMat &def_grad)
void get_local_disp(const assembler::NonLinearAssemblerData &data, const int size, AutoDiffVect &local_disp)