VERB_code_2.3
|
This is the main program file. More...
#include <valarray>
#include <math.h>
#include <ctime>
#include <time.h>
#include "../Logging/Output.h"
#include "../VariousFunctions/variousFunctions.h"
#include "../Diffusion/PSD.h"
#include "../Grid/Grid.h"
#include "../Grid/BoundaryConditions.h"
#include "../Grid/AdditionalSourcesAndLosses.h"
#include "../Parameters/Parameters.h"
Go to the source code of this file.
Macros | |
#define | _CRT_SECURE_NO_DEPRECATE |
No "depreciated" warnings. | |
#define | __VERB_VERSION_NUMBER__ "2.3.0.0" |
Number of current VERB code version. | |
Functions | |
int | main (int argc, char *argv[]) |
Main code. More... | |
Variables | |
Parameters_structure | parameters |
Parameters structure, with all parameters from the parameters.ini file. The default parameters defined in the constructor. | |
This is the main program file.
Code below corresponds to the commented part. It works only in uncommented state.
Definition in file Main.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main code.
NOTE: The code bodies displayed below are abbreviations of the functions and variable names for simplicity's sake. To see the full code, look at source code.
[in] | argv[] | The name of the parameter file |
argc | Number of arguments, mandatory automatic parameter (does not need to be specified). |
Create the radial and local diffusions grids from the given parameters specified by Parameters.ini
Output the grids to plt files for MATLAB to read
Loading the boundaries that should be loaded from a file
Check the parameters, if the type of boundary is defined we can load the boundary.
Else the default value for boundary type is BCT_CONSTANT_PSD
The boundary defined only on the slice of the grid
See Matrix3D::xSlice and Matrix3D::ySlice
create initial radial diffusion PSD
making boundary conditions using corresponding slice method for L, pc, and alpha where GridElement represents L, pc, or alpha, and GridElementSlice represents xSlice, ySlice, and zSlice respectively
create local diffusions PSD, and interpolate them with radial PSD
create and obtain all diffusion coefficients, stored into function arguments
Update the boundary conditions for L if need be
Update radial diffusion coefficients if using radial diffusion
Calculate diffusion for radial distance, given diffusion coefficients, grid elements, and boundary conditions (including boundary flux)
check PSD::Diffusion_L for implementation
How to calculate BF - it is a boundary condition file
μ = μ(L_boundary)
\( Bf = \frac{Flux-data(L\_boundary, μ)}{ pc(L\_boundary, μ) } / [ \frac{J\_L7}{pc(L=7, μ)} * \frac{steady\_state(L\_boundary)}{steady\_state(L=7)} ] \)
Interpolate from radial to local diffusion grids so that captures upper boundary condition with ySlice max size
Update everything: pc-boundaries, alpha-boundaries, diffusion coefficients
calculate Diffusion for pc and alpha if approximating with Block method
checks to see that grid is 3D by checking pc and alpha size
see PSD::Diffusion_pc_alpha for details on matrix calculations
calculate Diffusion for pc, alpha, or MixedTerms if approximating with Split method checks to see that grid has dimension in respective element see PSD::Diffusion_pc, PSD::Diffusion_alpha, and PSD::DiffusionMixTermExplicit for details on matrix calculations
calculate and update sources and losses
checks for negative PSD values, and sets them to floating point zero
interpolate from local diffusions to radial diffusion grid