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

Detailed Description

Solve time-dependent MHD equations in 2D with lagrange basis set.

Data Types

type  oft_xmhd_2d_sim
 Main 2D MHD simulation object. More...
type  xmhd_2d_mfun
 Object to compute left-hand side of system for linear solves. More...
type  xmhd_2d_nlfun
 Object to compute left-hand side of system for nonlinear solves. More...

Functions/Subroutines

subroutine build_approx_jacobian (self, a)
 Compute the approximate Jacobian matrix for the nonlinear function being solved.
subroutine mfnk_update (uin)
 Update matrix-free Jacobian on all levels with new solution.
subroutine mfun_apply (self, a, b)
 Compute the mass matrix for RHS.
subroutine nlfun_apply (self, a, b)
 Compute the NL error function, where we are solving F(x) = 0.
subroutine r_init (pt, val)
subroutine rst_load (self, u, filename, path, t, dt)
 Load xMHD solution state from a restart file.
subroutine rst_save (self, u, t, dt, filename, path)
 Save xMHD solution state to a restart file.
subroutine run_lin_simulation (self)
 Main driver for 2D MHD linear time advance.
subroutine run_simulation (self)
subroutine setup (self, mg_mesh_in, order)
 Setup composite FE representation and ML environment.
subroutine setup_bc (self)
 Set any boundary conditions not already set with default values.
subroutine update_jacobian (uin)
 Update Jacobian matrices on all levels with new solution.
subroutine, public xmhd_2d_plot (self)
 Plot the current solution state using XDMF/HDF5 output Runtime options are set in the main input file using the group xmhd_plot_options. Option group: xmhd_plot_options.

Variables

type(oft_xmhd_2d_sim), pointer current_sim => NULL()
class(oft_bmesh), pointer, public mesh => NULL()
 Current mesh level.
class(multigrid_mesh), pointer mg_mesh => NULL()
 Multigrid mesh object.
type(oft_ml_fem_type), target, public ml_oft_blagrange
 Multilevel finite element representation.
class(oft_scalar_bfem), pointer oft_blagrange => NULL()
 Lagrange finite element representation.

Function/Subroutine Documentation

◆ build_approx_jacobian()

subroutine build_approx_jacobian ( class(oft_xmhd_2d_sim), intent(inout) self,
class(oft_vector), intent(inout) a )
private

Compute the approximate Jacobian matrix for the nonlinear function being solved.

Parameters
[in,out]aSolution for computing jacobian

◆ mfnk_update()

subroutine mfnk_update ( class(oft_vector), intent(inout), target uin)
private

Update matrix-free Jacobian on all levels with new solution.

Parameters
[in,out]uinCurrent field

◆ mfun_apply()

subroutine mfun_apply ( class(xmhd_2d_mfun), intent(inout) self,
class(oft_vector), intent(inout), target a,
class(oft_vector), intent(inout) b )
private

Compute the mass matrix for RHS.

Parameters
[in,out]selfmass function object
[in,out]aSource field
[in,out]bResult of metric function

–Set constant values

◆ nlfun_apply()

subroutine nlfun_apply ( class(xmhd_2d_nlfun), intent(inout) self,
class(oft_vector), intent(inout), target a,
class(oft_vector), intent(inout) b )
private

Compute the NL error function, where we are solving F(x) = 0.

b = F(a)

Parameters
[in,out]selfNL function object
[in,out]aSource field
[in,out]bResult of metric function

◆ r_init()

subroutine r_init ( real(r8), dimension(3), intent(in) pt,
real(r8), intent(out) val )
private

◆ rst_load()

subroutine rst_load ( class(oft_xmhd_2d_sim), intent(inout) self,
class(oft_vector), intent(inout), pointer u,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
real(r8), intent(out), optional t,
real(r8), intent(out), optional dt )
private

Load xMHD solution state from a restart file.

Parameters
[in,out]uSolution to load
[in]filenameName of restart file
[in]pathPath to store solution vector in file
[out]tTime of loaded solution
[out]dtTimestep at loaded time

◆ rst_save()

subroutine rst_save ( class(oft_xmhd_2d_sim), intent(inout) self,
class(oft_vector), intent(inout), pointer u,
real(r8), intent(in) t,
real(r8), intent(in) dt,
character(len=*), intent(in) filename,
character(len=*), intent(in) path )
private

Save xMHD solution state to a restart file.

Parameters
[in,out]uSolution to save
[in]tCurrent solution time
[in]dtCurrent timestep
[in]filenameName of restart file
[in]pathPath to store solution vector in file

◆ run_lin_simulation()

subroutine run_lin_simulation ( class(oft_xmhd_2d_sim), intent(inout), target self)
private

Main driver for 2D MHD linear time advance.

◆ run_simulation()

subroutine run_simulation ( class(oft_xmhd_2d_sim), intent(inout), target self)
private

◆ setup()

subroutine setup ( class(oft_xmhd_2d_sim), intent(inout) self,
class(multigrid_mesh), intent(in), target mg_mesh_in,
integer(i4), intent(in) order )
private

Setup composite FE representation and ML environment.

◆ setup_bc()

subroutine setup_bc ( class(oft_xmhd_2d_sim), intent(inout) self)
private

Set any boundary conditions not already set with default values.

◆ update_jacobian()

subroutine update_jacobian ( class(oft_vector), intent(inout), target uin)
private

Update Jacobian matrices on all levels with new solution.

Parameters
[in,out]uinCurrent solution

◆ xmhd_2d_plot()

subroutine, public xmhd_2d_plot ( class(oft_xmhd_2d_sim), intent(inout) self)

Plot the current solution state using XDMF/HDF5 output Runtime options are set in the main input file using the group xmhd_plot_options. Option group: xmhd_plot_options.

Option Description Type [dim]
rst_start=0 First restart file to read int
rst_end=2000 Last restart file to read int

Variable Documentation

◆ current_sim

type(oft_xmhd_2d_sim), pointer current_sim => NULL()

◆ mesh

class(oft_bmesh), pointer, public mesh => NULL()

Current mesh level.

◆ mg_mesh

class(multigrid_mesh), pointer mg_mesh => NULL()
private

Multigrid mesh object.

◆ ml_oft_blagrange

type(oft_ml_fem_type), target, public ml_oft_blagrange

Multilevel finite element representation.

◆ oft_blagrange

class(oft_scalar_bfem), pointer oft_blagrange => NULL()
private

Lagrange finite element representation.