XGCa
Modules | Functions/Subroutines
fem_ops.F90 File Reference
#include "petsc_version_defs.h"
#include <petsc/finclude/petsc.h>
Include dependency graph for fem_ops.F90:

Modules

module  fem_operations
 This module contains functions to construct finite element matrices for Helmholtz type equations div(alpha grad(X)) + beta X = gamma, and evaluate div(grad_RZ(X)) and v.grad_RZ(X) operations.
 

Functions/Subroutines

subroutine fem_operations::b_dot_grad_u (bdotgradu, b1, b2, uu, grid)
 
subroutine fem_operations::helm_mat_set_tri_values (nnode, arr, ind, is_in, bcflag, xgc_petsc, xgc_petsc_bd, lowbs, highbs, bs, scale_vec, scale_v, low1, idx, jdx, Amat, ierr)
 
subroutine fem_operations::check_symmetric (nnode, arr, is_in, bcflag, set_bmat, xgc_petsc, bs, lowbs, highbs, ind)
 
subroutine fem_operations::helm_matrix (grid, Amat, b_factors, alpha, beta, ntor, set_bmat, bd, bcflag, xgc_petsc, xgc_petsc_bd, bs, idx, jdx, scale_vec, mat_assemble, ierr)
 This routine sets up the matrix for the LHS of a Helmholtz equation of the form \(\nabla\cdot\left( \alpha\nabla_\perp\phi\right) + \beta \phi\). The routine loops over triangles, evaluates the stiffness matrix of the problem for the element and then proceeds to populate the RHS matrix of the Helmholtz equation with the proper entries of the stiffness matrix. In order to limit the computing time spent on this, triangles that are completely outside of the mesh area assigned to an MPI rank are skipped. More...
 
subroutine fem_operations::diff_matrix (grid, Amat, D, pinch_v, pinch_factor, geo_factors, bd, bcflag, mass_flag, pinch_flag, indirect_pinch_flag, xgc_petsc, bs, idx, jdx, scale_vec, mat_assemble, ierr)
 Sets up the matrix elements of the RHS of Fick's law for diffusive transport with a pinch velocity: \( \frac{\partial F}{\partial t} = \nabla \cdot \left[ \boldsymbol{D}.\nabla F - F \boldsymbol{v}_p \right] \) with the diffusion tensor \( D_{ij} = D(\psi,\theta) (\hat{\boldsymbol{\psi}} \otimes \hat{\boldsymbol{\psi}}) \), where \( D(\psi,\theta) \) is a scalar function of the radial and poloidal coordinate, and \( \hat{\boldsymbol{\psi}}=\nabla\psi/|\nabla \psi|. @param[in] grid XGC grid data structure, type(grid_type) @param[out] Amat PETSc matrix to store the diffusion operator, (PETSc Mat) @param[in] D Diffusion coefficient, real(8) @param[in] pinch_v Particle pinch velocity, real(8) @param[in] pinch_factor Prefactor of the pinch term (1 in density and momentum, 5/3 in temp. eq.), real(8) @param[in] geo_factors Geometrical factors needed for diffusivity and pinch velocity @param[in] bd Solver boundary @param[in] bcflag Whether inhomogeneous boundary conditions are used, logical @param[in] mass_flag Whether the mass matrix or diffusion matrix is computed, logical @param[in] pinch_flag Whether a pinch term is included (\)\nabla\cdot\left(\boldsymbol{v}_p X\right) \(), logical @param[in] indirect_pinch_flag Whether an indirect pinch term (i.e., conservation term from pinch of lower moment) is included (\)\boldsymbol{v}_p \cdot \nabla X. More...
 
subroutine fem_operations::fsa_21_t_matrix (grid, Amat, bcflag, xgc_petsc, petsc_xgc_bd, mat_assemble, ierr)
 This routine sets up the matrices for computing the flux surface average of a 2d scalar field: \( \langle \phi \rangle \). Contributions from the interior vertices and boundary vertices are handled by separate matrices. The matrices are constructed as the transpose of what is to be applied to vectors representing the interior vertices and boundary vertices. More...
 
subroutine fem_operations::fsa_12_matrix (grid, Amat, bcflag, xgc_petsc, petsc_xgc_bd, mat_assemble, ierr)
 This routine sets up the matrices for placing 1d surface data onto a 2d scalar field. Placement onto interior vertices and boundary vertices are handled by separate matrices. More...