Peano 4
Loading...
Searching...
No Matches
GlobalFixedTimeStep.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
3from exahype2.solvers.PDETerms import PDETerms
4from exahype2.solvers.rkdg.SeparateSweeps import SeparateSweeps
5
6from exahype2.solvers.rkdg.kernels import create_abstract_solver_declarations
7from exahype2.solvers.rkdg.kernels import create_abstract_solver_definitions
8from exahype2.solvers.rkdg.kernels import create_solver_declarations
9from exahype2.solvers.rkdg.kernels import create_solver_definitions
10
11from exahype2.solvers.rkdg.kernels import SolverVariant
12
13from exahype2.solvers.rkdg.kernels import create_volumetric_solver_call
14from exahype2.solvers.rkdg.kernels import create_add_solver_contributions_call
15from exahype2.solvers.rkdg.kernels import create_multiply_with_inverted_mass_matrix_call
16from exahype2.solvers.rkdg.rusanov.kernels import create_Riemann_solver_call
17
19 FixedTimeSteppingCodeSnippets,
20)
21
22
25 self,
26 name,
27 rk_order,
28 polynomials,
29 face_projections,
30 unknowns,
31 auxiliary_variables,
32 min_cell_h,
33 max_cell_h,
34 time_step_size,
35 flux=PDETerms.User_Defined_Implementation,
36 eigenvalues=PDETerms.User_Defined_Implementation,
37 ncp=PDETerms.None_Implementation,
38 point_source=PDETerms.None_Implementation,
39 boundary_conditions=PDETerms.User_Defined_Implementation,
40 refinement_criterion=PDETerms.Empty_Implementation,
41 initial_conditions=PDETerms.User_Defined_Implementation,
42 source_term=PDETerms.None_Implementation,
43 pde_terms_without_state=False,
44 plot_grid_properties=False,
45 ):
46 super(GlobalFixedTimeStep, self).__init__(
47 name,
48 rk_order,
49 polynomials,
50 face_projections,
51 unknowns,
52 auxiliary_variables,
53 min_cell_h,
54 max_cell_h,
55 plot_grid_properties,
56 pde_terms_without_state
57 )
58
60 self._normalised_time_step_size = time_step_size
61
63 self._volumetric_compute_kernel_call_volumetric_compute_kernel_call = create_volumetric_solver_call(self._basis, SolverVariant.WithVirtualFunctions)
64 self._volumetric_compute_kernel_call_stateless_volumetric_compute_kernel_call_stateless = create_volumetric_solver_call(self._basis, SolverVariant.Stateless)
65 self._Riemann_compute_kernel_call_Riemann_compute_kernel_call = create_Riemann_solver_call(self._basis, face_projections)
66 # TODO: self._Riemann_compute_kernel_call_stateless =
67 self._add_solver_contributions_call_add_solver_contributions_call = create_add_solver_contributions_call(self._basis)
68 self._multiply_with_inverted_mass_matrix_call_multiply_with_inverted_mass_matrix_call = create_multiply_with_inverted_mass_matrix_call(self._basis)
69
71 boundary_conditions=boundary_conditions,
72 refinement_criterion=refinement_criterion,
73 initial_conditions=initial_conditions,
74 additional_action_set_includes="",
75 additional_user_includes="",
76 flux=flux,
77 eigenvalues=eigenvalues,
78 ncp=ncp,
79 source_term=source_term,
80 point_source=point_source,
81 )
82
83
85 self,
86 flux=None,
87 ncp=None,
88 boundary_conditions=None,
89 refinement_criterion=None,
90 initial_conditions=None,
91 eigenvalues=None,
92 source_term=None,
93 point_source=None,
94 additional_action_set_includes="",
95 additional_user_includes="",
96 ):
97 super(GlobalFixedTimeStep, self).set_implementation(
98 boundary_conditions=boundary_conditions,
99 refinement_criterion=refinement_criterion,
100 initial_conditions=initial_conditions,
101 additional_action_set_includes="",
102 additional_user_includes="",
103 flux=flux,
104 ncp=ncp,
105 eigenvalues=eigenvalues,
106 source_term=source_term,
107 point_source=point_source,
108 )
109
110 # self._source_term_call = create_source_term_kernel(self._source_term_implementation)
111 # self._Riemann_solver_call = create_compute_Riemann_kernel_for_Rusanov(self._flux_implementation, self._ncp_implementation)
112
113 solver_code_snippets = FixedTimeSteppingCodeSnippets(
115 )
116
124 )
126 solver_code_snippets.create_abstract_solver_user_declarations()
127 )
135 )
137 solver_code_snippets.create_abstract_solver_user_definitions()
138 )
139
140 self._solver_user_declarations_solver_user_declarations = create_solver_declarations(
147 )
148 self._solver_user_definitions_solver_user_definitions = create_solver_definitions(
155 )
156
158 solver_code_snippets.create_compute_time_step_size()
159 )
161 solver_code_snippets.create_compute_new_time_step_size()
162 )
163
165 solver_code_snippets.create_start_time_step_implementation()
166 )
168 solver_code_snippets.create_finish_time_step_implementation()
169 )
171 solver_code_snippets.create_abstract_solver_constructor_statements()
172 )
173
174
175 @property
177 return (
178 super(GlobalFixedTimeStep, self).user_action_set_includes
179 + """
180#include "exahype2/dg/rusanov/Rusanov.h"
181"""
182 )
Code snippet generator for fixed time stepping in the Runge-Kutta schemes.
set_implementation(self, flux=None, ncp=None, eigenvalues=None, boundary_conditions=None, refinement_criterion=None, initial_conditions=None, source_term=None, point_source=None, additional_action_set_includes="", additional_user_includes="")
If you pass in User_Defined, then the generator will create C++ stubs that you have to befill manuall...
Probably the simplest solver you could think off.
__init__(self, name, rk_order, polynomials, face_projections, unknowns, auxiliary_variables, min_cell_h, max_cell_h, time_step_size, flux=PDETerms.User_Defined_Implementation, eigenvalues=PDETerms.User_Defined_Implementation, ncp=PDETerms.None_Implementation, point_source=PDETerms.None_Implementation, boundary_conditions=PDETerms.User_Defined_Implementation, refinement_criterion=PDETerms.Empty_Implementation, initial_conditions=PDETerms.User_Defined_Implementation, source_term=PDETerms.None_Implementation, pde_terms_without_state=False, plot_grid_properties=False)
The super call invokes the creation of the data sets, where the guards have to be known already.
set_implementation(self, flux=None, ncp=None, boundary_conditions=None, refinement_criterion=None, initial_conditions=None, eigenvalues=None, source_term=None, point_source=None, additional_action_set_includes="", additional_user_includes="")
If you pass in User_Defined, then the generator will create C++ stubs that you have to befill manuall...
user_action_set_includes(self)
Add further includes to this property, if your action sets require some additional routines from othe...