DFNgen
2.0
DFN Model Generator
|
Go to the source code of this file.
Functions | |
double | sumDeviation (const double *data, int n) |
double * | sumDevAry3 (double *data) |
int | maxElmtIdx (double *data, int n) |
int * | sortedIndex (const double *arr, int n) |
double | getArea (struct Poly &poly) |
int | indexFromProb (float *CDF, double roll, int size) |
int | indexFromProb_and_P32Status (float *CDF, double roll, int famSize, int cdfSize, int &cdfIdx) |
void | adjustCDF_and_famProb (float *&CDF, float *&famProbability, int &cdfSize, int idx2Remove) |
float * | createCDF (float *famProb, int size) |
float | truncatedPowerLaw (float randomNum, float emin, float emax, float alpha) |
int | cdfIdxFromFamNum (float *CDF, bool *p32Status, int famIdx) |
void | OR (bool *dest, bool *src) |
void adjustCDF_and_famProb | ( | float *& | CDF, |
float *& | famProbability, | ||
int & | cdfSize, | ||
int | idx2Remove | ||
) |
Adjusts the CDF and the famProb array. Used with P32 stopping contdition (see input file) When a family's P32 requrement is met, the CDF is adjusted to remove that family from the array. The famProb is also adjusted in the same way. Arg 1: Pointer to CDF array Arg 2: Pointer to famProb array Arg 3: Number of elements in CDF array Arg 4: Index to the element in the famProb array which is being removed
Definition at line 269 of file mathFunctions.cpp.
int cdfIdxFromFamNum | ( | float * | CDF, |
bool * | p32Status, | ||
int | famIdx | ||
) |
Given a family number, return its corresponding CDF array index Arg 1: CDF array Arg 2: p32Status array Arg 3: Family index of family whos CDF index to return Return: Index of CDF which belongs to shapeFamily[famIdx]
Definition at line 221 of file mathFunctions.cpp.
float* createCDF | ( | float * | famProb, |
int | size | ||
) |
Creates CDF from famProb[] Arg 1: Pointer to famProb array (see input file, and readInput()) Arg 2: Size of array
Definition at line 244 of file mathFunctions.cpp.
double getArea | ( | struct Poly & | poly | ) |
Calculate exact area of polygon (after truncation) Summar of algorithm: 1: Creates a point on the inside of the polygon (insidePt) 2: Uses 'insidePt' to create vectors to all outside vertices, breaking the polygon into triangles 3: Uses .5 * (magnitude of cross product) for each triangle for area calculation 4: Sums the areas for each trianlge for total area of polygon Arg 1: Polygon Return: Area of polygon
Definition at line 110 of file mathFunctions.cpp.
int indexFromProb | ( | float * | CDF, |
double | roll, | ||
int | size | ||
) |
CDF is 1 to 1 and algined with the stochastic family shapes array (std vector). This chooses the family index based on a random roll (random number between 0 and 1) and 'famProb' Arg 1: CDF of shape families based on famProb array in input file Arg 2: Random number between 0 and 1 Arg 3: Number of elements in 'CDF' array Return: Index to family based on the probability famProb
Definition at line 166 of file mathFunctions.cpp.
int indexFromProb_and_P32Status | ( | float * | CDF, |
double | roll, | ||
int | famSize, | ||
int | cdfSize, | ||
int & | cdfIdx | ||
) |
Use with fracture intensity (p32) stopping option Arg 1: Pointer to CDF array Arg 2: Random variable between 0 and 1 Arg 3: Number of stochastic families Arg 4: Number of elements in CDF array Arg 5: OUTPUT, index of CDF element which was chosen randomly Return: Index of chosen family based on its family probability, and p32Status (avoids inserting a fracture from a family which has already met it's fracture intensity requrement)
Definition at line 187 of file mathFunctions.cpp.
int maxElmtIdx | ( | double * | v, |
int | n | ||
) |
Used to find index of element with max value from array4 Used in intersectionChecking() Arg 1: Array of doubles Arg 2: Size of array Return: Max element's array index
If elements happen to be equal, returns the first one
Definition at line 68 of file mathFunctions.cpp.
|
inline |
Used for ORing arrays of bool for boundary face codes Expectes array size is 6. ORs dest with src, then saves to dest. e.g destArray = destArray ^ srcArray
Arg 1: dest array Arg 2: souce array
Definition at line 24 of file mathFunctions.h.
int* sortedIndex | ( | const double * | v, |
int | n | ||
) |
Similar to mathematica's Ordering[] funct. Arg 1: Pointer to array of doubles Arg 2: Size of array, number of elements Return: Array of sorted indicies to elements in 'v' sorted smallest to largest
Definition at line 88 of file mathFunctions.cpp.
double* sumDevAry3 | ( | double * | v | ) |
Used in intersectionChecking() How function is used: v is a pointer to an array of 4 points, each point contains x, y, and z coordinates The 4 sumDeviation is computed on all points' x, y, and z coord. An array of three elements is returned containing the sum deviation of all x's, all y's, and all z's
Arg 1: Array of 12 elements: 4 points, {x1, y1, z1, ... , x4, y4, z4} Return: Array of 3 elements x,y,z with each stdDev, respectively
Definition at line 46 of file mathFunctions.cpp.
double sumDeviation | ( | const double * | v, |
int | n | ||
) |
There are several spots in the code which used to use standard deviation to know how to sort a list of points. To increase performance, the standard deviation is now calculated without the square root and division by N elements. Arg 1: Pointer to array which we need the sum deviation of Arg 2: Number of elements in array pointed to by arg 1 Return: The sum-deviation of array 'v'
Definition at line 19 of file mathFunctions.cpp.
float truncatedPowerLaw | ( | float | randomNum, |
float | min, | ||
float | max, | ||
float | alpha | ||
) |
Distrubution function for truncated power-law randomNum must be between 0 and 1 This distribution should be sampled uniformly between 0 and 1 to produce a truncated power-law distribution Arg 1: Random variable between 0 and 1 Arg 2: Minimum number which can be returned from the distribution Arg 3: Maximum number which can be returned from the distribution Arg 4: Power-law's alpha Return: Random float adhering to the truncated power law distribution
Definition at line 208 of file generatingPoints.cpp.