diff --git a/include/aspect/coordinate_systems.h b/include/aspect/coordinate_systems.h index 6e4b5748cff..2cd3205c386 100644 --- a/include/aspect/coordinate_systems.h +++ b/include/aspect/coordinate_systems.h @@ -25,6 +25,22 @@ namespace aspect { namespace Utilities { + /** + * Because many places in ASPECT assume that all functions in the namespace + * dealii::Utilities are available without qualification as + * Utilities::function, just as all the function in the + * namespace aspect::Utilities, we make sure all these functions + * are available inside aspect::Utilities. This is maybe not + * the cleanest solution, but it is most compatible with a lot of existing + * code, and also allows to migrate ASPECT functions into deal.II when + * useful without introducing incompatibilities. + * + * We need to do this in every header that introduces something into the + * namespace aspect::Utilities, because it needs to happen + * no matter which header files of ASPECT are included. + */ + using namespace dealii::Utilities; + namespace Coordinates { /** diff --git a/include/aspect/material_model/utilities.h b/include/aspect/material_model/utilities.h index bf877a0acfe..cb1608e1156 100644 --- a/include/aspect/material_model/utilities.h +++ b/include/aspect/material_model/utilities.h @@ -33,6 +33,20 @@ namespace aspect template class SimulatorAccess; namespace Utilities { + /** + * Because many places in ASPECT assume that all functions in the namespace + * dealii::Utilities are available without qualification as + * Utilities::function, just as all the function in the + * namespace aspect::Utilities, we make sure all these functions + * are available inside aspect::Utilities. This is maybe not + * the cleanest solution, but it is most compatible with a lot of existing + * code, and also allows to migrate ASPECT functions into deal.II when + * useful without introducing incompatibilities. + * + * We need to do this in every header that introduces something into the + * namespace aspect::Utilities, because it needs to happen + * no matter which header files of ASPECT are included. + */ using namespace dealii::Utilities; template diff --git a/include/aspect/particle/property/elastic_tensor_decomposition.h b/include/aspect/particle/property/elastic_tensor_decomposition.h index d7ab0df54f6..8df5367941e 100644 --- a/include/aspect/particle/property/elastic_tensor_decomposition.h +++ b/include/aspect/particle/property/elastic_tensor_decomposition.h @@ -28,6 +28,21 @@ namespace aspect { namespace Utilities { + /** + * Because many places in ASPECT assume that all functions in the namespace + * aspect::Utilities are available without qualification as + * Utilities::function, we make sure all these functions + * are also available inside aspect::Particle::Property::Utilities. + * This is maybe not the cleanest solution, but it is most compatible + * with a lot of existing code. + * + * We need to do this in every header that creates a new namespace named + * Utilities, because otherwise the compiler may not find + * the requested function in the current namespace and issue an error, even + * though the function is available in the namespace aspect::Utilities. + */ + using namespace aspect::Utilities; + /** * Return an even permutation based on an index. This is an internal * utilities function, also used by the unit tester. diff --git a/include/aspect/structured_data.h b/include/aspect/structured_data.h index c4c820a430b..af5b56be207 100644 --- a/include/aspect/structured_data.h +++ b/include/aspect/structured_data.h @@ -31,6 +31,22 @@ namespace aspect { namespace Utilities { + /** + * Because many places in ASPECT assume that all functions in the namespace + * dealii::Utilities are available without qualification as + * Utilities::function, just as all the function in the + * namespace aspect::Utilities, we make sure all these functions + * are available inside aspect::Utilities. This is maybe not + * the cleanest solution, but it is most compatible with a lot of existing + * code, and also allows to migrate ASPECT functions into deal.II when + * useful without introducing incompatibilities. + * + * We need to do this in every header that introduces something into the + * namespace aspect::Utilities, because it needs to happen + * no matter which header files of ASPECT are included. + */ + using namespace dealii::Utilities; + /** * StructuredDataLookup (formerly AsciiDataLookup) represents structured * data that can be read from files including in ascii format. diff --git a/include/aspect/utilities.h b/include/aspect/utilities.h index bb25f3865c5..36db12117c3 100644 --- a/include/aspect/utilities.h +++ b/include/aspect/utilities.h @@ -53,6 +53,20 @@ namespace aspect */ namespace Utilities { + /** + * Because many places in ASPECT assume that all functions in the namespace + * dealii::Utilities are available without qualification as + * Utilities::function, just as all the function in the + * namespace aspect::Utilities, we make sure all these functions + * are available inside aspect::Utilities. This is maybe not + * the cleanest solution, but it is most compatible with a lot of existing + * code, and also allows to migrate ASPECT functions into deal.II when + * useful without introducing incompatibilities. + * + * We need to do this in every header that introduces something into the + * namespace aspect::Utilities, because it needs to happen + * no matter which header files of ASPECT are included. + */ using namespace dealii::Utilities; diff --git a/include/aspect/volume_of_fluid/utilities.h b/include/aspect/volume_of_fluid/utilities.h index fe9c6c504f7..6d4a0860bf3 100644 --- a/include/aspect/volume_of_fluid/utilities.h +++ b/include/aspect/volume_of_fluid/utilities.h @@ -31,6 +31,21 @@ namespace aspect { namespace Utilities { + /** + * Because many places in ASPECT assume that all functions in the namespace + * aspect::Utilities are available without qualification as + * Utilities::function, we make sure all these functions + * are also available inside aspect::Particle::Property::Utilities. + * This is maybe not the cleanest solution, but it is most compatible + * with a lot of existing code. + * + * We need to do this in every header that creates a new namespace named + * Utilities, because otherwise the compiler may not find + * the requested function in the current namespace and issue an error, even + * though the function is available in the namespace aspect::Utilities. + */ + using namespace aspect::Utilities; + /** * Function to calculate volume fraction contained by indicator function * H(d-normal*(x'-x_{cen}')) on the [0, 1]^dim unit cell where x_{cen} is