34 using namespace Utilities;
44 min_depth(NaN::
DSNAN),
49 this->
name =
"uniform";
61 "Uniform grains model. All grains start exactly the same.");
65 "The distance from the fault center in meters from which the composition of this feature is present.");
67 "The distance from the fault in meters to which the composition of this feature is present.");
70 "A list with the integer labels of the composition which are present there.");
73 "A list with the labels of the grains which are present there for each compositions.");
76 "A list with the z-x-z Euler angles of the grains which are present there for each compositions.");
79 "Whether the value should replace any value previously defined at this location (replace) or " 80 "add the value to the previously define value (add, not implemented). Replacing implies that all values not " 81 "explicitly defined are set to zero.");
85 "A list of the size of all of the grains in each composition. If set to <0, the size will be set so that the total is equal to 1.");
93 min_depth = prm.
get<
double>(
"min distance fault center");
94 max_depth = prm.
get<
double>(
"max distance fault center");
97 const bool set_euler_angles = prm.
check_entry(
"Euler angles z-x-z");
98 const bool set_rotation_matrices = prm.
check_entry(
"rotation matrices");
100 WBAssertThrow(!(set_euler_angles ==
true && set_rotation_matrices ==
true),
101 "Only Euler angles or Rotation matrices may be set, but both are set for " << prm.
get_full_json_path());
104 WBAssertThrow(!(set_euler_angles ==
false && set_rotation_matrices ==
false),
105 "Euler angles or Rotation matrices have to be set, but neither are set for " << prm.
get_full_json_path());
107 if (set_euler_angles)
109 std::vector<std::array<double,3> > euler_angles_vector = prm.
get_vector<std::array<double,3> >(
"Euler angles z-x-z");
111 for (
size_t i = 0; i<euler_angles_vector.size(); ++i)
122 operation = prm.
get<std::string>(
"orientation operation");
127 "There are not the same amount of compositions (" << compositions.size()
130 "There are not the same amount of compositions (" << compositions.size()
131 <<
") and grain_sizes (" << grain_sizes.size() <<
").");
138 const unsigned int composition_number,
155 std::fill(grains_local.
sizes.begin(),grains_local.
sizes.end(),size);
bool check_entry(const std::string &name) const
std::vector< double > sizes
WorldBuilder::World * world
std::string get_full_json_path(size_t max_size=std::numeric_limits< size_t >::max()) const
#define WB_REGISTER_FEATURE_FAULT_GRAINS_MODEL(classname, name)
double distance_from_plane
#define WBAssertThrow(condition, message)
std::array< std::array< double, 3 >, 3 > euler_angles_to_rotation_matrix(double phi1_d, double theta_d, double phi2_d)
std::vector< std::array< std::array< double, 3 >, 3 > > rotation_matrices
void declare_entry(const std::string &name, const Types::Interface &type, const std::string &documentation)
std::vector< T > get_vector(const std::string &name)
T get(const std::string &name)