VERB4D
Functions
Diffusion_1D.h File Reference

Getting the diffusion in 1D for the given a 1D matrix of Phase Space Densities, x, boundary conditions, jacobian, sources, losses and change in time. More...

#include "Matrix.h"
#include "MatrixSolver.h"

Go to the source code of this file.

Functions

bool Diffusion_1D (Matrix1D< double > &psd, Matrix1D< double > x, int x_size, double x_LBC, double x_UBC, string x_LBC_type, string x_UBC_type, Matrix1D< double > Dxx, Matrix1D< double > G, Matrix1D< double > Sources, Matrix1D< double > Losses, double dt)
 

Detailed Description

Getting the diffusion in 1D for the given a 1D matrix of Phase Space Densities, x, boundary conditions, jacobian, sources, losses and change in time.

Created on: May 28, 2011 Author: dimath

Function Documentation

bool Diffusion_1D ( Matrix1D< double > &  psd,
Matrix1D< double >  x,
int  x_size,
double  x_LBC,
double  x_UBC,
string  x_LBC_type,
string  x_UBC_type,
Matrix1D< double >  Dxx,
Matrix1D< double >  G,
Matrix1D< double >  Sources,
Matrix1D< double >  Losses,
double  dt 
)

Function that creates a 1D Diffusion Matrix and returns a bool upon completion

1D Diffusion - returns true on successful completion

Method:

  1. Add boundary conditions
  2. Add sources and losses
  3. get the seond derivative approximation with diffusion coeficient SecondDerivativeApproximation_1D()
  4. solve matrix with tridag()
Parameters
psd- phase space density
x- one dimensional slice
x_size- size of slice
x_LBC- lower boundary condition for param x
x_UBC- upper boundary condition for param x
x_LBC_type- type of lower boundary condition for param x
x_UBC_type- type of upper boundary condition for param x
Dxx- 1D Diffusion matrix
G- 1D used for Jacobian to normalize matrix
Sources- matrix used for Sources
Losses- Matrix used for Losses (loss cone)
dt- change in time of single time step