Skip to content

Commit

Permalink
Merge pull request #5933 from bangerth/manager-superfluous
Browse files Browse the repository at this point in the history
Remove now superfluous Manager functions.
  • Loading branch information
gassmoeller authored Jun 22, 2024
2 parents b537df3 + f4138ac commit 1a96fc7
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 248 deletions.
18 changes: 0 additions & 18 deletions include/aspect/boundary_composition/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,6 @@ namespace aspect
class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
{
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.
Expand Down
18 changes: 0 additions & 18 deletions include/aspect/boundary_temperature/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,6 @@ namespace aspect
class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
{
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.
Expand Down
12 changes: 0 additions & 12 deletions include/aspect/initial_composition/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ namespace aspect
class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
{
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.
Expand Down
13 changes: 0 additions & 13 deletions include/aspect/initial_temperature/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,6 @@ namespace aspect
class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
{
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.
Expand Down
15 changes: 0 additions & 15 deletions include/aspect/mesh_refinement/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ namespace aspect
class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
{
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
Expand Down
17 changes: 0 additions & 17 deletions include/aspect/particle/property/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,30 +516,13 @@ namespace aspect
class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
{
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.
*/
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
Expand Down
16 changes: 0 additions & 16 deletions source/boundary_composition/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ namespace aspect
// -------------------------------- Deal with registering boundary_composition models and automating
// -------------------------------- their setup and selection at run time

template <int dim>
Manager<dim>::~Manager()
= default;



template <int dim>
void
Manager<dim>::update ()
{
for (auto &p : this->plugin_objects)
p->update();
}



namespace
{
std::tuple
Expand Down
16 changes: 0 additions & 16 deletions source/boundary_temperature/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ namespace aspect
// -------------------------------- Deal with registering boundary_temperature models and automating
// -------------------------------- their setup and selection at run time

template <int dim>
Manager<dim>::~Manager()
= default;



template <int dim>
void
Manager<dim>::update ()
{
for (auto &p : this->plugin_objects)
p->update();
}



namespace
{
std::tuple
Expand Down
16 changes: 0 additions & 16 deletions source/initial_composition/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ namespace aspect
// ------------------------------ Deal with registering initial composition models and automating
// ------------------------------ their setup and selection at run time

template <int dim>
Manager<dim>::~Manager()
= default;



namespace
{
std::tuple
Expand Down Expand Up @@ -132,16 +126,6 @@ namespace aspect



template <int dim>
void
Manager<dim>::update()
{
for (auto &initial_composition_object : this->plugin_objects)
initial_composition_object->update();
}



template <int dim>
double
Manager<dim>::initial_composition (const Point<dim> &position,
Expand Down
16 changes: 0 additions & 16 deletions source/initial_temperature/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ namespace aspect
// -------------------------------- Deal with registering initial_temperature models and automating
// -------------------------------- their setup and selection at run time

template <int dim>
Manager<dim>::~Manager()
= default;



namespace
{
std::tuple
Expand Down Expand Up @@ -122,16 +116,6 @@ namespace aspect



template <int dim>
void
Manager<dim>::update()
{
for (auto &initial_temperature_object : this->plugin_objects)
initial_temperature_object->update();
}



template <int dim>
double
Manager<dim>::initial_temperature (const Point<dim> &position) const
Expand Down
67 changes: 0 additions & 67 deletions source/mesh_refinement/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,73 +49,6 @@ namespace aspect

// ------------------------------ Manager -----------------------------

template <int dim>
Manager<dim>::~Manager()
= default;



template <int dim>
void
Manager<dim>::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 <int dim>
void
Manager<dim>::execute (Vector<float> &error_indicators) const
Expand Down
24 changes: 0 additions & 24 deletions source/particle/property/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,20 +306,6 @@ namespace aspect



template <int dim>
inline
Manager<dim>::Manager ()
= default;



template <int dim>
inline
Manager<dim>::~Manager ()
= default;



template <int dim>
void
Manager<dim>::initialize ()
Expand All @@ -342,16 +328,6 @@ namespace aspect



template <int dim>
void
Manager<dim>::update ()
{
for (const auto &p : this->plugin_objects)
p->update();
}



template <int dim>
void
Manager<dim>::initialize_one_particle (typename ParticleHandler<dim>::particle_iterator &particle) const
Expand Down

0 comments on commit 1a96fc7

Please sign in to comment.