8 const std::vector<int> &boundary_nodes,
9 const std::vector<mesh::LocalBoundary> &local_boundary,
10 const std::vector<mesh::LocalBoundary> &local_neumann_boundary,
11 const int n_boundary_samples,
14 const size_t obstacle_ndof,
15 const bool is_time_dependent,
17 : boundary_nodes_(boundary_nodes),
18 local_boundary_(&local_boundary),
19 local_neumann_boundary_(&local_neumann_boundary),
20 n_boundary_samples_(n_boundary_samples),
21 rhs_assembler_(&rhs_assembler),
22 is_time_dependent_(is_time_dependent)
29 const std::vector<int> &boundary_nodes,
31 const size_t obstacle_ndof,
32 const Eigen::MatrixXd &target_x)
33 : boundary_nodes_(boundary_nodes),
34 local_boundary_(nullptr),
35 local_neumann_boundary_(nullptr),
36 n_boundary_samples_(0),
37 rhs_assembler_(nullptr),
38 is_time_dependent_(false),
47 const size_t obstacle_ndof)
49 std::vector<bool> is_boundary_dof(ndof,
true);
51 is_boundary_dof[bn] =
false;
57 if (obstacle_ndof > 0)
59 const int n_fe_dof = ndof - obstacle_ndof;
61 for (
int i = n_fe_dof; i < ndof; ++i)
70 return !is_boundary_dof[row];
75 mask_.prune([&](
const int &row,
const int &col,
const double &
value) ->
bool {
77 return !is_boundary_dof[row];
void set_bc(const std::vector< mesh::LocalBoundary > &local_boundary, const std::vector< int > &bounday_nodes, const int resolution, const std::vector< mesh::LocalBoundary > &local_neumann_boundary, Eigen::MatrixXd &rhs, const Eigen::MatrixXd &displacement=Eigen::MatrixXd(), const double t=1) const
Eigen::SparseMatrix< double > lump_matrix(const Eigen::SparseMatrix< double > &M)
Lump each row of a matrix into the diagonal.
Eigen::SparseMatrix< double > sparse_identity(int rows, int cols)
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix