|
21 | 21 | #include "common.h" |
22 | 22 | #include <aspect/particle/property/interface.h> |
23 | 23 | #include <aspect/particle/manager.h> |
| 24 | +#include <aspect/simulator.h> |
24 | 25 | #include <deal.II/base/parameter_handler.h> |
25 | 26 |
|
26 | 27 | TEST_CASE("Particle Manager plugin names") |
27 | 28 | { |
| 29 | + // The Particle::Property::Manager needs to know about the Simulator object, |
| 30 | + // so we need to create a dummy one to initialize the manager. That, in |
| 31 | + // turn, needs to be initialized with a ParameterHandler, so we create one |
| 32 | + // and fill it with the minimum information needed to create a Simulator object. |
| 33 | + aspect::ParameterHandler sim_prm; |
| 34 | + aspect::Simulator<2>::declare_parameters(sim_prm, 0); |
| 35 | + { |
| 36 | + sim_prm.enter_subsection("Geometry model"); |
| 37 | + sim_prm.set("Model name", "box"); |
| 38 | + sim_prm.leave_subsection(); |
| 39 | + } |
| 40 | + { |
| 41 | + sim_prm.enter_subsection("Material model"); |
| 42 | + sim_prm.set("Model name", "simple"); |
| 43 | + sim_prm.leave_subsection(); |
| 44 | + } |
| 45 | + { |
| 46 | + sim_prm.enter_subsection("Gravity model"); |
| 47 | + sim_prm.set("Model name", "vertical"); |
| 48 | + sim_prm.leave_subsection(); |
| 49 | + } |
| 50 | + aspect::Simulator<2> dummy_sim (MPI_COMM_SELF, sim_prm); |
| 51 | + |
| 52 | + // Now create a Particle::Property::Manager and initialize it with the dummy simulator. |
28 | 53 | dealii::ParameterHandler prm; |
29 | 54 | aspect::Particle::Property::Manager<2> manager; |
| 55 | + manager.initialize_simulator (dummy_sim); |
| 56 | + |
30 | 57 | // The property manager needs to know about the integrator, which is declared in World |
31 | 58 | aspect::Particle::Manager<2>::declare_parameters(prm); |
32 | 59 |
|
|
0 commit comments