SmartLUSolver

class SmartLUSolver

Extends Solver class

Properties

timeIndex

Time index where simulation will start and where fattimeIndex is defined.

fattimeIndex

Distribution function that will be used to simulate next timestep and is thus defined at timeIndex.

nSaves

How many saves to do when invoking takeTimeSteps()

saveIndices

Which indecies will be saved. Initialized after nSaves have been set and is set when invoking takeTimeSteps() with initsaveIndices().

factor_L

L factor in LU factorization for last taken step in time.

factor_U

U factor in LU factorization for last taken step in time.

factor_P

P factor in LU factorization for last taken step in time.

factor_Q

Q factor in LU factorization for last taken step in time.

Functions

this = SmartLUSolver(state,eqSettings)

Construct a new instance of this class

output = takeTimeSteps(this,output)

Takes the remaining timesteps, starts from timeIndex and ends at end of TimeGrid object in State object in this class.

If output is supplied, this will be modified by adding new output to it, usefull when extending the distributions. Remember that this is pointers, so you if you supply a output class you only need to write takeTimeSteps(output); (e.i. no assignment as it is a handle class).

Setters

setf(this, distribution, momentumGrid)

Sets the fattimeIndex to the distribution (is a Distribution object). If momentumGrid (MomentumGrid object) is supplied then it interpolates the distribution function from distribution to the supplied momentumGrid object.

setTime(this, time, timeUnit)

Sets the timeIndex to last index where time is greater than the timesteps in TimeGrid object in state.

setnSaves(this, nSaves)

Set how many steps will be returned. Must be greater than 2.

initializing functions

initsaveIndices(this)

Sets what indices to save. Is called by takeTimeSteps. Always saves first and last index

clearf(this)

Reset the distribution function fattimeIndex to be empty.

setftoZero(this)

Set the distribution function fattimeIndex to all zeroes.

resettimeIndex(this)

Sets the timeIndex to be one, e.i. restart the simulation from first timestep.

setftoMaxmellian(this)

Sets the distribution function fattimeIndex to be Maxmellian.

rhs0 = enforceParticleAndHeat(this)

this adds a particle and heat source dependent on what settings are used in eqSetings. These are added to the 0th Legandre Mode.