Table of Contents

Main

Workflow:

Input files

The input files are stored in the “dat/” folder.

In G2C3, all the read operations are performed in read_data.F90 by the Master processing element (mpe==0). Then the MPI_BCAST subroutine in mpi.F90 broadcasts the values to all the other processing elements. In case the read elements are an array, first the array dimension is broadcast and then the arrays are allocated in allocate_arrays.F90

G2C3 conventions

Normalization

The basic units and normalization used in G2C3 are summarized as follows:

COCOS sign convention

Build mesh

 (a) Schematic of re-sampling based grid construction process; 
            (b) Construction of triangles between two consecutive
        constant flux surfaces. Note that at every iteration there are two possible
        triangles. The option for which the sum of lengths of their sides is
        smaller is chosen; (c) Grid generated in the core region $(0.2 
        \psi_\times \leq \psi \leq 0.99 \psi_\times)$, where $\psi_\times$ is the
        flux-function at the X-point, for the DIII-D configuration 
        and the corresponding mesh is shown in (d).

Mesh

Locator

We use a neural network in a Universal function approximation mode to map $\mathcal{N}_\Delta:(R,Z) \rightarrow \Delta$, where $\Delta$ is the triangle that encloses the point. (Learn more)

Build the gather-scatter operator

Field lines (numerical integrator)

(Learn more)

Integrator

Neural network

Build the (gyro-averaged) Poisson solver

PETSc

We use the PETSc library in the field solver to solve MPI and OpenMP-based sparse matrix operations, such as inverse and multiplication.

Initialize particles

MPI operations

Execute the PIC cycle