DFNgen  2.0
DFN Model Generator
insertShape.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <random>
3 #include "structures.h"
4 #include "insertShape.h"
5 #include "generatingPoints.h"
7 #include "input.h"
8 #include "vectorFunctions.h"
9 #include <string>
10 
11 
12 /**************************************************************************/
13 /***************** Generate Polygon/Fracture ****************************/
26 struct Poly generatePoly(struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex, bool useList) {
27 
28  // New polygon to build
29  struct Poly newPoly;
30  // Initialize normal to {0,0,1}. ( All polys start on x-y plane )
31  newPoly.normal[0] = 0; // x
32  newPoly.normal[1] = 0; // y
33  newPoly.normal[2] = 1; // z
34 
35  // Assign number of nodes
36  newPoly.numberOfNodes = shapeFam.numPoints;
37 
38  newPoly.vertices = new double[3*newPoly.numberOfNodes]; //numPoints*{x,y,z}
39 
40  // Assign family number (index of array)
41  newPoly.familyNum = familyIndex;
42 
43  // Switch based on distribution type
44  switch (shapeFam.distributionType) {
45 
46  case 1: { // Lognormal
47  double radius;
48  int count = 1;
49  if (shapeFam.radiiIdx >= shapeFam.radiiList.size() || useList == false) {
50  // If out of radii from list, insert random radius
51  std::lognormal_distribution<double> logDistribution(shapeFam.mean, shapeFam.sd);
52  do {
53  radius = logDistribution(generator);
54 
55  if (count % 1000 == 0) {
56  std::cout << "\nWARNING: Lognormal distribution for " << shapeType(shapeFam)
57  << " family " << getFamilyNumber(familyIndex, shapeFam.shapeFamily)
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";
61  break;
62  }
63  count++;
64  } while (radius < h || radius < shapeFam.logMin || radius > shapeFam.logMax);
65  }
66  else { // Insert radius from list
67  radius = shapeFam.radiiList[shapeFam.radiiIdx];
68  shapeFam.radiiIdx++;
69  }
70 
71  if (shapeFam.shapeFamily == 1) { // Rectangle
72  // Initialize rectangles vertices using lognormal dist.
73  initializeRectVertices(newPoly, radius, shapeFam.aspectRatio);
74  }
75  else {// Ellipse
76  initializeEllVertices(newPoly, radius, shapeFam.aspectRatio, shapeFam.thetaList, shapeFam.numPoints);
77  }
78 
79  break;
80  }
81 
82  case 2: { // Truncated power-law
83 
84  double radius;
85 
86  if (shapeFam.radiiIdx >= shapeFam.radiiList.size() || useList == false) {
87  // If out of radii from list, generate random radius
88  std::uniform_real_distribution<double> uniformDist(0.0,1.0);
89  radius = truncatedPowerLaw( uniformDist(generator), shapeFam.min, shapeFam.max, shapeFam.alpha);
90  }
91  else { // Pull radius from list
92  radius = shapeFam.radiiList[shapeFam.radiiIdx];
93  shapeFam.radiiIdx++;
94  }
95 
96  if (shapeFam.shapeFamily == 1) {
97  initializeRectVertices(newPoly, radius, shapeFam.aspectRatio);
98  }
99  else {
100  initializeEllVertices(newPoly, radius, shapeFam.aspectRatio, shapeFam.thetaList, shapeFam.numPoints);
101  }
102  break;
103  }
104 
105  case 3: { // Exponential
106  double radius;
107  int count = 1;
108  if (shapeFam.radiiIdx >= shapeFam.radiiList.size() || useList == false) {
109  // If out of radii from list, generate random radius
110  do {
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)
114  << " family " << getFamilyNumber(familyIndex, shapeFam.shapeFamily)
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";
118  break;
119  }
120 
121  count++;
122 
123  } while (radius < h || radius < shapeFam.expMin || radius > shapeFam.expMax);
124  }
125  else { // Insert radius from list
126  radius = shapeFam.radiiList[shapeFam.radiiIdx];
127  shapeFam.radiiIdx++;
128  }
129 
130  if (shapeFam.shapeFamily == 1) { // Rectangle
131  // Initialize rectangles vertices using exp. dist.
132  initializeRectVertices(newPoly, radius, shapeFam.aspectRatio);
133  }
134  else { // Ellipse
135  initializeEllVertices(newPoly, radius , shapeFam.aspectRatio, shapeFam.thetaList, shapeFam.numPoints);
136  }
137  break;
138  }
139 
140 
141  case 4: { // Constant
142  if (shapeFam.shapeFamily == 1) { // Rectangle
143  // Initialize rectangles vertices
144  initializeRectVertices(newPoly, shapeFam.constRadi, shapeFam.aspectRatio);
145  }
146  else { // Ellipse
147  initializeEllVertices(newPoly, shapeFam.constRadi, shapeFam.aspectRatio,shapeFam.thetaList, shapeFam.numPoints);
148  }
149  break;
150  }
151  }
152 
153 
154  double beta;
155  // Initialize beta based on distrubution type: 0 = unifrom on [0,2PI], 1 = constant
156  if (shapeFam.betaDistribution == 0) { //uniform distribution
157  std::uniform_real_distribution<double> uniformDist (0, 2*M_PI);
158  beta = uniformDist(generator);
159  }
160  else {
161  beta = shapeFam.beta;
162  }
163 
164  // Apply 2d rotation matrix, twist around origin
165  // Assumes polygon on x-y plane
166  // Angle must be in rad
167  applyRotation2D(newPoly, beta);
168 
169  // Fisher distribution / get normal vector
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) {
173  normalize(norm); // Ensure norm is normalized
174  }
175 
176  applyRotation3D(newPoly, norm); // Rotate vertices to norm (new normal)
177 
178  // Save newPoly's new normal vector
179  newPoly.normal[0] = norm[0];
180  newPoly.normal[1] = norm[1];
181  newPoly.normal[2] = norm[2];
182  delete[] norm;
183 
184  double *t;
185 
186  if (shapeFam.layer == 0 ) { // The family layer is the whole domain
188 
189  }
190  else { // Family belongs to a certain layer, shapeFam.layer is > zero
191 
192  // Layers start at 1, but the array of layers start at 0 hence sub of 1
193  // Layer 0 is reservered to denote the entire domain
194  int layerIdx = (shapeFam.layer - 1) * 2;
195 
196  // Layers only apply to z coordinates
197  t = randomTranslation(generator, (-domainSize[0]-domainSizeIncrease[0])/2, (domainSize[0]+domainSizeIncrease[0])/2, (-domainSize[1]-domainSizeIncrease[1])/2, (domainSize[1]+domainSizeIncrease[1])/2, layers[layerIdx] , layers[layerIdx+1]);
198  } // End else
199 
200  // Translate - will also set translation vector in poly structure
201  translate(newPoly, t);
202  delete[] t;
203 
204  return newPoly;
205 }
206 
207 
208 /**************************************************************************/
209 /************* Generate Polygon/Fracture With Given Radius **************/
221 struct Poly generatePoly_withRadius(double radius,struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex) {
222 
223  // New polygon to build
224  struct Poly newPoly;
225  // Initialize normal to {0,0,1}. ( All polys start on x-y plane )
226  newPoly.normal[0] = 0; //x
227  newPoly.normal[1] = 0; //y
228  newPoly.normal[2] = 1; //z
229 
230  // Assign number of nodes
231  newPoly.numberOfNodes = shapeFam.numPoints;
232  newPoly.vertices = new double[3*newPoly.numberOfNodes]; //numPoints*{x,y,z}
233 
234  // Assign family number (index of shapeFam array)
235  newPoly.familyNum = familyIndex;
236 
237  // TODO: Convert any degrees to rad
238  // in readInput() to avoid continuous checking
239 
240  if (shapeFam.shapeFamily == 1) { // If rectangle shape
241  // Initialize rectangles vertices
242  initializeRectVertices(newPoly, radius, shapeFam.aspectRatio);
243  }
244  else { // Ellipse
245  initializeEllVertices(newPoly, radius, shapeFam.aspectRatio,shapeFam.thetaList, shapeFam.numPoints);
246  }
247 
248  double beta;
249  // Initialize beta based on distrubution type: 0 = unifrom on [0,2PI], 1 = constant
250  if (shapeFam.betaDistribution == 0) { // Uniform distribution
251  std::uniform_real_distribution<double> uniformDist (0, 2*M_PI);
252  beta = uniformDist(generator);
253  }
254  else {
255  beta = shapeFam.beta;
256  }
257 
258  // Apply 2d rotation matrix, twist around origin
259  // assumes polygon on x-y plane
260  // Angle must be in rad
261  applyRotation2D(newPoly, beta);
262 
263  // Fisher distribution / get normal vector
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) {
267  normalize(norm); //ensure norm is normalized
268  }
269 
270  applyRotation3D(newPoly, norm); // Rotate vertices to norm (new normal)
271 
272  // Save newPoly's new normal vector
273  newPoly.normal[0] = norm[0];
274  newPoly.normal[1] = norm[1];
275  newPoly.normal[2] = norm[2];
276  delete[] norm;
277 
278  double *t;
279 
280  if (shapeFam.layer == 0 ) { // The family layer is the whole domain
281  t = randomTranslation(generator, (-domainSize[0]-domainSizeIncrease[0])/2,
284  (domainSize[2]+domainSizeIncrease[2])/2);
285 
286  }
287  else { // Family belongs to a certain layer, shapeFam.layer is > zero
288 
289  // Layers start at 1, but the array of layers start at 0, hence
290  // the subtraction by 1
291  // Layer 0 is reservered to be the entire domain
292  int layerIdx = (shapeFam.layer - 1) * 2;
293 
294  // Layers only apply to z coordinates
295  t = randomTranslation(generator, (-domainSize[0]-domainSizeIncrease[0])/2,
297  (domainSize[1]+domainSizeIncrease[1])/2, layers[layerIdx] , layers[layerIdx+1]);
298 
299  } // End else
300 
301  // Translate - will also set translation vector in poly structure
302  translate(newPoly, t);
303  delete[] t;
304 
305  return newPoly;
306 }
307 
308 
309 /*******************************************************************************/
310 /******************** Aperture assignment function ****************************/
325 // water density = 997.7
326 // gravity = 9.8
327 // water Visc = 8.9e-4
328 // constant scalar = waterDesnsity*gravity/waterVisc = 48.3868
329 #define _CONSTSCALAR 48.3868
330 void assignAperture(struct Poly &newPoly, std::mt19937_64 &generator) {
331 
332  // Most aperture variables are currently declared globaly
333  switch (aperture) {
334  case 1: { // Lognormal
335  std::lognormal_distribution<double> logDistribution(meanAperture, stdAperture);
336  newPoly.aperture = logDistribution(generator);
337  break;
338  }
339 
340  case 2:{
341  /* Transmissivity is calculated as transmissivity = F*R^k,
342  where F is a first element in aperturefromTransmissivity,
343  k is a second element and R is a mean radius of a polygon.
344  Aperture is calculated according to cubic law as
345  b=(transmissivity*12)^1/3 */
346  float radiAvg = (newPoly.xradius + newPoly.yradius)*.5;
347  double F = apertureFromTransmissivity[0];
348  double k = apertureFromTransmissivity[1];
349  double transmissivity = F * std::pow(radiAvg, k);
350  newPoly.aperture = std::cbrt((transmissivity*12/_CONSTSCALAR)); //cube root
351  break;
352  }
353 
354 
355  case 3:{
356  newPoly.aperture = constantAperture;
357  break;
358  }
359 
360  case 4:{
361  double radiAvg = (newPoly.xradius + newPoly.yradius)*.5;
362  double apertureMeanF = lengthCorrelatedAperture[0];
363  double b = lengthCorrelatedAperture[1];
364  newPoly.aperture = apertureMeanF * std::pow(radiAvg, b);
365 
366  break;
367  }
368  }
369 }
370 
371 /**************************************************************************/
372 /**************** permiability assignment function ***********************/
380 void assignPermeability(struct Poly &newPoly) {
381 
382  // Aperture variables are declared globaly
383  switch (permOption) {
384  case 0: { // Perm as function of aperture
385  newPoly.permeability = (newPoly.aperture * newPoly.aperture)/12;
386  break;
387  }
388 
389  case 1:{
391  break;
392  }
393  }
394 }
395 
396 /************** Initialize Rectangular Vertices *****************/
403 void initializeRectVertices(struct Poly &newPoly, float radius, float aspectRatio) {
404  float x = radius;
405  float y = radius * aspectRatio;
406  newPoly.xradius = x;
407  newPoly.yradius = y;
408  newPoly.aspectRatio = aspectRatio;
409 
410  // Initialize vertices
411  newPoly.vertices[0] = x;
412  newPoly.vertices[1] = y;
413  newPoly.vertices[2] = 0;
414  newPoly.vertices[3] = -x;
415  newPoly.vertices[4] = y;
416  newPoly.vertices[5] = 0;
417  newPoly.vertices[6] = -x;
418  newPoly.vertices[7] = -y;
419  newPoly.vertices[8] = 0;
420  newPoly.vertices[9] = x;
421  newPoly.vertices[10] = -y;
422  newPoly.vertices[11] = 0;
423 }
424 
425 
426 /****************************************************************/
427 /************* Initialize Ellipse Vertices **********************/
432 void initializeEllVertices(struct Poly &newPoly, float radius, float aspectRatio, float *thetaList, int numPoints) {
433 
434  newPoly.xradius = radius;
435  newPoly.yradius = radius * aspectRatio;
436  newPoly.aspectRatio = aspectRatio;
437  for (int i = 0; i < numPoints; i++ ) {
438  int idx = i*3;
439  newPoly.vertices[idx] = radius * std::cos(thetaList[i]);
440  newPoly.vertices[idx+1] = radius * aspectRatio * std::sin(thetaList[i]);
441  newPoly.vertices[idx+2] = 0;
442  }
443 }
444 
445 
446 /**********************************************************************/
447 /******************** Retranslate Polygon ***************************/
455 void reTranslatePoly(struct Poly &newPoly, struct Shape &shapeFam, std::mt19937_64 &generator) {
456 
457 
458  if (newPoly.truncated == 0) {
459  // If poly isn't truncated we can skip a lot of steps such
460  // as reallocating vertice memory, rotations, etc..
461 
462  newPoly.groupNum = 0; // Clear cluster group information
463  newPoly.intersectionIndex.clear(); // Clear any saved intersections
464 
465  // Move poly back to origin
466  for (int i = 0; i < newPoly.numberOfNodes; i++) {
467  int idx = 3*i;
468  newPoly.vertices[idx] -= newPoly.translation[0]; // x
469  newPoly.vertices[idx+1] -= newPoly.translation[1]; // y
470  newPoly.vertices[idx+2] -= newPoly.translation[2]; // z
471  }
472 
473  // Translate to new position
474  double *t;
475  if (shapeFam.layer == 0 ) { // The family layer is the whole domain
477  }
478  else { // Family belongs to a certain layer
479 
480  // Layers start at 1, but the array of layers start at 0. Layer 0 is reservered to be the entire domain
481  int layerIdx = (shapeFam.layer - 1) * 2;
482 
483  // Layers only apply to z coordinates
484  t = randomTranslation(generator, (-domainSize[0]-domainSizeIncrease[0])/2, (domainSize[0]+domainSizeIncrease[0])/2, (-domainSize[1]-domainSizeIncrease[1])/2, (domainSize[1]+domainSizeIncrease[1])/2, layers[layerIdx] , layers[layerIdx+1]);
485 
486  } // End else
487 
488  // Translate - will also set translation vector in poly structure
489  translate(newPoly, t);
490  delete[] t;
491  }
492 
493  else { // Poly was truncated, need to rebuild the polygon
494 
495  delete[] newPoly.vertices; // Delete truncated vertices
496  newPoly.vertices = new double[shapeFam.numPoints*3];
497 
498  // Reset boundary faces (0 means poly is no longer touching a boundary)
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;
505 
506  newPoly.truncated = 0; // Set to 0 to mean not truncated
507  newPoly.groupNum = 0; // Clear cluster group information
508 
509  newPoly.intersectionIndex.clear(); // Clear any saved intersections
510  newPoly.numberOfNodes = shapeFam.numPoints;
511 
512  if (shapeFam.shapeFamily == 1) { // 1 is rectanglular families. rebuild rectangle
513 
514  // Rebuild poly at origin using previous size
515  newPoly.vertices[0] = newPoly.xradius;
516  newPoly.vertices[1] = newPoly.yradius;
517  newPoly.vertices[2] = 0;
518  newPoly.vertices[3] = -newPoly.xradius;
519  newPoly.vertices[4] = newPoly.yradius;
520  newPoly.vertices[5] = 0;
521  newPoly.vertices[6] = -newPoly.xradius;
522  newPoly.vertices[7] = -newPoly.yradius;
523  newPoly.vertices[8] = 0;
524  newPoly.vertices[9] = newPoly.xradius;
525  newPoly.vertices[10] = -newPoly.yradius;
526  newPoly.vertices[11] = 0;
527  }
528  else { // Rebuild ellipse
529  initializeEllVertices(newPoly, newPoly.xradius, shapeFam.aspectRatio, shapeFam.thetaList, shapeFam.numPoints);
530  }
531 
532  // Save newPoly's previous normal vector and then reset poly normal to {0,0,1} for applyRotation3D function
533  double normalB[3] = {newPoly.normal[0], newPoly.normal[1], newPoly.normal[2]};
534 
535  newPoly.normal[0] = 0; //x
536  newPoly.normal[1] = 0; //y
537  newPoly.normal[2] = 1; //z
538 
539  double beta;
540  // Initialize beta based on distrubution type: 0 = unifrom on [0,2PI], 1 = constant
541  if (shapeFam.betaDistribution == 0) {
542  // Uniform distribution
543  std::uniform_real_distribution<double> uniformDist (0, 2*M_PI);
544  beta = uniformDist(generator);
545  }
546  else { // Constant
547  beta = shapeFam.beta;
548  }
549 
550  // Apply 2d rotation matrix, twist around origin
551  // Assumes polygon on x-y plane
552  // Angle must be in rad
553  applyRotation2D(newPoly, beta);
554 
555  // Rotates poly from {0,0,1} to normalB, NEED to save normalB to newPoly.normal afterwards
556  applyRotation3D(newPoly, normalB);
557 
558  newPoly.normal[0] = normalB[0];
559  newPoly.normal[1] = normalB[1];
560  newPoly.normal[2] = normalB[2];
561 
562  // Translate to new position
563  // Translate() will also set translation vector in poly structure
564  double *t;
565  if (shapeFam.layer == 0 ) { // The family layer is the whole domain
567  }
568  else { // Family belongs to a certain layer
569 
570  // Layers start at #1, but the array index of layers start at 0. ShapeFam.layer=0 is reservered to be the entire domain
571  int layerIdx = (shapeFam.layer - 1) * 2;
572 
573  // Layers only apply to z coordinates
574  t = randomTranslation(generator, (-domainSize[0]-domainSizeIncrease[0])/2, (domainSize[0]+domainSizeIncrease[0])/2, (-domainSize[1]-domainSizeIncrease[1])/2, (domainSize[1]+domainSizeIncrease[1])/2, layers[layerIdx] , layers[layerIdx+1]);
575 
576  } // End else
577 
578  translate(newPoly, t);
579  delete[] t;
580  }
581 }
582 
583 
584 /**********************************************************************/
585 /************* Check if Target P32 Has Been Met *********************/
598 bool p32Complete(int size) {
599 
600  // Check if p32Status array is all 1's, if not return 0
601  for (int i = 0; i < size; i++) {
602  if (p32Status[i] == 0) {
603  return 0;
604  }
605  }
606  // If function has not returned yet, array is all 1's
607  return 1;
608 }
609 
610 
611 /***************************************************************************/
612 /********************** Print Rejection Reson ****************************/
617 void printRejectReason(int rejectCode, struct Poly newPoly) {
618 
619  if (newPoly.familyNum >=0 ) {
620  std::cout << "\nAttempted fracture from family "
621  << newPoly.familyNum << " was rejected:\n";
622  }
623 
624  switch (rejectCode) {
625  case -2:
626  std::cout << "\trejectCode = -2: Intersection of length < h.\n";
627  break;
628 
629  case -1:
630  std::cout << "\trejectCode = -1: Fracture too close to a node.\n";
631  break;
632 
633  case -6:
634  std::cout << "\trejectCode = -6: Fracture too close "
635  << "to another fracture's edge.\n";
636  break;
637  case -7:
638  std::cout << "\trejectCode = -7: Fractures intersecting on same plane\n";
639  break;
640 
641  case -10:
642  std::cout << "\trejectCode = -10: Rejected triple intersection "
643  << "due to triple intersections being turned off in input file.\n";
644  break;
645 
646  case -11:
647  std::cout << "\trejectCode = -11: Fracture's intersection "
648  << "landed too close to a previous intersection.\n";
649  break;
650 
651  case -12:
652  std::cout << "\trejectCode = -12: Fracture created a triple "
653  << "intersection with an angle too small.\n";
654  break;
655 
656  case -13:
657  std::cout << "\trejectCode = -13: Fracture created a triple intersection "
658  << "with the triple intersection point too close to an intersection's endpoint.\n";
659  break;
660 
661  case -14:
662  std::cout << "\trejectCode = -14: Fracture created a triple intersection with "
663  << "the triple intersection point too close to another triple intersection point.\n";
664  break;
665 
666  default:
667  std::cout << "\trejectCode = " << rejectCode << "\n";
668  break;
669  }
670 }
671 
672 
673 /******************************************************************/
674 /********************* Get Family Number *************************/
688 int getFamilyNumber(int familyIndex, int familyShape) {
689  if (familyShape != 0) { // if not ellipse family
690  return familyIndex - nFamEll + 1;
691  }
692  else return familyIndex+1;
693 }
694 
695 
696 /******************************************************************/
697 /******************** Print Shape Type **************************/
700 std::string shapeType(struct Shape &shapeFam) {
701  if (shapeFam.shapeFamily == 0) {
702  return "Ellipse";
703  }
704  else {
705  return "Rectangular";
706  }
707 }
708 
709 /******************************************************************/
710 /************ Get Max Fracture Radii From Family ****************/
717 double getLargestFractureRadius(Shape &shapeFam) {
718  switch (shapeFam.distributionType) {
719  case 1: // Log-normal
720  return shapeFam.logMax;
721  break;
722 
723  case 2: // Power-law
724  return shapeFam.max;
725  break;
726 
727  case 3: // Exponential
728  return shapeFam.expMax;
729  break;
730  default: // Constant
731  return shapeFam.constRadi;
732 
733  break;
734  }
735 }
736 
737 
float apertureFromTransmissivity[2]
Definition: readInput.cpp:420
void translate(Poly &newPoly, double *translation)
unsigned int groupNum
Definition: structures.h:30
T magnitude(T x, T y, T z)
void normalize(T *vec)
float domainSizeIncrease[3]
Definition: readInput.cpp:111
float max
Definition: structures.h:502
bool p32Complete(int size)
bool truncated
Definition: structures.h:95
int numberOfNodes
Definition: structures.h:14
float constRadi
Definition: structures.h:496
bool betaDistribution
Definition: structures.h:431
float * thetaList
Definition: structures.h:402
double eps
Definition: DFNmain.cpp:39
std::string shapeType(struct Shape &shapeFam)
short layer
Definition: structures.h:412
float truncatedPowerLaw(float randomNum, float min, float max, float alpha)
void initializeRectVertices(struct Poly &newPoly, float radius, float aspectRatio)
bool permOption
Definition: readInput.cpp:349
float * layers
Definition: readInput.cpp:443
int aperture
Definition: readInput.cpp:413
double * randomTranslation(std::mt19937_64 &generator, float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
float aspectRatio
Definition: structures.h:49
float meanAperture
Definition: readInput.cpp:401
float stdAperture
Definition: readInput.cpp:405
int getFamilyNumber(int familyIndex, int familyShape)
float expMax
Definition: structures.h:478
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)
double * vertices
Definition: structures.h:70
#define _CONSTSCALAR
float beta
Definition: structures.h:435
void assignPermeability(struct Poly &newPoly)
double yradius
Definition: structures.h:46
double permeability
Definition: structures.h:74
int nFamEll
Definition: readInput.cpp:120
short numPoints
Definition: structures.h:399
float logMax
Definition: structures.h:493
short distributionType
Definition: structures.h:396
float aspectRatio
Definition: structures.h:415
double constantAperture
Definition: readInput.cpp:423
double * fisherDistribution(double theta, double phi, double kappa, std::mt19937_64 &generator)
double lengthCorrelatedAperture[2]
Definition: readInput.cpp:429
double xradius
Definition: structures.h:40
void reTranslatePoly(struct Poly &newPoly, struct Shape &shapeFam, std::mt19937_64 &generator)
std::vector< unsigned int > intersectionIndex
Definition: structures.h:98
struct Poly generatePoly(struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex, bool useList)
Definition: insertShape.cpp:26
double getLargestFractureRadius(Shape &shapeFam)
bool * p32Status
Definition: readInput.cpp:468
double normal[3]
Definition: structures.h:55
double constantPermeability
Definition: readInput.cpp:432
void printRejectReason(int rejectCode, struct Poly newPoly)
short shapeFamily
Definition: structures.h:393
double aperture
Definition: structures.h:66
double domainSize[3]
Definition: readInput.cpp:18
void initializeEllVertices(struct Poly &newPoly, float radius, float aspectRatio, float *thetaList, int numPoints)
int familyNum
Definition: structures.h:22
double h
Definition: readInput.cpp:21
bool faces[6]
Definition: structures.h:84
void applyRotation2D(Poly &newPoly, float angle)
double translation[3]
Definition: structures.h:52