Skip to content

Commit

Permalink
include utilities namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Feb 2, 2025
1 parent cacbbb2 commit 0d886ce
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/aspect/coordinate_systems.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ 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
14 changes: 14 additions & 0 deletions include/aspect/material_model/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ namespace aspect
template <int dim> class SimulatorAccess;
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;

template <int dim>
Expand Down
15 changes: 15 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,21 @@ 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 the current namespace and issue an error, even
* though the function is available in the namespace <code>aspect::Utilities</code>.
*/
using namespace aspect::Utilities;

/**
* Return an even permutation based on an index. This is an internal
* utilities function, also used by the unit tester.
Expand Down
16 changes: 16 additions & 0 deletions include/aspect/structured_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ 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;

/**
* StructuredDataLookup (formerly AsciiDataLookup) represents structured
* data that can be read from files including in ascii format.
Expand Down
14 changes: 14 additions & 0 deletions include/aspect/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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
15 changes: 15 additions & 0 deletions include/aspect/volume_of_fluid/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ 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 the current namespace and issue an error, even
* though the function is available in the namespace <code>aspect::Utilities</code>.
*/
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
Expand Down

0 comments on commit 0d886ce

Please sign in to comment.