|
Peano
|
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 |
| test_periodic_BC-1D.action |
Definition at line 23 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.Always |
Definition at line 276 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.args = parser.parse_args() |
Definition at line 89 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.build_mode = peano4.api.output.CompileMode.DEBUG |
Definition at line 121 of file test_periodic_BC-1D.py.
| 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.
| test_periodic_BC-1D.default |
Definition at line 17 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.dest |
Definition at line 17 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.dimensions = 2 |
Generate ExaParty project.
Definition at line 97 of file test_periodic_BC-1D.py.
| list test_periodic_BC-1D.dirs = ["vertexdata/", "repositories/", "globaldata/", "observers/"] |
Definition at line 271 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.domain_size = [1, 1, 1] |
Definition at line 128 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.first_plot_time_stamp |
Definition at line 138 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.help |
Definition at line 17 of file test_periodic_BC-1D.py.
| int test_periodic_BC-1D.hydro_dimensions = 1 |
Definition at line 98 of file test_periodic_BC-1D.py.
| tuple test_periodic_BC-1D.initialisation_snippet |
Definition at line 174 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.int |
Definition at line 17 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.make_clean_first |
Definition at line 278 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.max_end_time |
Definition at line 137 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.min_end_time |
Definition at line 136 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.number_of_parallel_builds |
Definition at line 278 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.offset = [0, 0, 0] |
Definition at line 127 of file test_periodic_BC-1D.py.
| list test_periodic_BC-1D.output_files |
Definition at line 281 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.overwrite |
Definition at line 276 of file test_periodic_BC-1D.py.
| 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.
| test_periodic_BC-1D.particle |
Definition at line 108 of file test_periodic_BC-1D.py.
| 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.
| test_periodic_BC-1D.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.
Definition at line 243 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.particle_set = project.add_particle_species(particle) |
Definition at line 117 of file test_periodic_BC-1D.py.
| 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.
| test_periodic_BC-1D.periodic_BC |
Definition at line 140 of file test_periodic_BC-1D.py.
| list test_periodic_BC-1D.periodic_boundary_conditions = [True, False, False] |
Definition at line 129 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.plotter_precision |
Definition at line 141 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.project |
Definition at line 101 of file test_periodic_BC-1D.py.
| 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.
| test_periodic_BC-1D.throw_away_data_after_generation |
Definition at line 276 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.time_in_between_plots |
Definition at line 139 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.True |
Definition at line 278 of file test_periodic_BC-1D.py.
| test_periodic_BC-1D.type |
Definition at line 17 of file test_periodic_BC-1D.py.