Skip to content
Snippets Groups Projects
Commit 548d9941 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add script for interpolation test

parent d7eff61a
No related branches found
No related tags found
1 merge request!23WIP: Feature/use cmake
Pipeline #
...@@ -48,6 +48,7 @@ from host_information import host_info ...@@ -48,6 +48,7 @@ from host_information import host_info
from .DNS import DNS from .DNS import DNS
from .PP import PP from .PP import PP
from .TEST import TEST
from .FluidConvert import FluidConvert from .FluidConvert import FluidConvert
from .NavierStokes import NavierStokes from .NavierStokes import NavierStokes
from .NSVorticityEquation import NSVorticityEquation from .NSVorticityEquation import NSVorticityEquation
......
#! /usr/bin/env python
import os
import numpy as np
import h5py
import sys
import bfps
from bfps import TEST
try:
import matplotlib.pyplot as plt
matplotlib_on = True
except ImportError:
matplotlib_on = False
def main():
nparticles = 10
c = TEST()
c.launch(
['test_interpolation',
'-n', '32',
'--np', '4',
'--ntpp', '1',
#'--nparticles', '{0}'.format(nparticles),
'--wd', './'] +
sys.argv[3:])
ifile = h5py.File(
'test_input.h5',
'r')
ofile = h5py.File(
'test_output.h5',
'r')
vort0 = ofile['tracers0/vorticity/0'].value
vel_gradient = ofile['tracers0/velocity_gradient/0'].value
vort1 = vort0.copy()
vort1[:, 0] = vel_gradient[:, 7] - vel_gradient[:, 5]
vort1[:, 1] = vel_gradient[:, 2] - vel_gradient[:, 6]
vort1[:, 2] = vel_gradient[:, 3] - vel_gradient[:, 1]
print(np.abs(vort0-vort1) / np.abs(vort0))
return None
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment