PolyFEM
Loading...
Searching...
No Matches
polyfem::assembler::ElasticityAssembler Class Referenceabstract

#include <Assembler.hpp>

Inheritance diagram for polyfem::assembler::ElasticityAssembler:
[legend]
Collaboration diagram for polyfem::assembler::ElasticityAssembler:
[legend]

Classes

class  OutputStress
 Scratch for one output point. All tensor storage has a fixed 3x3 capacity. More...
 

Public Member Functions

 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_output_values (const OutputData &data, std::vector< NamedMatrix > *scalar, std::vector< NamedMatrix > *tensor) const override
 Evaluate requested output families together using element-local scratch.
 
void compute_stress_tensor (const OutputData &data, const ElasticityTensorType &type, Eigen::MatrixXd &stresses) const
 
void compute_energy_density (const OutputData &data, Eigen::MatrixXd &energy) const
 Elastic energy density at data.local_pts, one row per point.
 
void compute_von_mises_stresses (const OutputData &data, Eigen::MatrixXd &stresses) const
 
bool is_solution_displacement () const override
 
bool is_tensor () const override
 
virtual bool allow_inversion () const =0
 
virtual 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
 
- Public Member Functions inherited from polyfem::assembler::Assembler
virtual ~Assembler ()=default
 
virtual std::string name () const =0
 
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 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
 
virtual 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
 
virtual 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
 
virtual 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
 
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 std::map< std::string, ParamFunc > parameters () const =0
 
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, const io::ResourceIO &resources)
 
virtual void add_multimaterial (const int index, const json &params, const Units &units, const io::ResourceIO &resources)
 
virtual void update_lame_params (const Eigen::MatrixXd &lambdas, const Eigen::MatrixXd &mus)
 
virtual bool is_linear () const =0
 
virtual bool is_fluid () const
 

Protected Member Functions

virtual bool compute_output_stress (const OutputData &data, const ElementAssemblyValues &vals, Eigen::Index point, const MatrixNd &displacement_gradient, OutputStress &stress) const
 Return false to use a material's legacy assign_stress_tensor implementation.
 
bool evaluate_output_stress (const OutputData &data, bool need_stress, bool need_energy, const std::function< void(Eigen::Index, OutputStress &)> &emit) const
 

Protected Attributes

bool use_robust_jacobian = false
 
- Protected Attributes inherited from polyfem::assembler::Assembler
int size_ = -1
 

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
 

Detailed Description

Definition at line 429 of file Assembler.hpp.

Constructor & Destructor Documentation

◆ ElasticityAssembler()

polyfem::assembler::ElasticityAssembler::ElasticityAssembler ( )
inline

Definition at line 432 of file Assembler.hpp.

◆ ~ElasticityAssembler()

virtual polyfem::assembler::ElasticityAssembler::~ElasticityAssembler ( )
virtualdefault

Member Function Documentation

◆ allow_inversion()

◆ assign_stress_tensor()

void polyfem::assembler::ElasticityAssembler::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
virtual

Reimplemented in polyfem::assembler::MultiModel, and polyfem::assembler::SumModel.

Definition at line 102 of file Assembler.cpp.

References polyfem::assembler::ElasticityAssembler::OutputStress::energy, polyfem::ENERGY, evaluate_output_stress(), polyfem::F, polyfem::assembler::ElasticityAssembler::OutputStress::has_stress, polyfem::assembler::OutputData::local_pts, polyfem::log_and_throw_error(), polyfem::assembler::Assembler::name(), polyfem::assembler::Assembler::size(), and polyfem::assembler::ElasticityAssembler::OutputStress::tensor().

Referenced by compute_energy_density(), compute_stress_tensor(), and compute_von_mises_stresses().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_energy_density()

void polyfem::assembler::ElasticityAssembler::compute_energy_density ( const OutputData &  data,
Eigen::MatrixXd &  energy 
) const
inline

Elastic energy density at data.local_pts, one row per point.

Definition at line 455 of file Assembler.hpp.

References assign_stress_tensor(), and polyfem::ENERGY.

Referenced by compute_output_values().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_output_stress()

virtual bool polyfem::assembler::ElasticityAssembler::compute_output_stress ( const OutputData &  data,
const ElementAssemblyValues &  vals,
Eigen::Index  point,
const MatrixNd &  displacement_gradient,
OutputStress &  stress 
) const
inlineprotectedvirtual

◆ compute_output_values()

void polyfem::assembler::ElasticityAssembler::compute_output_values ( const OutputData &  data,
std::vector< NamedMatrix > *  scalar,
std::vector< NamedMatrix > *  tensor 
) const
overridevirtual

Evaluate requested output families together using element-local scratch.

Reimplemented from polyfem::assembler::Assembler.

Reimplemented in polyfem::assembler::MultiModel, and polyfem::assembler::SumModel.

Definition at line 134 of file Assembler.cpp.

References polyfem::CAUCHY, compute_energy_density(), compute_stress_tensor(), compute_von_mises_stresses(), polyfem::assembler::ElasticityAssembler::OutputStress::deformation(), polyfem::assembler::ElasticityAssembler::OutputStress::energy, evaluate_output_stress(), polyfem::F, polyfem::assembler::ElasticityAssembler::OutputStress::has_stress, polyfem::assembler::OutputData::local_pts, polyfem::assembler::Assembler::size(), polyfem::assembler::ElasticityAssembler::OutputStress::tensor(), and polyfem::von_mises_stress_for_stress_tensor().

Referenced by compute_scalar_value(), and compute_tensor_value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_scalar_value()

void polyfem::assembler::ElasticityAssembler::compute_scalar_value ( const OutputData &  data,
std::vector< NamedMatrix > &  result 
) const
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 124 of file Assembler.cpp.

References compute_output_values().

Here is the call graph for this function:

◆ compute_stress_tensor()

void polyfem::assembler::ElasticityAssembler::compute_stress_tensor ( const OutputData &  data,
const ElasticityTensorType &  type,
Eigen::MatrixXd &  stresses 
) const
inline

Definition at line 442 of file Assembler.hpp.

References assign_stress_tensor(), polyfem::ENERGY, and polyfem::assembler::Assembler::size().

Referenced by compute_output_values().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_tensor_value()

void polyfem::assembler::ElasticityAssembler::compute_tensor_value ( const OutputData &  data,
std::vector< NamedMatrix > &  result 
) const
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 129 of file Assembler.cpp.

References compute_output_values().

Here is the call graph for this function:

◆ compute_von_mises_stresses()

void polyfem::assembler::ElasticityAssembler::compute_von_mises_stresses ( const OutputData &  data,
Eigen::MatrixXd &  stresses 
) const
inline

Definition at line 461 of file Assembler.hpp.

References assign_stress_tensor(), polyfem::CAUCHY, and polyfem::von_mises_stress_for_stress_tensor().

Referenced by compute_output_values().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ evaluate_output_stress()

bool polyfem::assembler::ElasticityAssembler::evaluate_output_stress ( const OutputData &  data,
bool  need_stress,
bool  need_energy,
const std::function< void(Eigen::Index, OutputStress &)> &  emit 
) const
protected

Definition at line 75 of file Assembler.cpp.

References polyfem::basis::ElementBases::bases, polyfem::assembler::OutputData::bs, polyfem::assembler::ElementAssemblyValues::compute(), compute_output_stress(), polyfem::assembler::OutputData::el_id, polyfem::assembler::OutputData::fun, polyfem::assembler::OutputData::gbs, polyfem::assembler::OutputData::local_pts, polyfem::assembler::ElasticityAssembler::OutputStress::needs_energy, polyfem::assembler::ElasticityAssembler::OutputStress::needs_stress, polyfem::assembler::Assembler::size(), and vals.

Referenced by assign_stress_tensor(), and compute_output_values().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_solution_displacement()

bool polyfem::assembler::ElasticityAssembler::is_solution_displacement ( ) const
inlineoverridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 471 of file Assembler.hpp.

◆ is_tensor()

bool polyfem::assembler::ElasticityAssembler::is_tensor ( ) const
inlineoverridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 472 of file Assembler.hpp.

◆ set_use_robust_jacobian()

void polyfem::assembler::ElasticityAssembler::set_use_robust_jacobian ( )

Definition at line 1437 of file Assembler.cpp.

References polyfem::logger(), and use_robust_jacobian.

Here is the call graph for this function:

Member Data Documentation

◆ use_robust_jacobian


The documentation for this class was generated from the following files: