-
Notifications
You must be signed in to change notification settings - Fork 5
Setup Script
ecrouse3 edited this page May 12, 2023
·
7 revisions
A python script is used to create the .nc files needed to run GITR. The following is the template script.
import sys, os
sys.path.insert(0, os.path.abspath('../../../python/'))
import shutil
import solps
import make_geom_<example>
import make_ParticleSource_<example>
nP = int(1e3)
r,z, rW,zW, rCoarse, zCoarse, addedPoints = make_geom_<example>.<example_name>(gitr_geometry_filename='gitrGeometry.cfg', \
solps_geomfile = 'assets/<solps_geomfile>.ogr', \
solps_targfile = 'assets/b2fgmtry', \
solps_rz = 'assets/solps_rz.txt', \
gitr_rz = 'assets/gitr_rz.txt', \
surf_coarse = 'assets/surf_coarse.txt', \
surf_ind = 'assets/surf_ind.txt', \
numAddedPoints = 100, \
surface_Z = 74)
os.remove('gitrGeometry.cfg0')
shutil.move('gitrGeometry.cfg', '../input/gitrGeometry.cfg')
readingEq.readEquilibrium(filename = 'assets/<B_feild>.eq', \
solps_geom = 'assets/b2fgmtry', \
solps_mesh_extra = None, \
plot_variables = 0, \
r_wall = r, z_wall = z)
shutil.move('bField.nc', '../input/bField.nc')
shutil.move('profiles.nc', '../input/profiles.nc')
make_ParticleSource_<example>.point_source(nP)
make_ParticleSource_<example>.simple2D(nP, \
geom = '../input/gitrGeometry.cfg', \
targFile = 'assets/rightTargOutput', \
wallFile = 'assets/gitr_rz.txt', \
coordsFile = 'right_target_coordinates.txt', \
surf_coarse = 'assets/surf_coarse.txt', \
surf_ind = 'assets/surf_ind.txt', \
profilesFile = '../input/profiles.nc', \
ftDFile = 'assets/ftridynBackgroundD.nc', \
ftCFile = 'assets/ftridynBackgroundC.nc', \
configuration = 'random', \
plot_variables = 1, \
r_W=rW, z_W=zW, rCoarse=rCoarse, zCoarse=zCoarse, addedPoints=addedPoints)
shutil.move('particleSource.nc', '../input/particleSource.nc')
Anything unclear or inaccurate? Please let us know by creating an Issue in the GitHub Issues tab.