PolyFEM
|
#include <NeoHookeanElasticity.hpp>
Public Member Functions | |
NeoHookeanElasticity () | |
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 |
VectorNd | compute_rhs (const AutodiffHessianPt &pt) const override |
void | compute_stiffness_value (const double t, const assembler::ElementAssemblyValues &vals, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &displacement, Eigen::MatrixXd &tensor) 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 |
void | compute_dstress_dmu_dlambda (const OptAssemblerData &data, Eigen::MatrixXd &dstress_dmu, Eigen::MatrixXd &dstress_dlambda) const override |
void | add_multimaterial (const int index, const json ¶ms, const Units &units) override |
void | set_params (const LameParameters ¶ms) |
const LameParameters & | lame_params () const |
void | update_lame_params (const Eigen::MatrixXd &lambdas, const Eigen::MatrixXd &mus) 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 |
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_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 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 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 |
Private Attributes | |
LameParameters | params_ |
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 11 of file NeoHookeanElasticity.hpp.
polyfem::assembler::NeoHookeanElasticity::NeoHookeanElasticity | ( | ) |
Definition at line 18 of file NeoHookeanElasticity.cpp.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 22 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::LameParameters::add_multimaterial(), params_, polyfem::assembler::Assembler::size(), and polyfem::Units::stress().
Referenced by polyfem::assembler::MultiModel::add_multimaterial().
|
inlineoverridevirtual |
Implements polyfem::assembler::ElasticityAssembler.
Definition at line 65 of file NeoHookeanElasticity.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 50 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::Assembler::size(), and polyfem::assembler::NonLinearAssemblerData::vals.
Referenced by polyfem::assembler::MultiModel::assemble_gradient().
|
virtual |
Implements polyfem::assembler::NLAssembler.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
|
overridevirtual |
Implements polyfem::assembler::NLAssembler.
Definition at line 177 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::Assembler::size(), and polyfem::assembler::NonLinearAssemblerData::vals.
Referenced by polyfem::assembler::MultiModel::assemble_hessian().
|
virtual |
Implements polyfem::assembler::NLAssembler.
|
overridevirtual |
Implements polyfem::assembler::ElasticityAssembler.
Definition at line 254 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::OutputData::bs, polyfem::assembler::ElementAssemblyValues::compute(), polyfem::compute_diplacement_grad(), polyfem::assembler::OutputData::el_id, polyfem::F, polyfem::assembler::OutputData::fun, polyfem::assembler::OutputData::gbs, polyfem::assembler::LameParameters::lambda_mu(), polyfem::assembler::OutputData::local_pts, params_, polyfem::PK1, polyfem::pk1_from_cauchy(), polyfem::PK2, polyfem::pk2_from_cauchy(), polyfem::assembler::Assembler::size(), polyfem::assembler::OutputData::t, and vals.
Referenced by polyfem::assembler::MultiModel::assign_stress_tensor().
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 719 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::OptAssemblerData::el_id, polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::OptAssemblerData::local_pts, and polyfem::assembler::OptAssemblerData::t.
|
overridevirtual |
Implements polyfem::assembler::NLAssembler.
Definition at line 303 of file NeoHookeanElasticity.cpp.
Referenced by polyfem::assembler::MultiModel::compute_energy().
|
private |
Definition at line 310 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::compute_disp_grad_at_quad(), polyfem::assembler::NonLinearAssemblerData::da, polyfem::utils::determinant(), polyfem::assembler::ElementAssemblyValues::element_id, polyfem::assembler::ElementAssemblyValues::eval_deformed_jacobian_determinant(), polyfem::get_local_disp(), polyfem::assembler::ElementAssemblyValues::jac_it, polyfem::assembler::LameParameters::lambda_mu(), params_, polyfem::quadrature::Quadrature::points, polyfem::assembler::ElementAssemblyValues::quadrature, polyfem::assembler::Assembler::size(), polyfem::assembler::NonLinearAssemblerData::t, polyfem::assembler::ElasticityAssembler::use_robust_jacobian, val, polyfem::assembler::ElementAssemblyValues::val, polyfem::assembler::NonLinearAssemblerData::vals, and polyfem::assembler::NonLinearAssemblerData::x.
void polyfem::assembler::NeoHookeanElasticity::compute_energy_aux_gradient_fast | ( | const NonLinearAssemblerData & | data, |
Eigen::Matrix< double, Eigen::Dynamic, 1 > & | G_flattened | ||
) | const |
Definition at line 422 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::NonLinearAssemblerData::da, polyfem::assembler::ElementAssemblyValues::element_id, polyfem::assembler::ElementAssemblyValues::eval_deformed_jacobian_determinant(), polyfem::assembler::ElementAssemblyValues::jac_it, polyfem::assembler::LameParameters::lambda_mu(), params_, polyfem::quadrature::Quadrature::points, polyfem::assembler::ElementAssemblyValues::quadrature, polyfem::assembler::Assembler::size(), polyfem::assembler::NonLinearAssemblerData::t, polyfem::assembler::ElasticityAssembler::use_robust_jacobian, val, polyfem::assembler::ElementAssemblyValues::val, polyfem::assembler::NonLinearAssemblerData::vals, and polyfem::assembler::NonLinearAssemblerData::x.
|
private |
|
private |
Definition at line 517 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::NonLinearAssemblerData::da, polyfem::assembler::ElementAssemblyValues::element_id, polyfem::assembler::ElementAssemblyValues::eval_deformed_jacobian_determinant(), polyfem::assembler::ElementAssemblyValues::jac_it, polyfem::assembler::LameParameters::lambda_mu(), params_, polyfem::quadrature::Quadrature::points, polyfem::assembler::ElementAssemblyValues::quadrature, polyfem::assembler::Assembler::size(), polyfem::assembler::NonLinearAssemblerData::t, polyfem::assembler::ElasticityAssembler::use_robust_jacobian, val, polyfem::assembler::ElementAssemblyValues::val, polyfem::assembler::NonLinearAssemblerData::vals, and polyfem::assembler::NonLinearAssemblerData::x.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 30 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::LameParameters::lambda_mu(), polyfem::autogen::neo_hookean_2d_function(), polyfem::autogen::neo_hookean_3d_function(), params_, and polyfem::assembler::Assembler::size().
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 119 of file NeoHookeanElasticity.cpp.
References polyfem::compute_diplacement_grad(), polyfem::utils::flatten(), polyfem::assembler::LameParameters::lambda_mu(), params_, polyfem::assembler::Assembler::size(), and vals.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 632 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::OptAssemblerData::el_id, polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::LameParameters::lambda_mu(), polyfem::assembler::OptAssemblerData::local_pts, params_, and polyfem::assembler::OptAssemblerData::t.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 654 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::OptAssemblerData::el_id, polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::LameParameters::lambda_mu(), polyfem::assembler::OptAssemblerData::local_pts, params_, and polyfem::assembler::OptAssemblerData::t.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 675 of file NeoHookeanElasticity.cpp.
References polyfem::assembler::OptAssemblerData::el_id, polyfem::assembler::OptAssemblerData::global_pts, polyfem::assembler::OptAssemblerData::grad_u_i, polyfem::assembler::LameParameters::lambda_mu(), polyfem::assembler::OptAssemblerData::local_pts, params_, polyfem::assembler::Assembler::size(), and polyfem::assembler::OptAssemblerData::t.
|
inline |
Definition at line 56 of file NeoHookeanElasticity.hpp.
References params_.
|
inlineoverridevirtual |
Implements polyfem::assembler::Assembler.
Definition at line 64 of file NeoHookeanElasticity.hpp.
|
overridevirtual |
Implements polyfem::assembler::Assembler.
Definition at line 736 of file NeoHookeanElasticity.cpp.
References params_, and polyfem::assembler::Assembler::size().
|
inline |
Definition at line 55 of file NeoHookeanElasticity.hpp.
References params_.
|
inlineoverridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 58 of file NeoHookeanElasticity.hpp.
References polyfem::assembler::LameParameters::lambda_mat_, polyfem::assembler::LameParameters::mu_mat_, and params_.
|
private |
Definition at line 75 of file NeoHookeanElasticity.hpp.
Referenced by add_multimaterial(), assign_stress_tensor(), compute_energy_aux(), compute_energy_aux_gradient_fast(), compute_energy_hessian_aux_fast(), compute_rhs(), compute_stiffness_value(), compute_stress_grad_multiply_mat(), compute_stress_grad_multiply_stress(), compute_stress_grad_multiply_vect(), lame_params(), parameters(), set_params(), and update_lame_params().