PolyFEM
Loading...
Searching...
No Matches
polyfem::assembler::SaintVenantElasticity Class Reference

#include <SaintVenantElasticity.hpp>

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

Public Member Functions

 SaintVenantElasticity ()
 
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 set_size (const int size) override
 
void set_stiffness_tensor (int i, int j, const double val)
 
double stifness_tensor (int i, int j) const
 
void add_multimaterial (const int index, const json &params, const Units &units) override
 
std::string name () const override
 
bool allow_inversion () const override
 
std::map< std::string, ParamFuncparameters () 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
 
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
 
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
 
virtual bool is_linear () const override
 
- Public Member Functions inherited from polyfem::assembler::Assembler
virtual ~Assembler ()=default
 
int size () const
 
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_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 , unsigned long N>
stress (const std::array< T, N > &strain, const int j) const
 
template<typename T >
compute_energy_aux (const NonLinearAssemblerData &data) 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 Member Functions inherited from polyfem::assembler::Assembler
virtual ~Assembler ()=default
 
int size () const
 
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_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 Attributes

ElasticityTensor elasticity_tensor_
 
- Private Attributes inherited from polyfem::assembler::ElasticityAssembler
bool use_robust_jacobian = false
 
- Private 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
 
- 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
 

Detailed Description

Definition at line 11 of file SaintVenantElasticity.hpp.

Constructor & Destructor Documentation

◆ SaintVenantElasticity()

polyfem::assembler::SaintVenantElasticity::SaintVenantElasticity ( )

Definition at line 22 of file SaintVenantElasticity.cpp.

Member Function Documentation

◆ add_multimaterial()

void polyfem::assembler::SaintVenantElasticity::add_multimaterial ( const int  index,
const json params,
const Units units 
)
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 26 of file SaintVenantElasticity.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().

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

◆ allow_inversion()

bool polyfem::assembler::SaintVenantElasticity::allow_inversion ( ) const
inlineoverridevirtual

Implements polyfem::assembler::ElasticityAssembler.

Definition at line 34 of file SaintVenantElasticity.hpp.

◆ assemble_energy()

double polyfem::assembler::NLAssembler::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
overridevirtual

Reimplemented from polyfem::assembler::NLAssembler.

Definition at line 244 of file Assembler.cpp.

◆ assemble_gradient() [1/3]

void polyfem::assembler::NLAssembler::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
overridevirtual

Reimplemented from polyfem::assembler::NLAssembler.

◆ assemble_gradient() [2/3]

Eigen::VectorXd polyfem::assembler::SaintVenantElasticity::assemble_gradient ( const NonLinearAssemblerData data) const
overridevirtual

Implements polyfem::assembler::NLAssembler.

Definition at line 89 of file SaintVenantElasticity.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().

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

◆ assemble_gradient() [3/3]

virtual Eigen::VectorXd polyfem::assembler::NLAssembler::assemble_gradient ( const NonLinearAssemblerData data) const
virtual

◆ assemble_hessian() [1/3]

void polyfem::assembler::NLAssembler::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
overridevirtual

Reimplemented from polyfem::assembler::NLAssembler.

◆ assemble_hessian() [2/3]

Eigen::MatrixXd polyfem::assembler::SaintVenantElasticity::assemble_hessian ( const NonLinearAssemblerData data) const
overridevirtual

Implements polyfem::assembler::NLAssembler.

Definition at line 111 of file SaintVenantElasticity.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().

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

◆ assemble_hessian() [3/3]

virtual Eigen::MatrixXd polyfem::assembler::NLAssembler::assemble_hessian ( const NonLinearAssemblerData data) const
virtual

◆ assign_stress_tensor()

void polyfem::assembler::SaintVenantElasticity::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
overridevirtual

Implements polyfem::assembler::ElasticityAssembler.

Definition at line 130 of file SaintVenantElasticity.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::OutputData::local_pts, polyfem::PK1, polyfem::pk1_from_cauchy(), polyfem::PK2, polyfem::pk2_from_cauchy(), polyfem::assembler::Assembler::size(), stress(), polyfem::assembler::OutputData::t, and vals.

Referenced by polyfem::assembler::MultiModel::assign_stress_tensor().

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

◆ compute_energy()

double polyfem::assembler::SaintVenantElasticity::compute_energy ( const NonLinearAssemblerData data) const
overridevirtual

Implements polyfem::assembler::NLAssembler.

Definition at line 202 of file SaintVenantElasticity.cpp.

Referenced by polyfem::assembler::MultiModel::compute_energy().

Here is the caller graph for this function:

◆ compute_energy_aux()

template<typename T >
T polyfem::assembler::SaintVenantElasticity::compute_energy_aux ( const NonLinearAssemblerData data) const
private

Definition at line 209 of file SaintVenantElasticity.cpp.

References polyfem::compute_disp_grad_at_quad(), polyfem::assembler::NonLinearAssemblerData::da, polyfem::get_local_disp(), polyfem::assembler::Assembler::size(), and stress().

Here is the call graph for this function:

◆ compute_rhs()

Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > polyfem::assembler::SaintVenantElasticity::compute_rhs ( const AutodiffHessianPt pt) const
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 73 of file SaintVenantElasticity.cpp.

References elasticity_tensor_, polyfem::autogen::saint_venant_2d_function(), polyfem::autogen::saint_venant_3d_function(), and polyfem::assembler::Assembler::size().

Here is the call graph for this function:

◆ name()

std::string polyfem::assembler::SaintVenantElasticity::name ( ) const
inlineoverridevirtual

Implements polyfem::assembler::Assembler.

Definition at line 33 of file SaintVenantElasticity.hpp.

◆ parameters()

std::map< std::string, Assembler::ParamFunc > polyfem::assembler::SaintVenantElasticity::parameters ( ) const
overridevirtual

Implements polyfem::assembler::Assembler.

Definition at line 260 of file SaintVenantElasticity.cpp.

References elasticity_tensor_, and polyfem::assembler::Assembler::size().

Here is the call graph for this function:

◆ set_size()

void polyfem::assembler::SaintVenantElasticity::set_size ( const int  size)
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 55 of file SaintVenantElasticity.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().

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

◆ set_stiffness_tensor()

void polyfem::assembler::SaintVenantElasticity::set_stiffness_tensor ( int  i,
int  j,
const double  val 
)

◆ stifness_tensor()

double polyfem::assembler::SaintVenantElasticity::stifness_tensor ( int  i,
int  j 
) const

◆ stress()

template<typename T , unsigned long N>
T polyfem::assembler::SaintVenantElasticity::stress ( const std::array< T, N > &  strain,
const int  j 
) const
private

Definition at line 62 of file SaintVenantElasticity.cpp.

References elasticity_tensor_.

Referenced by assign_stress_tensor(), and compute_energy_aux().

Here is the caller graph for this function:

Member Data Documentation

◆ elasticity_tensor_

ElasticityTensor polyfem::assembler::SaintVenantElasticity::elasticity_tensor_
private

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