Skip to content

Commit

Permalink
Fix namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Feb 2, 2025
1 parent 79f9f19 commit cc4bd3b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
14 changes: 14 additions & 0 deletions include/aspect/coordinate_systems.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ namespace aspect
{
namespace Utilities
{
/**
* Because many places in ASPECT assume that all functions in the namespace
* <code>dealii::Utilities</code> are available without qualification as
* <code>Utilities::function</code>, just as all the function in the
* namespace <code>aspect::Utilities</code>, we make sure all these functions
* are available inside <code>aspect::Utilities</code>. 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 <code>aspect::Utilities</code>, because it needs to happen
* no matter which header files of ASPECT are included.
*/
using namespace dealii::Utilities;

namespace Coordinates
Expand Down
13 changes: 13 additions & 0 deletions include/aspect/particle/property/elastic_tensor_decomposition.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ namespace aspect
{
namespace Utilities
{
/**
* Because many places in ASPECT assume that all functions in the namespace
* <code>aspect::Utilities</code> are available without qualification as
* <code>Utilities::function</code>, we make sure all these functions
* are also available inside <code>aspect::Particle::Property::Utilities</code>.
* 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
* <code>Utilities</code>, because otherwise the compiler may not find
* the requested function in this namespace and issue an error, even
* though the function is available in the namespace <code>aspect::Utilities</code>.
*/
using namespace aspect::Utilities;

/**
Expand Down
14 changes: 14 additions & 0 deletions include/aspect/structured_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ namespace aspect
{
namespace Utilities
{
/**
* Because many places in ASPECT assume that all functions in the namespace
* <code>dealii::Utilities</code> are available without qualification as
* <code>Utilities::function</code>, just as all the function in the
* namespace <code>aspect::Utilities</code>, we make sure all these functions
* are available inside <code>aspect::Utilities</code>. 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 <code>aspect::Utilities</code>, because it needs to happen
* no matter which header files of ASPECT are included.
*/
using namespace dealii::Utilities;

/**
Expand Down
2 changes: 0 additions & 2 deletions source/structured_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ namespace aspect
{
namespace Utilities
{
using namespace dealii::Utilities;

template <int dim>
StructuredDataLookup<dim>::StructuredDataLookup(const unsigned int n_components,
const double scale_factor)
Expand Down
2 changes: 0 additions & 2 deletions source/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ namespace aspect
*/
namespace Utilities
{
using namespace dealii::Utilities;

namespace internal
{
namespace MPI
Expand Down
2 changes: 0 additions & 2 deletions source/volume_of_fluid/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace aspect
{
namespace Utilities
{
using namespace dealii::Utilities;

double compute_fluid_fraction (const Tensor<1, 2> normal,
const double d)
{
Expand Down

0 comments on commit cc4bd3b

Please sign in to comment.