Package pulse.problem.schemes
Class BlockMatrixAlgorithm
- java.lang.Object
-
- pulse.problem.schemes.TridiagonalMatrixAlgorithm
-
- pulse.problem.schemes.BlockMatrixAlgorithm
-
- All Implemented Interfaces:
Serializable
public class BlockMatrixAlgorithm extends TridiagonalMatrixAlgorithm
A modification of the algorithm for solving a system of linear equations, where the first and last equation contains references to the last and first elements of the solution, respectively. The corresponding matrix is composed of an inner tridiagonal block and a border formed by an extra row and column. This block system is solved using the Sherman-Morrison-Woodbury identity and the Thomas algorithm for the main block.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BlockMatrixAlgorithm(Grid grid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevaluateBeta(double[] U)voidevaluateBeta(double[] U, int start, int endExclusive)Calculates thebetacoefficients as part of the tridiagonal matrix algorithm.double[]getGamma()double[]getP()double[]getQ()voidsetGamma(int i, double g)voidsweep(double[] V)Calculates the solutionVusing the tridiagonal matrix algorithm.-
Methods inherited from class pulse.problem.schemes.TridiagonalMatrixAlgorithm
beta, evaluateAlpha, getAlpha, getBeta, getCoefA, getCoefB, getCoefC, getGridPoints, getGridStep, getTimeStep, phi, setAlpha, setBeta, setCoefA, setCoefB, setCoefC
-
-
-
-
Constructor Detail
-
BlockMatrixAlgorithm
public BlockMatrixAlgorithm(Grid grid)
-
-
Method Detail
-
sweep
public void sweep(double[] V)
Description copied from class:TridiagonalMatrixAlgorithmCalculates the solutionVusing the tridiagonal matrix algorithm. This performs a backwards sweep fromN - 1to0whereNis the grid density value. The coefficientsalphaandbetashould have been precalculated- Overrides:
sweepin classTridiagonalMatrixAlgorithm- Parameters:
V- the array containing theNth value previously calculated from the respective boundary condition
-
evaluateBeta
public void evaluateBeta(double[] U)
- Overrides:
evaluateBetain classTridiagonalMatrixAlgorithm
-
evaluateBeta
public void evaluateBeta(double[] U, int start, int endExclusive)Description copied from class:TridiagonalMatrixAlgorithmCalculates thebetacoefficients as part of the tridiagonal matrix algorithm.- Overrides:
evaluateBetain classTridiagonalMatrixAlgorithm
-
getP
public double[] getP()
-
getQ
public double[] getQ()
-
setGamma
public void setGamma(int i, double g)
-
getGamma
public double[] getGamma()
-
-