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

#include <ViscousDamping.hpp>

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

Public Member Functions

std::string name () const override
 
std::map< std::string, ParamFuncparameters () const override
 
 ViscousDamping ()=default
 
double compute_energy (const NonLinearAssemblerData &data) const override
 
virtual Eigen::MatrixXd assemble_hessian (const NonLinearAssemblerData &data) const override
 
virtual Eigen::VectorXd assemble_gradient (const NonLinearAssemblerData &data) const override
 
void add_multimaterial (const int index, const json &params, const Units &units) override
 
void set_params (const double psi, const double phi)
 
void compute_stress_grad (const OptAssemblerData &data, const Eigen::MatrixXd &prev_grad_u_i, Eigen::MatrixXd &stress, Eigen::MatrixXd &result) const override
 
void compute_stress_prev_grad (const OptAssemblerData &data, const Eigen::MatrixXd &prev_grad_u_i, Eigen::MatrixXd &result) const override
 
double get_psi () const
 
double get_phi () const
 
bool is_valid () const
 
const DampingParametersdamping_params () 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
 
virtual double compute_energy (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 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_scalar_value (const OutputData &data, std::vector< NamedMatrix > &result) const
 
virtual void compute_tensor_value (const OutputData &data, std::vector< NamedMatrix > &result) 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 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 void update_lame_params (const Eigen::MatrixXd &lambdas, const Eigen::MatrixXd &mus)
 
virtual bool is_solution_displacement () const
 
virtual bool is_fluid () const
 
virtual bool is_tensor () const
 

Static Public Member Functions

static void compute_dstress_dpsi_dphi (const OptAssemblerData &data, const Eigen::MatrixXd &prev_grad_u_i, Eigen::MatrixXd &dstress_dpsi, Eigen::MatrixXd &dstress_dphi)
 

Protected Member Functions

void compute_stress_aux (const Eigen::MatrixXd &F, const Eigen::MatrixXd &dFdt, Eigen::MatrixXd &dRdF, Eigen::MatrixXd &dRdFdot) const
 
void compute_stress_grad_aux (const Eigen::MatrixXd &F, const Eigen::MatrixXd &dFdt, Eigen::MatrixXd &d2RdF2, Eigen::MatrixXd &d2RdFdFdot, Eigen::MatrixXd &d2RdFdot2) const
 

Protected Attributes

DampingParameters damping_params_
 
- 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 10 of file ViscousDamping.hpp.

Constructor & Destructor Documentation

◆ ViscousDamping()

polyfem::assembler::ViscousDamping::ViscousDamping ( )
default

Member Function Documentation

◆ add_multimaterial()

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

Reimplemented from polyfem::assembler::Assembler.

Definition at line 61 of file ViscousDamping.cpp.

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

Here is the call graph for this function:

◆ 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.

Reimplemented in polyfem::assembler::ViscousDampingPrev.

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

◆ assemble_gradient() [2/3]

◆ 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

◆ assemble_hessian() [2/3]

◆ assemble_hessian() [3/3]

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

◆ compute_dstress_dpsi_dphi()

void polyfem::assembler::ViscousDamping::compute_dstress_dpsi_dphi ( const OptAssemblerData data,
const Eigen::MatrixXd &  prev_grad_u_i,
Eigen::MatrixXd &  dstress_dpsi,
Eigen::MatrixXd &  dstress_dphi 
)
static

◆ compute_energy() [1/2]

◆ compute_energy() [2/2]

virtual double polyfem::assembler::NLAssembler::compute_energy ( const NonLinearAssemblerData data) const
virtual

◆ compute_stress_aux()

void polyfem::assembler::ViscousDamping::compute_stress_aux ( const Eigen::MatrixXd &  F,
const Eigen::MatrixXd &  dFdt,
Eigen::MatrixXd &  dRdF,
Eigen::MatrixXd &  dRdFdot 
) const
protected

Definition at line 5 of file ViscousDamping.cpp.

References damping_params_, polyfem::F, and polyfem::assembler::Assembler::size().

Referenced by polyfem::assembler::ViscousDampingPrev::assemble_gradient().

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

◆ compute_stress_grad()

void polyfem::assembler::ViscousDamping::compute_stress_grad ( const OptAssemblerData data,
const Eigen::MatrixXd &  prev_grad_u_i,
Eigen::MatrixXd &  stress,
Eigen::MatrixXd &  result 
) const
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 408 of file ViscousDamping.cpp.

References compute_stress_grad_aux(), damping_params_, polyfem::assembler::OptAssemblerData::dt, polyfem::F, polyfem::assembler::OptAssemblerData::grad_u_i, and polyfem::assembler::Assembler::size().

Here is the call graph for this function:

◆ compute_stress_grad_aux()

void polyfem::assembler::ViscousDamping::compute_stress_grad_aux ( const Eigen::MatrixXd &  F,
const Eigen::MatrixXd &  dFdt,
Eigen::MatrixXd &  d2RdF2,
Eigen::MatrixXd &  d2RdFdFdot,
Eigen::MatrixXd &  d2RdFdot2 
) const
protected

Definition at line 16 of file ViscousDamping.cpp.

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

Referenced by assemble_hessian(), polyfem::assembler::ViscousDampingPrev::assemble_hessian(), compute_stress_grad(), and compute_stress_prev_grad().

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

◆ compute_stress_prev_grad()

void polyfem::assembler::ViscousDamping::compute_stress_prev_grad ( const OptAssemblerData data,
const Eigen::MatrixXd &  prev_grad_u_i,
Eigen::MatrixXd &  result 
) const
overridevirtual

Reimplemented from polyfem::assembler::Assembler.

Definition at line 430 of file ViscousDamping.cpp.

References compute_stress_grad_aux(), polyfem::assembler::OptAssemblerData::dt, and polyfem::assembler::OptAssemblerData::grad_u_i.

Here is the call graph for this function:

◆ damping_params()

const DampingParameters & polyfem::assembler::ViscousDamping::damping_params ( ) const
inline

Definition at line 55 of file ViscousDamping.hpp.

References damping_params_.

◆ get_phi()

double polyfem::assembler::ViscousDamping::get_phi ( ) const
inline

Definition at line 51 of file ViscousDamping.hpp.

References damping_params_.

◆ get_psi()

double polyfem::assembler::ViscousDamping::get_psi ( ) const
inline

Definition at line 50 of file ViscousDamping.hpp.

References damping_params_.

◆ is_valid()

bool polyfem::assembler::ViscousDamping::is_valid ( ) const
inline

Definition at line 53 of file ViscousDamping.hpp.

References damping_params_.

◆ name()

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

Implements polyfem::assembler::Assembler.

Definition at line 18 of file ViscousDamping.hpp.

◆ parameters()

std::map< std::string, ParamFunc > polyfem::assembler::ViscousDamping::parameters ( ) const
inlineoverridevirtual

Implements polyfem::assembler::Assembler.

Definition at line 19 of file ViscousDamping.hpp.

◆ set_params()

void polyfem::assembler::ViscousDamping::set_params ( const double  psi,
const double  phi 
)
inline

Definition at line 30 of file ViscousDamping.hpp.

References damping_params_.

Member Data Documentation

◆ damping_params_

DampingParameters polyfem::assembler::ViscousDamping::damping_params_
protected

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