DFNgen  2.0
DFN Model Generator
insertShape.h File Reference
#include <vector>
#include <random>
#include "structures.h"
#include <fstream>
#include <string>
#include "distributions.h"
Include dependency graph for insertShape.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void insertUserRects (std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intpts, struct Stats &pstats, std::vector< Point > &triplePoints)
 
void insertUserEll (std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intpts, struct Stats &pstats, std::vector< Point > &triplePoints)
 
void insertUserRectsByCoord (std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intpts, struct Stats &pstats, std::vector< Point > &triplePoints)
 
void insertUserEllByCoord (std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intpts, struct Stats &pstats, std::vector< Point > &triplePoints)
 
struct Poly generatePoly (struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex, bool useList)
 
void initializeRectVertices (struct Poly &newPoly, float radius, float aspectRatio)
 
void assignAperture (struct Poly &newPoly, std::mt19937_64 &generator)
 
void assignPermeability (struct Poly &newPoly)
 
void reTranslatePoly (struct Poly &newPoly, struct Shape &shapeFam, std::mt19937_64 &generator)
 
bool p32Complete (int size)
 
void initializeEllVertices (struct Poly &newPoly, float radius, float aspectRatio, float *thetaList, int numPoints)
 
void printRejectReason (int rejectCode, struct Poly newPoly)
 
int getFamilyNumber (int familyIndex, int family)
 
std::string shapeType (struct Shape &shapeFam)
 
double getLargestFractureRadius (Shape &shapeFam)
 
struct Poly generatePoly_withRadius (double radius, struct Shape &shapeFam, std::mt19937_64 &generator, Distributions &distributions, int familyIndex)
 

Function Documentation

§ assignAperture()

void assignAperture ( struct Poly newPoly,
std::mt19937_64 &  generator 
)

Definition at line 330 of file insertShape.cpp.

Here is the caller graph for this function:

§ assignPermeability()

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.

Here is the caller graph for this function:

§ generatePoly()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

§ generatePoly_withRadius()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

§ getFamilyNumber()

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.

Here is the caller graph for this function:

§ getLargestFractureRadius()

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.

Here is the caller graph for this function:

§ initializeEllVertices()

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.

Here is the caller graph for this function:

§ initializeRectVertices()

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.

Here is the caller graph for this function:

§ insertUserEll()

void insertUserEll ( std::vector< Poly > &  acceptedPoly,
std::vector< IntPoints > &  intpts,
struct Stats pstats,
std::vector< Point > &  triplePoints 
)

Inserts a user defined ellipse into the domain. Intersection checking, FRAM, and rejection/accptance are all called within this function. Arg 1: Array for all accepted polygons Arg 2: Array for all accepted intersections Arg 3: Program statistics structure Arg 4: Array of all triple intersection points

Definition at line 21 of file insertUserEll.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ insertUserEllByCoord()

void insertUserEllByCoord ( std::vector< Poly > &  acceptedPoly,
std::vector< IntPoints > &  intpts,
struct Stats pstats,
std::vector< Point > &  triplePoints 
)

Inserts user ellipses using defined coordinates provided by the user (see input file). Intersection checking, FRAM, and rejection/accptance are all contained within this function. Arg 1: Array for all accepted polygons Arg 2: Array for all accepted intersections Arg 3: Program statistics structure Arg 4: Array of all triple intersection points

Definition at line 21 of file insertUserEllByCoord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ insertUserRects()

void insertUserRects ( std::vector< Poly > &  acceptedPoly,
std::vector< IntPoints > &  intpts,
struct Stats pstats,
std::vector< Point > &  triplePoints 
)

Inserts a user defined rectangle into the domain Intersection checking, FRAM, and rejection/accptance is all contained within this function. Arg 1: Array for all accepted polygons Arg 2: Array for all accepted intersections Arg 3: Program statistics structure Arg 4: Array of all triple intersection points

Definition at line 22 of file insertUserRects.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ insertUserRectsByCoord()

void insertUserRectsByCoord ( std::vector< Poly > &  acceptedPoly,
std::vector< IntPoints > &  intpts,
struct Stats pstats,
std::vector< Point > &  triplePoints 
)

Inserts user rectangles using defined coordinates provided by the user (see input file). Intersection checking, FRAM, and rejection/accptance are all contained within this function. Arg 1: Array for all accepted polygons Arg 2: Array for all accepted intersections Arg 3: Program statistics structure Arg 4: Array of all triple intersection points

Definition at line 21 of file insertUserRectsByCoord.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ p32Complete()

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.

Here is the caller graph for this function:

§ printRejectReason()

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.

Here is the caller graph for this function:

§ reTranslatePoly()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

§ shapeType()

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.

Here is the caller graph for this function: