|
World Builder
1.1.0-pre
A geodynamic initial conditions generator
|
#include <world.h>

Public Member Functions | |
| World (std::string filename, bool has_output_dir=false, const std::string &output_dir="", unsigned long random_number_seed=1, const bool limit_debug_consistency_checks=true) | |
| ~World () | |
| void | parse_entries (Parameters &prm) |
| unsigned int | properties_output_size (const std::vector< std::array< unsigned int, 3 >> &properties) const |
| std::vector< double > | properties (const std::array< double, 2 > &point, const double depth, const std::vector< std::array< unsigned int, 3 >> &properties) const |
| std::vector< double > | properties (const std::array< double, 3 > &point, const double depth, const std::vector< std::array< unsigned int, 3 >> &properties) const |
| double | temperature (const std::array< double, 2 > &point, const double depth) const |
| double | temperature (const std::array< double, 3 > &point, const double depth) const |
| double | temperature (const std::array< double, 2 > &point, const double depth, const double gravity_norm) const |
| double | temperature (const std::array< double, 3 > &point, const double depth, const double gravity_norm) const |
| double | composition (const std::array< double, 2 > &point, const double depth, const unsigned int composition_number) const |
| double | composition (const std::array< double, 3 > &point, const double depth, const unsigned int composition_number) const |
| WorldBuilder::grains | grains (const std::array< double, 2 > &point, const double depth, const unsigned int composition_number, size_t number_of_grains) const |
| WorldBuilder::grains | grains (const std::array< double, 3 > &point, const double depth, const unsigned int composition_number, size_t number_of_grains) const |
| Objects::PlaneDistances | distance_to_plane (const std::array< double, 3 > &point, const double depth, const std::string &name) const |
| std::mt19937 & | get_random_number_engine () |
Static Public Member Functions | |
| static void | declare_entries (Parameters &prm) |
Public Attributes | |
| int | MPI_RANK |
| int | MPI_SIZE |
| Parameters | parameters |
| std::vector< Point< 2 > > | cross_section |
| Point< 2 > | surface_coord_conversions |
| double | potential_mantle_temperature |
| double | surface_temperature |
| bool | force_surface_temperature |
| double | thermal_expansion_coefficient |
| double | specific_heat |
| double | thermal_diffusivity |
| double | maximum_distance_between_coordinates |
| std::string | interpolation |
| std::vector< std::string > | feature_tags |
Private Attributes | |
| unsigned int | dim |
| std::mt19937 | random_number_engine |
| bool | limit_debug_consistency_checks |
| WorldBuilder::World::World | ( | std::string | filename, |
| bool | has_output_dir = false, |
||
| const std::string & | output_dir = "", |
||
| unsigned long | random_number_seed = 1, |
||
| const bool | limit_debug_consistency_checks = true |
||
| ) |
Constructor. This constructor requires the parameter filename. Other parameters are optional.
| filename | a string with the location of the world builder file to initialize the world. |
| has_output_dir | a bool indicating whether the world builder is allowed to write out information to a directly. |
| output_dir | a string with the location of the directory where the world builder is allowed to write information to if it is allowed by the bool has_output_dir. |
| random_number_seed | a double containing a seed for the random number generator. The world builder uses a deterministic random number generator for some plugins. This is a deterministic random number generator on prorpose because even though you might want to use random numbers to initialize some fields, the result should be reproducible. Note that when the world builder is used in for example MPI programs you should supply the world builder created each MPI process a different seed. You can use the MPI RANK for this (seed is seed + MPI_RANK). Because the generator is deterministic (known and documented algorithm), we can test the results and they should be the same even for different compilers and machines. |
Definition at line 57 of file world.cc.

|
default |
Destructor

| double WorldBuilder::World::composition | ( | const std::array< double, 2 > & | point, |
| const double | depth, | ||
| const unsigned int | composition_number | ||
| ) | const |
| double WorldBuilder::World::composition | ( | const std::array< double, 3 > & | point, |
| const double | depth, | ||
| const unsigned int | composition_number | ||
| ) | const |
|
static |
| Objects::PlaneDistances WorldBuilder::World::distance_to_plane | ( | const std::array< double, 3 > & | point, |
| const double | depth, | ||
| const std::string & | name | ||
| ) | const |
Returns a PlaneDistances object that has the distance from and along a feature plane, calculated from the coordinates and the depth of the point.
| point | the coordinates in the cartesian geometry |
| depth | the depth of the point |
| name | the name of the feature (i.e. the string provided to the key word "name" in the wb file) |
Definition at line 562 of file world.cc.

| std::mt19937 & WorldBuilder::World::get_random_number_engine | ( | ) |
| WorldBuilder::grains WorldBuilder::World::grains | ( | const std::array< double, 2 > & | point, |
| const double | depth, | ||
| const unsigned int | composition_number, | ||
| size_t | number_of_grains | ||
| ) | const |
| WorldBuilder::grains WorldBuilder::World::grains | ( | const std::array< double, 3 > & | point, |
| const double | depth, | ||
| const unsigned int | composition_number, | ||
| size_t | number_of_grains | ||
| ) | const |
| void WorldBuilder::World::parse_entries | ( | Parameters & | prm | ) |
read in the world builder file
First load the major version number in the file and check the major version number of the program.
Secondly load the coordinate system parameters.
Thirdly load the gravity model parameters.
pre-compute stuff for the cross section
Temperature parameters.
Model discretization parameters
Local random number seed parameter
Now load the features. Some features use for example temperature values, so it is important that this is parsed the last.
Definition at line 158 of file world.cc.


| std::vector< double > WorldBuilder::World::properties | ( | const std::array< double, 2 > & | point, |
| const double | depth, | ||
| const std::vector< std::array< unsigned int, 3 >> & | properties | ||
| ) | const |
Returns different values at a single point in one go stored in a vector of doubles.
The properties input decides what each entry means, and the output is generated in the same order as the properties input. The properties input consists of a 3D array, where the first entry identifies the property and the last two entries provide extra information about that property.
Temperature is identified by 1 and no extra information is needed. So temperature input usually looks like {1,0,0}. A temperature query prodoces one entry in the output vector.
Composition is identified by 2. This produces one value in the output. The second entry identifies the composition number and the third number is not used. So a composition query asking about composition 1 looks like this: {2,1,0}. A composition query prodoces one entry in the output vector.
Grains are identified by 3. The second entry is the grain composition number and the third entry is the number of grains. A query about the grains, where it asks about composition 1 (for example enstatite) and 500 grains, looks like this: {3,1,500}. A composition query prodoces n_grains*10 entries in the output vector. The first n_grains entries are the sizes of all the grains, and the other 9 entries are sets of rotation matrices. The rotation matrix entries are ordered [0][0],[0][1],[0][2],[1][0],[1][1],etc.
The tag is identified by 4 and no extra information is needed. So the tag input usually looks like {4,0,0}. A tag query produces one entry in the output vector, representing the index of the tag of the last/dominant feature.
The velocity is identified by 5 and no extra information is needed. So the tag input usually looks like {5,0,0}. A tag query produces three entry in the output vector, representing the x, y and z velocity, even in 2D. In 2D the velocies are projected on the 2D plane, and the 3rd velocity element will be zero.
Definition at line 315 of file world.cc.


| std::vector< double > WorldBuilder::World::properties | ( | const std::array< double, 3 > & | point, |
| const double | depth, | ||
| const std::vector< std::array< unsigned int, 3 >> & | properties | ||
| ) | const |
Returns different values at a single point in one go stored in a vector of doubles.
The properties input decides what each entry means, and the output is generated in the same order as the properties input. The properties input consists of a 3D array, where the first entry identifies the property and the last two entries provide extra information about that property.
Temperature is identified by 1 and no extra information is needed. So temperature input usually looks like {1,0,0}. A temperature query prodoces one entry in the output vector.
Composition is identified by 2. This produces one value in the output. The second entry identifies the composition number and the third number is not used. So a composition query asking about composition 1 looks like this: {2,1,0}. A composition query prodoces one entry in the output vector.
Grains are identified by 3. The second entry is the grain composition number and the third entry is the number of grains. A query about the grains, where it asks about composition 1 (for example enstatite) and 500 grains, looks like this: {3,1,500}. A composition query prodoces n_grains*10 entries in the output vector. The first n_grains entries are the sizes of all the grains, and the other 9 entries are sets of rotation matrices. The rotation matrix entries are ordered [0][0],[0][1],[0][2],[1][0],[1][1],etc.
The tag is identified by 4 and no extra information is needed. So the tag input usually looks like {4,0,0}. A tag query produces one entry in the output vector, representing the index of the tag of the last/dominant feature.
The velocity is identified by 5 and no extra information is needed. So the tag input usually looks like {5,0,0}. A tag query produces three entry in the output vector, representing the x, y and z velocity, even in 2D. In 2D the velocies are projected on the 2D plane, and the 3rd velocity element will be zero.
Definition at line 403 of file world.cc.

| unsigned int WorldBuilder::World::properties_output_size | ( | const std::vector< std::array< unsigned int, 3 >> & | properties | ) | const |
Return the size of the output vector returned by the properties function for a given properties vector.
| properties | The properties parameter from the properties function. See the documentation of that function for more info. |
Definition at line 274 of file world.cc.


| double WorldBuilder::World::temperature | ( | const std::array< double, 2 > & | point, |
| const double | depth | ||
| ) | const |
| double WorldBuilder::World::temperature | ( | const std::array< double, 3 > & | point, |
| const double | depth | ||
| ) | const |
| double WorldBuilder::World::temperature | ( | const std::array< double, 2 > & | point, |
| const double | depth, | ||
| const double | gravity_norm | ||
| ) | const |
| double WorldBuilder::World::temperature | ( | const std::array< double, 3 > & | point, |
| const double | depth, | ||
| const double | gravity_norm | ||
| ) | const |
| std::vector<Point<2> > WorldBuilder::World::cross_section |
|
private |
| std::vector<std::string> WorldBuilder::World::feature_tags |
|
private |
limits some of the consistency checks in debug mode. Current only prevents a check whether depth in spherical coordinates is consistent with the computed depth from x,y,z and provided radius. Note: Recommended to keep it at false, unless you know what you are doing.
| double WorldBuilder::World::maximum_distance_between_coordinates |
| int WorldBuilder::World::MPI_RANK |
| int WorldBuilder::World::MPI_SIZE |
| Parameters WorldBuilder::World::parameters |
| double WorldBuilder::World::potential_mantle_temperature |
|
private |
| Point<2> WorldBuilder::World::surface_coord_conversions |
| double WorldBuilder::World::thermal_expansion_coefficient |