![]() |
An open source method of characteristics neutron transport code.
|
Go to the source code of this file.
Classes | |
| struct | ConvergenceData |
| Verbose iteration information for the CMFD eigenvalue solver. More... | |
| struct | DomainCommunicator |
| Structure for communication of fluxes between neighbor domains. More... | |
Functions | |
| double | eigenvalueSolve (Matrix *A, Matrix *M, Vector *X, double k_eff, double tol, double SOR_factor=1.5, ConvergenceData *convergence_data=NULL, DomainCommunicator *comm=NULL) |
| Get coupling fluxes and other information from neighbors. More... | |
| bool | linearSolve (Matrix *A, Matrix *M, Vector *X, Vector *B, double tol, double SOR_factor=1.5, ConvergenceData *convergence_data=NULL, DomainCommunicator *comm=NULL) |
| Solves a linear system using Red-Black Gauss Seidel with successive over-relaxation. More... | |
| bool | ddLinearSolve (Matrix *A, Matrix *M, Vector *X, Vector *B, double tol, double SOR_factor, ConvergenceData *convergence_data, DomainCommunicator *comm) |
| Solves a linear system using the linear solver above, but makes the loss and streaming matrix diagonally dominant first, to increase likelihood of convergence. More... | |
| void | matrixMultiplication (Matrix *A, Vector *X, Vector *B) |
| Performs a matrix vector multiplication. More... | |
| double | computeRMSE (Vector *x, Vector *y, bool integrated, DomainCommunicator *comm=NULL) |
| Computes the Root Mean Square Error of two Vectors. More... | |
| template<typename T > | |
| void | matrix_transpose (T *matrix, int dim1, int dim2) |
| Transpose a 2D matrix. More... | |
This file contains a library of functions for performing linear algebra operations.
| double computeRMSE | ( | Vector * | X, |
| Vector * | Y, | ||
| bool | integrated, | ||
| DomainCommunicator * | comm | ||
| ) |
Computes the Root Mean Square Error of two Vectors.
This function takes in two vectors (X and Y) and computes the Root Mean Square Error of the Vector Y with respect to Vector X. The boolean integrated must also be given to indicate whether the operation on the vector should be group-wise integrated before performing the RMSE operation.
| bool ddLinearSolve | ( | Matrix * | A, |
| Matrix * | M, | ||
| Vector * | X, | ||
| Vector * | B, | ||
| double | tol, | ||
| double | SOR_factor, | ||
| ConvergenceData * | convergence_data, | ||
| DomainCommunicator * | comm | ||
| ) |
Solves a linear system using the linear solver above, but makes the loss and streaming matrix diagonally dominant first, to increase likelihood of convergence.
This function takes in a loss + streaming Matrix (A), a fission gain Matrix (M), a flux Vector (X), a source Vector (B), a source convergence tolerance (tol) and a successive over-relaxation factor (SOR_factor) and makes (A) diagonally dominant before calling the linear solve routine to compute the solution to the linear system. The input X Vector is modified in place to be the solution vector. The transformation to make (A) diagonally dominant is compensated by another matrix multiplication.
| A | the loss + streaming Matrix object |
| M | the fission gain Matrix object |
| X | the flux Vector object |
| B | the source Vector object |
| tol | the power method and linear solve source convergence threshold |
| SOR_factor | the successive over-relaxation factor |
| convergence_data | a summary of the convergence performance |
| comm | a communicator for exchanging data through MPI |
| double eigenvalueSolve | ( | Matrix * | A, |
| Matrix * | M, | ||
| Vector * | X, | ||
| double | k_eff, | ||
| double | tol, | ||
| double | SOR_factor, | ||
| ConvergenceData * | convergence_data, | ||
| DomainCommunicator * | comm | ||
| ) |
Get coupling fluxes and other information from neighbors.
The information are transfered by reference.
Get coupling fluxes and other information from neighbors.
This function takes in a loss + streaming Matrix (A), a fission gain Matrix (M), a flux Vector (X), a tolerance used for both the power method and linear solve convergence (tol), and a successive over-relaxation factor (SOR_factor) and computes the dominant eigenvalue and eigenvector using the Power method. The eigenvalue is returned and the input X Vector is modified in place to be the corresponding eigenvector.
| A | the loss + streaming Matrix object |
| M | the fission gain Matrix object |
| X | the flux Vector object |
| k_eff | initial k_effective |
| tol | the power method and linear solve source convergence threshold |
| SOR_factor | the successive over-relaxation factor |
| convergence_data | a summary of how to solver converged |
| comm | an MPI communicator for the domain-decomposed solver |
| bool linearSolve | ( | Matrix * | A, |
| Matrix * | M, | ||
| Vector * | X, | ||
| Vector * | B, | ||
| double | tol, | ||
| double | SOR_factor, | ||
| ConvergenceData * | convergence_data, | ||
| DomainCommunicator * | comm | ||
| ) |
Solves a linear system using Red-Black Gauss Seidel with successive over-relaxation.
This function takes in a loss + streaming Matrix (A), a fission gain Matrix (M), a flux Vector (X), a source Vector (B), a source convergence tolerance (tol) and a successive over-relaxation factor (SOR_factor) and computes the solution to the linear system. The input X Vector is modified in place to be the solution vector.
| A | the loss + streaming Matrix object |
| M | the fission gain Matrix object |
| X | the flux Vector object |
| B | the source Vector object |
| tol | the power method and linear solve source convergence threshold |
| SOR_factor | the successive over-relaxation factor |
| convergence_data | a summary of how to solver converged |
| comm | an MPI communicator for the domain-decomposed solver |
|
inline |
Transpose a 2D matrix.
| matrix | array to transpose |
| dim1 | first dimension length |
| dim2 | second dimension length |