locally_relevant_dofs,
mpi_communicator);
system_rhs.reinit (locally_owned_dofs, mpi_communicator);
- system_rhs = 0;
+ system_rhs = PetscScalar();
constraints.clear ();
constraints.reinit (locally_relevant_dofs);
const unsigned int dofs_per_cell = fe.dofs_per_cell;
const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
+ FullMatrix<PetscScalar> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<PetscScalar> cell_rhs (dofs_per_cell);
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell)
if (cell->is_locally_owned())
{
- cell_matrix = 0;
- cell_rhs = 0;
+ cell_matrix = PetscScalar();
+ cell_rhs = PetscScalar();
fe_values.reinit (cell);
PETScWrappers::SolverCG solver(solver_control, mpi_communicator);
+#ifndef PETSC_USE_COMPLEX
PETScWrappers::PreconditionBoomerAMG
preconditioner(system_matrix,
PETScWrappers::PreconditionBoomerAMG::AdditionalData(true));
solver.solve (system_matrix, completely_distributed_solution, system_rhs,
preconditioner),
solver_control.last_step(), 10, 10);
+#else
+ check_solver_within_range(
+ solver.solve (system_matrix, completely_distributed_solution, system_rhs,
+ PETScWrappers::PreconditionJacobi(system_matrix)),
+ solver_control.last_step(), 120, 260);
+#endif
pcout << " Solved in " << solver_control.last_step()
<< " iterations." << std::endl;
--- /dev/null
+
+Cycle 0:
+ Number of active cells: 1024
+ 104+100+104+100+104+104+100+104+100+104+
+ Number of degrees of freedom: 4225
+ 465+416+432+416+416+432+416+416+400+416+
+DEAL:mpi::Solver stopped within 120 - 260 iterations
+ Solved in 126 iterations.
+
+Cycle 1:
+ Number of active cells: 4096
+ 408+412+408+412+408+408+412+408+412+408+
+ Number of degrees of freedom: 16641
+ 1729+1680+1664+1680+1632+1664+1680+1632+1648+1632+
+DEAL:mpi::Solver stopped within 120 - 260 iterations
+ Solved in 251 iterations.
+
--- /dev/null
+
+Cycle 0:
+ Number of active cells: 1024
+ 340+344+340+
+ Number of degrees of freedom: 4225
+ 1453+1412+1360+
+DEAL:mpi::Solver stopped within 120 - 260 iterations
+ Solved in 126 iterations.
+
+Cycle 1:
+ Number of active cells: 4096
+ 1364+1368+1364+
+ Number of degrees of freedom: 16641
+ 5645+5540+5456+
+DEAL:mpi::Solver stopped within 120 - 260 iterations
+ Solved in 251 iterations.
+
--- /dev/null
+
+Cycle 0:
+ Number of active cells: 1024
+ 256+256+256+256+
+ Number of degrees of freedom: 4225
+ 1089+1056+1056+1024+
+DEAL:mpi::Solver stopped within 120 - 260 iterations
+ Solved in 126 iterations.
+
+Cycle 1:
+ Number of active cells: 4096
+ 1024+1024+1024+1024+
+ Number of degrees of freedom: 16641
+ 4225+4160+4160+4096+
+DEAL:mpi::Solver stopped within 120 - 260 iterations
+ Solved in 251 iterations.
+