BlockVector <double> solution_delta (dofs_per_block);
solution_delta.collect_sizes ();
- while (time.current() < time.end()) {
+ while (time.current() <= time.end()) {
solution_delta = 0.0;
// Solve step and update total solution vector
csp.block(t_dof,t_dof).reinit (n_dofs_t, n_dofs_t);
csp.collect_sizes();
- DoFTools::make_sparsity_pattern (dof_handler_ref, csp, constraints, false);
+ DoFTools::make_sparsity_pattern (dof_handler_ref, csp);
+// DoFTools::make_sparsity_pattern (dof_handler_ref, csp, constraints, false);
// DoFTools::make_sparsity_pattern (dof_handler_ref, coupling, csp, constraints, false);
sparsity_pattern.copy_from (csp);
}
}
// No convergence -> continue with calculations
- assemble_system_K (); // Assemble stiffness matrix
+ // Assemble stiffness matrix
+ assemble_system_K ();
+
+ // Do the static condensation to make K'_uu, and put K_pt^{-1}
+ // in the K_pt block and K_tt^{-1} in the K_pp block
+ assemble_SC();
+
constraints.condense (tangent_matrix, residual); // Apply BC's
solve_linear_system (newton_update);
constraints.distribute(newton_update); // Populate the constrained DOF's with their values
// Solve for du
{
- // Do the static condensation to make K'_uu, and put K_pt^{-1}
- // in the K_pt block and K_tt^{-1} in the K_pp block
- assemble_SC();
-
// K'uu du = Ru − Kup Ktp^-1 (Rt − Ktt Kpt^{-1} Rp)
tangent_matrix.block(p_dof, t_dof).vmult(A.block(t_dof), residual.block(p_dof));
tangent_matrix.block(t_dof, t_dof).vmult (B.block(t_dof), A.block(t_dof));