![]() |
The Open FUSION Toolkit 26.9
An open-source framework for fusion and plasma science and engineering
|
Fortran part of Python wrapper for coupled MUG/TokaMaker (mugtok_td) functionality.
Data Types | |
| type | mugtok_instance |
| MUG/TokaMaker wrapper object for the Python API. More... | |
Functions/Subroutines | |
| subroutine | mugtok_alloc (mugtok_ptr, equil_ptr, error_str) |
| Allocate the combined MUG/TokaMaker simulation object from an existing equilibrium. | |
| logical function | mugtok_ccast (mugtok_cptr, sim_obj, error_str) |
| Cast a C pointer back to the Fortran MUG/TokaMaker wrapper object. | |
| subroutine | mugtok_destroy (mugtok_ptr, error_str) |
| Destroy the combined simulation object (the borrowed equilibrium/mesh are left intact). | |
| subroutine | mugtok_get_field (mugtok_ptr, field_id, vals, error_str) |
| Get the current values of a MUG-owned solution field at node points. | |
| subroutine | mugtok_get_gradf (mugtok_ptr, gr, gz, error_str) |
| Get the projected poloidal gradient of F at node points (dF/dR, dF/dZ). | |
| subroutine | mugtok_get_pmesh (mugtok_ptr, np, r_loc, nc, lc_loc, reg_loc, error_str) |
| Get the order-1 (pressure) plotting mesh: node coordinates and triangle connectivity. | |
| subroutine | mugtok_setup (mugtok_ptr, dt, lin_tol, nl_tol, mhd_flag_ptr, dens_ptr, visc_ptr, nreg, incomp, toroidal_flow, error_str) |
| Set up the combined simulation (mesh/FE are reused from the equilibrium's device). | |
| subroutine | mugtok_step (mugtok_ptr, curr_ptr, ncoils, time, dt, nl_its, lin_its, nretry, error_str) |
| Advance the coupled solution by one timestep. | |
| subroutine mugtok_alloc | ( | type(c_ptr), intent(out) | mugtok_ptr, |
| type(c_ptr), intent(in), value | equil_ptr, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Allocate the combined MUG/TokaMaker simulation object from an existing equilibrium.
| [out] | mugtok_ptr | Pointer to new MUG/TokaMaker object |
| [in] | equil_ptr | Pointer to active TokaMaker equilibrium (gs_equil) |
| [out] | error_str | Error string (empty if no error) |
| logical function mugtok_ccast | ( | type(c_ptr), intent(in) | mugtok_cptr, |
| type(mugtok_instance), intent(out), pointer | sim_obj, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out), optional | error_str ) |
Cast a C pointer back to the Fortran MUG/TokaMaker wrapper object.
| [in] | mugtok_cptr | C pointer to wrapper object |
| [out] | sim_obj | Fortran wrapper object |
| [out] | error_str | Error string (empty if no error) |
| subroutine mugtok_destroy | ( | type(c_ptr), intent(in), value | mugtok_ptr, |
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Destroy the combined simulation object (the borrowed equilibrium/mesh are left intact).
| [in] | mugtok_ptr | Pointer to MUG/TokaMaker object |
| [out] | error_str | Error string (empty if no error) |
| subroutine mugtok_get_field | ( | type(c_ptr), intent(in), value | mugtok_ptr, |
| integer(c_int), intent(in), value | field_id, | ||
| type(c_ptr), intent(in), value | vals, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Get the current values of a MUG-owned solution field at node points.
| [in] | mugtok_ptr | Pointer to MUG/TokaMaker object |
| [in] | field_id | Field index (1=n,2/3/4=vel,5=P,7=F) |
| [in] | vals | Output array (size = field's FE block DOFs) |
| [out] | error_str | Error string (empty if no error) |
| subroutine mugtok_get_gradf | ( | type(c_ptr), intent(in), value | mugtok_ptr, |
| type(c_ptr), intent(in), value | gr, | ||
| type(c_ptr), intent(in), value | gz, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Get the projected poloidal gradient of F at node points (dF/dR, dF/dZ).
| [in] | mugtok_ptr | Pointer to MUG/TokaMaker object |
| [in] | gr | Output dF/dR array |
| [in] | gz | Output dF/dZ array |
| [out] | error_str | Error string (empty if no error) |
| subroutine mugtok_get_pmesh | ( | type(c_ptr), intent(in), value | mugtok_ptr, |
| integer(c_int), intent(out) | np, | ||
| type(c_ptr), intent(out) | r_loc, | ||
| integer(c_int), intent(out) | nc, | ||
| type(c_ptr), intent(out) | lc_loc, | ||
| type(c_ptr), intent(out) | reg_loc, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Get the order-1 (pressure) plotting mesh: node coordinates and triangle connectivity.
| [in] | mugtok_ptr | Pointer to MUG/TokaMaker object |
| [out] | np | Number of pressure node points |
| [out] | r_loc | Node coordinate list pointer |
| [out] | nc | Number of cells |
| [out] | lc_loc | Cell (triangle) list pointer |
| [out] | reg_loc | Per-cell region ID list pointer |
| [out] | error_str | Error string (empty if no error) |
| subroutine mugtok_setup | ( | type(c_ptr), intent(in), value | mugtok_ptr, |
| real(c_double), intent(in), value | dt, | ||
| real(c_double), intent(in), value | lin_tol, | ||
| real(c_double), intent(in), value | nl_tol, | ||
| type(c_ptr), intent(in), value | mhd_flag_ptr, | ||
| type(c_ptr), intent(in), value | dens_ptr, | ||
| type(c_ptr), intent(in), value | visc_ptr, | ||
| integer(c_int), intent(in), value | nreg, | ||
| logical(c_bool), intent(in), value | incomp, | ||
| logical(c_bool), intent(in), value | toroidal_flow, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Set up the combined simulation (mesh/FE are reused from the equilibrium's device).
| [in] | mugtok_ptr | Pointer to MUG/TokaMaker object |
| [in] | dt | Timestep [s] |
| [in] | lin_tol | Linear solver tolerance |
| [in] | nl_tol | Non-linear solver tolerance |
| [in] | mhd_flag_ptr | Per-region MHD flag (int32, 1=MHD region) |
| [in] | dens_ptr | Per-region density (<0 where unused) |
| [in] | visc_ptr | Per-region kinematic viscosity (<0 where unused) |
| [in] | nreg | Number of mesh regions |
| [in] | incomp | Incompressible flow? |
| [in] | toroidal_flow | Allow toroidal (phi) flow in the MHD regions? |
| [out] | error_str | Error string (empty if no error) |
| subroutine mugtok_step | ( | type(c_ptr), intent(in), value | mugtok_ptr, |
| type(c_ptr), intent(in), value | curr_ptr, | ||
| integer(c_int), intent(in), value | ncoils, | ||
| real(c_double), intent(inout) | time, | ||
| real(c_double), intent(inout) | dt, | ||
| integer(c_int), intent(out) | nl_its, | ||
| integer(c_int), intent(out) | lin_its, | ||
| integer(c_int), intent(out) | nretry, | ||
| character(kind=c_char), dimension(oft_error_slen), intent(out) | error_str ) |
Advance the coupled solution by one timestep.
| [in] | mugtok_ptr | Pointer to MUG/TokaMaker object |
| [in] | curr_ptr | Coil currents [A] at end of step |
| [in] | ncoils | Number of coils |
| [in,out] | time | Current simulation time [s] |
| [in,out] | dt | Timestep size [s] |
| [out] | nl_its | Number of nonlinear iterations |
| [out] | lin_its | Number of linear iterations |
| [out] | nretry | Number of retries |
| [out] | error_str | Error string (empty if no error) |