Skip to content

Commit

Permalink
Minor changes to the primal test.
Browse files Browse the repository at this point in the history
  • Loading branch information
friedenhe committed Feb 2, 2025
1 parent 67b966f commit 02e0238
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions tests/runUnitTests_primal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from mpi4py import MPI
from dafoam import PYDAFOAM
import os
import numpy as np

gcomm = MPI.COMM_WORLD

Expand All @@ -28,10 +27,10 @@
norm = np.linalg.norm(states)
norm = gcomm.allreduce(norm, op=MPI.SUM)
if ((3787018.3272404578 - norm) / norm) > 1e-10:
print("SSTLM test failed!")
print("ke test failed!")
exit(1)
else:
print("SSTLM test passed!")
print("ke test passed!")

if gcomm.rank == 0:
os.system("rm -rf processor* *.bin")
Expand All @@ -45,27 +44,10 @@
norm = np.linalg.norm(states)
norm = gcomm.allreduce(norm, op=MPI.SUM)
if ((3787032.628925756 - norm) / norm) > 1e-10:
print("SSTLM test failed!")
print("kw test failed!")
exit(1)
else:
print("SSTLM test passed!")

if gcomm.rank == 0:
os.system("rm -rf processor* *.bin")
os.system("cp -r 0.compressible/* 0/")
os.system("cp -r system.subsonic/* system/")
os.system("cp -r constant/turbulenceProperties.safv3 constant/turbulenceProperties")

DASolver = PYDAFOAM(options=daOptions, comm=gcomm)
DASolver()
states = DASolver.getStates()
norm = np.linalg.norm(states)
norm = gcomm.allreduce(norm, op=MPI.SUM)
if ((3786983.4415608784 - norm) / norm) > 1e-10:
print("SSTLM test failed!")
exit(1)
else:
print("SSTLM test passed!")
print("kw test passed!")

if gcomm.rank == 0:
os.system("rm -rf processor* *.bin")
Expand Down

0 comments on commit 02e0238

Please sign in to comment.