From f4138acd36195a02d08e71a28223e67d0e2ea4f7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 21 Jun 2024 18:51:26 -0600 Subject: [PATCH] Remove now superfluous Manager functions. --- .../aspect/boundary_composition/interface.h | 18 ----- .../aspect/boundary_temperature/interface.h | 18 ----- .../aspect/initial_composition/interface.h | 12 ---- .../aspect/initial_temperature/interface.h | 13 ---- include/aspect/mesh_refinement/interface.h | 15 ----- include/aspect/particle/property/interface.h | 17 ----- source/boundary_composition/interface.cc | 16 ----- source/boundary_temperature/interface.cc | 16 ----- source/initial_composition/interface.cc | 16 ----- source/initial_temperature/interface.cc | 16 ----- source/mesh_refinement/interface.cc | 67 ------------------- source/particle/property/interface.cc | 24 ------- 12 files changed, 248 deletions(-) diff --git a/include/aspect/boundary_composition/interface.h b/include/aspect/boundary_composition/interface.h index 1d3e2213ad8..72aa2c42f0c 100644 --- a/include/aspect/boundary_composition/interface.h +++ b/include/aspect/boundary_composition/interface.h @@ -85,24 +85,6 @@ namespace aspect class Manager : public Plugins::ManagerBase>, public SimulatorAccess { public: - /** - * Destructor. Made virtual since this class has virtual member - * functions. - */ - ~Manager () override; - - /** - * A function that is called at the beginning of each time step and - * calls the corresponding functions of all created plugins. - * - * The point of this function is to allow complex boundary composition - * models to do an initialization step once at the beginning of each - * time step. An example would be a model that needs to call an - * external program to compute the composition change at a boundary. - */ - void - update () override; - /** * Declare the parameters of all known boundary composition plugins, as * well as the ones this class has itself. diff --git a/include/aspect/boundary_temperature/interface.h b/include/aspect/boundary_temperature/interface.h index 7b694b5f515..3359ed09254 100644 --- a/include/aspect/boundary_temperature/interface.h +++ b/include/aspect/boundary_temperature/interface.h @@ -106,24 +106,6 @@ namespace aspect class Manager : public Plugins::ManagerBase>, public SimulatorAccess { public: - /** - * Destructor. Made virtual since this class has virtual member - * functions. - */ - ~Manager () override; - - /** - * A function that is called at the beginning of each time step and - * calls the corresponding functions of all created plugins. - * - * The point of this function is to allow complex boundary temperature - * models to do an initialization step once at the beginning of each - * time step. An example would be a model that needs to call an - * external program to compute the temperature change at a boundary. - */ - void - update () override; - /** * Declare the parameters of all known boundary temperature plugins, as * well as the ones this class has itself. diff --git a/include/aspect/initial_composition/interface.h b/include/aspect/initial_composition/interface.h index 96a1f5df87c..57e00e38d53 100644 --- a/include/aspect/initial_composition/interface.h +++ b/include/aspect/initial_composition/interface.h @@ -74,18 +74,6 @@ namespace aspect class Manager : public Plugins::ManagerBase>, public SimulatorAccess { public: - /** - * Destructor. Made virtual since this class has virtual member - * functions. - */ - ~Manager () override; - - /** - * Update function. Called once at the beginning of a timestep to - * update all plugin objects. - */ - void update () override; - /** * Declare the parameters of all known initial composition plugins, as * well as of ones this class has itself. diff --git a/include/aspect/initial_temperature/interface.h b/include/aspect/initial_temperature/interface.h index 9b726ab4f4d..dea8e451aaf 100644 --- a/include/aspect/initial_temperature/interface.h +++ b/include/aspect/initial_temperature/interface.h @@ -73,19 +73,6 @@ namespace aspect class Manager : public Plugins::ManagerBase>, public SimulatorAccess { public: - /** - * Destructor. Made virtual since this class has virtual member - * functions. - */ - ~Manager () override; - - /** - * Update function. Called once at the beginning of a timestep to - * update all plugin objects. - */ - void - update() override; - /** * Declare the parameters of all known initial conditions plugins, as * well as of ones this class has itself. diff --git a/include/aspect/mesh_refinement/interface.h b/include/aspect/mesh_refinement/interface.h index 69b2a480d14..01f348deab2 100644 --- a/include/aspect/mesh_refinement/interface.h +++ b/include/aspect/mesh_refinement/interface.h @@ -117,21 +117,6 @@ namespace aspect class Manager : public Plugins::ManagerBase>, public SimulatorAccess { public: - /** - * Destructor. Made virtual since this class has virtual member - * functions. - */ - ~Manager () override; - - /** - * Update all of the mesh refinement objects that have been requested - * in the input file. Individual mesh refinement objects may choose to - * implement an update function to modify object variables once per - * time step. - */ - void - update () override; - /** * Execute all of the mesh refinement objects that have been requested * in the input file. The error indicators are then each individually diff --git a/include/aspect/particle/property/interface.h b/include/aspect/particle/property/interface.h index 9d943da535a..e59ec79228a 100644 --- a/include/aspect/particle/property/interface.h +++ b/include/aspect/particle/property/interface.h @@ -516,16 +516,6 @@ namespace aspect class Manager : public Plugins::ManagerBase>, public SimulatorAccess { public: - /** - * Empty constructor for Manager - */ - Manager (); - - /** - * Destructor for Manager - */ - ~Manager () override; - /** * Initialization function. This function is called once at the * beginning of the program after parse_parameters is run. @@ -533,13 +523,6 @@ namespace aspect void initialize () override; - /** - * Update function. This function is called once at the - * beginning of each timestep. - */ - void - update () override; - /** * Initialization function for particle properties. This function is * called once for each of the particles of a particle diff --git a/source/boundary_composition/interface.cc b/source/boundary_composition/interface.cc index 91719a1e34f..8896d2bbbd6 100644 --- a/source/boundary_composition/interface.cc +++ b/source/boundary_composition/interface.cc @@ -40,22 +40,6 @@ namespace aspect // -------------------------------- Deal with registering boundary_composition models and automating // -------------------------------- their setup and selection at run time - template - Manager::~Manager() - = default; - - - - template - void - Manager::update () - { - for (auto &p : this->plugin_objects) - p->update(); - } - - - namespace { std::tuple diff --git a/source/boundary_temperature/interface.cc b/source/boundary_temperature/interface.cc index f42bf0826c3..98b46328d68 100644 --- a/source/boundary_temperature/interface.cc +++ b/source/boundary_temperature/interface.cc @@ -40,22 +40,6 @@ namespace aspect // -------------------------------- Deal with registering boundary_temperature models and automating // -------------------------------- their setup and selection at run time - template - Manager::~Manager() - = default; - - - - template - void - Manager::update () - { - for (auto &p : this->plugin_objects) - p->update(); - } - - - namespace { std::tuple diff --git a/source/initial_composition/interface.cc b/source/initial_composition/interface.cc index cf2a64b8e42..dc29a352691 100644 --- a/source/initial_composition/interface.cc +++ b/source/initial_composition/interface.cc @@ -37,12 +37,6 @@ namespace aspect // ------------------------------ Deal with registering initial composition models and automating // ------------------------------ their setup and selection at run time - template - Manager::~Manager() - = default; - - - namespace { std::tuple @@ -132,16 +126,6 @@ namespace aspect - template - void - Manager::update() - { - for (auto &initial_composition_object : this->plugin_objects) - initial_composition_object->update(); - } - - - template double Manager::initial_composition (const Point &position, diff --git a/source/initial_temperature/interface.cc b/source/initial_temperature/interface.cc index c747b7197b8..2785b1f7813 100644 --- a/source/initial_temperature/interface.cc +++ b/source/initial_temperature/interface.cc @@ -36,12 +36,6 @@ namespace aspect // -------------------------------- Deal with registering initial_temperature models and automating // -------------------------------- their setup and selection at run time - template - Manager::~Manager() - = default; - - - namespace { std::tuple @@ -122,16 +116,6 @@ namespace aspect - template - void - Manager::update() - { - for (auto &initial_temperature_object : this->plugin_objects) - initial_temperature_object->update(); - } - - - template double Manager::initial_temperature (const Point &position) const diff --git a/source/mesh_refinement/interface.cc b/source/mesh_refinement/interface.cc index 8e16815ddd4..cd18979dda9 100644 --- a/source/mesh_refinement/interface.cc +++ b/source/mesh_refinement/interface.cc @@ -49,73 +49,6 @@ namespace aspect // ------------------------------ Manager ----------------------------- - template - Manager::~Manager() - = default; - - - - template - void - Manager::update () - { - Assert (this->plugin_objects.size() > 0, ExcInternalError()); - - // call the update() functions of all refinement plugins. - for (const auto &p : this->plugin_objects) - { - try - { - p->update (); - } - - // plugins that throw exceptions usually do not result in - // anything good because they result in an unwinding of the stack - // and, if only one processor triggers an exception, the - // destruction of objects often causes a deadlock. thus, if - // an exception is generated, catch it, print an error message, - // and abort the program - catch (std::exception &exc) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Exception on MPI process <" - << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << "> while running mesh refinement plugin <" - << typeid(*p).name() - << ">: " << std::endl - << exc.what() << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - // terminate the program! - MPI_Abort (MPI_COMM_WORLD, 1); - } - catch (...) - { - std::cerr << std::endl << std::endl - << "----------------------------------------------------" - << std::endl; - std::cerr << "Exception on MPI process <" - << Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - << "> while running mesh refinement plugin <" - << typeid(*p).name() - << ">: " << std::endl; - std::cerr << "Unknown exception!" << std::endl - << "Aborting!" << std::endl - << "----------------------------------------------------" - << std::endl; - - // terminate the program! - MPI_Abort (MPI_COMM_WORLD, 1); - } - } - } - - - template void Manager::execute (Vector &error_indicators) const diff --git a/source/particle/property/interface.cc b/source/particle/property/interface.cc index 47027dc7d45..577d858286f 100644 --- a/source/particle/property/interface.cc +++ b/source/particle/property/interface.cc @@ -306,20 +306,6 @@ namespace aspect - template - inline - Manager::Manager () - = default; - - - - template - inline - Manager::~Manager () - = default; - - - template void Manager::initialize () @@ -342,16 +328,6 @@ namespace aspect - template - void - Manager::update () - { - for (const auto &p : this->plugin_objects) - p->update(); - } - - - template void Manager::initialize_one_particle (typename ParticleHandler::particle_iterator &particle) const