I used the PyFR program on a Linux terminal, and the related file “Myconfig.ini,” “Mytest.mesh,” and “Mytest.pyfrm.” I’m going to try using the Python program to process the PyFR case with Runtest.py. However, I got an error message. I checked the PyFR code ,but the BaseSystem class was initialized without arguments for “rallocs”. Because I am first try. Could you please give me a simple example that uses Python code or a framework?
base_system=BaseSystem(backend,mesh=mesh_pyfrm,initsoln=None,nregs=1,cfg=config)
TypeError: BaseSystem.init() missing 1 required positional argument: 'rallocs'
Runtest.py
import os
from pyfr.solvers.navstokes.system import NavierStokesSystem
from pyfr.integrators.std.steppers import StdRK4Stepper
from pyfr.inifile import Inifile
from pyfr.readers.native import NativeReader
from pyfr.backends.base.backend import BaseBackend
from pyfr.backends import get_backend
from pyfr.solvers.base import BaseSystem
mesh_name='Mytest.mesh'
pyfrm_name='Mytest.pyfrm'
config_name='Myconfig.ini'
#get file pathe
script_dir = os.path.dirname(os.path.abspath(__file__))
mesh_path = os.path.join(script_dir, mesh_name)
mesh_pyfrm = os.path.join(script_dir, pyfrm_name)
config_path = os.path.join(script_dir, config_name)
output_dir = os.path.join(script_dir, 'results')
config = Inifile.load(config_path)
backend = get_backend('openmp',config)
mesh = NativeReader(mesh_pyfrm)
base_system=BaseSystem(backend,mesh=mesh_pyfrm,initsoln=None,nregs=1,cfg=config)
system = NavierStokesSystem()
integrator = system.get_integrator(tmax=config.getfloat('time-integration', 'tmax'))
integrator.run()
Myconfig.ini
[backend]
precision = double
[constants]
Pc = 1.0
gamma = 1.4
mu = 3.94405318873308E-6
Pr = 0.71
[solver]
system = navier-stokes
order = 2
[solver-time-integrator]
formulation = std
scheme = rk45
controller = none
tstart = 0.0
tend = 2.0
dt = 0.0005
[solver-interfaces]
riemann-solver = hllc
ldg-beta = 0.5
ldg-tau = 0.1
[solver-interfaces-quad]
flux-pts = gauss-legendre
[solver-elements-hex]
soln-pts = gauss-legendre
[soln-plugin-nancheck]
nsteps = 10
[soln-plugin-writer]
dt-out = 1.0
basedir = .
basename = Ode-{t:.1f}
[soln-plugin-residual]
nsteps = 1
file = residual.csv
header = true
[soln-bcs-wall]
type = slp-adia-wall
[soln-bcs-inlet]
type = sup-in-fa
rho =1.0
u = 0.0
v = 0.0
w = 2.0
p = Pc
[soln-bcs-outlet]
type = sup-in-fa
rho =1.0
u = 0.0
v = 0.0
w = 1.0
p = Pc
[soln-ics]
rho =1.0
u = 0.0
v = 0.0
w = 1.0
p = Pc