44 switch (shapeFam.distributionType) {
49 if (shapeFam.radiiIdx >= shapeFam.radiiList.size() || useList ==
false) {
51 std::lognormal_distribution<double> logDistribution(shapeFam.mean, shapeFam.sd);
53 radius = logDistribution(generator);
55 if (count % 1000 == 0) {
56 std::cout <<
"\nWARNING: Lognormal distribution for " <<
shapeType(shapeFam)
58 <<
" has been unable to generate a fracture with radius within set parameters after " 59 << count <<
" consecutive tries.\n";
60 std::cout <<
"Consider adjusting the lognormal paramerters for this family in the input file.\n";
64 }
while (radius <
h || radius < shapeFam.logMin || radius > shapeFam.logMax);
67 radius = shapeFam.radiiList[shapeFam.radiiIdx];
71 if (shapeFam.shapeFamily == 1) {
86 if (shapeFam.radiiIdx >= shapeFam.radiiList.size() || useList ==
false) {
88 std::uniform_real_distribution<double> uniformDist(0.0,1.0);
89 radius =
truncatedPowerLaw( uniformDist(generator), shapeFam.min, shapeFam.max, shapeFam.alpha);
92 radius = shapeFam.radiiList[shapeFam.radiiIdx];
96 if (shapeFam.shapeFamily == 1) {
108 if (shapeFam.radiiIdx >= shapeFam.radiiList.size() || useList ==
false) {
111 radius = distributions.expDist->getValue(shapeFam.expLambda, shapeFam.minDistInput, shapeFam.maxDistInput);
112 if (count % 1000 == 0) {
113 std::cout <<
"\nWARNING: Exponential distribution for " <<
shapeType(shapeFam)
115 <<
" has been unable to generate a fracture with radius within set parameters after " 116 << count <<
" consecutive tries.\n";
117 std::cout <<
"Consider adjusting the exponential parameters for this family in the input file.\n";
123 }
while (radius <
h || radius < shapeFam.expMin || radius > shapeFam.expMax);
126 radius = shapeFam.radiiList[shapeFam.radiiIdx];
130 if (shapeFam.shapeFamily == 1) {
142 if (shapeFam.shapeFamily == 1) {
156 if (shapeFam.betaDistribution == 0) {
157 std::uniform_real_distribution<double> uniformDist (0, 2*M_PI);
158 beta = uniformDist(generator);
161 beta = shapeFam.beta;
170 double *norm =
fisherDistribution(shapeFam.theta, shapeFam.phi, shapeFam.kappa, generator);
171 double mag =
magnitude(norm[0], norm[1], norm[2]);
172 if (mag < 1-eps || mag > 1+
eps) {
179 newPoly.
normal[0] = norm[0];
180 newPoly.
normal[1] = norm[1];
181 newPoly.
normal[2] = norm[2];
186 if (shapeFam.layer == 0 ) {
194 int layerIdx = (shapeFam.layer - 1) * 2;
240 if (shapeFam.shapeFamily == 1) {
250 if (shapeFam.betaDistribution == 0) {
251 std::uniform_real_distribution<double> uniformDist (0, 2*M_PI);
252 beta = uniformDist(generator);
255 beta = shapeFam.beta;
264 double *norm =
fisherDistribution(shapeFam.theta, shapeFam.phi, shapeFam.kappa, generator);
265 double mag =
magnitude(norm[0], norm[1], norm[2]);
266 if (mag < 1-eps || mag > 1+
eps) {
273 newPoly.
normal[0] = norm[0];
274 newPoly.
normal[1] = norm[1];
275 newPoly.
normal[2] = norm[2];
280 if (shapeFam.layer == 0 ) {
292 int layerIdx = (shapeFam.layer - 1) * 2;
329 #define _CONSTSCALAR 48.3868 336 newPoly.
aperture = logDistribution(generator);
349 double transmissivity = F * std::pow(radiAvg, k);
364 newPoly.
aperture = apertureMeanF * std::pow(radiAvg, b);
437 for (
int i = 0; i < numPoints; i++ ) {
439 newPoly.
vertices[idx] = radius * std::cos(thetaList[i]);
440 newPoly.
vertices[idx+1] = radius * aspectRatio * std::sin(thetaList[i]);
475 if (shapeFam.
layer == 0 ) {
481 int layerIdx = (shapeFam.
layer - 1) * 2;
499 newPoly.
faces[0] = 0;
500 newPoly.
faces[1] = 0;
501 newPoly.
faces[2] = 0;
502 newPoly.
faces[3] = 0;
503 newPoly.
faces[4] = 0;
504 newPoly.
faces[5] = 0;
543 std::uniform_real_distribution<double> uniformDist (0, 2*M_PI);
544 beta = uniformDist(generator);
547 beta = shapeFam.
beta;
558 newPoly.
normal[0] = normalB[0];
559 newPoly.
normal[1] = normalB[1];
560 newPoly.
normal[2] = normalB[2];
565 if (shapeFam.
layer == 0 ) {
571 int layerIdx = (shapeFam.
layer - 1) * 2;
601 for (
int i = 0; i < size; i++) {
620 std::cout <<
"\nAttempted fracture from family " 621 << newPoly.
familyNum <<
" was rejected:\n";
624 switch (rejectCode) {
626 std::cout <<
"\trejectCode = -2: Intersection of length < h.\n";
630 std::cout <<
"\trejectCode = -1: Fracture too close to a node.\n";
634 std::cout <<
"\trejectCode = -6: Fracture too close " 635 <<
"to another fracture's edge.\n";
638 std::cout <<
"\trejectCode = -7: Fractures intersecting on same plane\n";
642 std::cout <<
"\trejectCode = -10: Rejected triple intersection " 643 <<
"due to triple intersections being turned off in input file.\n";
647 std::cout <<
"\trejectCode = -11: Fracture's intersection " 648 <<
"landed too close to a previous intersection.\n";
652 std::cout <<
"\trejectCode = -12: Fracture created a triple " 653 <<
"intersection with an angle too small.\n";
657 std::cout <<
"\trejectCode = -13: Fracture created a triple intersection " 658 <<
"with the triple intersection point too close to an intersection's endpoint.\n";
662 std::cout <<
"\trejectCode = -14: Fracture created a triple intersection with " 663 <<
"the triple intersection point too close to another triple intersection point.\n";
667 std::cout <<
"\trejectCode = " << rejectCode <<
"\n";
689 if (familyShape != 0) {
690 return familyIndex -
nFamEll + 1;
692 else return familyIndex+1;
705 return "Rectangular";
void translate(Poly &newPoly, double *translation)
T magnitude(T x, T y, T z)
bool p32Complete(int size)
std::string shapeType(struct Shape &shapeFam)
float truncatedPowerLaw(float randomNum, float min, float max, float alpha)
void initializeRectVertices(struct Poly &newPoly, float radius, float aspectRatio)
double * randomTranslation(std::mt19937_64 &generator, float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
int getFamilyNumber(int familyIndex, int familyShape)
void applyRotation3D(Poly &newPoly, double *normalB)
void assignAperture(struct Poly &newPoly, std::mt19937_64 &generator)
struct Poly generatePoly_withRadius(double radius, struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex)
void assignPermeability(struct Poly &newPoly)
double * fisherDistribution(double theta, double phi, double kappa, std::mt19937_64 &generator)
void reTranslatePoly(struct Poly &newPoly, struct Shape &shapeFam, std::mt19937_64 &generator)
std::vector< unsigned int > intersectionIndex
struct Poly generatePoly(struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex, bool useList)
double getLargestFractureRadius(Shape &shapeFam)
void printRejectReason(int rejectCode, struct Poly newPoly)
void initializeEllVertices(struct Poly &newPoly, float radius, float aspectRatio, float *thetaList, int numPoints)
void applyRotation2D(Poly &newPoly, float angle)