include/meltpooldg/linear_algebra/preconditioner_factory.hpp Source File

Developer Documentation: include/meltpooldg/linear_algebra/preconditioner_factory.hpp Source File
Developer Documentation
preconditioner_factory.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <deal.II/base/exceptions.h>
8
9#include <deal.II/lac/trilinos_precondition.h>
10
16
17namespace MeltPoolDG
18{
35 template <int dim, typename number, typename OperatorType, typename VectorType>
36 Preconditioner<dim, VectorType, number>
37 make_preconditioner(const PreconditionerType &preconditioner_type,
38 const OperatorType *operator_in,
39 const ScratchData<dim, dim, number> &scratch_data,
40 const unsigned dof_idx,
41 const bool do_matrix_free = true)
42 {
43 switch (preconditioner_type)
44 {
45 case PreconditionerType::Identity: {
48 }
49 case PreconditionerType::AMG: {
52 number,
53 VectorType,
54 dealii::TrilinosWrappers::PreconditionAMG,
55 OperatorType>(
56 operator_in, scratch_data, dof_idx, do_matrix_free));
57 }
58 case PreconditionerType::ILU: {
61 number,
62 VectorType,
63 dealii::TrilinosWrappers::PreconditionILU,
64 OperatorType>(
65 operator_in, scratch_data, dof_idx, do_matrix_free));
66 }
67 case PreconditionerType::Diagonal: {
69 {
70 if (do_matrix_free)
71 {
74 scratch_data,
75 dof_idx));
76 }
77 }
80 number,
81 VectorType,
82 dealii::TrilinosWrappers::PreconditionJacobi,
83 OperatorType>(operator_in, scratch_data, dof_idx, false));
84 }
85 default: {
86 AssertThrow(false,
87 dealii::ExcMessage("The requested preconditioner type is not"
88 " implemented."));
89 }
90 }
91 }
92} // namespace MeltPoolDG
Definition preconditioner_trilinos_wrapper.hpp:46
Definition preconditioner_trilinos_wrapper.hpp:190
Definition preconditioner_jacobi.hpp:30
Definition preconditioner.hpp:42
Container for shared scratch data between operations/operators.
Definition scratch_data.hpp:61
Definition preconditioner_jacobi.hpp:17
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17
Preconditioner< dim, VectorType, number > make_preconditioner(const PreconditionerType &preconditioner_type, const OperatorType *operator_in, const ScratchData< dim, dim, number > &scratch_data, const unsigned dof_idx, const bool do_matrix_free=true)
Definition preconditioner_factory.hpp:37