35 std::string
name()
const override {
return "AMIPS"; }
36 std::map<std::string, ParamFunc>
parameters()
const override {
return std::map<std::string, ParamFunc>(); }
42 const std::function<Eigen::MatrixXd(
const Eigen::MatrixXd &)> &fun)
const override;
50 template <
int n_basis,
int dim>
52 template <
int n_basis,
int dim>
64 std::string
name()
const override {
return "AMIPSAutodiff"; }
65 std::map<std::string, ParamFunc>
parameters()
const override;
75 using MatrixNT = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3>;
77 MatrixNT
F = MatrixNT::Zero(
size(),
size());
78 for (
int i = 0; i <
size(); ++i)
80 for (
int j = 0; j <
size(); ++j)
82 for (
int k = 0; k <
size(); ++k)
92 return (
F.transpose() *
F).trace() / pow(J, 2. /
size());
std::map< std::string, ParamFunc > parameters() const override
std::vector< Eigen::MatrixXd > canonical_transformation_
void add_multimaterial(const int index, const json ¶ms, const Units &units) override
T elastic_energy(const RowVectorNd &p, const double t, const int el_id, const DefGradMatrix< T > &def_grad) const
std::string name() const override
double compute_energy(const NonLinearAssemblerData &data) const override
std::string name() const override
T compute_energy_aux(const NonLinearAssemblerData &data) const
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
void compute_energy_hessian_aux_fast(const NonLinearAssemblerData &data, Eigen::MatrixXd &H) const
void add_multimaterial(const int index, const json ¶ms, const Units &units) override
bool allow_inversion() const override
Eigen::MatrixXd assemble_hessian(const NonLinearAssemblerData &data) const override
void compute_energy_aux_gradient_fast(const NonLinearAssemblerData &data, Eigen::VectorXd &G_flattened) const
Eigen::VectorXd assemble_gradient(const NonLinearAssemblerData &data) const override
std::map< std::string, ParamFunc > parameters() 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
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3 > DefGradMatrix
T determinant(const Eigen::Matrix< T, rows, cols, option, maxRow, maxCol > &mat)
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd