PolyFEM
|
#include <HookeLinearElasticity.hpp>
Public Member Functions | |
HookeLinearElasticity () | |
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 stiffness value | |
double | compute_energy (const NonLinearAssemblerData &data) const override |
Eigen::MatrixXd | assemble_hessian (const NonLinearAssemblerData &data) const override |
Eigen::VectorXd | assemble_gradient (const NonLinearAssemblerData &data) const override |
VectorNd | compute_rhs (const AutodiffHessianPt &pt) const override |
void | set_size (const int size) override |
void | add_multimaterial (const int index, const json ¶ms, const Units &units) override |
const ElasticityTensor & | elasticity_tensor () const |
virtual bool | is_linear () const override |
bool | allow_inversion () const override |
std::string | name () 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 | 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 override |
assembles the stiffness matrix for the given basis the bilinear form (local assembler) is encoded by the overloaded assemble (see below) function that the subclass (eg Laplacian) defines sets stiffness and modifies cache if it has not already been computed | |
virtual Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 9, 1 > | assemble (const LinearAssemblerData &data) const=0 |
local assembly function that defines the bilinear form (LHS) computes and returns a single local stiffness value | |
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::LinearAssembler | |
LinearAssembler () | |
virtual | ~LinearAssembler ()=default |
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 override |
assembles the stiffness matrix for the given basis the bilinear form (local assembler) is encoded by the overloaded assemble (see below) function that the subclass (eg Laplacian) defines sets stiffness and modifies cache if it has not already been computed | |
Public Member Functions inherited from polyfem::assembler::Assembler | |
virtual | ~Assembler ()=default |
int | size () 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_multiply_mat (const OptAssemblerData &data, const Eigen::MatrixXd &mat, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const |
virtual void | compute_stress_grad_multiply_stress (const OptAssemblerData &data, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const |
virtual void | compute_stress_grad_multiply_vect (const OptAssemblerData &data, const Eigen::MatrixXd &vect, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) 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 void | update_lame_params (const Eigen::MatrixXd &lambdas, const Eigen::MatrixXd &mus) |
virtual bool | is_fluid () const |
Private Member Functions | |
template<typename T > | |
T | compute_energy_aux (const NonLinearAssemblerData &data) const |
Private 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 |
Private Member Functions inherited from polyfem::assembler::Assembler | |
virtual | ~Assembler ()=default |
int | size () 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_multiply_mat (const OptAssemblerData &data, const Eigen::MatrixXd &mat, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const |
virtual void | compute_stress_grad_multiply_stress (const OptAssemblerData &data, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const |
virtual void | compute_stress_grad_multiply_vect (const OptAssemblerData &data, const Eigen::MatrixXd &vect, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) 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 void | update_lame_params (const Eigen::MatrixXd &lambdas, const Eigen::MatrixXd &mus) |
virtual bool | is_fluid () const |
Private 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 Attributes | |
ElasticityTensor | elasticity_tensor_ |
Private Attributes inherited from polyfem::assembler::Assembler | |
int | size_ = -1 |
Private Attributes inherited from polyfem::assembler::ElasticityAssembler | |
bool | use_robust_jacobian = false |
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 |
Private 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 |
Definition at line 11 of file HookeLinearElasticity.hpp.
polyfem::assembler::HookeLinearElasticity::HookeLinearElasticity | ( | ) |
Definition at line 44 of file HookeLinearElasticity.cpp.
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 48 of file HookeLinearElasticity.cpp.
References elasticity_tensor_, entries, polyfem::assembler::ElasticityTensor::set_from_entries(), polyfem::assembler::ElasticityTensor::set_from_lambda_mu(), polyfem::assembler::ElasticityTensor::set_from_young_poisson(), polyfem::assembler::Assembler::size(), and polyfem::Units::stress().
Referenced by polyfem::assembler::MultiModel::add_multimaterial().
|
inlineoverridevirtual |
Implements polyfem::assembler::ElasticityAssembler.
Definition at line 42 of file HookeLinearElasticity.hpp.
|
overridevirtual |
assembles the stiffness matrix for the given basis the bilinear form (local assembler) is encoded by the overloaded assemble (see below) function that the subclass (eg Laplacian) defines sets stiffness and modifies cache if it has not already been computed
Reimplemented from polyfem::assembler::Assembler.
|
overridevirtual |
local assembly function that defines the bilinear form (LHS) computes and returns a single local stiffness value
Implements polyfem::assembler::LinearAssembler.
Definition at line 84 of file HookeLinearElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::assembler::ElasticityTensor::compute_stress(), polyfem::assembler::LinearAssemblerData::da, elasticity_tensor_, polyfem::assembler::LinearAssemblerData::i, polyfem::assembler::LinearAssemblerData::j, polyfem::assembler::ElementAssemblyValues::jac_it, polyfem::assembler::Assembler::size(), and polyfem::assembler::LinearAssemblerData::vals.
|
virtual |
local assembly function that defines the bilinear form (LHS) computes and returns a single local stiffness value
Implements polyfem::assembler::LinearAssembler.
|
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 307 of file HookeLinearElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::gradient_from_energy(), 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 325 of file HookeLinearElasticity.cpp.
References polyfem::assembler::ElementAssemblyValues::basis_values, polyfem::hessian_from_energy(), 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 199 of file HookeLinearElasticity.cpp.
References polyfem::assembler::OutputData::bs, polyfem::assembler::ElementAssemblyValues::compute(), polyfem::compute_diplacement_grad(), polyfem::assembler::ElasticityTensor::compute_stress(), polyfem::assembler::OutputData::el_id, elasticity_tensor_, polyfem::F, polyfem::assembler::OutputData::fun, polyfem::assembler::OutputData::gbs, polyfem::assembler::OutputData::local_pts, polyfem::PK1, polyfem::pk1_from_cauchy(), polyfem::PK2, polyfem::pk2_from_cauchy(), polyfem::assembler::Assembler::size(), and vals.
Referenced by polyfem::assembler::MultiModel::assign_stress_tensor().
|
overridevirtual |
Implements polyfem::assembler::NLAssembler.
Definition at line 302 of file HookeLinearElasticity.cpp.
Referenced by polyfem::assembler::MultiModel::compute_energy().
|
private |
Definition at line 343 of file HookeLinearElasticity.cpp.
References polyfem::compute_disp_grad_at_quad(), polyfem::assembler::NonLinearAssemblerData::da, elasticity_tensor_, polyfem::get_local_disp(), and polyfem::assembler::Assembler::size().
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 269 of file HookeLinearElasticity.cpp.
References elasticity_tensor_, polyfem::autogen::hooke_2d_function(), polyfem::autogen::hooke_3d_function(), and polyfem::assembler::Assembler::size().
|
inline |
Definition at line 39 of file HookeLinearElasticity.hpp.
References elasticity_tensor_.
Referenced by parameters().
|
inlineoverridevirtual |
Reimplemented from polyfem::assembler::LinearAssembler.
Definition at line 41 of file HookeLinearElasticity.hpp.
|
inlineoverridevirtual |
Implements polyfem::assembler::Assembler.
Definition at line 43 of file HookeLinearElasticity.hpp.
|
overridevirtual |
Implements polyfem::assembler::Assembler.
Definition at line 284 of file HookeLinearElasticity.cpp.
References elasticity_tensor(), and polyfem::assembler::Assembler::size().
|
overridevirtual |
Reimplemented from polyfem::assembler::Assembler.
Definition at line 77 of file HookeLinearElasticity.cpp.
References elasticity_tensor_, polyfem::assembler::ElasticityTensor::resize(), polyfem::assembler::Assembler::set_size(), and polyfem::assembler::Assembler::size().
Referenced by polyfem::assembler::MultiModel::set_size().
|
private |
Definition at line 53 of file HookeLinearElasticity.hpp.
Referenced by add_multimaterial(), assemble(), assign_stress_tensor(), compute_energy_aux(), compute_rhs(), elasticity_tensor(), and set_size().