The Open FUSION Toolkit 26.6
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_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_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