19 virtual double pressure(
const double start_pressure,
const double v0,
const double v1)
const {
return 0; }
20 virtual double first_derivative(
const double start_pressure,
const double v0,
const double v1)
const {
return 0; }
21 virtual double second_derivative(
const double start_pressure,
const double v0,
const double v1)
const {
return 0; }
22 virtual double energy(
const double start_pressure,
const double v0,
const double v1)
const {
return 0; }
31 virtual double pressure(
const double start_pressure,
const double v0,
const double v1)
const override
36 virtual double first_derivative(
const double start_pressure,
const double v0,
const double v1)
const override
38 return -((start_pressure +
atmospheric) * v0) / (v1 * v1);
41 virtual double second_derivative(
const double start_pressure,
const double v0,
const double v1)
const override
43 return 2 * ((start_pressure +
atmospheric) * v0) / (v1 * v1 * v1);
46 virtual double energy(
const double start_pressure,
const double v0,
const double v1)
const override {
return (start_pressure +
atmospheric) * v0 * std::log(v1) -
atmospheric * v1; }
52 virtual double pressure(
const double start_pressure,
const double v0,
const double v1)
const override
57 virtual double first_derivative(
const double start_pressure,
const double v0,
const double v1)
const override
62 virtual double second_derivative(
const double start_pressure,
const double v0,
const double v1)
const override
81 const std::vector<mesh::LocalBoundary> &local_pressure_boundary,
82 const std::unordered_map<
int, std::vector<mesh::LocalBoundary>> &local_pressure_cavity,
83 const std::vector<int> &dirichlet_nodes,
84 const std::vector<int> &primitive_to_nodes,
const std::vector<int> &node_to_primitives,
85 const int n_basis,
const int size,
89 const Eigen::MatrixXd &displacement,
90 const std::vector<mesh::LocalBoundary> &local_pressure_boundary,
92 const double t)
const;
94 const Eigen::MatrixXd &displacement,
95 const std::vector<mesh::LocalBoundary> &local_pressure_boundary,
96 const std::vector<int> &dirichlet_nodes,
99 Eigen::VectorXd &grad)
const;
101 const Eigen::MatrixXd &displacement,
102 const std::vector<mesh::LocalBoundary> &local_pressure_boundary,
103 const std::vector<int> &dirichlet_nodes,
104 const int resolution,
106 const bool project_to_psd,
110 const Eigen::MatrixXd &displacement,
111 const std::unordered_map<
int, std::vector<mesh::LocalBoundary>> &local_pressure_cavity,
112 const int resolution,
113 const double t)
const;
115 const Eigen::MatrixXd &displacement,
116 const std::unordered_map<
int, std::vector<mesh::LocalBoundary>> &local_pressure_cavity,
117 const std::vector<int> &dirichlet_nodes,
118 const int resolution,
120 Eigen::VectorXd &grad)
const;
122 const Eigen::MatrixXd &displacement,
123 const std::unordered_map<
int, std::vector<mesh::LocalBoundary>> &local_pressure_cavity,
124 const std::vector<int> &dirichlet_nodes,
125 const int resolution,
127 const bool project_to_psd,
131 const Eigen::MatrixXd &displacement,
132 const std::vector<mesh::LocalBoundary> &local_pressure_boundary,
133 const std::vector<int> &dirichlet_nodes,
134 const int resolution,
136 const int n_vertices,
141 inline const std::vector<basis::ElementBases> &
bases()
const {
return bases_; }
142 inline const std::vector<basis::ElementBases> &
gbases()
const {
return gbases_; }
146 const int boundary_id,
147 const std::vector<mesh::LocalBoundary> &local_boundary,
148 const std::vector<int> &dirichlet_nodes,
149 const int resolution,
150 Eigen::VectorXd &grad,
152 const bool multiply_pressure =
false)
const;
156 const Eigen::MatrixXd &displacement,
157 const std::vector<mesh::LocalBoundary> &local_boundary,
158 const int resolution,
160 const bool multiply_pressure =
false)
const;
162 const std::vector<mesh::LocalBoundary> &local_boundary,
163 const std::vector<int> &dirichlet_nodes,
164 const int resolution,
165 Eigen::VectorXd &grad,
167 const bool multiply_pressure =
false)
const;
169 const Eigen::MatrixXd &displacement,
170 const std::vector<mesh::LocalBoundary> &local_boundary,
171 const std::vector<int> &dirichlet_nodes,
172 const int resolution,
175 const bool multiply_pressure =
false)
const;
177 const Eigen::MatrixXd &displacement,
178 const std::vector<mesh::LocalBoundary> &local_boundary,
179 const std::vector<int> &dirichlet_nodes,
180 const int resolution,
183 const bool multiply_pressure =
false)
const;
186 const std::vector<mesh::LocalBoundary> &local_boundary,
187 const std::vector<int> &dirichlet_nodes)
const;
195 const std::vector<basis::ElementBases> &
bases_;
196 const std::vector<basis::ElementBases> &
gbases_;
virtual double energy(const double start_pressure, const double v0, const double v1) const override
virtual double second_derivative(const double start_pressure, const double v0, const double v1) const override
virtual double pressure(const double start_pressure, const double v0, const double v1) const override
virtual double first_derivative(const double start_pressure, const double v0, const double v1) const override
virtual double pressure(const double start_pressure, const double v0, const double v1) const override
virtual double first_derivative(const double start_pressure, const double v0, const double v1) const override
virtual double energy(const double start_pressure, const double v0, const double v1) const override
virtual double second_derivative(const double start_pressure, const double v0, const double v1) const override
double compute_energy(const Eigen::MatrixXd &displacement, const std::vector< mesh::LocalBoundary > &local_pressure_boundary, const int resolution, const double t) const
bool is_closed_or_boundary_fixed(const std::vector< mesh::LocalBoundary > &local_boundary, const std::vector< int > &dirichlet_nodes) const
const std::vector< int > primitive_to_nodes_
const std::vector< basis::ElementBases > & gbases_
std::unique_ptr< ThermodynamicProcess > cavity_thermodynamics_
void compute_grad_volume_id(const Eigen::MatrixXd &displacement, const int boundary_id, 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
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_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
const std::vector< basis::ElementBases > & bases_
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_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
const std::vector< basis::ElementBases > & bases() const
const Assembler & assembler_
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 mesh::Obstacle & obstacle_
const Assembler & assembler() const
const std::vector< basis::ElementBases > & gbases() const
const std::vector< int > node_to_primitives_
std::unordered_map< int, double > starting_volumes_
const Problem & problem() 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
const mesh::Mesh & mesh() const
std::set< int > relevant_pressure_nodes_
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
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
virtual double pressure(const double start_pressure, const double v0, const double v1) const
virtual double second_derivative(const double start_pressure, const double v0, const double v1) const
virtual double energy(const double start_pressure, const double v0, const double v1) const
virtual double first_derivative(const double start_pressure, const double v0, const double v1) const
virtual ~ThermodynamicProcess()
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix