Skip to content

Commit 786a03b

Browse files
committed
Split radial gravity profiles
1 parent 4deac06 commit 786a03b

File tree

8 files changed

+389
-216
lines changed

8 files changed

+389
-216
lines changed

cookbooks/inner_core_convection/inner_core_convection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <aspect/material_model/simple.h>
2222
#include <aspect/heating_model/interface.h>
23-
#include <aspect/gravity_model/radial.h>
23+
#include <aspect/gravity_model/radial_linear.h>
2424
#include <deal.II/base/parsed_function.h>
2525

2626
namespace aspect

include/aspect/gravity_model/radial.h

Lines changed: 9 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -22,120 +22,14 @@
2222
#ifndef _aspect_gravity_model_radial_h
2323
#define _aspect_gravity_model_radial_h
2424

25-
#include <aspect/simulator_access.h>
26-
#include <aspect/gravity_model/interface.h>
27-
28-
namespace aspect
29-
{
30-
namespace GravityModel
31-
{
32-
/**
33-
* A class that describes gravity as a radial vector of constant
34-
* magnitude. The magnitude's value is read from the input file.
35-
*
36-
* @ingroup GravityModels
37-
*/
38-
template <int dim>
39-
class RadialConstant : public Interface<dim>, public SimulatorAccess<dim>
40-
{
41-
public:
42-
/**
43-
* Return the gravity vector as a function of position.
44-
*/
45-
Tensor<1,dim> gravity_vector (const Point<dim> &position) const override;
46-
47-
/**
48-
* Declare the parameters this class takes through input files.
49-
*/
50-
static
51-
void
52-
declare_parameters (ParameterHandler &prm);
53-
54-
/**
55-
* Read the parameters this class declares from the parameter file.
56-
*/
57-
void
58-
parse_parameters (ParameterHandler &prm) override;
59-
60-
private:
61-
/**
62-
* Magnitude of the gravity vector.
63-
*/
64-
double magnitude;
65-
};
66-
67-
68-
/**
69-
* This model has been removed due to its misleading name. The available
70-
* AsciiData gravity model (using default parameters) is much more
71-
* earth-like, since it uses the gravity profile used in the construction
72-
* of the Preliminary Reference Earth Model (PREM, Dziewonski and Anderson,
73-
* 1981).
74-
*
75-
* This is the model used and discussed in the step-32 tutorial program of
76-
* deal.II.
77-
*
78-
* @ingroup GravityModels
79-
*/
80-
template <int dim>
81-
class RadialEarthLike : public Interface<dim>, public SimulatorAccess<dim>
82-
{
83-
public:
84-
/**
85-
* Initialization.
86-
*/
87-
void initialize() override;
88-
89-
/**
90-
* Return the gravity vector as a function of position.
91-
*/
92-
Tensor<1,dim> gravity_vector (const Point<dim> &position) const override;
93-
};
94-
95-
96-
/**
97-
* A class that describes gravity as a radial vector of linearly
98-
* changing magnitude with depth.
99-
*
100-
* @ingroup GravityModels
101-
*/
102-
template <int dim>
103-
class RadialLinear : public Interface<dim>, public SimulatorAccess<dim>
104-
{
105-
public:
106-
/**
107-
* Return the gravity vector as a function of position.
108-
*/
109-
Tensor<1,dim> gravity_vector (const Point<dim> &position) const override;
110-
111-
/**
112-
* Declare the parameters this class takes through input files.
113-
*/
114-
static
115-
void
116-
declare_parameters (ParameterHandler &prm);
117-
118-
/**
119-
* Read the parameters this class declares from the parameter file.
120-
*/
121-
void
122-
parse_parameters (ParameterHandler &prm) override;
123-
124-
private:
125-
/**
126-
* Magnitude of the gravity vector at the surface, m/s^2
127-
*/
128-
double magnitude_at_surface;
129-
130-
/**
131-
* Magnitude of the gravity vector at the bottom, m/s^2.
132-
* 'Bottom' means at the maximum depth of the provided geometry, for
133-
* a full sphere this means the center.
134-
*/
135-
double magnitude_at_bottom;
136-
137-
};
138-
}
139-
}
25+
/**
26+
* @deprecated: This header file is deprecated. Use one of the specific
27+
* radial gravity profile headers below instead.
28+
*/
29+
#pragma message("WARNING: <aspect/include/gravity_model/radial.h> is deprecated. Use one of the specific radial gravity profiles instead.")
30+
31+
#include <aspect/gravity_model/radial_constant.h>
32+
#include <aspect/gravity_model/radial_linear.h>
33+
#include <aspect/gravity_model/radial_earth_like.h>
14034

14135
#endif
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Copyright (C) 2014 - 2019 by the authors of the ASPECT code.
3+
4+
This file is part of ASPECT.
5+
6+
ASPECT is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2, or (at your option)
9+
any later version.
10+
11+
ASPECT is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with ASPECT; see the file LICENSE. If not see
18+
<http://www.gnu.org/licenses/>.
19+
*/
20+
21+
22+
#ifndef _aspect_gravity_model_radial_constant_h
23+
#define _aspect_gravity_model_radial_constant_h
24+
25+
#include <aspect/simulator_access.h>
26+
#include <aspect/gravity_model/interface.h>
27+
28+
namespace aspect
29+
{
30+
namespace GravityModel
31+
{
32+
/**
33+
* A class that describes gravity as a radial vector of constant
34+
* magnitude. The magnitude's value is read from the input file.
35+
*
36+
* @ingroup GravityModels
37+
*/
38+
template <int dim>
39+
class RadialConstant : public Interface<dim>, public SimulatorAccess<dim>
40+
{
41+
public:
42+
/**
43+
* Return the gravity vector as a function of position.
44+
*/
45+
Tensor<1,dim> gravity_vector (const Point<dim> &position) const override;
46+
47+
/**
48+
* Declare the parameters this class takes through input files.
49+
*/
50+
static
51+
void
52+
declare_parameters (ParameterHandler &prm);
53+
54+
/**
55+
* Read the parameters this class declares from the parameter file.
56+
*/
57+
void
58+
parse_parameters (ParameterHandler &prm) override;
59+
60+
private:
61+
/**
62+
* Magnitude of the gravity vector.
63+
*/
64+
double magnitude;
65+
};
66+
}
67+
}
68+
69+
#endif
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
Copyright (C) 2014 - 2019 by the authors of the ASPECT code.
3+
4+
This file is part of ASPECT.
5+
6+
ASPECT is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2, or (at your option)
9+
any later version.
10+
11+
ASPECT is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with ASPECT; see the file LICENSE. If not see
18+
<http://www.gnu.org/licenses/>.
19+
*/
20+
21+
22+
#ifndef _aspect_gravity_model_radial_earth_like_h
23+
#define _aspect_gravity_model_radial_earth_like_h
24+
25+
#include <aspect/simulator_access.h>
26+
#include <aspect/gravity_model/interface.h>
27+
28+
namespace aspect
29+
{
30+
namespace GravityModel
31+
{
32+
/**
33+
* This model has been removed due to its misleading name. The available
34+
* AsciiData gravity model (using default parameters) is much more
35+
* earth-like, since it uses the gravity profile used in the construction
36+
* of the Preliminary Reference Earth Model (PREM, Dziewonski and Anderson,
37+
* 1981).
38+
*
39+
* This is the model used and discussed in the step-32 tutorial program of
40+
* deal.II.
41+
*
42+
* @ingroup GravityModels
43+
*/
44+
template <int dim>
45+
class RadialEarthLike : public Interface<dim>, public SimulatorAccess<dim>
46+
{
47+
public:
48+
/**
49+
* Initialization.
50+
*/
51+
void initialize() override;
52+
53+
/**
54+
* Return the gravity vector as a function of position.
55+
*/
56+
Tensor<1,dim> gravity_vector (const Point<dim> &position) const override;
57+
};
58+
}
59+
}
60+
61+
#endif
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
Copyright (C) 2014 - 2019 by the authors of the ASPECT code.
3+
4+
This file is part of ASPECT.
5+
6+
ASPECT is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation; either version 2, or (at your option)
9+
any later version.
10+
11+
ASPECT is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with ASPECT; see the file LICENSE. If not see
18+
<http://www.gnu.org/licenses/>.
19+
*/
20+
21+
22+
#ifndef _aspect_gravity_model_radial_linear_h
23+
#define _aspect_gravity_model_radial_linear_h
24+
25+
#include <aspect/simulator_access.h>
26+
#include <aspect/gravity_model/interface.h>
27+
28+
namespace aspect
29+
{
30+
namespace GravityModel
31+
{
32+
/**
33+
* A class that describes gravity as a radial vector of linearly
34+
* changing magnitude with depth.
35+
*
36+
* @ingroup GravityModels
37+
*/
38+
template <int dim>
39+
class RadialLinear : public Interface<dim>, public SimulatorAccess<dim>
40+
{
41+
public:
42+
/**
43+
* Return the gravity vector as a function of position.
44+
*/
45+
Tensor<1,dim> gravity_vector (const Point<dim> &position) const override;
46+
47+
/**
48+
* Declare the parameters this class takes through input files.
49+
*/
50+
static
51+
void
52+
declare_parameters (ParameterHandler &prm);
53+
54+
/**
55+
* Read the parameters this class declares from the parameter file.
56+
*/
57+
void
58+
parse_parameters (ParameterHandler &prm) override;
59+
60+
private:
61+
/**
62+
* Magnitude of the gravity vector at the surface, m/s^2
63+
*/
64+
double magnitude_at_surface;
65+
66+
/**
67+
* Magnitude of the gravity vector at the bottom, m/s^2.
68+
* 'Bottom' means at the maximum depth of the provided geometry, for
69+
* a full sphere this means the center.
70+
*/
71+
double magnitude_at_bottom;
72+
73+
};
74+
}
75+
}
76+
77+
#endif

0 commit comments

Comments
 (0)