VERB4D
|
A matrix that can be created in 1, 2, 3, or 4 dimensions with the ability to be updated. More...
#include <UpdatableMatrix.h>
Public Member Functions | |
MatrixND & | operator= (const MatrixND &M) |
MatrixND & | operator= (const double Val) |
bool | readFromIniFile (string ini_filename, MatrixND &Q1, MatrixND &Q2, MatrixND &Q3, MatrixND &Q4) |
void | update (double time, MatrixND Q1, MatrixND Q2, MatrixND Q3, MatrixND Q4=MatrixND()) |
A matrix that can be created in 1, 2, 3, or 4 dimensions with the ability to be updated.
Updatable list of matrix - 1,2,3,4 dimensions. Currently set up to be used for diffusion coefficients, Sources, and Losses only. All other matrices use UpdatableMatrix
It's a template because it's easier to create, maintain, and debug one class, instead of 4 classes with the same functionality
It's just like a normal matrix (and can be used just like one), but it can also be updated according to rules from an ini-file
The ini-files specify several matrices that are added to each other, e.g. diffusion coefficients for different waves to get one diffusion coefficient The readFromIniFile function is used to load data into an UpdatableListMatrix by storing line by line the contents of the ini file into a vector of UpdatableMatrix At every time step the update function is called from the main file. The vector is then traversed and any valid updates are completed. The standard method is to save diffusion coefficients, Sources, or Losses in a .tab file which is comprised of either .plt or .lst files or both.
|
inline |
Overloaded = operator for any size Updatable List Matrix. Copies every element from M and returns current matrix
|
inline |
Overloaded = operator for any size Updatable List Matrix. Sets every elemenet to Val and returns current matrix
bool UpdatableListMatrix< MatrixND >::readFromIniFile | ( | string | ini_filename, |
MatrixND & | Q1, | ||
MatrixND & | Q2, | ||
MatrixND & | Q3, | ||
MatrixND & | Q4 | ||
) |
Read UpdatableListMatrix rules from ini-file UpdatableListMatrix is a list (vector) or UpdatableMatrices They are combined together to form one matrix (e.g. diffusion coefficients for different waves)
The inputted file can be of any format. If it is a data file (such as .plt) the data will be stored into the matrix. If the file is an update file then the matrix will only be updated on the corresponding timestep from the main file. The inputted file may be a .tab file that has a combination of data and update files. This function goes through the inputted file and stores the contents individually into a vector of UpdatableMatrix, which in turn will be evaluated from the calls to the UpdatableMatrix functions
ini_filename | - ini filename with appropriate structure |
Q1 | - corresponding grid coordinate |
Q2 | - corresponding grid coordinate |
Q3 | - corresponding grid coordinate |
Q4 | - corresponding grid coordinate |
void UpdatableListMatrix< MatrixND >::update | ( | double | current_time, |
MatrixND | Q1, | ||
MatrixND | Q2, | ||
MatrixND | Q3, | ||
MatrixND | Q4 = MatrixND() |
||
) |
Update the UpdatableListMatrix - call update() for each UpdatableMatrix in the list, then sum all the UpdatableMatrices together
iteration | - current iteration number |
dt | - time step |
Q1 | - corresponding grid coordinate |
Q2 | - corresponding grid coordinate |
Q3 | - corresponding grid coordinate |
Q4 | - corresponding grid coordinate |