22 const int n_pressure_bases,
23 const std::vector<int> &boundary_nodes,
24 const std::vector<mesh::LocalBoundary> &local_boundary,
25 const std::vector<mesh::LocalBoundary> &local_neumann_boundary,
26 const int n_boundary_samples,
27 const Eigen::MatrixXd &rhs,
31 const bool is_formulation_mixed,
32 const bool is_time_dependent);
34 std::string
name()
const override {
return "body"; }
76 const Eigen::MatrixXd &
x,
77 const Eigen::MatrixXd &adjoint,
78 Eigen::VectorXd &term);
81 const Eigen::VectorXd &u_prev,
97 const Eigen::MatrixXd &
rhs_;
Form representing body forces.
std::string name() const override
const assembler::RhsAssembler & rhs_assembler_
Reference to the RHS assembler.
void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override
Compute the second derivative of the value wrt x.
bool is_formulation_mixed_
True if the formulation is mixed.
const std::vector< int > & boundary_nodes_
void update_quantities(const double t, const Eigen::VectorXd &x) override
Update time dependent quantities.
void force_shape_derivative(const int n_verts, const double t, const Eigen::MatrixXd &x, const Eigen::MatrixXd &adjoint, Eigen::VectorXd &term)
Compute the derivative of the force wrt vertex positions, then multiply the resulting matrix with adj...
void set_apply_DBC(const Eigen::VectorXd &x, const bool val) override
Set if the Dirichlet boundary conditions should be enforced.
void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override
Compute the first derivative of the value wrt x.
const std::vector< mesh::LocalBoundary > & local_neumann_boundary_
const int ndof_
Number of degrees of freedom.
const assembler::Density & density_
Eigen::MatrixXd current_rhs_
Cached RHS for the current time.
const std::vector< mesh::LocalBoundary > & local_boundary_
const int n_pressure_bases_
void update_current_rhs(const Eigen::VectorXd &x)
Update current_rhs.
bool apply_DBC_
If true, set the Dirichlet boundary conditions in the RHS.
const Eigen::MatrixXd & rhs_
static RHS for the current time
Eigen::MatrixXd x_prev_
Cached previous solution.
void hessian_wrt_u_prev(const Eigen::VectorXd &u_prev, const double t, StiffnessMatrix &hessian) const
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the value of the body force form.
const int n_boundary_samples_
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix