The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
Loading...
Searching...
No Matches
oft_base_f Module Reference

Detailed Description

Fortran part of Python wrappers for OFT.

Authors
Chris Hansen
Date
May 2023

Functions/Subroutines

subroutine copy_string (f_string, c_string)
 Needs docs.
subroutine copy_string_rev (c_string, f_string)
 Needs docs.
subroutine oft_apply_field_eval (fe_ptr, int_obj, int_type, pt_ptr, npts, fbary_tol, dim, field_ptr)
 Evaluate a general FE field with an interpolation object created by oft_get_field_eval.
subroutine oft_get_field_eval (fe_ptr, vals, imode, int_obj, error_str)
 Create an interpolation object for general FE fields (only 2D Lagrange for now).
subroutine oft_setup_smesh (ndim, np, r_loc, npc, nc, lc_loc, reg_loc, nregs, mesh_ptr)
 Setup surface mesh from specified coordinate, connectivity, and region arrays.
subroutine oft_setup_vmesh (np, r_loc, npc, nc, lc_loc, reg_loc, nregs, mesh_ptr)
 Setup volume mesh from specified coordinate, connectivity, and region arrays.
subroutine oft_smesh_get (mesh_ptr, ndim, np, r_loc, npc, nc, lc_loc, reg_loc, nreg, error_str)
 Return references to arrays defining an existing surface mesh.
subroutine oft_vmesh_get (mesh_ptr, np, r_loc, npc, nc, lc_loc, reg_loc, nreg, error_str)
 Return references to arrays defining an existing volume mesh.
subroutine oftpy_init (nthreads, quiet, input_file, slens, abort_fun)
 Needs docs.
subroutine oftpy_load_xml (xml_file, oft_node_ptr)
 Needs docs.
subroutine oftpy_set_debug (debug_level)
 Set debug verbosity level.
subroutine oftpy_set_nthreads (nthreads)
 Set the number of OpenMP threads to use.

Function/Subroutine Documentation

◆ copy_string()

subroutine copy_string ( character(len=*), intent(in) f_string,
character(kind=c_char), dimension(*), intent(out) c_string )

Needs docs.

Parameters
[in]f_stringNeeds docs
[out]c_stringNeeds docs

◆ copy_string_rev()

subroutine copy_string_rev ( character(kind=c_char), dimension(*), intent(in) c_string,
character(len=*), intent(inout) f_string )

Needs docs.

Parameters
[in]c_stringNeeds docs
[in,out]f_stringNeeds docs

◆ oft_apply_field_eval()

subroutine oft_apply_field_eval ( type(c_ptr), intent(in), value fe_ptr,
type(c_ptr), intent(in), value int_obj,
integer(c_int), intent(in), value int_type,
type(c_ptr), intent(in), value pt_ptr,
integer(c_int), intent(in), value npts,
real(c_double), intent(in), value fbary_tol,
integer(c_int), intent(in), value dim,
type(c_ptr), intent(in), value field_ptr )

Evaluate a general FE field with an interpolation object created by oft_get_field_eval.

Parameters
[in]fe_ptrPointer to FE object
[in]int_objPointer to interpolation object
[in]int_typeField type (negative to destroy)
[in]pt_ptrLocation for evaluation [X,Y,Z] (3D) or [X,Y,0] (2D)
[in]nptsNumber of points to evaluate
[in]fbary_tolTolerance for physical to logical mapping
[in]dimDimension of field
[in]field_ptrField at locations specified by pt_ptr

◆ oft_get_field_eval()

subroutine oft_get_field_eval ( type(c_ptr), intent(in), value fe_ptr,
type(c_ptr), intent(in), value vals,
integer(kind=c_int), intent(in), value imode,
type(c_ptr), intent(out) int_obj,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Create an interpolation object for general FE fields (only 2D Lagrange for now).

Parameters
[in]fe_ptrPointer to FE object
[in]valsNeeds docs
[in]imodeField type
[out]int_objPointer to interpolation object
[out]error_strError string (empty if no error)

◆ oft_setup_smesh()

subroutine oft_setup_smesh ( integer(c_int), intent(in), value ndim,
integer(c_int), intent(in), value np,
type(c_ptr), intent(in), value r_loc,
integer(c_int), intent(in), value npc,
integer(c_int), intent(in), value nc,
type(c_ptr), intent(in), value lc_loc,
type(c_ptr), intent(in), value reg_loc,
integer(c_int), intent(out) nregs,
type(c_ptr), intent(out) mesh_ptr )

Setup surface mesh from specified coordinate, connectivity, and region arrays.

Parameters
[in]r_locPointer to point locations array (3,np)
[in]lc_locPointer to cell connectivity array (npc,nc)
[in]reg_locPointer to cell region array (nc)
[in]npNumber of points in surface mesh
[in]ndimSpatial dimension of the mesh coordinates (Note: r array is always (3,np))
[in]npcNumber of points per cell (3 for triangles, 4 for quads)
[in]ncNumber of cells in surface mesh
[out]nregsNumber of regions in surface mesh
[out]mesh_ptrPointer to multigrid_mesh object containing the constructed surface mesh

◆ oft_setup_vmesh()

subroutine oft_setup_vmesh ( integer(c_int), intent(in), value np,
type(c_ptr), intent(in), value r_loc,
integer(c_int), intent(in), value npc,
integer(c_int), intent(in), value nc,
type(c_ptr), intent(in), value lc_loc,
type(c_ptr), intent(in), value reg_loc,
integer(c_int), intent(out) nregs,
type(c_ptr), intent(out) mesh_ptr )

Setup volume mesh from specified coordinate, connectivity, and region arrays.

Parameters
[in]r_locPointer to point locations array (3,np)
[in]lc_locPointer to cell connectivity array (npc,nc)
[in]reg_locPointer to cell region array (nc)
[in]npNumber of points in volume mesh
[in]npcNumber of points per cell (4 for tetrahedra, 8 for hexahedra)
[in]ncNumber of cells in volume mesh
[out]nregsNumber of regions in volume mesh
[out]mesh_ptrPointer to multigrid_mesh object containing the constructed volume mesh

◆ oft_smesh_get()

subroutine oft_smesh_get ( type(c_ptr), intent(in), value mesh_ptr,
integer(c_int), intent(out) ndim,
integer(c_int), intent(out) np,
type(c_ptr), intent(out) r_loc,
integer(c_int), intent(out) npc,
integer(c_int), intent(out) nc,
type(c_ptr), intent(out) lc_loc,
type(c_ptr), intent(out) reg_loc,
integer(c_int), intent(out) nreg,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Return references to arrays defining an existing surface mesh.

This routine exposes pointers to the coordinate, connectivity, and region arrays stored inside the Fortran multigrid_mesh object referenced by mesh_ptr. No data are copied and callers must not free or reallocate the objects.

Parameters
[in]mesh_ptrPointer to multigrid_mesh object containing the desired surface mesh
[out]ndimSpatial dimension of the mesh coordinates (Note: r array is always (3,np))
[out]npNumber of points in surface mesh
[out]r_locPointer to point locations array (3,np)
[out]npcNumber of points per cell (3 for triangles, 4 for quads)
[out]ncNumber of cells in surface mesh
[out]lc_locPointer to cell connectivity array (npc,nc)
[out]reg_locPointer to cell region array (nc)
[out]nregNumber of regions in surface mesh
[out]error_strError information

◆ oft_vmesh_get()

subroutine oft_vmesh_get ( type(c_ptr), intent(in), value mesh_ptr,
integer(c_int), intent(out) np,
type(c_ptr), intent(out) r_loc,
integer(c_int), intent(out) npc,
integer(c_int), intent(out) nc,
type(c_ptr), intent(out) lc_loc,
type(c_ptr), intent(out) reg_loc,
integer(c_int), intent(out) nreg,
character(kind=c_char), dimension(oft_error_slen), intent(out) error_str )

Return references to arrays defining an existing volume mesh.

This routine exposes pointers to the coordinate, connectivity, and region arrays stored inside the Fortran multigrid_mesh object referenced by mesh_ptr. No data are copied and callers must not free or reallocate the objects.

Parameters
[in]mesh_ptrPointer to multigrid_mesh object containing the desired volume mesh
[out]npNumber of points in volume mesh
[out]r_locPointer to point locations array (3,np)
[out]npcNumber of points per cell (4 for tetrahedra, 8 for hexahedra)
[out]ncNumber of cells in volume mesh
[out]lc_locPointer to cell connectivity array (npc,nc)
[out]reg_locPointer to cell region array (nc)
[out]nregNumber of regions in volume mesh
[out]error_strError information

◆ oftpy_init()

subroutine oftpy_init ( integer(c_int), intent(in), value nthreads,
logical(c_bool), intent(in), value quiet,
character(kind=c_char), dimension(oft_path_slen), intent(in) input_file,
type(c_ptr), intent(in), value slens,
type(c_funptr), intent(in), value abort_fun )

Needs docs.

Parameters
[in]nthreadsNeeds docs
[in]quietIf True, do not print OFT environment information on initialization
[in]input_fileNeeds docs
[in]slensString lengths
[in]abort_funAbort callback for Python

◆ oftpy_load_xml()

subroutine oftpy_load_xml ( character(kind=c_char), dimension(oft_path_slen), intent(in) xml_file,
type(c_ptr), intent(out) oft_node_ptr )

Needs docs.

Parameters
[in]xml_fileNeeds docs
[out]oft_node_ptrNeeds docs

◆ oftpy_set_debug()

subroutine oftpy_set_debug ( integer(c_int), intent(in), value debug_level)

Set debug verbosity level.

Parameters
[in]debug_levelNew value for debug level (must be in range [0,3])

◆ oftpy_set_nthreads()

subroutine oftpy_set_nthreads ( integer(c_int), intent(in), value nthreads)

Set the number of OpenMP threads to use.

Parameters
[in]nthreadsNumber of threads to use for subsequent OpenMP parallel regions