Peano
Loading...
Searching...
No Matches
test_periodic_BC-1D Namespace Reference

Variables

 parser = argparse.ArgumentParser(description="Test periodic boundary conditions")
 Parse user input.
 
 dest
 
 type
 
 int
 
 default
 
 help
 
 action
 
 args = parser.parse_args()
 
int dimensions = 2
 Generate ExaParty project.
 
int hydro_dimensions = 1
 
 project
 
 particle
 
 particle_set = project.add_particle_species(particle)
 
 build_mode = peano4.api.output.CompileMode.DEBUG
 
list offset = [0, 0, 0]
 
list domain_size = [1, 1, 1]
 
list periodic_boundary_conditions = [True, False, False]
 
 min_end_time
 
 max_end_time
 
 first_plot_time_stamp
 
 time_in_between_plots
 
 periodic_BC
 
 plotter_precision
 
str particle_force = ""
 Declare the force acting on the particle.
 
float search_radius = args.cell_size / 100.0
 Initialisation snippet for the particle.
 
tuple initialisation_snippet
 
 coords = np.array([[0.21, 0.5, 0.0], [0.81, 0.5, 0.0]])
 
 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/"]
 
 overwrite
 
 Always
 
 throw_away_data_after_generation
 
 make_clean_first
 
 True
 
 number_of_parallel_builds
 
list output_files
 

Variable Documentation

◆ action

test_periodic_BC-1D.action

Definition at line 23 of file test_periodic_BC-1D.py.

◆ Always

test_periodic_BC-1D.Always

Definition at line 276 of file test_periodic_BC-1D.py.

◆ args

test_periodic_BC-1D.args = parser.parse_args()

Definition at line 89 of file test_periodic_BC-1D.py.

◆ build_mode

test_periodic_BC-1D.build_mode = peano4.api.output.CompileMode.DEBUG

Definition at line 121 of file test_periodic_BC-1D.py.

◆ coords

test_periodic_BC-1D.coords = np.array([[0.21, 0.5, 0.0], [0.81, 0.5, 0.0]])

Definition at line 209 of file test_periodic_BC-1D.py.

◆ default

test_periodic_BC-1D.default

Definition at line 17 of file test_periodic_BC-1D.py.

◆ dest

test_periodic_BC-1D.dest

Definition at line 17 of file test_periodic_BC-1D.py.

◆ dimensions

test_periodic_BC-1D.dimensions = 2

Generate ExaParty project.

Definition at line 97 of file test_periodic_BC-1D.py.

◆ dirs

list test_periodic_BC-1D.dirs = ["vertexdata/", "repositories/", "globaldata/", "observers/"]

Definition at line 271 of file test_periodic_BC-1D.py.

◆ domain_size

test_periodic_BC-1D.domain_size = [1, 1, 1]

Definition at line 128 of file test_periodic_BC-1D.py.

◆ first_plot_time_stamp

test_periodic_BC-1D.first_plot_time_stamp

Definition at line 138 of file test_periodic_BC-1D.py.

◆ help

test_periodic_BC-1D.help

Definition at line 17 of file test_periodic_BC-1D.py.

◆ hydro_dimensions

int test_periodic_BC-1D.hydro_dimensions = 1

Definition at line 98 of file test_periodic_BC-1D.py.

◆ initialisation_snippet

tuple test_periodic_BC-1D.initialisation_snippet
Initial value:
1= (
2
3 + str(search_radius)
4 +
5 + str(domain_size[0])
6 +
7 + str(offset[0])
8 +
9)

Definition at line 174 of file test_periodic_BC-1D.py.

◆ int

test_periodic_BC-1D.int

Definition at line 17 of file test_periodic_BC-1D.py.

◆ make_clean_first

test_periodic_BC-1D.make_clean_first

Definition at line 278 of file test_periodic_BC-1D.py.

◆ max_end_time

test_periodic_BC-1D.max_end_time

Definition at line 137 of file test_periodic_BC-1D.py.

◆ min_end_time

test_periodic_BC-1D.min_end_time

Definition at line 136 of file test_periodic_BC-1D.py.

◆ number_of_parallel_builds

test_periodic_BC-1D.number_of_parallel_builds

Definition at line 278 of file test_periodic_BC-1D.py.

◆ offset

test_periodic_BC-1D.offset = [0, 0, 0]

Definition at line 127 of file test_periodic_BC-1D.py.

◆ output_files

list test_periodic_BC-1D.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 281 of file test_periodic_BC-1D.py.

◆ overwrite

test_periodic_BC-1D.overwrite

Definition at line 276 of file test_periodic_BC-1D.py.

◆ parser

test_periodic_BC-1D.parser = argparse.ArgumentParser(description="Test periodic boundary conditions")

Parse user input.

Definition at line 15 of file test_periodic_BC-1D.py.

◆ particle

test_periodic_BC-1D.particle
Initial value:
2 name="GenericParticle",
3 cfl_factor=0.999,
4 initial_time_step_size=args.timestep_size,
5 particles_per_cell=0,
6 min_h=args.cell_size,
7 max_h=0.3,
8 add_partid=(not args.asserts),
9)

Definition at line 108 of file test_periodic_BC-1D.py.

◆ particle_force

str test_periodic_BC-1D.particle_force = ""

Declare the force acting on the particle.

No force. We just need the particles to drift along calmly with the same velocity they start out with.

Definition at line 158 of file test_periodic_BC-1D.py.

◆ particle_plotter

test_periodic_BC-1D.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 243 of file test_periodic_BC-1D.py.

◆ particle_set

test_periodic_BC-1D.particle_set = project.add_particle_species(particle)

Definition at line 117 of file test_periodic_BC-1D.py.

◆ peano4_project

test_periodic_BC-1D.peano4_project = project.generate_Peano4_project(verbose=args.verbose)

Generate plain Peano 4 project.

See commments above (for the force interaction kernel) why we might want to have some of the constants from the Python script within the C++ code base that's generated.

Definition at line 262 of file test_periodic_BC-1D.py.

◆ periodic_BC

test_periodic_BC-1D.periodic_BC

Definition at line 140 of file test_periodic_BC-1D.py.

◆ periodic_boundary_conditions

list test_periodic_BC-1D.periodic_boundary_conditions = [True, False, False]

Definition at line 129 of file test_periodic_BC-1D.py.

◆ plotter_precision

test_periodic_BC-1D.plotter_precision

Definition at line 141 of file test_periodic_BC-1D.py.

◆ project

test_periodic_BC-1D.project
Initial value:
2 namespace=["tests", "exaparty", "periodicBoundaryConditions1D"],
3 project_name="periodicBoundaryConditions1D",
4 executable="periodicBCTest1D",
5)
ExaParty project.
Definition Project.py:27

Definition at line 101 of file test_periodic_BC-1D.py.

◆ search_radius

float test_periodic_BC-1D.search_radius = args.cell_size / 100.0

Initialisation snippet for the particle.

If we work with only one particle, then we can simply set its velocity. However, our script works both if we only module the earth but also when we model earth and sun explicitly. In the latter case, we have to ensure that only the earth is given an initial velocity.

Definition at line 173 of file test_periodic_BC-1D.py.

◆ throw_away_data_after_generation

test_periodic_BC-1D.throw_away_data_after_generation

Definition at line 276 of file test_periodic_BC-1D.py.

◆ time_in_between_plots

test_periodic_BC-1D.time_in_between_plots

Definition at line 139 of file test_periodic_BC-1D.py.

◆ True

test_periodic_BC-1D.True

Definition at line 278 of file test_periodic_BC-1D.py.

◆ type

test_periodic_BC-1D.type

Definition at line 17 of file test_periodic_BC-1D.py.