Peano 4
Loading...
Searching...
No Matches
GlobalAdaptiveTimeStepWithEnclaveTasking.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.SeparateSweepsWithEnclaveTasking import SeparateSweepsWithEnclaveTasking
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
18from exahype2.solvers.rkdg.AdaptiveTimeSteppingCodeSnippets import AdaptiveTimeSteppingCodeSnippets
19
20
22 def __init__(self,
23 name,
24 rk_order,
25 polynomials,
26 face_projections,
27 unknowns,
28 auxiliary_variables,
29 min_cell_h,
30 max_cell_h,
31 time_step_relaxation,
32 flux=PDETerms.User_Defined_Implementation,
33 eigenvalues=PDETerms.User_Defined_Implementation,
34 ncp=PDETerms.None_Implementation,
35 point_source=PDETerms.None_Implementation,
36 boundary_conditions=PDETerms.User_Defined_Implementation,
37 refinement_criterion=PDETerms.Empty_Implementation,
38 initial_conditions=PDETerms.User_Defined_Implementation,
39 source_term=PDETerms.None_Implementation,
40 plot_grid_properties=False,
41 pde_terms_without_state=False,
42 ):
43 super(GlobalAdaptiveTimeStepWithEnclaveTasking,self).__init__(name,
44 rk_order,
45 polynomials,
46 face_projections,
47 unknowns,
48 auxiliary_variables,
49 min_cell_h,
50 max_cell_h,
51 plot_grid_properties,
52 pde_terms_without_state)
53
54 self._time_step_relaxation = time_step_relaxation
56
58 self._volumetric_compute_kernel_call_volumetric_compute_kernel_call = create_volumetric_solver_call(self._basis, SolverVariant.WithVirtualFunctions)
59 self._volumetric_compute_kernel_call_stateless_volumetric_compute_kernel_call_stateless = create_volumetric_solver_call(self._basis, SolverVariant.Stateless)
60 self._Riemann_compute_kernel_call_Riemann_compute_kernel_call = create_Riemann_solver_call(self._basis, face_projections)
61 # TODO: self._Riemann_compute_kernel_call_stateless =
64 # TODO: self._fused_Riemann_compute_kernel_call_cpu =
65 # TODO: self._fused_Riemann_compute_kernel_call_gpu =
66 self._add_solver_contributions_call_add_solver_contributions_call = create_add_solver_contributions_call(self._basis)
67 self._multiply_with_inverted_mass_matrix_call_multiply_with_inverted_mass_matrix_call = create_multiply_with_inverted_mass_matrix_call(self._basis)
68
69 self.set_implementationset_implementation(boundary_conditions=boundary_conditions,
70 refinement_criterion=refinement_criterion,
71 initial_conditions=initial_conditions,
72 additional_action_set_includes="",
73 additional_user_includes="",
74 flux=flux,
75 eigenvalues=eigenvalues,
76 ncp=ncp,
77 source_term=source_term,
78 point_source=point_source
79 )
80
81
83 flux=None,
84 ncp=None,
85 eigenvalues=None,
86 boundary_conditions=None,
87 refinement_criterion=None,
88 initial_conditions=None,
89 source_term=None,
90 point_source=None,
91 additional_action_set_includes = "",
92 additional_user_includes = ""
93 ):
94 """
95 If you pass in User_Defined, then the generator will create C++ stubs
96 that you have to befill manually. If you pass in None_Implementation, it
97 will create nop, i.e., no implementation or defaults. Any other string
98 is copied 1:1 into the implementation. If you pass in None, then the
99 set value so far won't be overwritten.
100
101 Please note that not all options are supported by all solvers. You
102 cannot set ncp and fluxes for the ClawPack Riemann solvers, e.g.
103
104 This routine should be the very last invoked by the constructor.
105 """
106 super(GlobalAdaptiveTimeStepWithEnclaveTasking,self).set_implementation(boundary_conditions=boundary_conditions,
107 refinement_criterion=refinement_criterion,
108 initial_conditions=initial_conditions,
109 additional_action_set_includes=additional_action_set_includes,
110 additional_user_includes=additional_user_includes,
111 flux=flux,
112 ncp=ncp,
113 eigenvalues=eigenvalues,
114 source_term=source_term,
115 point_source=point_source
116 )
117
119
121 self._abstract_solver_user_declarations_abstract_solver_user_declarations += solver_code_snippets.create_abstract_solver_user_declarations()
123 self._abstract_solver_user_definitions_abstract_solver_user_definitions += solver_code_snippets.create_abstract_solver_user_definitions()
124
127
128 self._compute_time_step_size_compute_time_step_size = solver_code_snippets.create_compute_time_step_size()
129 self._compute_new_time_step_size_compute_new_time_step_size = solver_code_snippets.create_compute_new_time_step_size()
130
131 self._start_time_step_implementation_start_time_step_implementation = solver_code_snippets.create_start_time_step_implementation()
132 self._finish_time_step_implementation_finish_time_step_implementation = solver_code_snippets.create_finish_time_step_implementation()
133 self._constructor_implementation_constructor_implementation = solver_code_snippets.create_abstract_solver_constructor_statements()
134
135
136 @property
138 return super(GlobalAdaptiveTimeStepWithEnclaveTasking, self).user_action_set_includes + """
139#include "exahype2/dg/rusanov/Rusanov.h"
140"""
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...
Two separate sweeps per Runge-Kutta sweep where volumetric operations are outsourced into dedicated t...
user_action_set_includes(self)
Add further includes to this property, if your action sets require some additional routines from othe...
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...
__init__(self, name, rk_order, polynomials, face_projections, unknowns, auxiliary_variables, min_cell_h, max_cell_h, time_step_relaxation, 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, plot_grid_properties=False, pde_terms_without_state=False)
See superclass constructor for all the interesting info.