37 using namespace Utilities;
42 parameters(filename,*this)
55 prm.
load_entry(
"Potential mantle temperature",
false,
56 Types::Double(1600,
"The potential temperature of the mantle at the surface in Kelvin"));
57 prm.
load_entry(
"Thermal expansion coefficient alpha",
false,
58 Types::Double(3.5e-5,
"The thermal expansion coefficient alpha. TODO: expand add units"));
59 prm.
load_entry(
"specific heat Cp",
false,
Types::Double(1250,
"The specific heat Cp. TODO: expand and add units"));
64 prm.
load_entry(
"Surface rotation angle",
false,
65 Types::Double(0,
"The angle with which the model should be rotated around the Surface rotation point."));
66 prm.
load_entry(
"Surface rotation point",
false,
75 bool set = prm.
load_entry(
"Cross section",
false,
78 "This is an array of two points along where the cross section is taken"));
85 WBAssertThrow(cross_section.size() == 2,
"The cross section should contain two points, but it contains " 86 << cross_section.size() <<
" points.");
91 Point<2> surface_coord_conversions = (*cross_section[0]-*cross_section[1]);
92 surface_coord_conversions *= 1/(surface_coord_conversions.norm());
93 prm.
set_entry(
"Surface coordinate conversions",
94 Types::Point<2>(surface_coord_conversions, surface_coord_conversions,
"An internal value which is precomputed."));
102 Types::Feature(
"These are the features"),
"A list of features."));
107 World::temperature(
const std::array<double,2> &point,
const double depth,
const double gravity_norm)
const 110 WBAssertThrow(dim == 2,
"This function can only be called when the cross section " 111 "variable in the world builder file has been set. Dim is " 117 WBAssert(cross_section_natural.
inner_type_index.size() == 2,
"Internal error: Cross section natural should contain two points, but it contains " << cross_section_natural.
inner_type_index.size() <<
" points.");
119 std::vector<Types::Point<2> > cross_section;
120 for (
unsigned int i = 0; i < cross_section_natural.
inner_type_index.size(); ++i)
123 WBAssert(cross_section.size() == 2,
"Internal error: Cross section should contain two points, but it contains " << cross_section.size() <<
" points.");
127 Point<3> coord_3d(cross_section[0][0] + point[0] * surface_coord_conversions[0],
128 cross_section[0][1] + point[0] * surface_coord_conversions[1],
135 World::temperature(
const std::array<double,3> &point_,
const double depth,
const double gravity_norm)
const 146 temperature = (*it)->temperature(point,depth,gravity_norm,temperature);
153 World::composition(
const std::array<double,2> &point,
const double depth,
const unsigned int composition_number)
const 156 WBAssertThrow(dim == 2,
"This function can only be called when the cross section " 157 "variable in the world builder file has been set. Dim is " 162 std::vector<Types::Point<2> > cross_section;
163 for (
unsigned int i = 0; i < cross_section_natural.
inner_type_index.size(); ++i)
164 cross_section.push_back(this->parameters.vector_point_2d[cross_section_natural.
inner_type_index[i]]);
166 WBAssert(cross_section.size() == 2,
"Internal error: Cross section should contain two points, but it contains " 167 << cross_section.size() <<
" points.");
171 Point<3> coord_3d(cross_section[0][0] + point[0] * surface_coord_conversions[0],
172 cross_section[0][1] + point[0] * surface_coord_conversions[1],
179 World::composition(
const std::array<double,3> &point_,
const double depth,
const unsigned int composition_number)
const 185 composition = (*it)->composition(point,depth,composition_number, composition);
void declare_and_parse(Parameters ¶meters)
bool composition(const std::array< double, 2 > &point, const double depth, const unsigned int composition_number) const
double temperature(const std::array< double, 2 > &point, const double depth, const double gravity_norm) const
std::vector< unsigned int > inner_type_index
World(std::string filename)
const Types::Array & get_array(const std::string &name) const
const std::array< double, dim > & get_array() const
#define WBAssert(condition, message)
std::vector< Types::Point< 2 > > vector_point_2d
bool load_entry(const std::string &name, const bool required, const Types::Interface &type)
#define WBAssertThrow(condition, message)
Point< dim > get_point(const std::string &name) const
std::vector< std::unique_ptr< WorldBuilder::Features::Interface > > features
bool set_entry(const std::string &name, const Types::Interface &type)
double get_double(const std::string &name) const