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

#include <PressureAssembler.hpp>

Collaboration diagram for polyfem::assembler::PressureAssembler:
[legend]

Public Member Functions

 PressureAssembler (const Assembler &assembler, const mesh::Mesh &mesh, const mesh::Obstacle &obstacle, const std::vector< mesh::LocalBoundary > &local_pressure_boundary, const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &local_pressure_cavity, const std::vector< int > &dirichlet_nodes, const std::vector< int > &primitive_to_nodes, const std::vector< int > &node_to_primitives, const int n_basis, const int size, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Problem &problem)
 
double compute_energy (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_pressure_boundary, const int resolution, const double t) const
 
void compute_energy_grad (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_pressure_boundary, const std::vector< int > &dirichlet_nodes, const int resolution, const double t, Eigen::VectorXd &grad) const
 
void compute_energy_hess (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_pressure_boundary, const std::vector< int > &dirichlet_nodes, const int resolution, const double t, const bool project_to_psd, StiffnessMatrix &hess) const
 
double compute_cavity_energy (const Eigen::MatrixXd &displacement, const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &local_pressure_cavity, const int resolution, const double t) const
 
void compute_cavity_energy_grad (const Eigen::MatrixXd &displacement, const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &local_pressure_cavity, const std::vector< int > &dirichlet_nodes, const int resolution, const double t, Eigen::VectorXd &grad) const
 
void compute_cavity_energy_hess (const Eigen::MatrixXd &displacement, const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &local_pressure_cavity, const std::vector< int > &dirichlet_nodes, const int resolution, const double t, const bool project_to_psd, StiffnessMatrix &hess) const
 
void compute_force_jacobian (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_pressure_boundary, const std::vector< int > &dirichlet_nodes, const int resolution, const double t, const int n_vertices, StiffnessMatrix &hess) const
 
const Problemproblem () const
 
const mesh::Meshmesh () const
 
const std::vector< basis::ElementBases > & bases () const
 
const std::vector< basis::ElementBases > & gbases () const
 
const Assemblerassembler () const
 

Private Member Functions

double compute_volume (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_boundary, const int resolution, const double t=0, const bool multiply_pressure=false) const
 
void compute_grad_volume (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_boundary, const std::vector< int > &dirichlet_nodes, const int resolution, Eigen::VectorXd &grad, const double t=0, const bool multiply_pressure=false) const
 
void compute_hess_volume_3d (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_boundary, const std::vector< int > &dirichlet_nodes, const int resolution, StiffnessMatrix &hess, const double t=0, const bool multiply_pressure=false) const
 
void compute_hess_volume_2d (const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_boundary, const std::vector< int > &dirichlet_nodes, const int resolution, StiffnessMatrix &hess, const double t=0, const bool multiply_pressure=false) const
 
bool is_closed_or_boundary_fixed (const std::vector< mesh::LocalBoundary > &local_boundary, const std::vector< int > &dirichlet_nodes) const
 

Private Attributes

const Assemblerassembler_
 
const mesh::Meshmesh_
 
const mesh::Obstacleobstacle_
 
const int n_basis_
 
const int size_
 
const std::vector< basis::ElementBases > & bases_
 
const std::vector< basis::ElementBases > & gbases_
 
const Problemproblem_
 
std::unordered_map< int, double > starting_volumes_
 
std::unique_ptr< ThermodynamicProcesscavity_thermodynamics_
 
const std::vector< int > primitive_to_nodes_
 
const std::vector< int > node_to_primitives_
 

Detailed Description

Definition at line 74 of file PressureAssembler.hpp.

Constructor & Destructor Documentation

◆ PressureAssembler()

polyfem::assembler::PressureAssembler::PressureAssembler ( const Assembler assembler,
const mesh::Mesh mesh,
const mesh::Obstacle obstacle,
const std::vector< mesh::LocalBoundary > &  local_pressure_boundary,
const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &  local_pressure_cavity,
const std::vector< int > &  dirichlet_nodes,
const std::vector< int > &  primitive_to_nodes,
const std::vector< int > &  node_to_primitives,
const int  n_basis,
const int  size,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Problem problem 
)

Definition at line 766 of file PressureAssembler.cpp.

References cavity_thermodynamics_, compute_volume(), is_closed_or_boundary_fixed(), polyfem::logger(), and starting_volumes_.

Here is the call graph for this function:

Member Function Documentation

◆ assembler()

const Assembler & polyfem::assembler::PressureAssembler::assembler ( ) const
inline

Definition at line 143 of file PressureAssembler.hpp.

References assembler_.

◆ bases()

const std::vector< basis::ElementBases > & polyfem::assembler::PressureAssembler::bases ( ) const
inline

Definition at line 141 of file PressureAssembler.hpp.

References bases_.

◆ compute_cavity_energy()

double polyfem::assembler::PressureAssembler::compute_cavity_energy ( const Eigen::MatrixXd &  displacement,
const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &  local_pressure_cavity,
const int  resolution,
const double  t 
) const

Definition at line 800 of file PressureAssembler.cpp.

References cavity_thermodynamics_, compute_volume(), polyfem::assembler::Problem::pressure_cavity_bc(), problem_, and starting_volumes_.

Referenced by polyfem::solver::PressureForm::value_unweighted().

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

◆ compute_cavity_energy_grad()

void polyfem::assembler::PressureAssembler::compute_cavity_energy_grad ( const Eigen::MatrixXd &  displacement,
const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &  local_pressure_cavity,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
const double  t,
Eigen::VectorXd &  grad 
) const

Definition at line 818 of file PressureAssembler.cpp.

References cavity_thermodynamics_, compute_grad_volume(), compute_volume(), polyfem::assembler::Problem::pressure_cavity_bc(), problem_, and starting_volumes_.

Referenced by polyfem::solver::PressureForm::first_derivative_unweighted().

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

◆ compute_cavity_energy_hess()

void polyfem::assembler::PressureAssembler::compute_cavity_energy_hess ( const Eigen::MatrixXd &  displacement,
const std::unordered_map< int, std::vector< mesh::LocalBoundary > > &  local_pressure_cavity,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
const double  t,
const bool  project_to_psd,
StiffnessMatrix hess 
) const

Definition at line 843 of file PressureAssembler.cpp.

References cavity_thermodynamics_, compute_grad_volume(), compute_hess_volume_2d(), compute_hess_volume_3d(), compute_volume(), polyfem::log_and_throw_error(), polyfem::assembler::Problem::pressure_cavity_bc(), problem_, size_, and starting_volumes_.

Referenced by polyfem::solver::PressureForm::second_derivative_unweighted().

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

◆ compute_energy()

double polyfem::assembler::PressureAssembler::compute_energy ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_pressure_boundary,
const int  resolution,
const double  t 
) const

Definition at line 882 of file PressureAssembler.cpp.

References compute_volume().

Referenced by polyfem::solver::PressureForm::value_unweighted().

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

◆ compute_energy_grad()

void polyfem::assembler::PressureAssembler::compute_energy_grad ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_pressure_boundary,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
const double  t,
Eigen::VectorXd &  grad 
) const

Definition at line 892 of file PressureAssembler.cpp.

References compute_grad_volume().

Referenced by polyfem::solver::PressureForm::first_derivative_unweighted().

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

◆ compute_energy_hess()

void polyfem::assembler::PressureAssembler::compute_energy_hess ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_pressure_boundary,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
const double  t,
const bool  project_to_psd,
StiffnessMatrix hess 
) const

Definition at line 903 of file PressureAssembler.cpp.

References compute_hess_volume_2d(), compute_hess_volume_3d(), polyfem::log_and_throw_error(), and size_.

Referenced by compute_force_jacobian(), and polyfem::solver::PressureForm::second_derivative_unweighted().

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

◆ compute_force_jacobian()

void polyfem::assembler::PressureAssembler::compute_force_jacobian ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_pressure_boundary,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
const double  t,
const int  n_vertices,
StiffnessMatrix hess 
) const

Definition at line 923 of file PressureAssembler.cpp.

References compute_energy_hess().

Referenced by polyfem::solver::PressureForm::force_shape_derivative().

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

◆ compute_grad_volume()

void polyfem::assembler::PressureAssembler::compute_grad_volume ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_boundary,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
Eigen::VectorXd &  grad,
const double  t = 0,
const bool  multiply_pressure = false 
) const
private

Definition at line 210 of file PressureAssembler.cpp.

References polyfem::utils::create_thread_storage(), polyfem::utils::maybe_parallel_for(), n_basis_, and size_.

Referenced by compute_cavity_energy_grad(), compute_cavity_energy_hess(), and compute_energy_grad().

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

◆ compute_hess_volume_2d()

void polyfem::assembler::PressureAssembler::compute_hess_volume_2d ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_boundary,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
StiffnessMatrix hess,
const double  t = 0,
const bool  multiply_pressure = false 
) const
private

Definition at line 522 of file PressureAssembler.cpp.

References polyfem::utils::create_thread_storage(), polyfem::utils::maybe_parallel_for(), n_basis_, and size_.

Referenced by compute_cavity_energy_hess(), and compute_energy_hess().

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

◆ compute_hess_volume_3d()

void polyfem::assembler::PressureAssembler::compute_hess_volume_3d ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_boundary,
const std::vector< int > &  dirichlet_nodes,
const int  resolution,
StiffnessMatrix hess,
const double  t = 0,
const bool  multiply_pressure = false 
) const
private

Definition at line 335 of file PressureAssembler.cpp.

References polyfem::utils::create_thread_storage(), polyfem::utils::maybe_parallel_for(), n_basis_, and size_.

Referenced by compute_cavity_energy_hess(), and compute_energy_hess().

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

◆ compute_volume()

double polyfem::assembler::PressureAssembler::compute_volume ( const Eigen::MatrixXd &  displacement,
const std::vector< mesh::LocalBoundary > &  local_boundary,
const int  resolution,
const double  t = 0,
const bool  multiply_pressure = false 
) const
private

Definition at line 90 of file PressureAssembler.cpp.

References polyfem::utils::create_thread_storage(), and polyfem::utils::maybe_parallel_for().

Referenced by compute_cavity_energy(), compute_cavity_energy_grad(), compute_cavity_energy_hess(), compute_energy(), and PressureAssembler().

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

◆ gbases()

const std::vector< basis::ElementBases > & polyfem::assembler::PressureAssembler::gbases ( ) const
inline

Definition at line 142 of file PressureAssembler.hpp.

References gbases_.

◆ is_closed_or_boundary_fixed()

bool polyfem::assembler::PressureAssembler::is_closed_or_boundary_fixed ( const std::vector< mesh::LocalBoundary > &  local_boundary,
const std::vector< int > &  dirichlet_nodes 
) const
private

Definition at line 691 of file PressureAssembler.cpp.

References polyfem::utils::create_thread_storage(), and polyfem::utils::maybe_parallel_for().

Referenced by PressureAssembler().

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

◆ mesh()

const mesh::Mesh & polyfem::assembler::PressureAssembler::mesh ( ) const
inline

Definition at line 140 of file PressureAssembler.hpp.

References mesh_.

◆ problem()

const Problem & polyfem::assembler::PressureAssembler::problem ( ) const
inline

Definition at line 139 of file PressureAssembler.hpp.

References problem_.

Member Data Documentation

◆ assembler_

const Assembler& polyfem::assembler::PressureAssembler::assembler_
private

Definition at line 180 of file PressureAssembler.hpp.

Referenced by assembler().

◆ bases_

const std::vector<basis::ElementBases>& polyfem::assembler::PressureAssembler::bases_
private

Definition at line 185 of file PressureAssembler.hpp.

Referenced by bases().

◆ cavity_thermodynamics_

std::unique_ptr<ThermodynamicProcess> polyfem::assembler::PressureAssembler::cavity_thermodynamics_
private

◆ gbases_

const std::vector<basis::ElementBases>& polyfem::assembler::PressureAssembler::gbases_
private

Definition at line 186 of file PressureAssembler.hpp.

Referenced by gbases().

◆ mesh_

const mesh::Mesh& polyfem::assembler::PressureAssembler::mesh_
private

Definition at line 181 of file PressureAssembler.hpp.

Referenced by mesh().

◆ n_basis_

const int polyfem::assembler::PressureAssembler::n_basis_
private

◆ node_to_primitives_

const std::vector<int> polyfem::assembler::PressureAssembler::node_to_primitives_
private

Definition at line 193 of file PressureAssembler.hpp.

◆ obstacle_

const mesh::Obstacle& polyfem::assembler::PressureAssembler::obstacle_
private

Definition at line 182 of file PressureAssembler.hpp.

◆ primitive_to_nodes_

const std::vector<int> polyfem::assembler::PressureAssembler::primitive_to_nodes_
private

Definition at line 192 of file PressureAssembler.hpp.

◆ problem_

const Problem& polyfem::assembler::PressureAssembler::problem_
private

◆ size_

const int polyfem::assembler::PressureAssembler::size_
private

◆ starting_volumes_

std::unordered_map<int, double> polyfem::assembler::PressureAssembler::starting_volumes_
private

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