PolyFEM
|
#include <MooneyRivlin3ParamSymbolic.hpp>
Public Member Functions | |
MooneyRivlin3ParamSymbolic () | |
const GenericMatParam & | c1 () const |
const GenericMatParam & | c2 () const |
const GenericMatParam & | c3 () const |
const GenericMatParam & | d1 () const |
double | compute_energy (const NonLinearAssemblerData &data) const override |
Eigen::VectorXd | assemble_gradient (const NonLinearAssemblerData &data) const override |
Eigen::MatrixXd | assemble_hessian (const NonLinearAssemblerData &data) const override |
void | add_multimaterial (const int index, const json ¶ms, const Units &units) override |
std::string | name () const override |
bool | allow_inversion () const override |
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 |
void | compute_stress_grad_multiply_mat (const OptAssemblerData &data, const Eigen::MatrixXd &mat, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override |
void | compute_stress_grad_multiply_stress (const OptAssemblerData &data, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override |
void | compute_stress_grad_multiply_vect (const OptAssemblerData &data, const Eigen::MatrixXd &vect, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override |
template<int n_basis, int dim> | |
void | compute_energy_aux_gradient_fast (const NonLinearAssemblerData &data, Eigen::Matrix< double, Eigen::Dynamic, 1 > &G_flattened) const |
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 |
virtual Eigen::VectorXd | assemble_gradient (const NonLinearAssemblerData &data) const=0 |
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 |
virtual Eigen::MatrixXd | assemble_hessian (const NonLinearAssemblerData &data) const=0 |
Public Member Functions inherited from polyfem::assembler::NLAssembler | |
virtual | ~NLAssembler ()=default |
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 |
Eigen::VectorXd | assemble_energy_per_element (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 |
virtual bool | is_linear () const override |
Public Member Functions inherited from polyfem::assembler::Assembler | |
virtual | ~Assembler ()=default |
int | size () const |
virtual void | set_size (const int size) |
virtual void | assemble (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, StiffnessMatrix &stiffness, const bool is_mass=false) const |
virtual void | compute_stiffness_value (const double t, const assembler::ElementAssemblyValues &vals, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &displacement, Eigen::MatrixXd &tensor) const |
virtual void | compute_dstress_dmu_dlambda (const OptAssemblerData &data, Eigen::MatrixXd &dstress_dmu, Eigen::MatrixXd &dstress_dlambda) const |
virtual void | compute_stress_grad (const OptAssemblerData &data, const Eigen::MatrixXd &prev_grad_u_i, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const |
virtual void | compute_stress_prev_grad (const OptAssemblerData &data, const Eigen::MatrixXd &prev_grad_u_i, Eigen::MatrixXd &result) const |
virtual VectorNd | compute_rhs (const AutodiffHessianPt &pt) const |
virtual Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > | kernel (const int dim, const AutodiffGradPt &rvect, const AutodiffScalarGrad &r) const |
void | set_materials (const std::vector< int > &body_ids, const json &body_params, const Units &units) |
virtual void | update_lame_params (const Eigen::MatrixXd &lambdas, const Eigen::MatrixXd &mus) |
virtual bool | is_fluid () const |
Public Member Functions inherited from polyfem::assembler::ElasticityAssembler | |
ElasticityAssembler () | |
virtual | ~ElasticityAssembler ()=default |
void | set_use_robust_jacobian () |
void | compute_scalar_value (const OutputData &data, std::vector< NamedMatrix > &result) const override |
void | compute_tensor_value (const OutputData &data, std::vector< NamedMatrix > &result) const override |
void | compute_stress_tensor (const OutputData &data, const ElasticityTensorType &type, Eigen::MatrixXd &stresses) const |
void | compute_von_mises_stresses (const OutputData &data, Eigen::MatrixXd &stresses) const |
bool | is_solution_displacement () const override |
bool | is_tensor () const override |
Private Member Functions | |
template<typename T > | |
T | compute_energy_aux (const NonLinearAssemblerData &data) const |
template<int n_basis, int dim> | |
void | compute_energy_hessian_aux_fast (const NonLinearAssemblerData &data, Eigen::MatrixXd &H) const |
template<int n_basis, int dim> | |
void | compute_energy_aux_gradient_fast (const NonLinearAssemblerData &data, Eigen::VectorXd &G_flattened) const |
template<typename T > | |
T | elastic_energy (const RowVectorNd &p, const int el_id, const AutoDiffGradMat< T > &def_grad) const |
void | get_grad_hess_symbolic (const double c1, const double c2, const double c3, const double d1, const Eigen::MatrixXd &def_grad, Eigen::MatrixXd &grad, Eigen::MatrixXd &hess) const |
void | get_grad_hess_autodiff (const double c1, const double c2, const double c3, const double d1, const Eigen::MatrixXd &global_pts, const int el_id, const Eigen::MatrixXd &F, Eigen::MatrixXd &grad, Eigen::MatrixXd &hess) const |
Private Attributes | |
GenericMatParam | c1_ |
GenericMatParam | c2_ |
GenericMatParam | c3_ |
GenericMatParam | d1_ |
Additional Inherited Members | |
Public Types inherited from polyfem::assembler::Assembler | |
typedef std::pair< std::string, Eigen::MatrixXd > | NamedMatrix |
typedef std::function< double(const RowVectorNd &, const RowVectorNd &, double, int)> | ParamFunc |
Protected Attributes inherited from polyfem::assembler::Assembler | |
int | size_ = -1 |
Protected Attributes inherited from polyfem::assembler::ElasticityAssembler | |
bool | use_robust_jacobian = false |
Definition at line 16 of file MooneyRivlin3ParamSymbolic.hpp.
polyfem::assembler::MooneyRivlin3ParamSymbolic::MooneyRivlin3ParamSymbolic | ( | ) |
Definition at line 8 of file MooneyRivlin3ParamSymbolic.cpp.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 559 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::assembler::GenericMatParam::add_multimaterial(), c1_, c2_, c3_, d1_, and polyfem::Units::stress().
|
inlineoverridevirtual |
Implements polyfem::assembler::ElasticityAssembler.
Definition at line 39 of file MooneyRivlin3ParamSymbolic.hpp.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 244 of file Assembler.cpp.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
|
overridevirtual |
Implements polyfem::assembler::NLAssembler.
Definition at line 14 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::Assembler::size(), and polyfem::assembler::NonLinearAssemblerData::vals.
|
virtual |
Implements polyfem::assembler::NLAssembler.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
|
overridevirtual |
Implements polyfem::assembler::NLAssembler.
Definition at line 84 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::Assembler::size(), and polyfem::assembler::NonLinearAssemblerData::vals.
|
virtual |
Implements polyfem::assembler::NLAssembler.
|
overridevirtual |
Implements polyfem::assembler::ElasticityAssembler.
Definition at line 161 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::assembler::OutputData::bs, c1(), c1_, c2(), c2_, c3(), c3_, polyfem::assembler::ElementAssemblyValues::compute(), polyfem::compute_diplacement_grad(), d1(), d1_, polyfem::assembler::OutputData::el_id, polyfem::F, polyfem::assembler::OutputData::fun, polyfem::assembler::OutputData::gbs, polyfem::autogen::generate_gradient(), polyfem::assembler::OutputData::local_pts, polyfem::PK1, polyfem::pk1_from_cauchy(), polyfem::PK2, polyfem::pk2_from_cauchy(), polyfem::assembler::Assembler::size(), polyfem::assembler::OutputData::t, and vals.
|
inline |
Definition at line 25 of file MooneyRivlin3ParamSymbolic.hpp.
References c1_.
Referenced by assign_stress_tensor(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), elastic_energy(), get_grad_hess_symbolic(), and parameters().
|
inline |
Definition at line 26 of file MooneyRivlin3ParamSymbolic.hpp.
References c2_.
Referenced by assign_stress_tensor(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), elastic_energy(), get_grad_hess_symbolic(), and parameters().
|
inline |
Definition at line 27 of file MooneyRivlin3ParamSymbolic.hpp.
References c3_.
Referenced by assign_stress_tensor(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), elastic_energy(), get_grad_hess_symbolic(), and parameters().
|
overridevirtual |
Implements polyfem::assembler::NLAssembler.
Definition at line 372 of file MooneyRivlin3ParamSymbolic.cpp.
|
private |
Definition at line 378 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::compute_disp_grad_at_quad(), polyfem::assembler::NonLinearAssemblerData::da, elastic_energy(), polyfem::assembler::ElementAssemblyValues::element_id, polyfem::get_local_disp(), polyfem::assembler::Assembler::size(), val, polyfem::assembler::ElementAssemblyValues::val, and polyfem::assembler::NonLinearAssemblerData::vals.
void polyfem::assembler::MooneyRivlin3ParamSymbolic::compute_energy_aux_gradient_fast | ( | const NonLinearAssemblerData & | data, |
Eigen::Matrix< double, Eigen::Dynamic, 1 > & | G_flattened | ||
) | const |
Definition at line 404 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, c1(), c1_, c2(), c2_, c3(), c3_, d1(), d1_, polyfem::assembler::NonLinearAssemblerData::da, polyfem::assembler::ElementAssemblyValues::element_id, polyfem::assembler::ElementAssemblyValues::jac_it, polyfem::assembler::Assembler::size(), polyfem::assembler::ElementAssemblyValues::val, polyfem::assembler::NonLinearAssemblerData::vals, and polyfem::assembler::NonLinearAssemblerData::x.
|
private |
|
private |
Definition at line 467 of file MooneyRivlin3ParamSymbolic.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, c1(), c1_, c2(), c2_, c3(), c3_, d1(), d1_, polyfem::assembler::NonLinearAssemblerData::da, polyfem::assembler::ElementAssemblyValues::element_id, polyfem::assembler::ElementAssemblyValues::jac_it, polyfem::assembler::Assembler::size(), polyfem::assembler::ElementAssemblyValues::val, polyfem::assembler::NonLinearAssemblerData::vals, and polyfem::assembler::NonLinearAssemblerData::x.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 215 of file MooneyRivlin3ParamSymbolic.cpp.
References c1(), c1_, c2(), c2_, c3(), c3_, d1(), d1_, polyfem::assembler::OptAssemblerData::el_id, polyfem::F, get_grad_hess_symbolic(), polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::OptAssemblerData::local_pts, polyfem::assembler::Assembler::size(), and polyfem::assembler::OptAssemblerData::t.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 247 of file MooneyRivlin3ParamSymbolic.cpp.
References c1(), c1_, c2(), c2_, c3(), c3_, d1(), d1_, polyfem::assembler::OptAssemblerData::el_id, polyfem::F, get_grad_hess_symbolic(), polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::OptAssemblerData::local_pts, polyfem::assembler::Assembler::size(), and polyfem::assembler::OptAssemblerData::t.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 277 of file MooneyRivlin3ParamSymbolic.cpp.
References c1(), c1_, c2(), c2_, c3(), c3_, d1(), d1_, polyfem::assembler::OptAssemblerData::el_id, polyfem::F, get_grad_hess_symbolic(), polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::OptAssemblerData::local_pts, polyfem::assembler::Assembler::size(), and polyfem::assembler::OptAssemblerData::t.
|
inline |
Definition at line 28 of file MooneyRivlin3ParamSymbolic.hpp.
References d1_.
Referenced by assign_stress_tensor(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), elastic_energy(), get_grad_hess_symbolic(), and parameters().
|
private |
Definition at line 317 of file MooneyRivlin3ParamSymbolic.cpp.
References c1(), c1_, c2(), c2_, c3(), c3_, d1(), d1_, polyfem::utils::determinant(), polyfem::first_invariant(), polyfem::second_invariant(), polyfem::assembler::Assembler::size(), and val.
Referenced by compute_energy_aux(), and get_grad_hess_autodiff().
|
private |
Definition at line 352 of file MooneyRivlin3ParamSymbolic.cpp.
References elastic_energy(), polyfem::F, DiffScalarBase::setVariableCount(), and polyfem::assembler::Assembler::size().
|
private |
Definition at line 342 of file MooneyRivlin3ParamSymbolic.cpp.
References c1(), c2(), c3(), d1(), polyfem::F, polyfem::autogen::generate_gradient(), and polyfem::autogen::generate_hessian().
Referenced by compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), and compute_stress_grad_multiply_vect().
|
inlineoverridevirtual |
Implements polyfem::assembler::Assembler.
Definition at line 38 of file MooneyRivlin3ParamSymbolic.hpp.
|
overridevirtual |
Implements polyfem::assembler::Assembler.
Definition at line 567 of file MooneyRivlin3ParamSymbolic.cpp.
References c1(), c2(), c3(), and d1().
|
private |
Definition at line 63 of file MooneyRivlin3ParamSymbolic.hpp.
Referenced by add_multimaterial(), assign_stress_tensor(), c1(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), and elastic_energy().
|
private |
Definition at line 64 of file MooneyRivlin3ParamSymbolic.hpp.
Referenced by add_multimaterial(), assign_stress_tensor(), c2(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), and elastic_energy().
|
private |
Definition at line 65 of file MooneyRivlin3ParamSymbolic.hpp.
Referenced by add_multimaterial(), assign_stress_tensor(), c3(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), and elastic_energy().
|
private |
Definition at line 66 of file MooneyRivlin3ParamSymbolic.hpp.
Referenced by add_multimaterial(), assign_stress_tensor(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), d1(), and elastic_energy().