Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::MultiRegions::GlobalLinSysDirect Class Reference

A global linear system. More...

#include <GlobalLinSysDirect.h>

Inheritance diagram for Nektar::MultiRegions::GlobalLinSysDirect:
Inheritance graph
[legend]
Collaboration diagram for Nektar::MultiRegions::GlobalLinSysDirect:
Collaboration graph
[legend]

Public Member Functions

 GlobalLinSysDirect (const GlobalLinSysKey &pKey, const boost::weak_ptr< ExpList > &pExp, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
 Constructor for full direct matrix solve. More...
 
virtual ~GlobalLinSysDirect ()
 
- Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSys
 GlobalLinSys (const GlobalLinSysKey &pKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
 Constructor for full direct matrix solve. More...
 
virtual ~GlobalLinSys ()
 
const GlobalLinSysKeyGetKey (void) const
 Returns the key associated with the system. More...
 
const boost::weak_ptr< ExpList > & GetLocMat (void) const
 
void InitObject ()
 
void Initialise (const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
 
void Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
 Solve the linear system for given input and output vectors using a specified local to global map. More...
 
boost::shared_ptr< GlobalLinSysGetSharedThisPtr ()
 Returns a shared pointer to the current object. More...
 
int GetNumBlocks ()
 
DNekScalMatSharedPtr GetBlock (unsigned int n)
 
DNekScalBlkMatSharedPtr GetStaticCondBlock (unsigned int n)
 
void DropStaticCondBlock (unsigned int n)
 
void SolveLinearSystem (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir=0)
 Solve the linear system for given input and output vectors. More...
 

Protected Member Functions

virtual void v_SolveLinearSystem (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir=0)
 Solve the linear system for given input and output vectors. More...
 
- Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSys
virtual int v_GetNumBlocks ()
 Get the number of blocks in this system. More...
 
virtual DNekScalMatSharedPtr v_GetBlock (unsigned int n)
 Retrieves the block matrix from n-th expansion using the matrix key provided by the m_linSysKey. More...
 
virtual DNekScalBlkMatSharedPtr v_GetStaticCondBlock (unsigned int n)
 Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided by the m_linSysKey. More...
 
virtual void v_DropStaticCondBlock (unsigned int n)
 Releases the static condensation block matrices from NekManager of n-th expansion using the matrix key provided by the m_linSysKey. More...
 
PreconditionerSharedPtr CreatePrecon (AssemblyMapSharedPtr asmMap)
 Create a preconditioner object from the parameters defined in the supplied assembly map. More...
 

Protected Attributes

DNekLinSysSharedPtr m_linSys
 Basic linear system object. More...
 
- Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSys
const GlobalLinSysKey m_linSysKey
 Key associated with this linear system. More...
 
const boost::weak_ptr< ExpListm_expList
 Local Matrix System. More...
 
const map< int,
RobinBCInfoSharedPtr
m_robinBCInfo
 Robin boundary info. More...
 

Detailed Description

A global linear system.

Solves a linear system using direct methods.

Consider a linear system $\boldsymbol{M\hat{u}}_g=\boldsymbol{\hat{f}}$ to be solved, where $\boldsymbol{M}$ is a matrix of type specified by mkey. This function assembles the global system matrix $\boldsymbol{M}$ out of the elemental submatrices $\boldsymbol{M}^e$. This is equivalent to:

\[ \boldsymbol{M}=\boldsymbol{\mathcal{A}}^T \underline{\boldsymbol{M}}^e\boldsymbol{\mathcal{A}}.\]

where the matrix $\boldsymbol{\mathcal{A}}$ is a sparse permutation matrix of size $N_{\mathrm{eof}}\times N_{\mathrm{dof}}$. However, due to the size and sparsity of the matrix $\boldsymbol{\mathcal{A}}$, it is more efficient to assemble the global matrix using the mapping array map $[e][i]$ contained in the input argument locToGloMap. The global assembly is then evaluated as:

\[ \boldsymbol{M}\left[\mathrm{\texttt{map}}[e][i]\right] \left[\mathrm{\texttt{map}}[e][j]\right] =\mathrm{\texttt{sign}}[e][i]\cdot \mathrm{\texttt{sign}}[e][j] \cdot\boldsymbol{M}^e[i][j]\]

where the values sign $[e][i]$ ensure the correct connectivity.

Solves a linear system using single- or multi-level static condensation.

Definition at line 49 of file GlobalLinSysDirect.h.

Constructor & Destructor Documentation

Nektar::MultiRegions::GlobalLinSysDirect::GlobalLinSysDirect ( const GlobalLinSysKey pKey,
const boost::weak_ptr< ExpList > &  pExp,
const boost::shared_ptr< AssemblyMap > &  pLocToGloMap 
)

Constructor for full direct matrix solve.

Definition at line 54 of file GlobalLinSysDirect.cpp.

59  : GlobalLinSys(pKey, pExp, pLocToGloMap)
60  {
61  }
GlobalLinSys(const GlobalLinSysKey &pKey, const boost::weak_ptr< ExpList > &pExpList, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
Constructor for full direct matrix solve.
Nektar::MultiRegions::GlobalLinSysDirect::~GlobalLinSysDirect ( )
virtual

Definition at line 63 of file GlobalLinSysDirect.cpp.

64  {
65  }

Member Function Documentation

void Nektar::MultiRegions::GlobalLinSysDirect::v_SolveLinearSystem ( const int  pNumRows,
const Array< OneD, const NekDouble > &  pInput,
Array< OneD, NekDouble > &  pOutput,
const AssemblyMapSharedPtr locToGloMap,
const int  pNumDir = 0 
)
protectedvirtual

Solve the linear system for given input and output vectors.

Implements Nektar::MultiRegions::GlobalLinSys.

Definition at line 68 of file GlobalLinSysDirect.cpp.

References Nektar::eWrapper, and m_linSys.

74  {
75  const int nHomDofs = pNumRows - pNumDir;
76 
77  DNekVec Vin (nHomDofs, pInput + pNumDir);
78  DNekVec Vout(nHomDofs, pOutput + pNumDir, eWrapper);
79 
80  m_linSys->Solve(Vin, Vout);
81  }
DNekLinSysSharedPtr m_linSys
Basic linear system object.

Member Data Documentation

DNekLinSysSharedPtr Nektar::MultiRegions::GlobalLinSysDirect::m_linSys
protected