basic test for generation stage
parent
40f5c5ba74
commit
4c3cfa0b5c
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,48 @@
|
|||||||
|
from FFTMA import gen
|
||||||
|
import numpy as np
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
def generate(N):
|
||||||
|
nx, ny, nz = N,N,N
|
||||||
|
dx, dy, dz = 1.0, 1.0, 1.0
|
||||||
|
seed= 1548762 #rdi(10000,99999)
|
||||||
|
var=1
|
||||||
|
vario=2
|
||||||
|
alpha=1
|
||||||
|
lcx=2
|
||||||
|
lcy=4
|
||||||
|
lcz=16
|
||||||
|
ap1x=1
|
||||||
|
ap1y=0
|
||||||
|
ap1z=0
|
||||||
|
ap2x=0
|
||||||
|
ap2y=1
|
||||||
|
ap2z=0
|
||||||
|
|
||||||
|
v1 = (var, vario, alpha, lcx, lcy, lcz, ap1x, ap1y, ap1z, ap2x, ap2y, ap2z)
|
||||||
|
variograms = [v1]
|
||||||
|
|
||||||
|
mean=15.3245987
|
||||||
|
variance=3.5682389
|
||||||
|
typ=3
|
||||||
|
|
||||||
|
return gen(nx, ny, nz, dx, dy, dz, seed, variograms, mean, variance, typ, 8)
|
||||||
|
|
||||||
|
|
||||||
|
def test(N):
|
||||||
|
k = generate(N)
|
||||||
|
k_correct = np.load(f"out_{N}.npy")
|
||||||
|
comparison = k == k_correct
|
||||||
|
return comparison.all()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class TestGeneration(unittest.TestCase):
|
||||||
|
def test_8(self):
|
||||||
|
self.assertTrue(test(8))
|
||||||
|
|
||||||
|
def test_16(self):
|
||||||
|
self.assertTrue(test(16))
|
||||||
|
|
||||||
|
def test_32(self):
|
||||||
|
self.assertTrue(test(32))
|
Loading…
Reference in New Issue