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

Functions

 parse_args ()
 Parse user input.
 

Variables

 args = parse_args()
 
list project_namespace = ["benchmarks", "exaparty", "noh2D"]
 Generate ExaParty project.
 
 project
 
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 = 2.0 / cells_per_dimension * 3.0
 
 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 = [False, 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]
 
float hydro_H_max = max_cell_size / 2
 
list dx = domain_size[0] / args.particle_number
 
 hydro_h_max
 
 h_hydro_max
 
 valid_mantissa_bits
 
 particle_set = project.add_particle_species(particle)
 
 build_mode = peano4.api.output.CompileMode.RELEASE
 
 min_end_time
 
 max_end_time
 
 first_plot_time_stamp
 
 time_in_between_plots
 
 periodic_BC
 
 plotter_precision
 
 realisation = args.realisation.split(".")
 
 parallelisation = realisation[0]
 
 storage = realisation[1]
 
 sorting = realisation[2]
 
 kernel_optimisation = realisation[3]
 
 ICs = exaparty.api.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
 
 parser = argparse.ArgumentParser(description="SPH test script")
 Parse user input.
 
 dest
 
 type
 
 default
 
 help
 
 action
 
 required
 
 choices
 
int depth = 0
 
list cellsize = domain_size[0]
 

Function Documentation

◆ parse_args()

noh.parse_args ( )

Parse user input.

Definition at line 18 of file noh.py.

Variable Documentation

◆ action

noh.action

Definition at line 30 of file noh.py.

◆ Always

noh.Always

Definition at line 468 of file noh.py.

◆ args

noh.args = parse_args()

Definition at line 150 of file noh.py.

◆ build_mode

noh.build_mode = peano4.api.output.CompileMode.RELEASE

Definition at line 294 of file noh.py.

◆ cells_per_dimension

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

Definition at line 174 of file noh.py.

◆ cellsize

list noh.cellsize = domain_size[0]

Definition at line 213 of file noh.py.

◆ CFL_CONSTANT

noh.CFL_CONSTANT = args.cfl_factor

Definition at line 217 of file noh.py.

◆ choices

noh.choices

Definition at line 126 of file noh.py.

◆ default

noh.default

Definition at line 23 of file noh.py.

◆ depth

int noh.depth = 0

Definition at line 212 of file noh.py.

◆ dest

noh.dest

Definition at line 21 of file noh.py.

◆ dimensions

int noh.dimensions = 2

Definition at line 168 of file noh.py.

◆ dirs

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

Cleanup and compilation.

Definition at line 461 of file noh.py.

◆ domain_size

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

Definition at line 206 of file noh.py.

◆ dx

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

Definition at line 238 of file noh.py.

◆ first_plot_time_stamp

noh.first_plot_time_stamp

Definition at line 311 of file noh.py.

◆ GAMMA

list noh.GAMMA = gamma_hydro_list[0]

Definition at line 227 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 220 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 221 of file noh.py.

◆ GAMMA_HYDRO_SYMBOL

list noh.GAMMA_HYDRO_SYMBOL = gamma_hydro_list_symbols[0]

Definition at line 228 of file noh.py.

◆ GLOBAL_TIME_STEP_SIZE

noh.GLOBAL_TIME_STEP_SIZE = args.timestep_size

Definition at line 216 of file noh.py.

◆ h_hydro_max

noh.h_hydro_max

Definition at line 244 of file noh.py.

◆ help

noh.help

Definition at line 24 of file noh.py.

◆ hydro_dimensions

int noh.hydro_dimensions = 2

Definition at line 169 of file noh.py.

◆ HYDRO_DIMENSIONS

int noh.HYDRO_DIMENSIONS = hydro_dimensions

Definition at line 210 of file noh.py.

◆ hydro_H_max

float noh.hydro_H_max = max_cell_size / 2

Definition at line 236 of file noh.py.

◆ hydro_h_max

noh.hydro_h_max
Initial value:
1= exaparty.api.sphtools.sph_kernel_get_smoothing_length_from_interaction_radius(
2 hydro_H_max, kernel, hydro_dimensions
3)

Definition at line 241 of file noh.py.

◆ HYDRO_PART_NUMBER

noh.HYDRO_PART_NUMBER = args.particle_number

Definition at line 213 of file noh.py.

◆ ICs

Initialisation snippet for the particle.

Definition at line 349 of file noh.py.

◆ initialisation_snippet

noh.initialisation_snippet = ICs.initialisation_snippet

Definition at line 350 of file noh.py.

◆ kernel

noh.kernel = args.kernel

Definition at line 232 of file noh.py.

◆ kernel_optimisation

str noh.kernel_optimisation = realisation[3]

Definition at line 322 of file noh.py.

◆ KERNEL_SUPPORT_RAD

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

Definition at line 234 of file noh.py.

◆ KERNEL_SYMBOL

noh.KERNEL_SYMBOL = sphtools.sph_kernel_macro_name[kernel]

Definition at line 233 of file noh.py.

◆ make_clean_first

noh.make_clean_first

Definition at line 470 of file noh.py.

◆ max_cell_size

float noh.max_cell_size = 2.0 / cells_per_dimension * 3.0

Definition at line 175 of file noh.py.

◆ max_end_time

noh.max_end_time

Definition at line 310 of file noh.py.

◆ min_end_time

noh.min_end_time

Definition at line 309 of file noh.py.

◆ name

str noh.name = "HydroPart"

Definition at line 166 of file noh.py.

◆ number_of_parallel_builds

noh.number_of_parallel_builds

Definition at line 470 of file noh.py.

◆ offset

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

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

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

Definition at line 205 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") or f.endswith(".vtu") or f.endswith(".pvd")
5 ]

Definition at line 474 of file noh.py.

◆ overwrite

noh.overwrite

Definition at line 468 of file noh.py.

◆ parallelisation

str noh.parallelisation = realisation[0]

Definition at line 319 of file noh.py.

◆ parser

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

Parse user input.

Definition at line 17 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 exaparty_project_namespace=project_namespace,
8 particles_per_cell=particles_per_cell,
9 min_h=max_cell_size,
10 max_h=max_cell_size,
11)

Definition at line 186 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.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 389 of file noh.py.

◆ particle_set

noh.particle_set = project.add_particle_species(particle)

Definition at line 291 of file noh.py.

◆ particles_per_cell

noh.particles_per_cell = args.particles_per_cell

Definition at line 171 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 420 of file noh.py.

◆ periodic_BC

noh.periodic_BC

Definition at line 313 of file noh.py.

◆ periodic_boundary_conditions

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

Definition at line 207 of file noh.py.

◆ plotter_precision

noh.plotter_precision

Definition at line 314 of file noh.py.

◆ project

noh.project
Initial value:
2 namespace=project_namespace, project_name="Noh2D", executable=args.output_file
3)
ExaParty project.
Definition Project.py:27

Definition at line 158 of file noh.py.

◆ project_namespace

list noh.project_namespace = ["benchmarks", "exaparty", "noh2D"]

Generate ExaParty project.

Definition at line 156 of file noh.py.

◆ realisation

noh.realisation = args.realisation.split(".")

Definition at line 318 of file noh.py.

◆ required

noh.required

Definition at line 45 of file noh.py.

◆ sorting

str noh.sorting = realisation[2]

Definition at line 321 of file noh.py.

◆ storage

str noh.storage = realisation[1]

Definition at line 320 of file noh.py.

◆ throw_away_data_after_generation

noh.throw_away_data_after_generation

Definition at line 468 of file noh.py.

◆ time_in_between_plots

noh.time_in_between_plots

Definition at line 312 of file noh.py.

◆ total_number_of_cells

int noh.total_number_of_cells = total_number_of_particles / particles_per_cell

Definition at line 173 of file noh.py.

◆ total_number_of_particles

int noh.total_number_of_particles = args.particle_number**hydro_dimensions

Definition at line 172 of file noh.py.

◆ True

noh.True

Definition at line 470 of file noh.py.

◆ type

noh.type

Definition at line 22 of file noh.py.

◆ valid_mantissa_bits

noh.valid_mantissa_bits

Definition at line 256 of file noh.py.