|
Peano
|
Variables | |
| 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", "sod"] |
| 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 = [2, 2, 2] |
| 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 = "multiscale-sort" |
| str | kernel_optimisation = "no-optimisation" |
| 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 |
| list sod.cellsize = domain_size[0] |
| list sod.dirs = ["vertexdata/", "repositories/", "globaldata/", "observers/"] |
| list sod.dx = domain_size[0] / args.particle_number |
| list sod.GAMMA = gamma_hydro_list[0] |
| list sod.gamma_hydro_list = [str(5 / 3), str(7 / 5), str(4 / 3), str(2 / 1)] |
| list sod.gamma_hydro_list_symbols |
| list sod.GAMMA_HYDRO_SYMBOL = gamma_hydro_list_symbols[0] |
| int sod.HYDRO_DIMENSIONS = hydro_dimensions |
| sod.hydro_h_max |
| sod.KERNEL_SUPPORT_RAD = sphtools.sph_kernel_H_over_h[HYDRO_DIMENSIONS - 1][kernel] |
| sod.offset = [0, 0, 0] |
| list sod.output_files |
| sod.parser = argparse.ArgumentParser(description="SPH test script") |
| sod.particle |
| sod.particle_plotter |
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.
| sod.peano4_project = project.generate_Peano4_project(verbose=args.verbose) |
Generate plain Peano 4 project.
The value of some constants such as the adiabatic index cannot be arbitrary but rather we have a set of pre-defined options. The same happens for some functions, e.g. the SPH smoothing kernel. This allows us to define some symbols and fix the values at compile time.
| sod.project |
| list sod.project_namespace = ["tests", "exaparty", "sod"] |