PolyFEM
Loading...
Searching...
No Matches
PressureForm.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Form.hpp"
4
8
10
11#include <unordered_map>
12#include <vector>
13
14namespace polyfem::solver
15{
17 class PressureForm : public Form
18 {
20
21 public:
25 PressureForm(const int ndof,
26 const std::vector<mesh::LocalBoundary> &local_pressure_boundary,
27 const std::unordered_map<int, std::vector<mesh::LocalBoundary>> &local_pressure_cavity,
28 const std::vector<int> &dirichlet_nodes,
29 const QuadratureOrders &n_boundary_samples,
30 const assembler::PressureAssembler &pressure_assembler,
31 const bool is_time_dependent);
32
33 std::string name() const override { return "pressure"; }
34
35 protected:
39 double value_unweighted(const Eigen::VectorXd &x) const override;
40
44 void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override;
45
49 void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override;
50
51 public:
55 void update_quantities(const double t, const Eigen::VectorXd &x) override;
56
57 private:
58 double t_;
59 const int ndof_;
60
61 const std::vector<mesh::LocalBoundary> &local_pressure_boundary_;
62 const std::unordered_map<int, std::vector<mesh::LocalBoundary>> &local_pressure_cavity_;
63 const std::vector<int> &dirichlet_nodes_;
65
67 };
68} // namespace polyfem::solver
int x
Form representing body forces.
void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override
Compute the second derivative of the value wrt x.
void update_quantities(const double t, const Eigen::VectorXd &x) override
Update time dependent quantities.
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the value of the body force form.
const assembler::PressureAssembler & pressure_assembler_
Reference to the pressure assembler.
const QuadratureOrders n_boundary_samples_
const std::vector< mesh::LocalBoundary > & local_pressure_boundary_
const int ndof_
Number of degrees of freedom.
const std::vector< int > & dirichlet_nodes_
void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override
Compute the first derivative of the value wrt x.
const std::unordered_map< int, std::vector< mesh::LocalBoundary > > & local_pressure_cavity_
std::string name() const override
std::array< int, 2 > QuadratureOrders
Definition Types.hpp:19
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:24