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

Go to the source code of this file.

Functions

void searchVar (std::ifstream &stream, std::string search)
 
void checkIfOpen (std::ifstream &stream, std::string fileName)
 
void checkIfOpen (std::ofstream &stream, std::string fileName)
 
void getCords (std::ifstream &stream, double *outAry, int nPoly, int nVertices)
 
template<typename T >
void get2dAry (std::ifstream &stream, T *var, int rowSize)
 
template<typename T >
void getInputAry (std::ifstream &stream, T *var, int nElements)
 
template<typename T >
void printAry (T *var, std::string varName, int nElements)
 
template<typename T >
void print2dAry (T *var, std::string varName, int rowSize)
 
template<typename T >
void getElements (std::ifstream &stream, T *var, int nElements)
 
void getRectCoords (std::ifstream &stream, double *var, int nRectangles)
 
void printRectCoords (double *var, std::string varName, int nRectangles)
 
void printInputVars ()
 
void getInput (char *inputFile, std::vector< Shape > &shapeFamily)
 
unsigned int getTimeBasedSeed ()
 

Function Documentation

§ checkIfOpen() [1/2]

void checkIfOpen ( std::ifstream &  stream,
std::string  fileName 
)

Checks file for being opened correectly with error msg Arg 1: ifstream file object Arg 2: Filename. Used for error print if there is an error

Definition at line 35 of file readInputFunctions.cpp.

Here is the caller graph for this function:

§ checkIfOpen() [2/2]

void checkIfOpen ( std::ofstream &  stream,
std::string  fileName 
)

Definition at line 42 of file readInputFunctions.cpp.

§ get2dAry()

template<typename T >
void get2dAry ( std::ifstream &  stream,
T *  var,
int  rowSize 
)

Gets multiple arrays from input/ Assumes arrays are format: {x,y,z} Reads a 2D array in a 1D format. Arg 1: ifstream object Arg 2: OUTPUT, array to place read values into Arg 3: Number of rows of array we are reading

Definition at line 26 of file readInputFunctions.h.

Here is the caller graph for this function:

§ getCords()

void getCords ( std::ifstream &  stream,
double *  outAry,
int  nPoly,
int  nVertices 
)

Used to read in ellipse coordinates when the user is using user ellipses defined by coordinates option. Arg 1: ifstream file object Arg 2: OUTPUT. Pointer to array to store the coordinates Arg 3: Number of ellipses Arg 4: Number of points per ellipse

Definition at line 77 of file readInputFunctions.cpp.

Here is the caller graph for this function:

§ getElements()

template<typename T >
void getElements ( std::ifstream &  stream,
T *  var,
int  nElements 
)

Read list of elements from file seperated by spaces Arg 1: ifstream object Arg 2: OUTPUT, Pointer to arary to store elements read Arg 3: Number of elements to read

Definition at line 91 of file readInputFunctions.h.

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

§ getInput()

void getInput ( char *  input,
std::vector< Shape > &  shapeFamily 
)

Reads in all input variables. Creates Shape structure array from user input if using stochastic fracture families.

Arg 1: Path to input file Arg 2: OUTPUT, Shape array to store stochastic families

Definition at line 485 of file readInput.cpp.

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

§ getInputAry()

template<typename T >
void getInputAry ( std::ifstream &  stream,
T *  var,
int  nElements 
)

Used to read in 1d arrays from input file with n Elements Arg 1: ifstream object Arg 2: OUTPUT, array to place read values into Arg 3: Number of elements to read

Definition at line 42 of file readInputFunctions.h.

Here is the caller graph for this function:

§ getRectCoords()

void getRectCoords ( std::ifstream &  stream,
double *  var,
int  nRectangles 
)

Used to read in rectangualr coordinates when the user is using user rectangles defined by coordinates option. Arg 1: ifstream file object Arg 2: OUTPUT. Pointer to array to store the coordinates Arg 3: Number of rectangles

Definition at line 56 of file readInputFunctions.cpp.

Here is the caller graph for this function:

§ getTimeBasedSeed()

unsigned int getTimeBasedSeed ( )

Gets time based seed Return: Seed based on the system clock

Definition at line 112 of file readInputFunctions.cpp.

Here is the caller graph for this function:

§ print2dAry()

template<typename T >
void print2dAry ( T *  var,
std::string  varName,
int  rowSize 
)

Prints 1-d array in 2-d array form. Assumes 3 col per row Arg 1: Pointer to array Arg 2: Variable name ARg 3: Number of row

Definition at line 75 of file readInputFunctions.h.

Here is the caller graph for this function:

§ printAry()

template<typename T >
void printAry ( T *  var,
std::string  varName,
int  nElements 
)

Prints array of size 'nElements' Arg 1: Pointer to array Arg 2: Variable name ARg 3: Number of elements

Definition at line 57 of file readInputFunctions.h.

Here is the caller graph for this function:

§ printInputVars()

void printInputVars ( )

Definition at line 1245 of file readInput.cpp.

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

§ printRectCoords()

void printRectCoords ( double *  var,
std::string  varName,
int  nRectangles 
)

Prints rectangular coordinates. Useful for debugging. Arg 1: Array that stored all rectangular coordinates. Arg 2: Variable name Arg 3: Number of rectangles

Definition at line 95 of file readInputFunctions.cpp.

Here is the caller graph for this function:

§ searchVar()

void searchVar ( std::ifstream &  stream,
std::string  search 
)

Searches for variable in files, moves file pointer to position after word. Used to read in varlable values Arg 1: ifstream file object Arg 2: Word to search for

Definition at line 14 of file readInputFunctions.cpp.

Here is the caller graph for this function: