The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
OpenFUSIONToolkit.util Namespace Reference

Detailed Description

Helper functions for Open FUSION Toolkit (OFT) Python interfaces.

Authors
Chris Hansen
Date
May 2023

Functions

 read_fortran_namelist (file0, silent=True, b_arr=False)
 run_shell_command (command, timeout=10, env_vars={})
 Run a shell command.
 write_native_mesh (filename, r, lc, reg, nodesets=[], sidesets=[], ho_info=None, periodic_info=None)

Variables

float eC = 1.60217663e-19
 Electron charge.
int mu0 = numpy.pi*4.E-7
 Vacuum magnetic permeability.

Function Documentation

◆ read_fortran_namelist()

read_fortran_namelist ( file0,
silent = True,
b_arr = False )
Return a dictionary with the parameters in the namelist file (file0)
  
  @param file0 File to read from
  @param silent If false, print dictionary entries after reading
  @param b_arr Refers to an array at the bottom of the file, if one exists
  @result Dictionary containing data from file0.

◆ run_shell_command()

run_shell_command ( command,
timeout = 10,
env_vars = {} )

Run a shell command.

Parameters
commandCommand and arguments to run
timeoutTimeout for command to complete [seconds]
env_varsModifications to runtime environment
Returns
result STDOUT, errcode Error code from command

◆ write_native_mesh()

write_native_mesh ( filename,
r,
lc,
reg,
nodesets = [],
sidesets = [],
ho_info = None,
periodic_info = None )
Create a native HDF5 mesh file for OFT from the given mesh information

@param filename Filename for mesh file
@param r Points list [np,3]
@param lc Cell list [nc,3] (1-based)
@param reg Region list [nc]
@param nodesets List of node sets
@param sidesets List of side sets
@param ho_info High-order grid information
@param periodic_info Information for mesh periodicity

Variable Documentation

◆ eC

float eC = 1.60217663e-19

Electron charge.

◆ mu0

int mu0 = numpy.pi*4.E-7

Vacuum magnetic permeability.