485 void getInput(
char* input, std::vector<Shape> &shapeFamily){
487 std::string tempstring;
490 std::ifstream inputFile;
491 std::cout<<
"DFN Generator Input File: "<< input <<
"\n\n";
495 inputFile.open(input, std::ifstream::in);
501 searchVar(inputFile,
"printRejectReasons:");
511 if (numOfLayers > 0 ) {
512 layers =
new float[numOfLayers*2];
516 std::cout <<
"Number of Layers: " << numOfLayers <<
"\n";
519 inputFile >> ch >>
layers[idx] >> ch >>
layers[idx+1] >> ch;
520 std::cout<<
" Layer "<<i+1<<
"{-z,+z}: {"<<
layers[idx] <<
","<<
layers[idx+1] <<
"}, Volume: ";
521 layerVol[i] = domainSize[0]*domainSize[1]* (std::abs(layers[idx+1]-layers[idx]));
522 std::cout <<
layerVol[i] <<
"m^3\n";
533 if (disableFram ==
true) {
534 std::cout<<
"\nFRAM IS DISABLED\n";
537 searchVar(inputFile,
"tripleIntersections:");
540 searchVar(inputFile,
"forceLargeFractures:");
543 searchVar(inputFile,
"visualizationMode:");
546 if (disableFram ==
true){
547 visualizationMode = 1;
553 searchVar(inputFile,
"outputFinalRadiiPerFamily:");
556 searchVar(inputFile,
"outputAcceptedRadiiPerFamily:");
562 searchVar(inputFile,
"domainSizeIncrease:");
565 searchVar(inputFile,
"keepOnlyLargestCluster:");
568 searchVar(inputFile,
"ignoreBoundaryFaces:");
574 searchVar(inputFile,
"rejectsPerFracture:");
583 searchVar(inputFile,
"removeFracturesLessThan:");
586 if (nFamEll > 0 || nFamRect >0) {
595 searchVar(inputFile,
"radiiListIncrease:");
603 searchVar(inputFile,
"ebetaDistribution:");
687 if (stopCondition == 1) {
705 for (
int i = 0; i <
nFamEll; i++){
706 struct Shape newShapeFam;
734 newShapeFam.
sd =
esd[shape1];
740 newShapeFam.
min =
emin[shape2];
741 newShapeFam.
max =
emax[shape2];
759 if (stopCondition == 1){
764 shapeFamily.push_back(newShapeFam);
791 if (stopCondition == 1){
799 searchVar(inputFile,
"rbetaDistribution:");
878 if (stopCondition == 1) {
889 if (nFamRect > 0 || nFamEll > 0) {
891 if (stopCondition == 0){
895 else if (stopCondition == 1) {
898 for (
int i = 0; i < (nFamRect +
nFamEll); i++){
916 for (
int i = 0; i <
nFamRect; i++) {
918 struct Shape newShapeFam;
944 newShapeFam.
sd =
rsd[shape1];
950 newShapeFam.
min =
rmin[shape2];
951 newShapeFam.
max =
rmax[shape2];
968 if (stopCondition == 1){
974 shapeFamily.push_back(newShapeFam);
1000 if (stopCondition == 1) {
1006 searchVar(inputFile,
"userEllipsesOnOff:");
1009 if (userEllipsesOnOff != 0) {
1011 searchVar(inputFile,
"UserEll_Input_File_Path:");
1012 inputFile >> tempstring;
1013 std::ifstream uEllFile;
1014 uEllFile.open(tempstring.c_str(),std::ifstream::in);
1016 std::cout <<
"User Defined Ellipses File: " << tempstring << std::endl;
1044 searchVar(uEllFile,
"Number_of_Vertices:");
1052 searchVar(inputFile,
"userRectanglesOnOff:");
1056 if (userRectanglesOnOff != 0) {
1058 searchVar(inputFile,
"UserRect_Input_File_Path:");
1060 inputFile >> tempstring;
1061 std::ifstream uRectFile;
1062 uRectFile.open(tempstring.c_str(),std::ifstream::in);
1064 std::cout <<
"User Defined Rectangles File: " << tempstring << std::endl;
1101 searchVar(inputFile,
"userEllByCoord:");
1104 searchVar(inputFile,
"userRecByCoord:");
1109 if ((userRectanglesOnOff == 1 || userRecByCoord == 1) && (userEllipsesOnOff == 1 || userEllByCoord == 1)) {
1110 searchVar(inputFile,
"insertUserRectanglesFirst:");
1119 if (userEllByCoord != 0) {
1120 searchVar(inputFile,
"EllByCoord_Input_File_Path:");
1121 inputFile >> tempstring;
1123 file.open(tempstring.c_str(),std::ifstream::in);
1125 std::cout <<
"User Defined Ellipses by Coordinates File: " << tempstring << std::endl;
1142 if (userRecByCoord != 0) {
1143 searchVar(inputFile,
"RectByCood_Input_File_Path:");
1144 inputFile >> tempstring;
1145 std::ifstream uCoordFile;
1146 uCoordFile.open(tempstring.c_str(),std::ifstream::in);
1148 std::cout <<
"User Defined Rectangles by Coordinates File: " << tempstring << std::endl;
1164 if (aperture == 1) {
1173 else if (aperture == 2) {
1174 searchVar(inputFile,
"apertureFromTransmissivity:");
1177 else if (aperture == 3) {
1178 searchVar(inputFile,
"constantAperture:");
1181 else if (aperture == 4) {
1182 searchVar(inputFile,
"lengthCorrelatedAperture:");
1186 std::cerr<<
"\nERROR: Aperture option not recognised\n";
1192 if (permOption != 0) {
1193 searchVar(inputFile,
"constantPermeability:");
1198 if (nFamEll + nFamRect == 0 && stopCondition != 0) {
1199 std::cout<<
"\nWARNING: You have defined stopCondition = 1 (P32 program stopping condition) but have no stochastic shape families defined. Automatically setting stopCondition to 0 for use with user defined polygons and nPoly.\n\n";
1202 if (userEllipsesOnOff == 0 && userRectanglesOnOff == 0 && userRecByCoord == 0 ) {
1203 std::cout <<
"ERROR: All polygon generating options are off or undefined, please check input file for errors.\n\n";
1208 if (userEllipsesOnOff == 1){
1212 if (userRectanglesOnOff == 1){
1216 if (userRecByCoord == 1) {
1228 for (
unsigned int i = 0; i < shapeFamily.size(); i ++) {
1230 double temp = M_PI/180;
1231 shapeFamily[i].beta *= temp;
1232 shapeFamily[i].theta *= temp;
1233 shapeFamily[i].phi *= temp;
1234 shapeFamily[i].angleOption = 0;
1246 std::cout <<
"npoly = " <<
nPoly << std::endl;
1249 std::cout <<
"h = " <<
h << std::endl;
1251 std::cout <<
"seed = " <<
seed << std::endl;
1255 std::cout<<
"nFamRect = " <<
nFamRect<<std::endl;
1256 std::cout <<
"nFamEll = " <<
nFamEll << std::endl;
1260 std::cout <<
"eAngleOption = " <<
eAngleOption << std::endl;
1275 std::cout <<
"rAngleOption = " <<
rAngleOption << std::endl;
1290 std::cout<<
"nUserEll = " <<
nUserEll <<
"\n";
1292 std::cout <<
"urAngleOption = " <<
ueAngleOption <<std::endl;
1304 std::cout<<
"nUserRect = "<<
nUserRect <<
"\n";
1306 std::cout<<
"urAngleOption = " <<
urAngleOption << std::endl;
1316 std::cout <<
"nRectByCoord = " <<
nRectByCoord << std::endl;
1320 std::cout <<
"aperture option: " <<
aperture << std::endl;
1322 std::cout <<
"meanAperture = " <<
meanAperture << std::endl;
1323 std::cout <<
"stdAperture = " <<
stdAperture << std::endl;
1338 std::cout <<
"Permeability: Function of aperture\n";
void generateTheta(float *&thetaArray, float aspectRatio, int nPoints)