30 const std::vector<double>& local_x_data,
31 const std::vector<double>& local_x_prev_data,
32 std::vector<double>& local_b_data, std::vector<double>& local_Jac_data)
34 std::vector<double> local_M_data(local_Jac_data.size());
35 std::vector<double> local_K_data(local_Jac_data.size());
41 "The number of specified epsilons ({:d}) and the number of local "
42 "d.o.f.s ({:d}) do not match, i.e., the latter is not divisible by "
48 static_cast<Eigen::MatrixXd::Index
>(local_x_data.size());
57 auto const num_dofs_per_component =
62 local_assembler.
assemble(t, dt, local_x_data, local_x_prev_data,
63 local_M_data, local_K_data, local_b_data);
68 for (Eigen::MatrixXd::Index i = 0; i < num_r_c; ++i)
71 auto const component = i / num_dofs_per_component;
86 auto const local_M_0 =
88 auto const local_M_p =
90 local_Jac.col(i).noalias() +=
91 (local_M_p * (x_p - x_prev) - local_M_0 * (x - x_prev)) /
97 auto const local_K_0 =
99 auto const local_K_p =
101 local_Jac.col(i).noalias() +=
102 (local_K_p * x_p - local_K_0 * x) / eps;
107 auto const local_b_0 =
109 auto const local_b_p =
111 local_Jac.col(i).noalias() -= (local_b_p - local_b_0) / eps;
116 local_M_data.clear();
117 local_K_data.clear();
118 local_b_data.clear();
121 local_assembler.
assemble(t, dt, local_x_data, local_x_prev_data,
122 local_M_data, local_K_data, local_b_data);
129 if (!local_b_data.empty())
137 if (!local_M_data.empty())
140 b -= M * (x - x_prev) / dt;
141 local_M_data.clear();
143 if (!local_K_data.empty())
147 local_K_data.clear();
void assembleWithJacobian(LocalAssemblerInterface &local_assembler, double const t, double const dt, std::vector< double > const &local_x_data, std::vector< double > const &local_x_prev_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
virtual void assemble(double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)