Skip to content

Commit 752d6ad

Browse files
authored
Merge pull request #6217 from gassmoeller/fix_utility_namespaces
Include utilities namespace wherever necessary
2 parents cacbbb2 + 0d886ce commit 752d6ad

File tree

6 files changed

+90
-0
lines changed

6 files changed

+90
-0
lines changed

include/aspect/coordinate_systems.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ namespace aspect
2525
{
2626
namespace Utilities
2727
{
28+
/**
29+
* Because many places in ASPECT assume that all functions in the namespace
30+
* <code>dealii::Utilities</code> are available without qualification as
31+
* <code>Utilities::function</code>, just as all the function in the
32+
* namespace <code>aspect::Utilities</code>, we make sure all these functions
33+
* are available inside <code>aspect::Utilities</code>. This is maybe not
34+
* the cleanest solution, but it is most compatible with a lot of existing
35+
* code, and also allows to migrate ASPECT functions into deal.II when
36+
* useful without introducing incompatibilities.
37+
*
38+
* We need to do this in every header that introduces something into the
39+
* namespace <code>aspect::Utilities</code>, because it needs to happen
40+
* no matter which header files of ASPECT are included.
41+
*/
42+
using namespace dealii::Utilities;
43+
2844
namespace Coordinates
2945
{
3046
/**

include/aspect/material_model/utilities.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ namespace aspect
3333
template <int dim> class SimulatorAccess;
3434
namespace Utilities
3535
{
36+
/**
37+
* Because many places in ASPECT assume that all functions in the namespace
38+
* <code>dealii::Utilities</code> are available without qualification as
39+
* <code>Utilities::function</code>, just as all the function in the
40+
* namespace <code>aspect::Utilities</code>, we make sure all these functions
41+
* are available inside <code>aspect::Utilities</code>. This is maybe not
42+
* the cleanest solution, but it is most compatible with a lot of existing
43+
* code, and also allows to migrate ASPECT functions into deal.II when
44+
* useful without introducing incompatibilities.
45+
*
46+
* We need to do this in every header that introduces something into the
47+
* namespace <code>aspect::Utilities</code>, because it needs to happen
48+
* no matter which header files of ASPECT are included.
49+
*/
3650
using namespace dealii::Utilities;
3751

3852
template <int dim>

include/aspect/particle/property/elastic_tensor_decomposition.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ namespace aspect
2828
{
2929
namespace Utilities
3030
{
31+
/**
32+
* Because many places in ASPECT assume that all functions in the namespace
33+
* <code>aspect::Utilities</code> are available without qualification as
34+
* <code>Utilities::function</code>, we make sure all these functions
35+
* are also available inside <code>aspect::Particle::Property::Utilities</code>.
36+
* This is maybe not the cleanest solution, but it is most compatible
37+
* with a lot of existing code.
38+
*
39+
* We need to do this in every header that creates a new namespace named
40+
* <code>Utilities</code>, because otherwise the compiler may not find
41+
* the requested function in the current namespace and issue an error, even
42+
* though the function is available in the namespace <code>aspect::Utilities</code>.
43+
*/
44+
using namespace aspect::Utilities;
45+
3146
/**
3247
* Return an even permutation based on an index. This is an internal
3348
* utilities function, also used by the unit tester.

include/aspect/structured_data.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ namespace aspect
3131
{
3232
namespace Utilities
3333
{
34+
/**
35+
* Because many places in ASPECT assume that all functions in the namespace
36+
* <code>dealii::Utilities</code> are available without qualification as
37+
* <code>Utilities::function</code>, just as all the function in the
38+
* namespace <code>aspect::Utilities</code>, we make sure all these functions
39+
* are available inside <code>aspect::Utilities</code>. This is maybe not
40+
* the cleanest solution, but it is most compatible with a lot of existing
41+
* code, and also allows to migrate ASPECT functions into deal.II when
42+
* useful without introducing incompatibilities.
43+
*
44+
* We need to do this in every header that introduces something into the
45+
* namespace <code>aspect::Utilities</code>, because it needs to happen
46+
* no matter which header files of ASPECT are included.
47+
*/
48+
using namespace dealii::Utilities;
49+
3450
/**
3551
* StructuredDataLookup (formerly AsciiDataLookup) represents structured
3652
* data that can be read from files including in ascii format.

include/aspect/utilities.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ namespace aspect
5353
*/
5454
namespace Utilities
5555
{
56+
/**
57+
* Because many places in ASPECT assume that all functions in the namespace
58+
* <code>dealii::Utilities</code> are available without qualification as
59+
* <code>Utilities::function</code>, just as all the function in the
60+
* namespace <code>aspect::Utilities</code>, we make sure all these functions
61+
* are available inside <code>aspect::Utilities</code>. This is maybe not
62+
* the cleanest solution, but it is most compatible with a lot of existing
63+
* code, and also allows to migrate ASPECT functions into deal.II when
64+
* useful without introducing incompatibilities.
65+
*
66+
* We need to do this in every header that introduces something into the
67+
* namespace <code>aspect::Utilities</code>, because it needs to happen
68+
* no matter which header files of ASPECT are included.
69+
*/
5670
using namespace dealii::Utilities;
5771

5872

include/aspect/volume_of_fluid/utilities.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ namespace aspect
3131
{
3232
namespace Utilities
3333
{
34+
/**
35+
* Because many places in ASPECT assume that all functions in the namespace
36+
* <code>aspect::Utilities</code> are available without qualification as
37+
* <code>Utilities::function</code>, we make sure all these functions
38+
* are also available inside <code>aspect::Particle::Property::Utilities</code>.
39+
* This is maybe not the cleanest solution, but it is most compatible
40+
* with a lot of existing code.
41+
*
42+
* We need to do this in every header that creates a new namespace named
43+
* <code>Utilities</code>, because otherwise the compiler may not find
44+
* the requested function in the current namespace and issue an error, even
45+
* though the function is available in the namespace <code>aspect::Utilities</code>.
46+
*/
47+
using namespace aspect::Utilities;
48+
3449
/**
3550
* Function to calculate volume fraction contained by indicator function
3651
* H(d-normal*(x'-x_{cen}')) on the [0, 1]^dim unit cell where x_{cen} is

0 commit comments

Comments
 (0)