diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-02-10 12:19:46 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2017-02-10 12:19:46 -0500 |
commit | 0ef0c0ce1d904be2b4e1f4da62dc029d8572c983 (patch) | |
tree | 12978013d870186240c08d1fdd6a7ce8781bca93 /src/spheres_poly/spheres.cpp | |
parent | 9a93a3b88a604672f557950e6c7f3fe815bcf163 (diff) | |
parent | 901b9f16494f37890be17ef4bb66e6efc6873340 (diff) | |
download | fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.tar.gz fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.tar.bz2 fuse_networks-0ef0c0ce1d904be2b4e1f4da62dc029d8572c983.zip |
Merge branch 'tmp'
Diffstat (limited to 'src/spheres_poly/spheres.cpp')
-rw-r--r-- | src/spheres_poly/spheres.cpp | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/spheres_poly/spheres.cpp b/src/spheres_poly/spheres.cpp deleted file mode 100644 index 9b14b01..0000000 --- a/src/spheres_poly/spheres.cpp +++ /dev/null @@ -1,64 +0,0 @@ -//=========================================================== -//=========================================================== -//=========================================================== -// -// Molecular dynamics simulation of hardspheres -// -//=========================================================== -//=========================================================== -//=========================================================== - -#include <iostream> -#include <math.h> -#include <fstream> -#include <vector> -#include <time.h> -#include <string.h> -#include <stdlib.h> -#include <cstdlib> - -#include "box.h" -#include "sphere.h" -#include "event.h" -#include "heap.h" - - -double *spherespp(int N, double bidispersityratio, double bidispersityfraction, double maxpf, double maxpressure, double maxcollisionrate) -{ - int eventspercycle = 20; // # events per sphere per cycle - double initialpf = 0.01; // initial packing fraction - double temp = 0.2; // initial temp., use 0 for zero velocities - double growthrate = 0.001; // growth rate - double massratio = 1.; // ratio of sphere masses - int hardwallBC = 0; // 0 for periodic, 1 for hard wall BC - - double d, r; // initial diameter and radius of spheres - - r = pow(initialpf*pow(SIZE, DIM)/(N*VOLUMESPHERE), 1.0/((double)(DIM))); - - box b(N, r, growthrate, maxpf, bidispersityratio, - bidispersityfraction, massratio, hardwallBC); - - b.CreateSpheres(temp); - - - while ((b.collisionrate < maxcollisionrate) && (b.pf < maxpf) && (b.pressure < maxpressure)) - { - b.Process(eventspercycle*N); - b.Synchronize(true); - } - - double *data = (double *)malloc(DIM * N * sizeof(double)); - - b.WriteConfiguration(data); - - return data; -} - -extern "C" { - double *spheres(int N, double bidispersityratio, double bidispersityfraction, double maxpf, double maxpressure, double maxcollisionrate) { - return spherespp(N, bidispersityratio, bidispersityfraction, maxpf, maxpressure, maxcollisionrate); - } -} - - |