| 1 |
///////////////////////////////////////////////////////////// |
| 2 |
// // |
| 3 |
// Copyright (c) 2007-2017 by The University of Queensland // |
| 4 |
// Centre for Geoscience Computing // |
| 5 |
// http://earth.uq.edu.au/centre-geoscience-computing // |
| 6 |
// // |
| 7 |
// Primary Business: Brisbane, Queensland, Australia // |
| 8 |
// Licensed under the Open Software License version 3.0 // |
| 9 |
// http://www.apache.org/licenses/LICENSE-2.0 // |
| 10 |
// // |
| 11 |
///////////////////////////////////////////////////////////// |
| 12 |
|
| 13 |
#include "geometry/Sphere.h" |
| 14 |
#include "util/vector3.h" |
| 15 |
#include "CircMNTable3D.h" |
| 16 |
#include "InsertGenerator3D.h" |
| 17 |
#include "granular_gouge.h" |
| 18 |
|
| 19 |
// --- IO includes --- |
| 20 |
#include <iostream> |
| 21 |
|
| 22 |
using std::cout; |
| 23 |
using std::cout; |
| 24 |
using std::endl; |
| 25 |
|
| 26 |
// -- System includes -- |
| 27 |
#include <cstdlib> |
| 28 |
#include <sys/time.h> |
| 29 |
using std::atoi; |
| 30 |
using std::atof; |
| 31 |
|
| 32 |
|
| 33 |
int main(int argc, char** argv) |
| 34 |
{ |
| 35 |
int ret=0; |
| 36 |
|
| 37 |
double xsize=atof(argv[1]); |
| 38 |
double ysize=atof(argv[2]); |
| 39 |
double ysize_bdry=atof(argv[3]); |
| 40 |
double zsize=atof(argv[4]); |
| 41 |
int nrid=atoi(argv[5]); |
| 42 |
double rid=atoi(argv[6]); |
| 43 |
int ntry=atoi(argv[7]); |
| 44 |
double rmin=atof(argv[8]); |
| 45 |
double grmin=atof(argv[9]); |
| 46 |
double grmax=atof(argv[10]); |
| 47 |
int outputstyle=atoi(argv[11]); |
| 48 |
|
| 49 |
|
| 50 |
// seed RNG |
| 51 |
struct timeval tv; |
| 52 |
gettimeofday(&tv,NULL); |
| 53 |
int random_seed=tv.tv_usec; |
| 54 |
srand(random_seed); |
| 55 |
|
| 56 |
Vector3 min=Vector3(0.0,0.0,0.0); |
| 57 |
Vector3 max=Vector3(xsize,ysize,zsize); |
| 58 |
Vector3 gmin=Vector3(0.0,ysize_bdry,0.0); |
| 59 |
Vector3 gmax=Vector3(xsize,ysize-ysize_bdry,zsize); |
| 60 |
|
| 61 |
CircMNTable3D T(min,max,2.5,3); |
| 62 |
CircMNTable3D::SetOutputStyle(outputstyle); |
| 63 |
InsertGenerator3D G(rmin,1.0,ntry,1000,1e-6); |
| 64 |
|
| 65 |
generate_upper_tri_rough_block(&T,&G,xsize,ysize_bdry,zsize,ysize-ysize_bdry,nrid,rid); |
| 66 |
generate_lower_tri_rough_block(&T,&G,xsize,ysize_bdry,zsize,0.0,nrid,rid); |
| 67 |
generate_granular_gouge(&T,&G,gmin,gmax,grmin,grmax,ntry); |
| 68 |
T.generateBonds(0,1e-5,0); |
| 69 |
|
| 70 |
cout << T << endl; |
| 71 |
|
| 72 |
return ret; |
| 73 |
} |