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

Go to the source code of this file.

Functions

std::vector< PointdiscretizeLineOfIntersection (double *pt1, double *pt2, double dist)
 
struct Point lineFunction3D (double *v, double *point, double t)
 
double * fisherDistribution (double theta, double phi, double kappa, std::mt19937_64 &generator)
 
double * randomTranslation (std::mt19937_64 &generator, float xMin, float xMax, float yMin, float yMax, float zMin, float zMax)
 
float truncatedPowerLaw (float randomNum, float emin, float emax, float alpha)
 
void generateTheta (float *&thetaArray, float aspectRatio, int nPoints)
 
bool greaterThan (float i, float j)
 

Function Documentation

§ discretizeLineOfIntersection()

std::vector<Point> discretizeLineOfIntersection ( double *  pt1,
double *  pt2,
double  dist 
)

Discretizes intersetion Arg 1: End point 1, array of three doubles {x, y, z} Arg 2: End point 2, array of three doubles {x, y, z} Return: List of 3D points of the discretized nodes, including end points

Definition at line 18 of file generatingPoints.cpp.

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

§ fisherDistribution()

double* fisherDistribution ( double  theta,
double  phi,
double  kappa,
std::mt19937_64 &  generator 
)

Creates and returns an x,y,z array of doubles using fisher distribution.

NOTE: Uses new[] to return an array. NEED TO USE delete[] TO FREE THE MEMORY AFTER USE

Arg 1: theta, the angle the normal vector makes with the z-axis Arg 2: phi, the angle the projection of the normal onto the x-y plane makes with the x-axis Arg 3: kappa, parameter for the fisher distribnShaprutions Arg 4: Random generator, see std c++ <random> library Return: A fisher distribution array {x, y, z}. Used for random generation of polygon normal vectors.

Definition at line 93 of file generatingPoints.cpp.

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

§ generateTheta()

void generateTheta ( float *&  thetaArray,
float  aspectRatio,
int  nPoints 
)

Integrate diff eq for theta as function of arc length using RK2 Used once for each ell family, saves theta array to shape structures Arg 1: OUTPUT, Theta array used for ellipse generation Arg 2: Aspect ratio of ellipse family Arg 3: Number of points being used for ellipse family

Definition at line 224 of file generatingPoints.cpp.

Here is the caller graph for this function:

§ greaterThan()

bool greaterThan ( float  i,
float  j 
)

Used for sort() in generateRadiiLists() Compares two floats.

Arg 1: float i Arg 2: float j Return: True if i > j False otherwise

Definition at line 263 of file generatingPoints.cpp.

Here is the caller graph for this function:

§ lineFunction3D()

struct Point lineFunction3D ( double *  v,
double *  point,
double  t 
)

Returns a point on the line/vector v at point t, 0 <= t <= 1 Arg 1: Array of three doubles {x, y, z}, vector of line segment Arg 2: Array of three doubles {x, y, z}, end point on line Arg 3: t, 0<= t <= 1 Return: Point on line

Definition at line 72 of file generatingPoints.cpp.

Here is the caller graph for this function:

§ randomTranslation()

double* randomTranslation ( std::mt19937_64 &  generator,
float  xMin,
float  xMax,
float  yMin,
float  yMax,
float  zMin,
float  zMax 
)

Uses new[] to pass a vector/array. NEED TO USE delete[] TO FREE THE MEMORY AFTER USE Arg 1: Random generator, see std c++ <random> library Arg 2: minimum x for random x Arg 3: maximum x for random x Arg 4: maximum y for random y Arg 5: minimum y for random y Arg 6: maximum z for random z Arg 7: minimum z for random z Return: Pointer to random ranslation, array of three doubles {x, y, z}

Definition at line 177 of file generatingPoints.cpp.

Here is the caller graph for this function:

§ truncatedPowerLaw()

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.