Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include utilities namespace wherever necessary #6217

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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