Skip to content

Commit

Permalink
Merge pull request #5934 from bangerth/manager-deprecate
Browse files Browse the repository at this point in the history
Deprecate now redundant functions in all of the Manager classes.
  • Loading branch information
gassmoeller authored Jun 25, 2024
2 parents c6efb32 + 3488b5d commit 03b29b8
Show file tree
Hide file tree
Showing 33 changed files with 131 additions and 34 deletions.
12 changes: 12 additions & 0 deletions include/aspect/boundary_composition/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename BoundaryCompositionType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryCompositionType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_boundary_composition_model () const;

Expand All @@ -174,9 +180,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename BoundaryCompositionType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryCompositionType>::value>>
DEAL_II_DEPRECATED
const BoundaryCompositionType &
get_matching_boundary_composition_model () const;

Expand Down
12 changes: 12 additions & 0 deletions include/aspect/boundary_temperature/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename BoundaryTemperatureType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryTemperatureType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_boundary_temperature_model () const;

Expand All @@ -208,9 +214,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename BoundaryTemperatureType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,BoundaryTemperatureType>::value>>
DEAL_II_DEPRECATED
const BoundaryTemperatureType &
get_matching_boundary_temperature_model () const;

Expand Down
12 changes: 12 additions & 0 deletions include/aspect/heating_model/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename HeatingModelType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,HeatingModelType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_heating_model () const;

Expand All @@ -289,9 +295,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename HeatingModelType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,HeatingModelType>::value>>
DEAL_II_DEPRECATED
const HeatingModelType &
get_matching_heating_model () const;

Expand Down
12 changes: 12 additions & 0 deletions include/aspect/initial_composition/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename InitialCompositionType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,InitialCompositionType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_initial_composition_model () const;

Expand All @@ -163,9 +169,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename InitialCompositionType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,InitialCompositionType>::value>>
DEAL_II_DEPRECATED
const InitialCompositionType &
get_matching_initial_composition_model () const;

Expand Down
12 changes: 12 additions & 0 deletions include/aspect/initial_temperature/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename InitialTemperatureType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,InitialTemperatureType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_initial_temperature_model () const;

Expand All @@ -160,9 +166,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename InitialTemperatureType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,InitialTemperatureType>::value>>
DEAL_II_DEPRECATED
const InitialTemperatureType &
get_matching_initial_temperature_model () const;

Expand Down
12 changes: 12 additions & 0 deletions include/aspect/mesh_refinement/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename MeshRefinementType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshRefinementType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_mesh_refinement_strategy () const;

Expand All @@ -176,9 +182,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename MeshRefinementType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,MeshRefinementType>::value>>
DEAL_II_DEPRECATED
const MeshRefinementType &
get_matching_mesh_refinement_strategy () const;

Expand Down
12 changes: 12 additions & 0 deletions include/aspect/particle/property/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename ParticlePropertyType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,ParticlePropertyType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_property () const;

Expand All @@ -630,9 +636,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename ParticlePropertyType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,ParticlePropertyType>::value>>
DEAL_II_DEPRECATED
const ParticlePropertyType &
get_matching_property () const;

Expand Down
17 changes: 15 additions & 2 deletions include/aspect/postprocess/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ namespace aspect
* of course needs to be able to access these other postprocessors.
* This can be done by deriving your postprocessor from
* SimulatorAccess, and then using the
* SimulatorAccess::get_postprocess_manager::get_matching_postprocessor
* function.
* SimulatorAccess::get_postprocess_manager() function, followed
* by asking the resulting object via get_matching_plugin_object()
* for a specific postprocessor object.
*/
virtual
std::list<std::string>
Expand Down Expand Up @@ -193,9 +194,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename PostprocessorType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,PostprocessorType>::value>>
DEAL_II_DEPRECATED
bool
has_matching_postprocessor () const;

Expand All @@ -209,9 +216,15 @@ namespace aspect
*
* This function can only be called if the given template type (the first template
* argument) is a class derived from the Interface class in this namespace.
*
* @deprecated Instead of this function, use the
* Plugins::ManagerBase::has_matching_plugin_object() and
* Plugins::ManagerBase::get_matching_plugin_object() functions of the base
* class of the current class.
*/
template <typename PostprocessorType,
typename = typename std::enable_if_t<std::is_base_of<Interface<dim>,PostprocessorType>::value>>
DEAL_II_DEPRECATED
const PostprocessorType &
get_matching_postprocessor () const;

Expand Down
4 changes: 2 additions & 2 deletions source/boundary_temperature/dynamic_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,11 +594,11 @@ namespace aspect
// It is not available at the time initialize() function of boundary temperature is called.
if (is_first_call==true)
{
AssertThrow(this->get_postprocess_manager().template has_matching_postprocessor<const Postprocess::CoreStatistics<dim>>(),
AssertThrow(this->get_postprocess_manager().template has_matching_plugin_object<const Postprocess::CoreStatistics<dim>>(),
ExcMessage ("Dynamic core boundary condition has to work with dynamic core statistics postprocessor."));

const Postprocess::CoreStatistics<dim> &core_statistics
= this->get_postprocess_manager().template get_matching_postprocessor<const Postprocess::CoreStatistics<dim>>();
= this->get_postprocess_manager().template get_matching_plugin_object<const Postprocess::CoreStatistics<dim>>();
// The restart data is stored in 'core statistics' postprocessor.
// If restart from checkpoint, extract data from there.
core_data = core_statistics.get_core_data();
Expand Down
4 changes: 2 additions & 2 deletions source/heating_model/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace aspect
bool
Manager<dim>::adiabatic_heating_enabled() const
{
return has_matching_heating_model<HeatingModel::AdiabaticHeating<dim>>() ;
return this->template has_matching_plugin_object<HeatingModel::AdiabaticHeating<dim>>() ;
}


Expand All @@ -68,7 +68,7 @@ namespace aspect
bool
Manager<dim>::shear_heating_enabled() const
{
return has_matching_heating_model<HeatingModel::ShearHeating<dim>>() ;
return this->template has_matching_plugin_object<HeatingModel::ShearHeating<dim>>() ;
}


Expand Down
2 changes: 1 addition & 1 deletion source/particle/property/cpo_bingham_average.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ namespace aspect
{
// Get a pointer to the CPO particle property.
cpo_particle_property = std::make_unique<const Particle::Property::CrystalPreferredOrientation<dim>> (
this->get_particle_world(this->get_particle_world_index()).get_property_manager().template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>());
this->get_particle_world(this->get_particle_world_index()).get_property_manager().template get_matching_plugin_object<Particle::Property::CrystalPreferredOrientation<dim>>());

random_number_seed = prm.get_integer ("Random number seed");
n_grains = cpo_particle_property->get_number_of_grains();
Expand Down
2 changes: 1 addition & 1 deletion source/particle/property/cpo_elastic_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ namespace aspect
{
// Get a reference to the CPO particle property.
const Particle::Property::CrystalPreferredOrientation<dim> &cpo_particle_property =
this->get_particle_world(this->get_particle_world_index()).get_property_manager().template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>();
this->get_particle_world(this->get_particle_world_index()).get_property_manager().template get_matching_plugin_object<Particle::Property::CrystalPreferredOrientation<dim>>();


const SymmetricTensor<2,6> C_average = voigt_average_elastic_tensor(cpo_particle_property,
Expand Down
2 changes: 1 addition & 1 deletion source/postprocess/core_statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace aspect
std::ostringstream screen_text;

const BoundaryTemperature::DynamicCore<dim> &dynamic_core =
this->get_boundary_temperature_manager().template get_matching_boundary_temperature_model<BoundaryTemperature::DynamicCore<dim>>();
this->get_boundary_temperature_manager().template get_matching_plugin_object<BoundaryTemperature::DynamicCore<dim>>();

core_data = dynamic_core.get_core_data();

Expand Down
2 changes: 1 addition & 1 deletion source/postprocess/crystal_preferred_orientation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace aspect

// Get a reference to the CPO particle property.
const Particle::Property::CrystalPreferredOrientation<dim> &cpo_particle_property =
manager.template get_matching_property<Particle::Property::CrystalPreferredOrientation<dim>>();
manager.template get_matching_plugin_object<Particle::Property::CrystalPreferredOrientation<dim>>();

const unsigned int n_grains = cpo_particle_property.get_number_of_grains();
const unsigned int n_minerals = cpo_particle_property.get_number_of_minerals();
Expand Down
2 changes: 1 addition & 1 deletion source/postprocess/dynamic_topography.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace aspect
DynamicTopography<dim>::execute (TableHandler &)
{
const Postprocess::BoundaryPressures<dim> &boundary_pressures =
this->get_postprocess_manager().template get_matching_postprocessor<Postprocess::BoundaryPressures<dim>>();
this->get_postprocess_manager().template get_matching_plugin_object<Postprocess::BoundaryPressures<dim>>();

// Get the average pressure at the top and bottom boundaries.
// This will be used to compute the dynamic pressure at the boundaries.
Expand Down
6 changes: 3 additions & 3 deletions source/postprocess/geoid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace aspect
{
// Get a pointer to the boundary densities postprocessor.
const Postprocess::BoundaryDensities<3> &boundary_densities =
this->get_postprocess_manager().template get_matching_postprocessor<Postprocess::BoundaryDensities<3>>();
this->get_postprocess_manager().template get_matching_plugin_object<Postprocess::BoundaryDensities<3>>();

const double top_layer_average_density = boundary_densities.density_at_top();
const double bottom_layer_average_density = boundary_densities.density_at_bottom();
Expand Down Expand Up @@ -270,7 +270,7 @@ namespace aspect
{
// Get a reference to the dynamic topography postprocessor.
const Postprocess::DynamicTopography<3> &dynamic_topography =
this->get_postprocess_manager().template get_matching_postprocessor<Postprocess::DynamicTopography<3>>();
this->get_postprocess_manager().template get_matching_plugin_object<Postprocess::DynamicTopography<3>>();

// Get the already-computed dynamic topography solution.
const LinearAlgebra::BlockVector &topo_vector = dynamic_topography.topography_vector();
Expand Down Expand Up @@ -317,7 +317,7 @@ namespace aspect
{
// Get a reference to the dynamic topography postprocessor.
const Postprocess::DynamicTopography<3> &dynamic_topography =
this->get_postprocess_manager().template get_matching_postprocessor<Postprocess::DynamicTopography<3>>();
this->get_postprocess_manager().template get_matching_plugin_object<Postprocess::DynamicTopography<3>>();

// Get the already-computed dynamic topography solution.
const LinearAlgebra::BlockVector &topo_vector = dynamic_topography.topography_vector();
Expand Down
Loading

0 comments on commit 03b29b8

Please sign in to comment.