File cyclic_reduction.hxx#
-
template<class T>
class CyclicReduce# Public Functions
-
CyclicReduce() = default#
-
inline CyclicReduce(MPI_Comm c, int size)#
-
inline void setup(MPI_Comm c, int size)#
Set parameters
- Parameters:
c – [in] The communicator of all processors involved in the solve
size – [in] The number of rows on this processor
-
~CyclicReduce() = default#
-
inline void setPeriodic(bool p = true)#
Specify that the tridiagonal system is periodic By default not periodic
-
inline void setCoefs(const Matrix<T> &a, const Matrix<T> &b, const Matrix<T> &c)#
Set the entries in the matrix to be inverted
- Parameters:
a – [in] Left diagonal. Should have size [nsys][N] where N is set in the constructor or setup
b – [in] Diagonal values. Should have size [nsys][N]
c – [in] Right diagonal. Should have size [nsys][N]
Private Functions
-
inline void allocMemory(int np, int nsys, int n)#
Allocate memory arrays
- Parameters:
np – [in] Number of processors
nsys – [in] Number of independent systems to solve
n – [in] Size of each system of equations
-
inline void reduce(int ns, int nloc, Matrix<T> &co, Matrix<T> &ifc)#
Calculate interface equations
This reduces ns separate systems of equations, each consisting of nloc rows on this processor, to two interface rows for each system, which are stored in ifc.
(a1 b1 c1 ) ( a2 b2 c2 ) (A1 B1 C1 ) ( a3 b3 c3 ) => ( A2 B2 C2) ( … ) ( an bn cn)
Private Members
-
MPI_Comm comm#
Communicator.
-
int nprocs = {0}#
-
int myproc = {-1}#
Number of processors and ID of my processor.
-
int N = {0}#
Total size of the problem.
-
int Nsys = {0}#
Number of independent systems to solve.
-
int myns#
Number of systems for interface solve on this processor.
-
int sys0#
Starting system index for interface solve.
-
bool periodic = {false}#
Is the domain periodic?
-
CyclicReduce() = default#