236 * #
if defined(DEAL_II_WITH_PETSC) && !defined(DEAL_II_PETSC_WITH_COMPLEX) && \
237 * !(defined(DEAL_II_WITH_TRILINOS) && defined(FORCE_USE_OF_TRILINOS))
238 *
using namespace dealii::LinearAlgebraPETSc;
239 * # define USE_PETSC_LA
240 * #elif defined(DEAL_II_WITH_TRILINOS)
241 *
using namespace dealii::LinearAlgebraTrilinos;
243 * # error DEAL_II_WITH_PETSC or DEAL_II_WITH_TRILINOS required
247 * #include <deal.II/lac/vector.h>
248 * #include <deal.II/lac/full_matrix.h>
249 * #include <deal.II/lac/solver_cg.h>
250 * #include <deal.II/lac/solver_gmres.h>
251 * #include <deal.II/lac/solver_minres.h>
252 * #include <deal.II/lac/affine_constraints.h>
253 * #include <deal.II/lac/dynamic_sparsity_pattern.h>
255 * #include <deal.II/lac/petsc_sparse_matrix.h>
256 * #include <deal.II/lac/petsc_vector.h>
257 * #include <deal.II/lac/petsc_solver.h>
258 * #include <deal.II/lac/petsc_precondition.h>
260 * #include <deal.II/grid/grid_generator.h>
261 * #include <deal.II/grid/manifold_lib.h>
262 * #include <deal.II/grid/grid_tools.h>
263 * #include <deal.II/dofs/dof_handler.h>
264 * #include <deal.II/dofs/dof_renumbering.h>
265 * #include <deal.II/dofs/dof_tools.h>
266 * #include <deal.II/fe/fe_values.h>
267 * #include <deal.II/fe/fe_q.h>
268 * #include <deal.II/fe/fe_system.h>
269 * #include <deal.II/numerics/vector_tools.h>
270 * #include <deal.II/numerics/data_out.h>
271 * #include <deal.II/numerics/error_estimator.h>
273 * #include <deal.II/base/utilities.h>
274 * #include <deal.II/base/conditional_ostream.h>
275 * #include <deal.II/base/index_set.h>
276 * #include <deal.II/lac/sparsity_tools.h>
277 * #include <deal.II/distributed/tria.h>
278 * #include <deal.II/distributed/grid_refinement.h>
282 * #include <iostream>
291 * <a name=
"step_55-Linearsolversandpreconditioners"></a>
292 * <h3>Linear solvers and preconditioners</h3>
296 * We need a few helper classes to represent our solver strategy
297 * described in the introduction.
303 *
namespace LinearSolvers
307 * This
class exposes the action of applying the inverse of a
308 * giving
matrix via the function
309 * InverseMatrix::vmult(). Internally, the inverse is not formed
310 * explicitly. Instead, a linear solver with CG is performed. This
311 *
class extends the InverseMatrix class in @ref step_22
"step-22" with an option
312 * to specify a preconditioner, and to allow
for different vector
313 *
types in the vmult function. We use the same mechanism as in
314 * @ref step_31
"step-31" to convert a
run-time exception into a failed assertion
315 * should the inner solver not converge.
318 *
template <
class Matrix,
class Preconditioner>
322 * InverseMatrix(
const Matrix &m,
const Preconditioner &preconditioner);
324 *
template <
typename VectorType>
325 *
void vmult(VectorType &dst,
const VectorType &src)
const;
329 *
const Preconditioner &preconditioner;
333 *
template <
class Matrix,
class Preconditioner>
334 * InverseMatrix<Matrix, Preconditioner>::InverseMatrix(
336 *
const Preconditioner &preconditioner)
338 * , preconditioner(preconditioner)
343 *
template <
class Matrix,
class Preconditioner>
344 *
template <
typename VectorType>
346 * InverseMatrix<Matrix, Preconditioner>::vmult(VectorType &dst,
347 *
const VectorType &src)
const
349 *
SolverControl solver_control(src.size(), 1e-8 * src.l2_norm());
355 * cg.solve(*matrix, dst, src, preconditioner);
357 *
catch (std::exception &e)
359 *
Assert(
false, ExcMessage(
e.what()));
366 * The
class A template class for a simple block
diagonal preconditioner
370 *
template <
class PreconditionerA,
class PreconditionerS>
371 *
class BlockDiagonalPreconditioner :
public Subscriptor
374 * BlockDiagonalPreconditioner(
const PreconditionerA &preconditioner_A,
375 *
const PreconditionerS &preconditioner_S);
377 *
void vmult(LA::MPI::BlockVector &dst,
378 *
const LA::MPI::BlockVector &src)
const;
381 *
const PreconditionerA &preconditioner_A;
382 *
const PreconditionerS &preconditioner_S;
385 *
template <
class PreconditionerA,
class PreconditionerS>
386 * BlockDiagonalPreconditioner<PreconditionerA, PreconditionerS>::
387 * BlockDiagonalPreconditioner(
const PreconditionerA &preconditioner_A,
388 *
const PreconditionerS &preconditioner_S)
389 * : preconditioner_A(preconditioner_A)
390 * , preconditioner_S(preconditioner_S)
394 *
template <
class PreconditionerA,
class PreconditionerS>
395 *
void BlockDiagonalPreconditioner<PreconditionerA, PreconditionerS>::vmult(
396 * LA::MPI::BlockVector &dst,
397 *
const LA::MPI::BlockVector &src)
const
399 * preconditioner_A.vmult(dst.block(0), src.block(0));
400 * preconditioner_S.vmult(dst.block(1), src.block(1));
408 * <a name=
"step_55-Problemsetup"></a>
409 * <h3>Problem setup</h3>
413 * The following classes represent the right hand side and the exact
414 * solution
for the test problem.
421 *
class RightHandSide :
public Function<dim>
434 *
void RightHandSide<dim>::vector_value(
const Point<dim> &p,
437 *
const double R_x = p[0];
438 *
const double R_y = p[1];
453 * Utilities::fixed_power<2>(-
std::sqrt(25.0 + 4 * pi2) + 5.0) *
460 * Utilities::fixed_power<3>(-
std::sqrt(25.0 + 4 * pi2) + 5.0) *
474 *
class ExactSolution :
public Function<dim>
486 *
void ExactSolution<dim>::vector_value(
const Point<dim> &p,
489 *
const double R_x = p[0];
490 *
const double R_y = p[1];
515 * (-6538034.74494422 +
521 * (-10.0 + 2.0 *
std::sqrt(25.0 + 4 * pi2)) +
524 * (-8 *
std::sqrt(25.0 + 4 * pi2) + 40.0) +
526 * (-10.0 + 2.0 *
std::sqrt(25.0 + 4 * pi2));
534 * <a name=
"step_55-Themainprogram"></a>
535 * <h3>The main program</h3>
539 * The main
class is very similar to @ref step_40
"step-40", except that matrices and
540 * vectors are now block versions, and we store a std::vector<IndexSet>
541 *
for owned and relevant DoFs instead of a single
IndexSet. We have
542 * exactly two IndexSets, one
for all velocity unknowns and one
for all
547 *
class StokesProblem
550 * StokesProblem(
unsigned int velocity_degree);
556 *
void setup_system();
557 *
void assemble_system();
559 *
void refine_grid();
560 *
void output_results(
const unsigned int cycle);
562 *
const unsigned int velocity_degree;
563 *
const double viscosity;
570 * std::vector<IndexSet> owned_partitioning;
571 * std::vector<IndexSet> relevant_partitioning;
575 * LA::MPI::BlockSparseMatrix system_matrix;
576 * LA::MPI::BlockSparseMatrix preconditioner_matrix;
577 * LA::MPI::BlockVector locally_relevant_solution;
578 * LA::MPI::BlockVector system_rhs;
587 * StokesProblem<dim>::StokesProblem(
unsigned int velocity_degree)
588 * : velocity_degree(velocity_degree)
590 * , mpi_communicator(MPI_COMM_WORLD)
599 * , computing_timer(mpi_communicator,
608 * The Kovasznay flow is defined on the domain [-0.5, 1.5]^2, which we
613 *
void StokesProblem<dim>::make_grid()
622 * <a name=
"step_55-SystemSetup"></a>
623 * <h3>System Setup</h3>
627 * The construction of the block matrices and vectors is
new compared to
628 * @ref step_40
"step-40" and is different compared to
serial codes like @ref step_22
"step-22", because
629 * we need to supply the set of rows that belong to our processor.
633 *
void StokesProblem<dim>::setup_system()
637 * dof_handler.distribute_dofs(fe);
641 * Put all dim velocities into block 0 and the pressure into block 1,
642 * then
reorder the unknowns by block. Finally count how many unknowns
646 * std::vector<unsigned int> stokes_sub_blocks(dim + 1, 0);
647 * stokes_sub_blocks[dim] = 1;
650 *
const std::vector<types::global_dof_index> dofs_per_block =
653 *
const unsigned int n_u = dofs_per_block[0];
654 *
const unsigned int n_p = dofs_per_block[1];
656 * pcout <<
" Number of degrees of freedom: " << dof_handler.n_dofs() <<
" ("
657 * << n_u <<
'+' << n_p <<
')' << std::endl;
661 * We
split up the
IndexSet for locally owned and locally relevant DoFs
662 * into two IndexSets based on how we want to create the block matrices
666 *
const IndexSet &locally_owned_dofs = dof_handler.locally_owned_dofs();
667 * owned_partitioning = {locally_owned_dofs.
get_view(0, n_u),
668 * locally_owned_dofs.
get_view(n_u, n_u + n_p)};
670 *
const IndexSet locally_relevant_dofs =
672 * relevant_partitioning = {locally_relevant_dofs.get_view(0, n_u),
673 * locally_relevant_dofs.get_view(n_u, n_u + n_p)};
677 * Setting up the constraints
for boundary conditions and hanging nodes
678 * is identical to @ref step_40
"step-40". Even though we don
't have any hanging nodes
679 * because we only perform global refinement, it is still a good idea
680 * to put this function call in, in case adaptive refinement gets
685 * constraints.reinit(locally_owned_dofs, locally_relevant_dofs);
687 * const FEValuesExtractors::Vector velocities(0);
688 * DoFTools::make_hanging_node_constraints(dof_handler, constraints);
689 * VectorTools::interpolate_boundary_values(dof_handler,
691 * ExactSolution<dim>(),
693 * fe.component_mask(velocities));
694 * constraints.close();
699 * Now we create the system matrix based on a BlockDynamicSparsityPattern.
700 * We know that we won't have coupling between different velocity
701 * components (because we use the laplace and not the deformation tensor)
702 * and no coupling between pressure with its test
functions, so we use
703 * a
Table to communicate
this coupling information to
708 * system_matrix.clear();
711 *
for (
unsigned int c = 0; c < dim + 1; ++c)
712 *
for (
unsigned int d = 0;
d < dim + 1; ++
d)
713 *
if (c == dim && d == dim)
715 *
else if (c == dim || d == dim || c == d)
723 * dof_handler, coupling, dsp, constraints,
false);
727 * dof_handler.locally_owned_dofs(),
729 * locally_relevant_dofs);
731 * system_matrix.reinit(owned_partitioning, dsp, mpi_communicator);
736 * The preconditioner
matrix has a different coupling (we only fill in
737 * the 1,1 block with the @ref GlossMassMatrix
"mass matrix"), otherwise
this code is identical
738 * to the construction of the system_matrix above.
742 * preconditioner_matrix.clear();
745 *
for (
unsigned int c = 0; c < dim + 1; ++c)
746 *
for (
unsigned int d = 0;
d < dim + 1; ++
d)
747 *
if (c == dim && d == dim)
755 * dof_handler, coupling, dsp, constraints,
false);
759 * dof_handler.locally_owned_dofs()),
761 * locally_relevant_dofs);
762 * preconditioner_matrix.reinit(owned_partitioning, dsp, mpi_communicator);
767 * Finally, we construct the block vectors with the right sizes. The
768 * function call with two std::vector<IndexSet> will create a ghosted
772 * locally_relevant_solution.reinit(owned_partitioning,
773 * relevant_partitioning,
775 * system_rhs.reinit(owned_partitioning, mpi_communicator);
783 * <a name=
"step_55-Assembly"></a>
788 * This function assembles the system
matrix, the preconditioner
matrix,
789 * and the right hand side. The code is pretty standard.
793 *
void StokesProblem<dim>::assemble_system()
798 * preconditioner_matrix = 0;
801 *
const QGauss<dim> quadrature_formula(velocity_degree + 1);
804 * quadrature_formula,
808 *
const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
809 *
const unsigned int n_q_points = quadrature_formula.size();
815 *
const RightHandSide<dim> right_hand_side;
816 * std::vector<Vector<double>> rhs_values(n_q_points,
Vector<double>(dim + 1));
818 * std::vector<Tensor<2, dim>> grad_phi_u(dofs_per_cell);
819 * std::vector<double> div_phi_u(dofs_per_cell);
820 * std::vector<double> phi_p(dofs_per_cell);
822 * std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
826 *
for (
const auto &cell : dof_handler.active_cell_iterators())
827 * if (cell->is_locally_owned())
829 * system_cell_matrix = 0;
830 * preconditioner_cell_matrix = 0;
833 * fe_values.reinit(cell);
834 * right_hand_side.vector_value_list(fe_values.get_quadrature_points(),
836 *
for (
unsigned int q = 0; q < n_q_points; ++q)
838 *
for (
unsigned int k = 0; k < dofs_per_cell; ++k)
840 * grad_phi_u[k] = fe_values[velocities].gradient(k, q);
841 * div_phi_u[k] = fe_values[velocities].divergence(k, q);
842 * phi_p[k] = fe_values[pressure].value(k, q);
845 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
847 *
for (
unsigned int j = 0; j < dofs_per_cell; ++j)
849 * system_cell_matrix(i, j) +=
851 * scalar_product(grad_phi_u[i], grad_phi_u[j]) -
852 * div_phi_u[i] * phi_p[j] - phi_p[i] * div_phi_u[j]) *
855 * preconditioner_cell_matrix(i, j) += 1.0 / viscosity *
856 * phi_p[i] * phi_p[j] *
860 *
const unsigned int component_i =
861 * fe.system_to_component_index(i).first;
862 * cell_rhs(i) += fe_values.shape_value(i, q) *
863 * rhs_values[q](component_i) * fe_values.JxW(q);
868 * cell->get_dof_indices(local_dof_indices);
869 * constraints.distribute_local_to_global(system_cell_matrix,
875 * constraints.distribute_local_to_global(preconditioner_cell_matrix,
877 * preconditioner_matrix);
890 * <a name=
"step_55-Solving"></a>
895 * This function solves the linear system with MINRES with a block
diagonal
896 * preconditioner and AMG
for the two
diagonal blocks as described in the
897 * introduction. The preconditioner applies a v cycle to the 0,0 block
898 * and a CG with the mass
matrix for the 1,1 block (the Schur complement).
902 *
void StokesProblem<dim>::solve()
906 * LA::MPI::PreconditionAMG prec_A;
908 * LA::MPI::PreconditionAMG::AdditionalData data;
910 * #ifdef USE_PETSC_LA
911 * data.symmetric_operator =
true;
913 * prec_A.initialize(system_matrix.block(0, 0), data);
916 * LA::MPI::PreconditionAMG prec_S;
918 * LA::MPI::PreconditionAMG::AdditionalData data;
920 * #ifdef USE_PETSC_LA
921 * data.symmetric_operator =
true;
923 * prec_S.initialize(preconditioner_matrix.block(1, 1), data);
928 * The InverseMatrix is used to solve
for the mass
matrix:
931 *
using mp_inverse_t = LinearSolvers::InverseMatrix<LA::MPI::SparseMatrix,
932 * LA::MPI::PreconditionAMG>;
933 *
const mp_inverse_t mp_inverse(preconditioner_matrix.block(1, 1), prec_S);
937 * This constructs the block preconditioner based on the preconditioners
938 *
for the individual blocks defined above.
941 *
const LinearSolvers::BlockDiagonalPreconditioner<LA::MPI::PreconditionAMG,
943 * preconditioner(prec_A, mp_inverse);
947 * With that, we can
finally set up the linear solver and solve the system:
951 * 1e-10 * system_rhs.l2_norm());
955 * LA::MPI::BlockVector distributed_solution(owned_partitioning,
958 * constraints.set_zero(distributed_solution);
960 * solver.solve(system_matrix,
961 * distributed_solution,
965 * pcout <<
" Solved in " << solver_control.last_step() <<
" iterations."
968 * constraints.distribute(distributed_solution);
972 * Like in @ref step_56
"step-56", we subtract the
mean pressure to allow error
973 * computations against our reference solution, which has a
mean value
977 * locally_relevant_solution = distributed_solution;
978 *
const double mean_pressure =
981 * locally_relevant_solution,
983 * distributed_solution.block(1).add(-mean_pressure);
984 * locally_relevant_solution.block(1) = distributed_solution.block(1);
992 * <a name=
"step_55-Therest"></a>
997 * The remainder of the code that deals with mesh refinement, output, and
998 * the main
loop is pretty standard.
1001 *
template <
int dim>
1002 *
void StokesProblem<dim>::refine_grid()
1011 *
template <
int dim>
1012 *
void StokesProblem<dim>::output_results(
const unsigned int cycle)
1022 *
const QGauss<dim> quadrature(velocity_degree + 2);
1025 * locally_relevant_solution,
1026 * ExactSolution<dim>(),
1032 *
const double error_u_l2 =
1038 * locally_relevant_solution,
1039 * ExactSolution<dim>(),
1045 *
const double error_p_l2 =
1050 * pcout <<
"error: u_0: " << error_u_l2 <<
" p_0: " << error_p_l2
1055 * std::vector<std::string> solution_names(dim,
"velocity");
1056 * solution_names.emplace_back(
"pressure");
1057 * std::vector<DataComponentInterpretation::DataComponentInterpretation>
1058 * data_component_interpretation(
1060 * data_component_interpretation.push_back(
1065 * data_out.add_data_vector(locally_relevant_solution,
1068 * data_component_interpretation);
1070 * LA::MPI::BlockVector interpolated;
1071 * interpolated.reinit(owned_partitioning, MPI_COMM_WORLD);
1074 * LA::MPI::BlockVector interpolated_relevant(owned_partitioning,
1075 * relevant_partitioning,
1077 * interpolated_relevant = interpolated;
1079 * std::vector<std::string> solution_names(dim,
"ref_u");
1080 * solution_names.emplace_back(
"ref_p");
1081 * data_out.add_data_vector(interpolated_relevant,
1084 * data_component_interpretation);
1089 *
for (
unsigned int i = 0; i < subdomain.size(); ++i)
1091 * data_out.add_data_vector(subdomain,
"subdomain");
1093 * data_out.build_patches();
1095 * data_out.write_vtu_with_pvtu_record(
1096 *
"./",
"solution", cycle, mpi_communicator, 2);
1101 *
template <
int dim>
1102 *
void StokesProblem<dim>::run()
1104 * #ifdef USE_PETSC_LA
1105 * pcout <<
"Running using PETSc." << std::endl;
1107 * pcout <<
"Running using Trilinos." << std::endl;
1109 *
const unsigned int n_cycles = 5;
1110 *
for (
unsigned int cycle = 0; cycle < n_cycles; ++cycle)
1112 * pcout <<
"Cycle " << cycle <<
':' << std::endl;
1121 * assemble_system();
1125 * output_results(cycle);
1127 * computing_timer.print_summary();
1128 * computing_timer.reset();
1130 * pcout << std::endl;
1137 *
int main(
int argc,
char *argv[])
1141 *
using namespace dealii;
1142 *
using namespace Step55;
1146 * StokesProblem<2> problem(2);
1149 *
catch (std::exception &exc)
1151 * std::cerr << std::endl
1153 * <<
"----------------------------------------------------"
1155 * std::cerr <<
"Exception on processing: " << std::endl
1156 * << exc.what() << std::endl
1157 * <<
"Aborting!" << std::endl
1158 * <<
"----------------------------------------------------"
1165 * std::cerr << std::endl
1167 * <<
"----------------------------------------------------"
1169 * std::cerr <<
"Unknown exception!" << std::endl
1170 * <<
"Aborting!" << std::endl
1171 * <<
"----------------------------------------------------"
1179<a name=
"step_55-Results"></a><h1>Results</h1>
1182As expected from the discussion above, the number of iterations is
independent
1183of the number of processors and only very slightly dependent on @f$h@f$:
1187 <th colspan=
"2">
PETSc</th>
1188 <th colspan=
"8">number of processors</th>
1290 <th colspan=
"2">Trilinos</th>
1291 <th colspan=
"8">number of processors</th>
1391While the
PETSc results show a
constant number of iterations, the iterations
1392increase when
using Trilinos. This is likely because of the different settings
1393used
for the AMG preconditioner. For performance reasons we
do not allow
1394coarsening below a couple thousand unknowns. As the coarse solver is an exact
1395solve (we are
using LU by
default), a change in number of levels will
1396influence the quality of a V-cycle. Therefore, a V-cycle is closer to an exact
1397solver
for smaller problem sizes.
1399<a name=
"step-55-extensions"></a>
1400<a name=
"step_55-Possibilitiesforextensions"></a><h3>Possibilities
for extensions</h3>
1403<a name=
"step_55-InvestigateTrilinositerations"></a><h4>Investigate Trilinos iterations</h4>
1406Play with the smoothers, smoothing steps, and other properties
for the
1407Trilinos AMG to achieve an optimal preconditioner.
1409<a name=
"step_55-SolvetheOseenprobleminsteadoftheStokessystem"></a><h4>Solve the Oseen problem instead of the Stokes system</h4>
1412This change
requires changing the outer solver to GMRES or BiCGStab, because
1415You can prescribe the exact flow solution as @f$b@f$ in the convective term @f$b
1416\cdot \nabla u@f$. This should give the same solution as the original problem,
1417if you set the right hand side to zero.
1419<a name=
"step_55-Adaptiverefinement"></a><h4>Adaptive refinement</h4>
1422So far,
this tutorial program refines the mesh globally in each step.
1423Replacing the code in StokesProblem::refine_grid() by something like
1430 QGauss<dim - 1>(fe.degree + 1),
1432 locally_relevant_solution,
1433 estimated_error_per_cell,
1434 fe.component_mask(velocities));
1439makes it simple to explore adaptive mesh refinement.
1442<a name="step_55-PlainProg"></a>
1443<h1> The plain program</h1>
1444@include "step-55.cc"
void attach_dof_handler(const DoFHandler< dim, spacedim > &)
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &values) const
IndexSet get_view(const size_type begin, const size_type end) const
#define Assert(cond, exc)
void loop(IteratorType begin, std_cxx20::type_identity_t< IteratorType > end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, AssemblerType &assembler, const LoopControl &lctrl=LoopControl())
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints={}, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
@ update_values
Shape function values.
@ update_JxW_values
Transformed quadrature weights.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
std::vector< value_type > split(const typename ::Triangulation< dim, spacedim >::cell_iterator &parent, const value_type parent_value)
@ component_is_part_of_vector
void component_wise(DoFHandler< dim, spacedim > &dof_handler, const std::vector< unsigned int > &target_component=std::vector< unsigned int >())
void hyper_cube(Triangulation< dim, spacedim > &tria, const double left=0., const double right=1., const bool colorize=false)
@ matrix
Contents is actually a matrix.
@ symmetric
Matrix is symmetric.
@ diagonal
Matrix is diagonal.
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
std::vector< unsigned int > serial(const std::vector< unsigned int > &targets, const std::function< RequestType(const unsigned int)> &create_request, const std::function< AnswerType(const unsigned int, const RequestType &)> &answer_request, const std::function< void(const unsigned int, const AnswerType &)> &process_answer, const MPI_Comm comm)
unsigned int n_mpi_processes(const MPI_Comm mpi_communicator)
std::vector< T > all_gather(const MPI_Comm comm, const T &object_to_send)
unsigned int this_mpi_process(const MPI_Comm mpi_communicator)
void run(const Iterator &begin, const std_cxx20::type_identity_t< Iterator > &end, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length, const unsigned int chunk_size)
int(&) functions(const void *v1, const void *v2)
static constexpr double PI
::VectorizedArray< Number, width > exp(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation