Peano
Loading...
Searching...
No Matches
SolverCodeSnippets.py
Go to the documentation of this file.
1# This file is part of the ExaHyPE2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3
4from abc import ABC
5from abc import abstractmethod
6
7
9 """
10
11 Interface for all solvers' code snippets
12
13 Every solver has to inject some code snippets into the generated code: Which
14 fields have to be available in the abstract base class, how do you compute
15 the time step size within the kernels, and so forth. These routines are
16 collected here. They are often the same for different numerical schemes, so
17 it makes sense to bundle them up in snippet classes.
18
19 """
20
21 @abstractmethod
23 raise Exception( "abstract method, not implemented")
24
25
26 @abstractmethod
28 raise Exception( "abstract method, not implemented")
29
30
31 @abstractmethod
33 raise Exception( "abstract method, not implemented")
34
35
36 @abstractmethod
38 """
39
40 Within the actual compute kernels, the kernels ask the solver variant how to
41 determine a new field
42
43
44 const double timeStepSize = ...;
45
46 You can remove the const if you want. Anyway, this routine has to build up the
47 right time step size choice.
48
49 """
50 raise Exception( "abstract method, not implemented")
51
52
53 @abstractmethod
55 """
56
57 Very similar to create_compute_time_step_size(), this routine should return
58 a code snippet which creates a field newTimeStepSize. It is used for subsequent
59 time steps and/or some global analysis.
60
61 """
62 raise Exception( "abstract method, not implemented")
63
64
65 @abstractmethod
67 raise Exception( "abstract method, not implemented")
68
69
70 @abstractmethod
72 raise Exception( "abstract method, not implemented")
73
Interface for all solvers' code snippets.
create_compute_time_step_size()
Within the actual compute kernels, the kernels ask the solver variant how to determine a new field.
create_compute_new_time_step_size()
Very similar to create_compute_time_step_size(), this routine should return a code snippet which crea...