21 const int n_pressure_bases,
22 const std::vector<int> &boundary_nodes,
23 const std::vector<mesh::LocalBoundary> &local_boundary,
24 const std::vector<mesh::LocalBoundary> &local_neumann_boundary,
25 const int n_boundary_samples,
26 const Eigen::MatrixXd &rhs,
29 const bool is_formulation_mixed,
30 const bool is_time_dependent);
32 std::string
name()
const override {
return "body"; }
64 const Eigen::MatrixXd &
x,
65 const Eigen::MatrixXd &adjoint,
66 Eigen::VectorXd &term);
69 const Eigen::VectorXd &u_prev,
85 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 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.
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