3 #include <amdis/Initfile.hpp> 4 #include <amdis/Output.hpp> 10 template <
class G,
class L>
11 template <
class Basis>
12 ISTLCommunication<G,L> CommunicationCreator<ISTLCommunication<G,L>>
13 ::create(Basis
const& basis, std::string
const& prefix)
15 using SolverType = Dune::SolverCategory::Category;
16 std::string category =
"";
24 SolverType
cat = SolverType::sequential;
25 auto const& gv = basis.gridView();
26 int mpiSize = gv.comm().size();
28 if (category ==
"default")
32 cat = SolverType::sequential;
37 if (gv.overlapSize(0) > 0)
38 cat = SolverType::overlapping;
42 warning(
"Nonoverlapping solvers are currently not supported.");
43 cat = SolverType::nonoverlapping;
47 else if (category !=
"sequential" && mpiSize == 1)
49 warning(
"Only one process detected. Solver category set to sequential\n");
50 cat = SolverType::sequential;
52 else if (category ==
"sequential")
54 test_exit(mpiSize == 1,
"Solver category sequential is not supported in parallel\n");
55 cat = SolverType::sequential;
57 else if (category ==
"overlapping")
59 if (gv.overlapSize(0) == 0)
60 warning(
"Overlapping solver category chosen for grid with no overlap\n");
61 cat = SolverType::overlapping;
63 else if (category ==
"nonoverlapping")
66 warning(
"Nonoverlapping solvers are currently not supported.");
67 cat = SolverType::nonoverlapping;
79 template <
class G,
class L>
80 template <
class Basis>
81 ISTLCommunication<G,L> CommunicationCreator<ISTLCommunication<G,L>>
82 ::create(Basis
const& , std::string
const& )
void error_exit(std::string const &str, Args &&... args)
print a message and exit
Definition: Output.hpp:142
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
auto cat(Dune::TypeTree::HybridTreePath< S... > const &tp0, Dune::TypeTree::HybridTreePath< T... > const &tp1)
Concatenate two treepaths.
Definition: TreePath.hpp:209
static std::optional< T > get(std::string const &key)
Get parameter-values from parameter-tree.
Definition: Initfile.hpp:25
void test_exit(bool condition, std::string const &str, Args &&... args)
test for condition and in case of failure print message and exit
Definition: Output.hpp:163