VERB4D
Functions
ReadInitialData.cpp File Reference

Reads in all the data files created in Matlab in order to initialize the parameters. More...

#include "ReadInitialData.h"

Functions

void AllocateMemory (Matrix4D< double > &PSD, Matrix4D< double > &P, Matrix4D< double > &R, Matrix4D< double > &V, Matrix4D< double > &K, Matrix4D< double > &L, int &P_size, int &R_size, int &V_size, int &K_size, Matrix3D< double > &P_LBC, Matrix3D< double > &P_UBC, Matrix3D< double > &R_LBC, Matrix3D< double > &R_UBC, Matrix3D< double > &V_LBC, Matrix3D< double > &V_UBC, Matrix3D< double > &K_LBC, Matrix3D< double > &K_UBC, Matrix3D< double > &L_LBC, Matrix3D< double > &L_UBC, Matrix4D< double > &DLL, Matrix4D< double > &DVV, Matrix4D< double > &DVK, Matrix4D< double > &DKK, Matrix4D< double > &VP, Matrix4D< double > &VL, Matrix4D< double > &G_local, Matrix4D< double > &G_radial, Matrix4D< double > &Sources, Matrix4D< double > &Losses)
 
void ReadBoundaryCondition (ifstream &input, Matrix3D< double > psd_slice, Matrix3D< double > &BC, string &BC_type, Matrix3D< double > Q_slice1, Matrix3D< double > Q_slice2, Matrix3D< double > Q_slice3)
 THIS FUNCTION IS NOT USED ANYWHERE.
 
bool ReadInitialData (string &InputFolder, string &OutputFolder, int argc, char *argv[], double &time_total, double &time_step, double &time_output, double &time_first, long int &it_first, int &max_threads, string &inversion_method, string &use_matlab, string &include_boundary, Matrix4D< double > &PSD, Matrix4D< double > &P, Matrix4D< double > &R, Matrix4D< double > &V, Matrix4D< double > &K, UpdatableMatrix< Matrix4D< double > > &L, int &P_size, int &R_size, int &V_size, int &K_size, int &L_size, Matrix3D< double > &PSD_l_P, Matrix3D< double > &PSD_u_P, UpdatableMatrix< Matrix3D< double > > &PSD_l_R, UpdatableMatrix< Matrix3D< double > > &PSD_u_R, UpdatableMatrix< Matrix3D< double > > &PSD_l_V, UpdatableMatrix< Matrix3D< double > > &PSD_u_V, UpdatableMatrix< Matrix3D< double > > &PSD_l_K, UpdatableMatrix< Matrix3D< double > > &PSD_u_K, UpdatableMatrix< Matrix3D< double > > &PSD_l_L, UpdatableMatrix< Matrix3D< double > > &PSD_u_L, string &Pl_BC_type, string &Pu_BC_type, string &Rl_BC_type, string &Ru_BC_type, string &Vl_BC_type, string &Vu_BC_type, string &Kl_BC_type, string &Ku_BC_type, string &Ll_BC_type, string &Lu_BC_type, UpdatableListMatrix< Matrix4D< double > > &DLL, UpdatableListMatrix< Matrix4D< double > > &DVV, UpdatableListMatrix< Matrix4D< double > > &DKK, UpdatableListMatrix< Matrix4D< double > > &DVK, UpdatableMatrix< Matrix4D< double > > &VP, UpdatableMatrix< Matrix4D< double > > &VL, UpdatableMatrix< Matrix4D< double > > &G_local, UpdatableMatrix< Matrix4D< double > > &G_radial, UpdatableListMatrix< Matrix4D< double > > &Sources, UpdatableListMatrix< Matrix4D< double > > &Losses)
 

Detailed Description

Reads in all the data files created in Matlab in order to initialize the parameters.

Created on: Oct 5, 2012 Author: dimath

Function Documentation

void AllocateMemory ( Matrix4D< double > &  PSD,
Matrix4D< double > &  P,
Matrix4D< double > &  R,
Matrix4D< double > &  V,
Matrix4D< double > &  K,
Matrix4D< double > &  L,
int &  P_size,
int &  R_size,
int &  V_size,
int &  K_size,
Matrix3D< double > &  P_LBC,
Matrix3D< double > &  P_UBC,
Matrix3D< double > &  R_LBC,
Matrix3D< double > &  R_UBC,
Matrix3D< double > &  V_LBC,
Matrix3D< double > &  V_UBC,
Matrix3D< double > &  K_LBC,
Matrix3D< double > &  K_UBC,
Matrix3D< double > &  L_LBC,
Matrix3D< double > &  L_UBC,
Matrix4D< double > &  DLL,
Matrix4D< double > &  DVV,
Matrix4D< double > &  DVK,
Matrix4D< double > &  DKK,
Matrix4D< double > &  VP,
Matrix4D< double > &  VL,
Matrix4D< double > &  G_local,
Matrix4D< double > &  G_radial,
Matrix4D< double > &  Sources,
Matrix4D< double > &  Losses 
)

Allocates the memory for all the matrices using Matrix4D::AllocateMemory() for everything except boundary conditions which use Matrix3D::AllocateMemory()

Parameters
P,R,V,K,L- matrices for Phi, Radial Distance, Energy, Pitch Angle, Distance due to magnetic field, respectively
P,R,V,K,L_size - sizes for the corresponding matrices
UBC/LBC- Boundary condition for each matrix P,R,V,K,L upper and lower
DLL,DVV,DKK,DVK- diffusion matrices
VP- Phi and Energy Matrix
VL- Phi and distance due to magnetic field Matrix
G_local,G_radial- Jacobians for normalizing data
Sources,Losses- matrices for calculating Sources and Losses(loss cone)
bool ReadInitialData ( string &  InputFolder,
string &  OutputFolder,
int  argc,
char *  argv[],
double &  time_total,
double &  time_step,
double &  time_output,
double &  time_first,
long int &  it_first,
int &  max_threads,
string &  inversion_method,
string &  use_matlab,
string &  include_boundary,
Matrix4D< double > &  PSD,
Matrix4D< double > &  P,
Matrix4D< double > &  R,
Matrix4D< double > &  V,
Matrix4D< double > &  K,
UpdatableMatrix< Matrix4D< double > > &  L,
int &  P_size,
int &  R_size,
int &  V_size,
int &  K_size,
int &  L_size,
Matrix3D< double > &  PSD_l_P,
Matrix3D< double > &  PSD_u_P,
UpdatableMatrix< Matrix3D< double > > &  PSD_l_R,
UpdatableMatrix< Matrix3D< double > > &  PSD_u_R,
UpdatableMatrix< Matrix3D< double > > &  PSD_l_V,
UpdatableMatrix< Matrix3D< double > > &  PSD_u_V,
UpdatableMatrix< Matrix3D< double > > &  PSD_l_K,
UpdatableMatrix< Matrix3D< double > > &  PSD_u_K,
UpdatableMatrix< Matrix3D< double > > &  PSD_l_L,
UpdatableMatrix< Matrix3D< double > > &  PSD_u_L,
string &  Pl_BC_type,
string &  Pu_BC_type,
string &  Rl_BC_type,
string &  Ru_BC_type,
string &  Vl_BC_type,
string &  Vu_BC_type,
string &  Kl_BC_type,
string &  Ku_BC_type,
string &  Ll_BC_type,
string &  Lu_BC_type,
UpdatableListMatrix< Matrix4D< double > > &  DLL,
UpdatableListMatrix< Matrix4D< double > > &  DVV,
UpdatableListMatrix< Matrix4D< double > > &  DKK,
UpdatableListMatrix< Matrix4D< double > > &  DVK,
UpdatableMatrix< Matrix4D< double > > &  VP,
UpdatableMatrix< Matrix4D< double > > &  VL,
UpdatableMatrix< Matrix4D< double > > &  G_local,
UpdatableMatrix< Matrix4D< double > > &  G_radial,
UpdatableListMatrix< Matrix4D< double > > &  Sources,
UpdatableListMatrix< Matrix4D< double > > &  Losses 
)

Reads in all the data created in Matlab in order to initialize the parameters

Using Parameters::getParameter() for timesteps, number of threads, input and output folders, boundary condition types

Using AllocateMemory() for all the matrices

Using UpdatableMatrix<MatrixND>::update() for G_local and G_radial

Using UpdatableMatrix<MatrixND>::readFromIniFile() for all boundary conditions and data tables/matrices

Parameters
InputFolder- Folder to get input from
OutputFolder- Folder to write output to
argc- number of arguments given
argv- array of string arguments inputted
time_total,step,output,first- time variables for calculations
max_threads- number of threads that can be used
inversion_method- tool for doing calculations, usually Lapack
PSD- Phase Space Density Matrix
P,R,V,K,L- matrices for Phi, Actual Distance, Energy, Pitch Angle, Distance due to magnetic field, respectively
P,R,V,K,L_size - sizes for the corresponding matrices
PSD_l_P,R,V,K,L - lower boundaries for PSD with respect to P,R,V,K,L
PSD_u_P,R,V,K,L - upper boundaries for PSD with respect to P,R,V,K,L
BC_type- Type of boundary condition for each matrix - either BCT_CONSTANT_VALUE or BCT_CONSTANT_DERIVATIVE
DLL,DVV,DKK,DVK- diffusion matrices
G_local,G_radial- Jacobians for normalizing data
Sources,Losses- matrices for calculating Sources and Losses(loss cone)