|
| | parser = argparse.ArgumentParser(description="SPH test script") |
| | Parse user input.
|
| |
| | dest |
| |
| | type |
| |
| | default |
| |
| | help |
| |
| | action |
| |
| | required |
| |
| | choices |
| |
| | args = parser.parse_args() |
| |
| list | project_namespace = ["tests", "exaparty", "sedov1D"] |
| | Generate ExaParty project.
|
| |
| | project |
| |
| str | name = "HydroPart" |
| |
| int | dimensions = 2 |
| |
| int | hydro_dimensions = 1 |
| |
| | particle |
| |
| list | offset = [0, 0, 0] |
| | Set parameters for the SPH simulation If no parameters are passed to the exaparty project, it initializes with default values.
|
| |
| list | domain_size = [1, 1, 1] |
| |
| list | periodic_boundary_conditions = [True, False, False] |
| |
| int | HYDRO_DIMENSIONS = hydro_dimensions |
| |
| | HYDRO_PART_NUMBER = args.particle_number |
| |
| | GLOBAL_TIME_STEP_SIZE = args.timestep_size |
| |
| | CFL_CONSTANT = args.cfl_factor |
| |
| list | gamma_hydro_list = [str(5 / 3), str(7 / 5), str(4 / 3), str(2 / 1)] |
| |
| list | gamma_hydro_list_symbols |
| |
| list | GAMMA = gamma_hydro_list[0] |
| |
| list | GAMMA_HYDRO_SYMBOL = gamma_hydro_list_symbols[0] |
| |
| | kernel = args.kernel |
| |
| | KERNEL_SYMBOL = sphtools.sph_kernel_macro_name[kernel] |
| |
| | KERNEL_SUPPORT_RAD = sphtools.sph_kernel_H_over_h[HYDRO_DIMENSIONS - 1][kernel] |
| |
| int | depth = 0 |
| |
| list | cellsize = domain_size[0] |
| |
| list | dx = domain_size[0] / args.particle_number |
| |
| float | hydro_H_max = 0.499 * cellsize |
| |
| | hydro_h_max |
| |
| | h_hydro_max |
| |
| | particle_set = project.add_particle_species(particle) |
| |
| | build_mode = peano4.api.output.CompileMode.DEBUG |
| |
| | min_end_time |
| |
| | max_end_time |
| |
| | first_plot_time_stamp |
| |
| | time_in_between_plots |
| |
| | periodic_BC |
| |
| | plotter_precision |
| |
| str | parallelisation = "domain-decomposition" |
| |
| str | storage = "scattered" |
| |
| str | sorting = "bucket-sort" |
| |
| str | kernel_optimisation = "no-optimisation" |
| |
| | ICs = exaparty.api.scenario.SedovBlastIC() |
| | Initialisation snippet for the particle.
|
| |
| | initialisation_snippet = ICs.initialisation_snippet |
| |
| float | coords = np.ones((args.particle_number, 2)) * 0.5 |
| |
| | particle_plotter |
| | Set up the plotter.
|
| |
| | peano4_project = project.generate_Peano4_project(verbose=args.verbose) |
| | Generate plain Peano 4 project.
|
| |
| list | dirs = ["vertexdata/", "repositories/", "globaldata/", "observers/"] |
| | Cleanup and compilation.
|
| |
| | overwrite |
| |
| | Always |
| |
| | throw_away_data_after_generation |
| |
| | make_clean_first |
| |
| | True |
| |
| | number_of_parallel_builds |
| |
| list | output_files |
| |
Initial value:
2 "particles",
3 particle_set,
4 "globaldata::{}::getSpecies().getMinTimeStamp()".format(particle.name),
5)
For constructor's time_stamp_evaluation argument.
Set up the plotter.
A plotter has to be told explicitly which data to visualisation. We visualise the velocity here as scalar attribute. To some degree, this is redundant info as we implicitly have the position of the particle and can "see" its velocity when we play through a movie. But the explicit visualisation shows how to handle attributes per particle.
When we create the plotter, we have to inform it how to enumerate the individual snapshots. Obviously, we can just count through the snapshots. In this case, you have to pass the constant peano4.api.toolbox.particles.PlotParticlesInVTKFormat.CountTimeSteps into the field time_stamp_evaluation. You can also define your own time stamp. For this, it is useful to know that each particle definition in the Python script will yield a particle class with the same name in the subnamespace globaldata. Every particle class in return has a class attribute
getSpecies()
which returns an object that holds global information about this particle type.
Definition at line 351 of file sedov.py.