DFNgen
2.0
DFN Model Generator
|
#include <iostream>
#include <random>
#include "structures.h"
#include "insertShape.h"
#include "generatingPoints.h"
#include "computationalGeometry.h"
#include "input.h"
#include "vectorFunctions.h"
#include <string>
Go to the source code of this file.
Macros | |
#define | _CONSTSCALAR 48.3868 |
Functions | |
struct Poly | generatePoly (struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex, bool useList) |
struct Poly | generatePoly_withRadius (double radius, struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex) |
void | assignAperture (struct Poly &newPoly, std::mt19937_64 &generator) |
void | assignPermeability (struct Poly &newPoly) |
void | initializeRectVertices (struct Poly &newPoly, float radius, float aspectRatio) |
void | initializeEllVertices (struct Poly &newPoly, float radius, float aspectRatio, float *thetaList, int numPoints) |
void | reTranslatePoly (struct Poly &newPoly, struct Shape &shapeFam, std::mt19937_64 &generator) |
bool | p32Complete (int size) |
void | printRejectReason (int rejectCode, struct Poly newPoly) |
int | getFamilyNumber (int familyIndex, int familyShape) |
std::string | shapeType (struct Shape &shapeFam) |
double | getLargestFractureRadius (Shape &shapeFam) |
#define _CONSTSCALAR 48.3868 |
Assigns aperture based in user input option to fractures/polygons Function is used at end of fracture insertion in main()
Arg 1: Polyogon to assign aperture to Arg 2: Random generator, see c++ std library: <random>
Options: 1) meanAperture and stdAperture for using LogNormal distribution. 2) apertureFromTransmissivity, first transmissivity is defined, and then, using a cubic law, the aperture is calculated; 3) constantAperture, all fractures, regardless of their size, will have the same aperture value; 4) lengthCorrelatedAperture, aperture is defined as a function of fracture size
Definition at line 329 of file insertShape.cpp.
void assignAperture | ( | struct Poly & | newPoly, |
std::mt19937_64 & | generator | ||
) |
void assignPermeability | ( | struct Poly & | newPoly | ) |
Assigns permiability using user's input option Runs once at end of fracture insertion for all accepted fractures Options: 0 - Permeability of each fracture is a function of fracture aperture, given by k=(b^2)/12, where b is an aperture and k is permeability 1 - Constant permeabilty for all fractures Arg 1: Polygon/fracture to assign permiability to
Definition at line 380 of file insertShape.cpp.
struct Poly generatePoly | ( | struct Shape & | shapeFam, |
std::mt19937_64 & | generator, | ||
Distributions & | distributions, | ||
int | familyIndex, | ||
bool | useList | ||
) |
Generates a polygon based on a stochastic fracture shape family NOTE: Function does not create bouding box. The bouding box has to be created after fracture truncation Arg 1: Shape family to generate fracture from Arg 2: Random generator, see std <random> c++ library Arg 3: Distributions class, currently used only for exponential dist. Arg 4: Index of 'shapeFam' (arg 1) in the shapeFamilies array in main() Arg 5: True - Use pre-calculated fracture radii list to pull radii from False - Generate random radii every time (used in dryRun() which estimates number of fractures needed when using p32 option and generates the radii lists) Return: Random polygon/fracture based from 'shapeFam'
Definition at line 26 of file insertShape.cpp.
struct Poly generatePoly_withRadius | ( | double | radius, |
struct Shape & | shapeFam, | ||
std::mt19937_64 & | generator, | ||
Distributions & | distributions, | ||
int | familyIndex | ||
) |
Similar to generatePoly() except the radius is passed to the function. Generates a polygon Shape (ell or rect) still comes from the shapes' familiy NOTE: Function does not create bouding box. The bouding box has to be created after fracture truncation Arg 1: Radius for polygon Arg 2: Shape family to generate fracture from Arg 3: Random generator, see std <random> c++ library Arg 4: Distributions class, currently used only for exponential dist. Arg 5: Index of 'shapeFam' (arg 1) in the shapeFamilies array in main() Return: Polygond with radius passed in arg 1 and shape based on 'shapeFam'
Definition at line 221 of file insertShape.cpp.
int getFamilyNumber | ( | int | familyIndex, |
int | familyShape | ||
) |
Turns the global family number into a number the user can more easily understand. The shapeFamily array contains both rectangle and ellipse families. For example: If shapeFamilies array has 3 families of ellipse families and 3 families of rectangle families: {ell, ell, ell, rect, rect, rect} If we want the local family number for index 3, it will return family 1, meaning the first rectangular family. This function is used in conjuntion with shapeType().
Arg 1: Family index which family belings to in main()'s 'shapeFamilies' array Arg 2: Rectangle or ellipse family 0 - Ellipse 1 - Rectangle
Definition at line 688 of file insertShape.cpp.
double getLargestFractureRadius | ( | Shape & | shapeFam | ) |
Returns the largest fracture radii defined by the user for a fracture family. This function is used for the 'forceLargeFractures' option in the input file Arg 1: Shape family Return: User's maximum radii for shapeFam (arg 1)
Definition at line 717 of file insertShape.cpp.
void initializeEllVertices | ( | struct Poly & | newPoly, |
float | radius, | ||
float | aspectRatio, | ||
float * | thetaList, | ||
int | numPoints | ||
) |
Initializes ellipse vertices on x-y plane Arg 1: Poly to initialize Arg 2: Radius (xradius = radius. yradius = radius * aspectRatio) Arg 3: Aspect ratio
Definition at line 432 of file insertShape.cpp.
void initializeRectVertices | ( | struct Poly & | newPoly, |
float | radius, | ||
float | aspectRatio | ||
) |
Initializes vertices for rectangular poly using radius (1/2 x length) and aspcet ratio. (xradius = radius, yradius = radius * aspectRatio) Poly will be on x-y plane Arg 1: Polygon to initialize vertices Arg 2: Radius (1/2 x dimension length) Arg 3: Aspect ratio
Definition at line 403 of file insertShape.cpp.
bool p32Complete | ( | int | size | ) |
For th P32 stopping option (see input file) Function checks the status of the fractures families target P32 The 'p32Status' array is 1 to 1 with the total number of families When a family's P32 requirement has been met, it's corresponding element in 'p32Status' is set to '1' For example, the status for shapeFamiliy[0] is in p32Status[0]. If p32Status[0] = 1, shapeFamily[0] has met its p32/fracture intensity target, else it has not and will keep inserting more fractures
Arg 1: Size of 'p32Status' array (same size as the shapeFamilies array) Return: True once ALL p32 targets have been met for all families False otherwise
Definition at line 598 of file insertShape.cpp.
void printRejectReason | ( | int | rejectCode, |
struct Poly | newPoly | ||
) |
Function prints fracture rejection reasons to user based on reject code Currtenly only used for user defined fractures. Arg 1: Rejection code Arg 2: Poly which was rejected
Definition at line 617 of file insertShape.cpp.
void reTranslatePoly | ( | struct Poly & | newPoly, |
struct Shape & | shapeFam, | ||
std::mt19937_64 & | generator | ||
) |
Re-translate poly Re-initializes/re-builds (if needed) polygon at origin and translates to new position preserving its size, shape, and normal vector This helps hit target distributions since we reject less Arg 1: Polygon Arg 2: Shape family structure which Polygon belongs to Arg 3: Random Generator
Definition at line 455 of file insertShape.cpp.
std::string shapeType | ( | struct Shape & | shapeFam | ) |
Print type of family (ellipse or rectangle) Arg 1: Shape family
Definition at line 700 of file insertShape.cpp.