XGCa
Modules | Functions/Subroutines
fem2d.F90 File Reference

Modules

module  two_dim_linear_fem
 This module contains the code to evaluate the matrix entries in 2-dimensional linear finite element equations of Helmholtz form -div(alpha grad(X) + beta X = gamma.
 

Functions/Subroutines

subroutine two_dim_linear_fem::helm2delem (alpha, beta, ul, xl, ss, pp, isw, ntor, bfield_coeffs, set_bmat)
 Evaluates each element's (i.e., triangle's) contributions to the RHS matrix of the Helmholtz equation \(\nabla\cdot(\alpha\nabla_\perp \phi)+\beta\phi\). The matrix entries of the RHS matrix can then be obtained by summing the contributions of all elements that belong to a mesh vertex. Thus, this routine returns a 3x3 matrix \(A_{ij}\), where \(i\) and \(j\) are the indices of the three vertices of the triangular element. More...
 
subroutine two_dim_linear_fem::diff2delem (D, pinch_v, xl, geo_factors, ss, mass_flag, pinch_flag, indirect_pinch_flag)
 Evaluates each element's (i.e., triangle's) contributions to the RHS matrix of the radial diffusion equation equation \(\nabla(D_{ij}\cdot\nabla n)\). The matrix \(D_{ij}\) is \(D_{ij}=D(\psi,\theta) \hat{\boldsymbol{\psi}} \bigotimes \hat{\boldsymbol{\psi}}\). The matrix entries of the RHS matrix can then be obtained by summing the contributions of all elements that belong to a mesh vertex. Thus, this routine returns a 3x3 matrix \(A_{ij}\), where \(i\) and \(j\) are the indices of the three vertices of the triangular element. More...
 
subroutine two_dim_linear_fem::bdotgradelem (ul, xl, bb, pp, area)
 Evaluates \(\boldsymbol{B}\cdot\nabla\) in the poloidal plane, i.e., \(B_R \partial/\partial R + B_Z \partial/\partial Z\) using triangular linear finite elements. More...
 
subroutine two_dim_linear_fem::new_thfx2d (alpha, ul, shp, gradpot, pot, dd)
 Evaulates the value and derivative of a function in linear finite element space based on the three triangle basis functions and their derivatives (shp). The routine also returns the "material tensor" (dd), which in case of XGC's Poisson equation is \(A_{ij}\) in \(\nabla(A_{ij}\cdot\nabla_\perp\) with \(A_{ij}\) being a diagonal 2x2 matrix (R and Z) with the polarization \(\alpha\) on the diagonal. More...
 
subroutine two_dim_linear_fem::new_tint2d (l, lint, el)
 Sets up Gauss points for 1 or 3-point integration rule on a triangle The Gauss points are given by their barycentric coordinates in the triangle el(1:3,:), and their weight el(4,:). The weight is either 1 for 1-point integration or 1/3 for 3-point integration. More...
 
subroutine two_dim_linear_fem::new_trishp (el, xl, xsj, shp)
 Calculates the linear basis functions in a triangular finite element. More...