VERB_code_2.2
2
|
The document Algorithms.pdf may be useful for understanding the structure of the code.
This document generated by Doxygen system. It has a description of API, used my main program code which run main() function. If you whant to understand how the VERB code works, please, read the owerview and after read the code and coments itself.
The code is designed to solve the Fokker-Planck diffusion equation:
, describs the evolution of phase space density (PSD) in time and phase space. It has three diffusion terms: Radial, Energy, and Pitch-angle. Radial diffusion needs different grid, than two other (local, Energy, and Pitch-angle) diffusions. Q - local sources. S - local losses. In the code we split the equation into three parts and solve them one after anouther with interpolation between radial and local grids:
We have two grids in the code and phase space density arrays on each of them. PSD values and grids are stored in the class PSD. The structure of the classes is following:
PSD as general class, contains methods to compute diffusion. It keeps PSD values in the parent class Matrix3D. Grid has 3-dimensions, so it has 3 GridElements, and one additional element epc which is just useful for the output. Each GridElements is a 3D-Array of values of coordinates. We have to do it this way, because grids are irregular. BoundaryCondition class is used for the boundary conditions for diffusion calculation.
PSD needs diffusion coefficients, grid, and boundary conditions as an input parameter for diffusion functions PSD::Diffusion_L(), PSD::Diffusion_pc(), PSD::Diffusion_alpha(), PSD::Diffusion_pc_alpha(). Diffusion coefficients for each diffusion are stored inside DiffusionCoefficientsGroup class. The class structure:
DiffusionCoefficients, produced by each wave type, grouped by directions in the DiffusionCoefficientsGroup class. That class can turn the waves on and off and scale their effect, and store the summation as Daa or Dpp.
Initial conditions defines by PSD::Create_Initial_PSD.
The code has empty constructor and functions, like AllocateMemory()
and Initialize()
which define an object. We also have a constructor, which call these functions during execution, just for shortening of the code. And it is like that for almost each class.