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

Detailed Description

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

Authors
Chris Hansen
Date
May 2023

Functions

 build_XDMF (path='.', repeat_static=False, pretty=False)
 Build XDMF plot metadata files.
 
 ctypes_numpy_array (type, ndim)
 Create a ctypes argument object for a given numpy array type and dimension.
 
 ctypes_subroutine (function, argtypes=None, restype=None)
 Create a ctypes object for a FORTRAN subroutine (no return value)
 
 write_native_mesh (filename, r, lc, reg, nodesets=[], sidesets=[], ho_info=None, periodic_info=None)
 

Variables

 c_bool_ptr = ctypes.POINTER(c_bool)
 ctypes logical (bool) pointer alias
 
 c_bool_ptr_ptr = ctypes.POINTER(c_bool_ptr)
 ctypes logical (bool) double pointer alias
 
 c_double_ptr = ctypes.POINTER(c_double)
 ctypes 64-bit floating point (double) pointer type
 
 c_double_ptr_ptr = ctypes.POINTER(c_double_ptr)
 ctypes 64-bit floating point (double) double pointer
 
 c_int_ptr = ctypes.POINTER(c_int)
 ctypes 32-bit integer (int) pointer alias
 
 c_int_ptr_ptr = ctypes.POINTER(c_int_ptr)
 ctypes 32-bit integer (int) double pointer alias
 
 c_struct = ctypes.Structure
 ctypes struct alias
 
 c_void_ptr_ptr = ctypes.POINTER(c_void_p)
 ctypes void double pointer
 
float eC = 1.60217663e-19
 Electron charge.
 
int mu0 = numpy.pi*4.E-7
 Vacuum magnetic permeability.
 

Function Documentation

◆ build_XDMF()

build_XDMF (   path = '.',
  repeat_static = False,
  pretty = False 
)

Build XDMF plot metadata files.

Parameters
pathFolder to build XDMF files in (must include "dump.dat" file)
repeat_staticRepeat static fields (0-th timestep) in all timesteps?
prettyUse pretty printing (indentation) in XDMF files?

◆ ctypes_numpy_array()

ctypes_numpy_array (   type,
  ndim 
)

Create a ctypes argument object for a given numpy array type and dimension.

Parameters
typeNumPy c-compatible datatype (https://numpy.org/doc/stable/user/basics.types.html)
ndimNumber of dimensions in array

◆ ctypes_subroutine()

ctypes_subroutine (   function,
  argtypes = None,
  restype = None 
)

Create a ctypes object for a FORTRAN subroutine (no return value)

Parameters
functionFunction object from ctypes library
argtypesList of types for each argument (optional)

◆ 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

◆ c_bool_ptr

c_bool_ptr = ctypes.POINTER(c_bool)

ctypes logical (bool) pointer alias

◆ c_bool_ptr_ptr

c_bool_ptr_ptr = ctypes.POINTER(c_bool_ptr)

ctypes logical (bool) double pointer alias

◆ c_double_ptr

c_double_ptr = ctypes.POINTER(c_double)

ctypes 64-bit floating point (double) pointer type

◆ c_double_ptr_ptr

c_double_ptr_ptr = ctypes.POINTER(c_double_ptr)

ctypes 64-bit floating point (double) double pointer

◆ c_int_ptr

c_int_ptr = ctypes.POINTER(c_int)

ctypes 32-bit integer (int) pointer alias

◆ c_int_ptr_ptr

c_int_ptr_ptr = ctypes.POINTER(c_int_ptr)

ctypes 32-bit integer (int) double pointer alias

◆ c_struct

c_struct = ctypes.Structure

ctypes struct alias

◆ c_void_ptr_ptr

c_void_ptr_ptr = ctypes.POINTER(c_void_p)

ctypes void double pointer

◆ eC

float eC = 1.60217663e-19

Electron charge.

◆ mu0

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

Vacuum magnetic permeability.