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

#include <FixedCorotational.hpp>

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

Public Member Functions

 FixedCorotational ()
 
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 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_dstress_dmu_dlambda (const OptAssemblerData &data, Eigen::MatrixXd &dstress_dmu, Eigen::MatrixXd &dstress_dlambda) const override
 
void add_multimaterial (const int index, const json &params, const Units &units) override
 
void set_params (const LameParameters &params)
 
const LameParameterslame_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, 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
 
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_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 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 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<int dim>
double 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
 

Static Private Member Functions

template<int dim>
static double compute_energy_from_singular_values (const Eigen::Vector< double, dim > &sigmas, const double lambda, const double mu)
 
template<int dim>
static Eigen::Vector< double, dim > compute_stress_from_singular_values (const Eigen::Vector< double, dim > &sigmas, const double lambda, const double mu)
 
template<int dim>
static Eigen::Matrix< double, dim, dim > compute_stiffness_from_singular_values (const Eigen::Vector< double, dim > &sigmas, const double lambda, const double mu)
 
template<int dim>
static double compute_energy_from_def_grad (const Eigen::Matrix< double, dim, dim > &F, const double lambda, const double mu)
 
template<int dim>
static Eigen::Matrix< double, dim, dim > compute_stress_from_def_grad (const Eigen::Matrix< double, dim, dim > &F, const double lambda, const double mu)
 
template<int dim>
static Eigen::Matrix< double, dim *dim, dim *dim > compute_stiffness_from_def_grad (const Eigen::Matrix< double, dim, dim > &F, const double lambda, const double mu)
 

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
 

Detailed Description

Definition at line 11 of file FixedCorotational.hpp.

Constructor & Destructor Documentation

◆ FixedCorotational()

polyfem::assembler::FixedCorotational::FixedCorotational ( )

Definition at line 75 of file FixedCorotational.cpp.

Member Function Documentation

◆ add_multimaterial()

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

Reimplemented from polyfem::assembler::Assembler.

Definition at line 79 of file FixedCorotational.cpp.

References polyfem::assembler::LameParameters::add_multimaterial(), params_, 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::FixedCorotational::allow_inversion ( ) const
inlineoverridevirtual

Implements polyfem::assembler::ElasticityAssembler.

Definition at line 51 of file FixedCorotational.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::Assembler.

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::Assembler.

◆ assemble_gradient() [2/3]

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

Implements polyfem::assembler::NLAssembler.

Definition at line 87 of file FixedCorotational.cpp.

References polyfem::assembler::ElementAssemblyValues::basis_values, 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::Assembler.

◆ assemble_hessian() [2/3]

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

Implements polyfem::assembler::NLAssembler.

Definition at line 157 of file FixedCorotational.cpp.

References polyfem::assembler::ElementAssemblyValues::basis_values, 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::FixedCorotational::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

◆ compute_dstress_dmu_dlambda()

void polyfem::assembler::FixedCorotational::compute_dstress_dmu_dlambda ( const OptAssemblerData data,
Eigen::MatrixXd &  dstress_dmu,
Eigen::MatrixXd &  dstress_dlambda 
) const
overridevirtual

◆ compute_energy()

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

Implements polyfem::assembler::NLAssembler.

Definition at line 285 of file FixedCorotational.cpp.

References polyfem::assembler::Assembler::size().

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

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

◆ compute_energy_aux()

◆ compute_energy_aux_gradient_fast() [1/2]

◆ compute_energy_aux_gradient_fast() [2/2]

template<int n_basis, int dim>
void polyfem::assembler::FixedCorotational::compute_energy_aux_gradient_fast ( const NonLinearAssemblerData data,
Eigen::VectorXd &  G_flattened 
) const
private

◆ compute_energy_from_def_grad()

template<int dim>
double polyfem::assembler::FixedCorotational::compute_energy_from_def_grad ( const Eigen::Matrix< double, dim, dim > &  F,
const double  lambda,
const double  mu 
)
staticprivate

Definition at line 670 of file FixedCorotational.cpp.

References compute_energy_from_singular_values(), and polyfem::F.

Referenced by compute_energy_aux().

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

◆ compute_energy_from_singular_values()

template<int dim>
double polyfem::assembler::FixedCorotational::compute_energy_from_singular_values ( const Eigen::Vector< double, dim > &  sigmas,
const double  lambda,
const double  mu 
)
staticprivate

Definition at line 599 of file FixedCorotational.cpp.

Referenced by compute_energy_from_def_grad().

Here is the caller graph for this function:

◆ compute_energy_hessian_aux_fast()

◆ compute_stiffness_from_def_grad()

template<int dim>
Eigen::Matrix< double, dim *dim, dim *dim > polyfem::assembler::FixedCorotational::compute_stiffness_from_def_grad ( const Eigen::Matrix< double, dim, dim > &  F,
const double  lambda,
const double  mu 
)
staticprivate

Definition at line 707 of file FixedCorotational.cpp.

References compute_stiffness_from_singular_values(), compute_stress_from_singular_values(), polyfem::F, polyfem::utils::AutoFlipSVD< MatrixType >::matrixU(), polyfem::utils::AutoFlipSVD< MatrixType >::matrixV(), polyfem::utils::AutoFlipSVD< MatrixType >::singularValues(), and V.

Referenced by compute_energy_hessian_aux_fast().

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

◆ compute_stiffness_from_singular_values()

template<int dim>
Eigen::Matrix< double, dim, dim > polyfem::assembler::FixedCorotational::compute_stiffness_from_singular_values ( const Eigen::Vector< double, dim > &  sigmas,
const double  lambda,
const double  mu 
)
staticprivate

Definition at line 634 of file FixedCorotational.cpp.

Referenced by compute_stiffness_from_def_grad().

Here is the caller graph for this function:

◆ compute_stress_from_def_grad()

template<int dim>
Eigen::Matrix< double, dim, dim > polyfem::assembler::FixedCorotational::compute_stress_from_def_grad ( const Eigen::Matrix< double, dim, dim > &  F,
const double  lambda,
const double  mu 
)
staticprivate

Definition at line 677 of file FixedCorotational.cpp.

References polyfem::F, polyfem::utils::AutoFlipSVD< MatrixType >::matrixU(), polyfem::utils::AutoFlipSVD< MatrixType >::matrixV(), and polyfem::utils::AutoFlipSVD< MatrixType >::singularValues().

Referenced by compute_energy_aux_gradient_fast().

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

◆ compute_stress_from_singular_values()

template<int dim>
Eigen::Vector< double, dim > polyfem::assembler::FixedCorotational::compute_stress_from_singular_values ( const Eigen::Vector< double, dim > &  sigmas,
const double  lambda,
const double  mu 
)
staticprivate

Definition at line 608 of file FixedCorotational.cpp.

Referenced by compute_stiffness_from_def_grad().

Here is the caller graph for this function:

◆ compute_stress_grad_multiply_mat()

void polyfem::assembler::FixedCorotational::compute_stress_grad_multiply_mat ( const OptAssemblerData data,
const Eigen::MatrixXd &  mat,
Eigen::MatrixXd &  stress,
Eigen::MatrixXd &  result 
) const
overridevirtual

◆ compute_stress_grad_multiply_stress()

void polyfem::assembler::FixedCorotational::compute_stress_grad_multiply_stress ( const OptAssemblerData data,
Eigen::MatrixXd &  stress,
Eigen::MatrixXd &  result 
) const
overridevirtual

◆ lame_params()

const LameParameters & polyfem::assembler::FixedCorotational::lame_params ( ) const
inline

Definition at line 42 of file FixedCorotational.hpp.

References params_.

◆ name()

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

Implements polyfem::assembler::Assembler.

Definition at line 50 of file FixedCorotational.hpp.

◆ parameters()

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

Implements polyfem::assembler::Assembler.

Definition at line 554 of file FixedCorotational.cpp.

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

Here is the call graph for this function:

◆ set_params()

void polyfem::assembler::FixedCorotational::set_params ( const LameParameters params)
inline

Definition at line 41 of file FixedCorotational.hpp.

References params_.

◆ update_lame_params()

void polyfem::assembler::FixedCorotational::update_lame_params ( const Eigen::MatrixXd &  lambdas,
const Eigen::MatrixXd &  mus 
)
inlineoverridevirtual

Member Data Documentation

◆ params_


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