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

Variables

 parser = argparse.ArgumentParser(description="SPH benchmarking script")
 Parse user input.
 
 dest
 
 type
 
 int
 
 default
 
 help
 
 action
 
 choices
 
 args = parser.parse_args()
 
 nneigh = args.nneigh
 
 kernel = args.kernel
 
 h_tol = args.h_tol
 
list project_namespace = ["tests", "exaparty", "testSML3D"]
 Generate ExaParty project.
 
 project
 
float cfl_factor = 0.2
 
float init_dt = 1.0e-16
 
list offset = [0, 0, 0]
 
list domain_size = [1, 1, 1]
 
list periodic_boundary_conditions = [False, False, False]
 
str name = "HydroPart"
 
int dimensions = 3
 
int hydro_dimensions = 3
 
 particle
 
int HYDRO_DIMENSIONS = hydro_dimensions
 Set parameters for the SPH simulation If no parameters are passed to the exaparty project, it initializes with default values.
 
 hfile = h5py.File(args.ic_filename, "r")
 
 header = hfile["Header"]
 
 npart = header.attrs["NumPart_ThisFile"][0]
 
 npart_base = header.attrs["NumPart_base"][0]
 
 HYDRO_PART_NUMBER = npart
 
float GLOBAL_TIME_STEP_SIZE = init_dt
 
float CFL_CONSTANT = 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_SYMBOL = exaparty.api.sphtools.sph_kernel_macro_name[kernel]
 
list dx = domain_size[0] / npart_base
 
int hydro_H_max = 4 * dx
 
 hydro_h_max
 
 h_hydro_max
 
 eta_factor
 
 ndim
 
 h_hydro_min
 
 h_max_iterations
 
 h_tolerance
 
 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
 
 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
 

Variable Documentation

◆ action

test_smoothing_length_computation_3D.action

Definition at line 26 of file test_smoothing_length_computation_3D.py.

◆ Always

test_smoothing_length_computation_3D.Always

Definition at line 358 of file test_smoothing_length_computation_3D.py.

◆ args

test_smoothing_length_computation_3D.args = parser.parse_args()

Definition at line 101 of file test_smoothing_length_computation_3D.py.

◆ build_mode

test_smoothing_length_computation_3D.build_mode = peano4.api.output.CompileMode.DEBUG

Definition at line 218 of file test_smoothing_length_computation_3D.py.

◆ CFL_CONSTANT

float test_smoothing_length_computation_3D.CFL_CONSTANT = cfl_factor

Definition at line 167 of file test_smoothing_length_computation_3D.py.

◆ cfl_factor

float test_smoothing_length_computation_3D.cfl_factor = 0.2

Definition at line 116 of file test_smoothing_length_computation_3D.py.

◆ choices

test_smoothing_length_computation_3D.choices

Definition at line 98 of file test_smoothing_length_computation_3D.py.

◆ default

test_smoothing_length_computation_3D.default

Definition at line 20 of file test_smoothing_length_computation_3D.py.

◆ dest

test_smoothing_length_computation_3D.dest

Definition at line 20 of file test_smoothing_length_computation_3D.py.

◆ dimensions

test_smoothing_length_computation_3D.dimensions = 3

Definition at line 130 of file test_smoothing_length_computation_3D.py.

◆ dirs

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

Cleanup and compilation.

Definition at line 351 of file test_smoothing_length_computation_3D.py.

◆ domain_size

test_smoothing_length_computation_3D.domain_size = [1, 1, 1]

Definition at line 120 of file test_smoothing_length_computation_3D.py.

◆ dx

list test_smoothing_length_computation_3D.dx = domain_size[0] / npart_base

Definition at line 184 of file test_smoothing_length_computation_3D.py.

◆ eta_factor

test_smoothing_length_computation_3D.eta_factor

Definition at line 194 of file test_smoothing_length_computation_3D.py.

◆ first_plot_time_stamp

test_smoothing_length_computation_3D.first_plot_time_stamp

Definition at line 231 of file test_smoothing_length_computation_3D.py.

◆ GAMMA

list test_smoothing_length_computation_3D.GAMMA = gamma_hydro_list[0]

Definition at line 177 of file test_smoothing_length_computation_3D.py.

◆ gamma_hydro_list

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

Definition at line 170 of file test_smoothing_length_computation_3D.py.

◆ gamma_hydro_list_symbols

list test_smoothing_length_computation_3D.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 171 of file test_smoothing_length_computation_3D.py.

◆ GAMMA_HYDRO_SYMBOL

list test_smoothing_length_computation_3D.GAMMA_HYDRO_SYMBOL = gamma_hydro_list_symbols[0]

Definition at line 178 of file test_smoothing_length_computation_3D.py.

◆ GLOBAL_TIME_STEP_SIZE

float test_smoothing_length_computation_3D.GLOBAL_TIME_STEP_SIZE = init_dt

Definition at line 166 of file test_smoothing_length_computation_3D.py.

◆ h_hydro_max

test_smoothing_length_computation_3D.h_hydro_max

Definition at line 189 of file test_smoothing_length_computation_3D.py.

◆ h_hydro_min

test_smoothing_length_computation_3D.h_hydro_min

Definition at line 198 of file test_smoothing_length_computation_3D.py.

◆ h_max_iterations

test_smoothing_length_computation_3D.h_max_iterations

Definition at line 199 of file test_smoothing_length_computation_3D.py.

◆ h_tol

test_smoothing_length_computation_3D.h_tol = args.h_tol

Definition at line 104 of file test_smoothing_length_computation_3D.py.

◆ h_tolerance

test_smoothing_length_computation_3D.h_tolerance

Definition at line 200 of file test_smoothing_length_computation_3D.py.

◆ header

test_smoothing_length_computation_3D.header = hfile["Header"]

Definition at line 159 of file test_smoothing_length_computation_3D.py.

◆ help

test_smoothing_length_computation_3D.help

Definition at line 20 of file test_smoothing_length_computation_3D.py.

◆ hfile

test_smoothing_length_computation_3D.hfile = h5py.File(args.ic_filename, "r")

Definition at line 158 of file test_smoothing_length_computation_3D.py.

◆ hydro_dimensions

int test_smoothing_length_computation_3D.hydro_dimensions = 3

Definition at line 131 of file test_smoothing_length_computation_3D.py.

◆ HYDRO_DIMENSIONS

int test_smoothing_length_computation_3D.HYDRO_DIMENSIONS = hydro_dimensions

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 155 of file test_smoothing_length_computation_3D.py.

◆ hydro_H_max

int test_smoothing_length_computation_3D.hydro_H_max = 4 * dx

Definition at line 185 of file test_smoothing_length_computation_3D.py.

◆ hydro_h_max

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

Definition at line 186 of file test_smoothing_length_computation_3D.py.

◆ HYDRO_PART_NUMBER

test_smoothing_length_computation_3D.HYDRO_PART_NUMBER = npart

Definition at line 163 of file test_smoothing_length_computation_3D.py.

◆ init_dt

float test_smoothing_length_computation_3D.init_dt = 1.0e-16

Definition at line 117 of file test_smoothing_length_computation_3D.py.

◆ int

test_smoothing_length_computation_3D.int

Definition at line 20 of file test_smoothing_length_computation_3D.py.

◆ kernel

test_smoothing_length_computation_3D.kernel = args.kernel

Definition at line 103 of file test_smoothing_length_computation_3D.py.

◆ KERNEL_SYMBOL

test_smoothing_length_computation_3D.KERNEL_SYMBOL = exaparty.api.sphtools.sph_kernel_macro_name[kernel]

Definition at line 181 of file test_smoothing_length_computation_3D.py.

◆ make_clean_first

test_smoothing_length_computation_3D.make_clean_first

Definition at line 360 of file test_smoothing_length_computation_3D.py.

◆ max_end_time

test_smoothing_length_computation_3D.max_end_time

Definition at line 230 of file test_smoothing_length_computation_3D.py.

◆ min_end_time

test_smoothing_length_computation_3D.min_end_time

Definition at line 229 of file test_smoothing_length_computation_3D.py.

◆ name

str test_smoothing_length_computation_3D.name = "HydroPart"

Definition at line 128 of file test_smoothing_length_computation_3D.py.

◆ ndim

test_smoothing_length_computation_3D.ndim

Definition at line 195 of file test_smoothing_length_computation_3D.py.

◆ nneigh

test_smoothing_length_computation_3D.nneigh = args.nneigh

Definition at line 102 of file test_smoothing_length_computation_3D.py.

◆ npart

test_smoothing_length_computation_3D.npart = header.attrs["NumPart_ThisFile"][0]

Definition at line 160 of file test_smoothing_length_computation_3D.py.

◆ npart_base

test_smoothing_length_computation_3D.npart_base = header.attrs["NumPart_base"][0]

Definition at line 161 of file test_smoothing_length_computation_3D.py.

◆ number_of_parallel_builds

test_smoothing_length_computation_3D.number_of_parallel_builds

Definition at line 360 of file test_smoothing_length_computation_3D.py.

◆ offset

test_smoothing_length_computation_3D.offset = [0, 0, 0]

Definition at line 119 of file test_smoothing_length_computation_3D.py.

◆ output_files

list test_smoothing_length_computation_3D.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 363 of file test_smoothing_length_computation_3D.py.

◆ overwrite

test_smoothing_length_computation_3D.overwrite

Definition at line 358 of file test_smoothing_length_computation_3D.py.

◆ parser

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

Parse user input.

Definition at line 18 of file test_smoothing_length_computation_3D.py.

◆ particle

test_smoothing_length_computation_3D.particle
Initial value:
2 name,
3 dimensions_hydro=hydro_dimensions,
4 cfl_factor=cfl_factor,
5 initial_time_step_size=init_dt,
6 constant_time_step_size=True,
7 exaparty_project_namespace=project_namespace,
8 particles_per_cell=20,
9 min_h=args.cell_size,
10 max_h=args.cell_size,
11)

Definition at line 133 of file test_smoothing_length_computation_3D.py.

◆ particle_plotter

test_smoothing_length_computation_3D.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 279 of file test_smoothing_length_computation_3D.py.

◆ particle_set

test_smoothing_length_computation_3D.particle_set = project.add_particle_species(particle)

Definition at line 215 of file test_smoothing_length_computation_3D.py.

◆ peano4_project

test_smoothing_length_computation_3D.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 309 of file test_smoothing_length_computation_3D.py.

◆ periodic_BC

test_smoothing_length_computation_3D.periodic_BC

Definition at line 233 of file test_smoothing_length_computation_3D.py.

◆ periodic_boundary_conditions

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

Definition at line 121 of file test_smoothing_length_computation_3D.py.

◆ plotter_precision

test_smoothing_length_computation_3D.plotter_precision

Definition at line 234 of file test_smoothing_length_computation_3D.py.

◆ project

test_smoothing_length_computation_3D.project
Initial value:
2 namespace=project_namespace, project_name="TestSML3D", executable="testSML"
3)
ExaParty project.
Definition Project.py:27

Definition at line 112 of file test_smoothing_length_computation_3D.py.

◆ project_namespace

list test_smoothing_length_computation_3D.project_namespace = ["tests", "exaparty", "testSML3D"]

Generate ExaParty project.

Definition at line 110 of file test_smoothing_length_computation_3D.py.

◆ throw_away_data_after_generation

test_smoothing_length_computation_3D.throw_away_data_after_generation

Definition at line 358 of file test_smoothing_length_computation_3D.py.

◆ time_in_between_plots

test_smoothing_length_computation_3D.time_in_between_plots

Definition at line 232 of file test_smoothing_length_computation_3D.py.

◆ True

test_smoothing_length_computation_3D.True

Definition at line 360 of file test_smoothing_length_computation_3D.py.

◆ type

test_smoothing_length_computation_3D.type

Definition at line 20 of file test_smoothing_length_computation_3D.py.