Memosa-FVM  0.2
OneDConduction.h File Reference
#include "Array.h"
Include dependency graph for OneDConduction.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OneDConduction< T >
 

Functions

template<class T >
void TDMA (Array< T > &ap, Array< T > &ae, Array< T > &aw, Array< T > &b, Array< T > &x)
 

Function Documentation

template<class T >
void TDMA ( Array< T > &  ap,
Array< T > &  ae,
Array< T > &  aw,
Array< T > &  b,
Array< T > &  x 
)

Definition at line 11 of file OneDConduction.h.

References Array< T >::getLength().

Referenced by OneDConduction< T >::solve().

12 {
13  const int n=ap.getLength();
14  for(int i=1; i<n; i++)
15  {
16  const T m(aw[i]/ap[i-1]);
17  ap[i] -= m*ae[i-1];
18  b[i] -= m*b[i-1];
19  }
20  x[n-1] = -b[n-1]/ap[n-1];
21  for(int i=n-2; i>=0; i--)
22  x[i] = (b[i] - ae[i]*x[i+1])/ap[i];
23 }
int getLength() const
Definition: Array.h:87