Peano 4
Loading...
Searching...
No Matches
noh Namespace Reference

Variables

str Parallelisation_DomainDecomposition = "domain-decomposition"
 Parse user input.
 
str Parallelisation_TaskTree = "task-tree"
 
str Parallelisation_TaskGraph = "task-graph"
 
list ParallelisationVariants
 
str Storage_Scattered = "scattered"
 
str Storage_ContinuousPerVertex = "continuous-per-vertex"
 
str Storage_GlobalContinuous = "global-continuous"
 
list StorageVariants = [Storage_ContinuousPerVertex, Storage_GlobalContinuous]
 
str Sorting_MultiscaleSort = "multiscale-sort"
 
str Sorting_BucketSort = "bucket-sort"
 
list SortingVariants = [Sorting_MultiscaleSort, Sorting_BucketSort]
 
str KernelOptimisation_NoOptimisation = "no-optimisation"
 
str KernelOptimisation_OuterGuards = "outer-guards"
 
str KernelOptimisation_VectoriseAll = "vectorise-all"
 
str KernelOptimisation_VectoriseDistanceChecks = "vectorise-distance-checks"
 
list BasicKernelOptimisationVariants
 
list AllKernelOptimisationVariants
 
list Choices
 
 parser = argparse.ArgumentParser(description="SPH benchmarking script")
 Parse user input.
 
 dest
 
 type
 
 default
 
 help
 
 action
 
 required
 
 choices
 
 args = parser.parse_args()
 
list project_namespace = ["benchmarks", "swift2", "noh"]
 Generate SWIFT project.
 
 project
 
 algorithm_steps_task_graph_compiler
 
 initialisation_steps_task_graph_compiler
 
str name = "HydroPart"
 
int dimensions = 2
 
int hydro_dimensions = 2
 
 particles_per_cell = args.particles_per_cell
 
int total_number_of_particles = args.particle_number**hydro_dimensions
 
int total_number_of_cells = total_number_of_particles / particles_per_cell
 
int cells_per_dimension = total_number_of_cells ** (1.0 / hydro_dimensions)
 
float max_cell_size = 1.0 / cells_per_dimension * 3.0
 
tuple particle_interaction_kernel_realisation
 
 particle
 
int HYDRO_DIMENSIONS = hydro_dimensions
 Set parameters for the SPH simulation If no parameters are passed to the swift2 project, it initializes with default values.
 
 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]
 
float hydro_h_max = max_cell_size / 2
 
 h_hydro_max
 
 valid_mantissa_bits
 
 particle_set = project.add_particle_species(particle)
 
 generator
 
 build_mode = peano4.output.CompileMode.Release
 
list offset = [0, 0, 0]
 Set parameters for the SPH simulation If no parameters are passed to the swift2 project, it initializes with default values.
 
list domain_size = [1, 1, 1]
 
list periodic_boundary_conditions = [False, False, False]
 
 min_end_time
 
 max_end_time
 
 first_plot_time_stamp
 
 time_in_between_plots
 
 periodic_BC
 
 plotter_precision
 
 ICs = swift2.scenario.NohProblemIC(dimensions=HYDRO_DIMENSIONS)
 Initialisation snippet for the particle.
 
 initialisation_snippet = ICs.initialisation_snippet
 
 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
 
 int
 
list dx = domain_size[0] / args.particle_number
 
float hydro_H_max = 10.0 * dx
 

Variable Documentation

◆ action

noh.action

Definition at line 81 of file noh.py.

◆ algorithm_steps_task_graph_compiler

noh.algorithm_steps_task_graph_compiler

Definition at line 212 of file noh.py.

◆ AllKernelOptimisationVariants

list noh.AllKernelOptimisationVariants
Initial value:
1= [
2 KernelOptimisation_NoOptimisation,
3 KernelOptimisation_OuterGuards,
4 KernelOptimisation_VectoriseAll,
5 KernelOptimisation_VectoriseDistanceChecks,
6]

Definition at line 44 of file noh.py.

◆ Always

noh.Always

Definition at line 597 of file noh.py.

◆ args

noh.args = parser.parse_args()

Definition at line 195 of file noh.py.

◆ BasicKernelOptimisationVariants

list noh.BasicKernelOptimisationVariants
Initial value:
1= [
2 KernelOptimisation_NoOptimisation,
3 KernelOptimisation_OuterGuards,
4]

Definition at line 40 of file noh.py.

◆ build_mode

noh.build_mode = peano4.output.CompileMode.Release

Definition at line 437 of file noh.py.

◆ cells_per_dimension

int noh.cells_per_dimension = total_number_of_cells ** (1.0 / hydro_dimensions)

Definition at line 294 of file noh.py.

◆ CFL_CONSTANT

noh.CFL_CONSTANT = args.cfl_factor

Definition at line 353 of file noh.py.

◆ Choices

list noh.Choices
Initial value:
1= [
2 parallelisation_variant + "." + storage + "." + sorting + "." + kernel_optimisation
3 for parallelisation_variant in ParallelisationVariants
4 for storage in [Storage_Scattered]
5 for sorting in SortingVariants
6 for kernel_optimisation in BasicKernelOptimisationVariants
7] + [
8 parallelisation_variant + "." + storage + "." + sorting + "." + kernel_optimisation
9 for parallelisation_variant in ParallelisationVariants
10 for storage in StorageVariants
11 for sorting in SortingVariants
12 for kernel_optimisation in AllKernelOptimisationVariants
13]

Definition at line 52 of file noh.py.

◆ choices

noh.choices

Definition at line 166 of file noh.py.

◆ default

noh.default

Definition at line 74 of file noh.py.

◆ dest

noh.dest

Definition at line 72 of file noh.py.

◆ dimensions

int noh.dimensions = 2

Definition at line 288 of file noh.py.

◆ dirs

list noh.dirs = ["vertexdata/", "repositories/", "globaldata/", "observers/"]

Cleanup and compilation.

Definition at line 590 of file noh.py.

◆ domain_size

list noh.domain_size = [1, 1, 1]

Definition at line 449 of file noh.py.

◆ dx

list noh.dx = domain_size[0] / args.particle_number

Definition at line 183 of file noh.py.

◆ first_plot_time_stamp

noh.first_plot_time_stamp

Definition at line 458 of file noh.py.

◆ GAMMA

list noh.GAMMA = gamma_hydro_list[0]

Definition at line 363 of file noh.py.

◆ gamma_hydro_list

list noh.gamma_hydro_list = [str(5 / 3), str(7 / 5), str(4 / 3), str(2 / 1)]

Definition at line 356 of file noh.py.

◆ gamma_hydro_list_symbols

list noh.gamma_hydro_list_symbols
Initial value:
1= [
2 "HYDRO_GAMMA_5_3",
3 "HYDRO_GAMMA_7_5",
4 "HYDRO_GAMMA_4_3",
5 "HYDRO_GAMMA_2_1",
6 ]

Definition at line 357 of file noh.py.

◆ GAMMA_HYDRO_SYMBOL

list noh.GAMMA_HYDRO_SYMBOL = gamma_hydro_list_symbols[0]

Definition at line 364 of file noh.py.

◆ generator

noh.generator

Definition at line 418 of file noh.py.

◆ GLOBAL_TIME_STEP_SIZE

noh.GLOBAL_TIME_STEP_SIZE = args.timestep_size

Definition at line 352 of file noh.py.

◆ h_hydro_max

noh.h_hydro_max

Definition at line 373 of file noh.py.

◆ help

noh.help

Definition at line 75 of file noh.py.

◆ hydro_dimensions

int noh.hydro_dimensions = 2

Definition at line 289 of file noh.py.

◆ HYDRO_DIMENSIONS

int noh.HYDRO_DIMENSIONS = hydro_dimensions

Set parameters for the SPH simulation If no parameters are passed to the swift2 project, it initializes with default values.

The values of the parameters can be modified or retrieved using the set/get methods.

Definition at line 346 of file noh.py.

◆ hydro_h_max

noh.hydro_h_max = max_cell_size / 2

Definition at line 372 of file noh.py.

◆ hydro_H_max

float noh.hydro_H_max = 10.0 * dx

Definition at line 184 of file noh.py.

◆ HYDRO_PART_NUMBER

noh.HYDRO_PART_NUMBER = args.particle_number

Definition at line 349 of file noh.py.

◆ ICs

Initialisation snippet for the particle.

Definition at line 482 of file noh.py.

◆ initialisation_snippet

noh.initialisation_snippet = ICs.initialisation_snippet

Definition at line 483 of file noh.py.

◆ initialisation_steps_task_graph_compiler

noh.initialisation_steps_task_graph_compiler

Definition at line 215 of file noh.py.

◆ int

noh.int

Definition at line 19 of file noh.py.

◆ kernel

noh.kernel = args.kernel

Definition at line 368 of file noh.py.

◆ KERNEL_SUPPORT_RAD

noh.KERNEL_SUPPORT_RAD = sphtools.sph_kernel_H_over_h[HYDRO_DIMENSIONS - 1][kernel]

Definition at line 370 of file noh.py.

◆ KERNEL_SYMBOL

noh.KERNEL_SYMBOL = sphtools.sph_kernel_macro_name[kernel]

Definition at line 369 of file noh.py.

◆ KernelOptimisation_NoOptimisation

str noh.KernelOptimisation_NoOptimisation = "no-optimisation"

Definition at line 35 of file noh.py.

◆ KernelOptimisation_OuterGuards

str noh.KernelOptimisation_OuterGuards = "outer-guards"

Definition at line 36 of file noh.py.

◆ KernelOptimisation_VectoriseAll

str noh.KernelOptimisation_VectoriseAll = "vectorise-all"

Definition at line 37 of file noh.py.

◆ KernelOptimisation_VectoriseDistanceChecks

str noh.KernelOptimisation_VectoriseDistanceChecks = "vectorise-distance-checks"

Definition at line 38 of file noh.py.

◆ make_clean_first

noh.make_clean_first

Definition at line 599 of file noh.py.

◆ max_cell_size

float noh.max_cell_size = 1.0 / cells_per_dimension * 3.0

Definition at line 295 of file noh.py.

◆ max_end_time

noh.max_end_time

Definition at line 457 of file noh.py.

◆ min_end_time

noh.min_end_time

Definition at line 456 of file noh.py.

◆ name

str noh.name = "HydroPart"

Definition at line 286 of file noh.py.

◆ number_of_parallel_builds

noh.number_of_parallel_builds

Definition at line 599 of file noh.py.

◆ offset

list noh.offset = [0, 0, 0]

Set parameters for the SPH simulation If no parameters are passed to the swift2 project, it initializes with default values.

The values of the parameters can be modified or retrieved using the set/get methods.

Definition at line 448 of file noh.py.

◆ output_files

list noh.output_files
Initial value:
1= [
2 f
3 for f in os.listdir(".")
4 if f.endswith(".peano-patch-file")
5 or f.endswith(".vtu")
6 or f.endswith(".pvd")
7 ]

Definition at line 603 of file noh.py.

◆ overwrite

noh.overwrite

Definition at line 597 of file noh.py.

◆ Parallelisation_DomainDecomposition

str noh.Parallelisation_DomainDecomposition = "domain-decomposition"

Parse user input.

Definition at line 17 of file noh.py.

◆ Parallelisation_TaskGraph

str noh.Parallelisation_TaskGraph = "task-graph"

Definition at line 19 of file noh.py.

◆ Parallelisation_TaskTree

str noh.Parallelisation_TaskTree = "task-tree"

Definition at line 18 of file noh.py.

◆ ParallelisationVariants

list noh.ParallelisationVariants
Initial value:
1= [
2 Parallelisation_DomainDecomposition,
3 Parallelisation_TaskTree,
4 Parallelisation_TaskGraph,
5]

Definition at line 20 of file noh.py.

◆ parser

noh.parser = argparse.ArgumentParser(description="SPH benchmarking script")

Parse user input.

Definition at line 68 of file noh.py.

◆ particle

noh.particle
Initial value:
2 name=name,
3 dimensions_hydro=hydro_dimensions,
4 cfl_factor=args.cfl_factor,
5 initial_time_step_size=args.timestep_size,
6 constant_time_step_size=True,
7 swift_project_namespace=project_namespace,
8 particles_per_cell=particles_per_cell,
9 min_h=max_cell_size,
10 max_h=max_cell_size,
11 particle_interaction_kernel_realisation=particle_interaction_kernel_realisation,
12 )

Definition at line 325 of file noh.py.

◆ particle_interaction_kernel_realisation

tuple noh.particle_interaction_kernel_realisation
Initial value:
1= (
2 swift2.particle.SPHLeapfrogFixedSearchRadius.ParticleKernelRealisation.NO_OPTIMISATION
3 )

Definition at line 307 of file noh.py.

◆ particle_plotter

noh.particle_plotter
Initial value:
2 "particles",
3 particle_set,
4 "globaldata::{}::getSpecies().getMinTimeStamp()".format(particle.name),
5 )

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.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 519 of file noh.py.

◆ particle_set

noh.particle_set = project.add_particle_species(particle)

Definition at line 415 of file noh.py.

◆ particles_per_cell

noh.particles_per_cell = args.particles_per_cell

Definition at line 291 of file noh.py.

◆ peano4_project

noh.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.

Definition at line 550 of file noh.py.

◆ periodic_BC

noh.periodic_BC

Definition at line 460 of file noh.py.

◆ periodic_boundary_conditions

list noh.periodic_boundary_conditions = [False, False, False]

Definition at line 450 of file noh.py.

◆ plotter_precision

noh.plotter_precision

Definition at line 461 of file noh.py.

◆ project

noh.project
Initial value:
2 namespace=project_namespace, project_name="Noh", executable=args.output_file
3 )
Swift2 project.
Definition Project.py:23

Definition at line 203 of file noh.py.

◆ project_namespace

list noh.project_namespace = ["benchmarks", "swift2", "noh"]

Generate SWIFT project.

Definition at line 201 of file noh.py.

◆ required

noh.required

Definition at line 96 of file noh.py.

◆ Sorting_BucketSort

str noh.Sorting_BucketSort = "bucket-sort"

Definition at line 32 of file noh.py.

◆ Sorting_MultiscaleSort

str noh.Sorting_MultiscaleSort = "multiscale-sort"

Definition at line 31 of file noh.py.

◆ SortingVariants

list noh.SortingVariants = [Sorting_MultiscaleSort, Sorting_BucketSort]

Definition at line 33 of file noh.py.

◆ Storage_ContinuousPerVertex

str noh.Storage_ContinuousPerVertex = "continuous-per-vertex"

Definition at line 27 of file noh.py.

◆ Storage_GlobalContinuous

str noh.Storage_GlobalContinuous = "global-continuous"

Definition at line 28 of file noh.py.

◆ Storage_Scattered

str noh.Storage_Scattered = "scattered"

Definition at line 26 of file noh.py.

◆ StorageVariants

Definition at line 29 of file noh.py.

◆ throw_away_data_after_generation

noh.throw_away_data_after_generation

Definition at line 597 of file noh.py.

◆ time_in_between_plots

noh.time_in_between_plots

Definition at line 459 of file noh.py.

◆ total_number_of_cells

int noh.total_number_of_cells = total_number_of_particles / particles_per_cell

Definition at line 293 of file noh.py.

◆ total_number_of_particles

int noh.total_number_of_particles = args.particle_number**hydro_dimensions

Definition at line 292 of file noh.py.

◆ True

noh.True

Definition at line 599 of file noh.py.

◆ type

noh.type

Definition at line 73 of file noh.py.

◆ valid_mantissa_bits

noh.valid_mantissa_bits

Definition at line 385 of file noh.py.