9 "GLMc0":1.5,
"GLMc":1.2,
"GLMd":2.0,
"GLMepsA":1.0,
"GLMepsP":1.0,
11 "itau":1.0,
"k1":0.1,
"k2":0.0,
"k3":0.5,
"eta":1.0,
12 "f":0.75,
"g":0.0,
"xi":1.0,
"e":1.0,
"c":1.0,
"mu":0.2,
"ds":1.0,
14 "domain_r":0.5,
"smoothing":0.0,
"KOSigma":8.0
17intparams = {
"BBHType":2,
"LapseType":0,
"tp_grid_setup":0,
"swi":99,
"ReSwi":1,
"SO":0}
19if __name__ ==
"__main__":
20 parser = argparse.ArgumentParser(description=
'ExaHyPE 2 - CCZ4 script')
21 parser.add_argument(
"-maxh",
"--max-h", dest=
"max_h", type=float, default=0.05, help=
"upper limit for refinement. Refers to volume size, i.e. not to patch size" )
22 parser.add_argument(
"-minh",
"--min-h", dest=
"min_h", type=float, default=0.05, help=
"lower limit for refinement (set to 0 to make it equal to max_h - default). Refers to volume size, i.e. not to patch size" )
23 parser.add_argument(
"-ps",
"--patch-size", dest=
"patch_size", type=int, default=9, help=
"Patch size, i.e. number of volumes per patch per direction" )
25 for k, v
in floatparams.items(): parser.add_argument(
"--{}".format(k), dest=
"CCZ4{}".format(k), type=float, default=v, help=
"default: %(default)s")
26 for k, v
in intparams.items(): parser.add_argument(
"--{}".format(k), dest=
"CCZ4{}".format(k), type=int, default=v, help=
"default: %(default)s")
28 args = parser.parse_args()
30 class CCZ4Solver( exahype2.solvers.fv.rusanov.GlobalAdaptiveTimeStepWithEnclaveTasking ):
31 def __init__(self, name, patch_size, min_volume_h, max_volume_h, cfl, domain_r, KOSig):
53 number_of_unknowns = sum(unknowns.values())
56#include "exagrype/ccz4/Kernels.h"
59 name=name, patch_size=patch_size,
60 unknowns=number_of_unknowns,
61 auxiliary_variables=0,
62 min_volume_h=min_volume_h, max_volume_h=max_volume_h,
63 time_step_relaxation=cfl,
64 pde_terms_without_state=
True,
70 self.set_implementation(
71 boundary_conditions=exahype2.solvers.PDETerms.User_Defined_Implementation,
72 ncp=exahype2.solvers.PDETerms.User_Defined_Implementation,
73 flux=exahype2.solvers.PDETerms.None_Implementation,
74 source_term=exahype2.solvers.PDETerms.User_Defined_Implementation,
75 refinement_criterion = exahype2.solvers.PDETerms.User_Defined_Implementation,
76 eigenvalues = exahype2.solvers.PDETerms.User_Defined_Implementation
83 constexpr int itmax = {{NUMBER_OF_VOLUMES_PER_AXIS}} * {{NUMBER_OF_VOLUMES_PER_AXIS}};
87 constexpr int itmax = {{NUMBER_OF_VOLUMES_PER_AXIS}} * {{NUMBER_OF_VOLUMES_PER_AXIS}} * {{NUMBER_OF_VOLUMES_PER_AXIS}};
91 for (int i=0;i<itmax;i++)
93 exagrype::ccz4::enforceCCZ4constraints( newQ+index );
94 index += {{NUMBER_OF_UNKNOWNS}} + {{NUMBER_OF_AUXILIARY_VARIABLES}};
101 self._action_set_couple_resolution_transitions_and_handle_dynamic_mesh_refinement.additional_includes +=
"""
102#include "exagrype/ccz4/Kernels.h"
107 We take this routine to add a few additional include statements.
115 project = exahype2.Project( [
"benchmarks",
"exahype2",
"ccz4"],
"ccz4", executable=
"peano4_test")
117 my_solver =
CCZ4Solver(
"CCZ4", args.patch_size, args.min_h, args.max_h, 0.1, args.CCZ4domain_r,args.CCZ4KOSigma)
118 userinfo.append((
"CFL ratio set as "+str(0.1),
None))
119 userinfo.append((
"The solver is Rusanov Finite Volume with EnclaveTasking",
None))
125 for k, v
in intparams.items():
126 intparams.update({k:eval(
"args.CCZ4{}".format(k))})
127 for k, v
in floatparams.items():
128 floatparams.update({k:eval(
"args.CCZ4{}".format(k))})
131 userinfo.append((
"picking gauge wave scenario",
None))
133 for k, v
in floatparams.items(): solverconstants+=
"static constexpr double {} = {};\n".format(
"CCZ4{}".format(k), v)
134 for k, v
in intparams.items(): solverconstants+=
"static constexpr int {} = {};\n".format(
"CCZ4{}".format(k), v)
135 my_solver.add_solver_constants(solverconstants)
137 project.add_solver(my_solver)
144 project.set_global_simulation_parameters(
146 [-0.5,-0.5,-0.5],[1,1,1],
153 project.set_Peano4_installation(
"../../../..", peano4.api.output.CompileMode.RELEASE)
155 project.set_output_path(
"./")
156 project.set_load_balancing(
"toolbox::loadbalancing::strategies::SpreadOutHierarchically",
"(new ::exahype2::LoadBalancingConfiguration(0.95,1000,16))" )
161 peano4_project = project.generate_Peano4_project(verbose=
True)
162 peano4_project.output.makefile.add_header_search_path(
"../../../../applications/exahype2/ccz4/")
164 peano4_project.output.makefile.add_CXX_flag(
"-DCCZ4EINSTEIN" )
168 peano4_project.generate( throw_away_data_after_generation=
False )
169 peano4_project.build( make_clean_first =
True )
172 userinfo.append((
"the executable file name: peano4_test",
None))
173 print(
"=========================================================")
174 print(
"The building information:")
175 for msg, exception
in userinfo: print(msg)
178 print(
"=========================================================")
postprocess_updated_patch
get_user_action_set_includes(self)
We take this routine to add a few additional include statements.
__init__(self, name, patch_size, min_volume_h, max_volume_h, cfl, domain_r, KOSig)