Utilities::MPI::
this_mpi_process(MPI_COMM_WORLD));
- // distribute_sp();
+
+#ifdef USE_PETSC_LA
IndexSet relevant;
DoFTools::extract_locally_relevant_dofs (stokes_dof_handler,
sp.compress();
- stokes_matrix.reinit (stokes_partitioning, sp, MPI_COMM_WORLD);
+ stokes_matrix.reinit (stokes_partitioning, sp, MPI_COMM_WORLD);
+#else
+ sp.compress();
+ stokes_matrix.reinit (sp);
+
+ #endif
}
stokes_constraints, false,
Utilities::MPI::
this_mpi_process(MPI_COMM_WORLD));
+#ifdef USE_PETSC_LA
IndexSet relevant;
DoFTools::extract_locally_relevant_dofs (stokes_dof_handler,
relevant);
SparsityTools::distribute_sparsity_pattern(sp,
- stokes_dof_handler.n_locally_owned_dofs_per_processor(),
- MPI_COMM_WORLD, relevant);
+ stokes_dof_handler.n_locally_owned_dofs_per_processor(),
+ MPI_COMM_WORLD, relevant);
+
sp.compress();
- stokes_preconditioner_matrix.reinit (stokes_partitioning, sp, MPI_COMM_WORLD);
+ stokes_matrix.reinit (stokes_partitioning, sp, MPI_COMM_WORLD);
+#else
+ sp.compress();
+
+ stokes_preconditioner_matrix.reinit (sp);
+#endif
}
temperature_constraints, false,
Utilities::MPI::
this_mpi_process(MPI_COMM_WORLD));
+#ifdef USE_PETSC_LA
IndexSet relevant;
DoFTools::extract_locally_relevant_dofs (temperature_dof_handler,
temperature_matrix.reinit (temperature_partitioner, temperature_partitioner, sp, MPI_COMM_WORLD);
temperature_mass_matrix.reinit (temperature_partitioner, temperature_partitioner, sp, MPI_COMM_WORLD);
temperature_stiffness_matrix.reinit (temperature_partitioner, temperature_partitioner, sp, MPI_COMM_WORLD);
- }
+#else
+ sp.compress();
+
+ temperature_matrix.reinit (sp);
+ temperature_mass_matrix.reinit (sp);
+ temperature_stiffness_matrix.reinit (sp);
+
+#endif
+ }
if (use_bdf2_scheme == true)
{
-#ifdef USE_PETSC_LA
- temperature_matrix = temperature_mass_matrix; // TODO: fast?
+ temperature_matrix.copy_from (temperature_mass_matrix);
temperature_matrix *= (2*time_step + old_time_step) /
(time_step + old_time_step);
+#ifdef USE_PETSC_LA
temperature_matrix.add (temperature_stiffness_matrix, time_step);
-
#else
- temperature_matrix.copy_from (temperature_mass_matrix);
- temperature_matrix *= (2*time_step + old_time_step) /
- (time_step + old_time_step);
temperature_matrix.add (time_step, temperature_stiffness_matrix);
#endif
}
else
{
+ temperature_matrix.copy_from (temperature_mass_matrix);
#ifdef USE_PETSC_LA
- temperature_matrix = temperature_mass_matrix;
temperature_matrix.add (temperature_stiffness_matrix, time_step);
#else
- temperature_matrix.copy_from (temperature_mass_matrix);
temperature_matrix.add (time_step, temperature_stiffness_matrix);
#endif
}