Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::MultiRegions::GlobalLinSysXxt Class Reference

#include <GlobalLinSysXxt.h>

Inheritance diagram for Nektar::MultiRegions::GlobalLinSysXxt:
[legend]

Public Member Functions

 GlobalLinSysXxt (const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExp, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
 Constructor for full direct matrix solve. More...
 
virtual ~GlobalLinSysXxt ()
 
- Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSys
 GlobalLinSys (const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::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 std::weak_ptr< ExpList > & GetLocMat (void) const
 
void InitObject ()
 
void Initialise (const std::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...
 
std::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...
 
void GlobalToLocalNoSign (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &local)
 
void LocalToGlobalNoSign (const Array< OneD, const NekDouble > &local, Array< OneD, NekDouble > &global)
 
- 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

struct Xxt::crs_datam_crsData
 
Array< OneD, unsigned int > m_Ai
 
Array< OneD, unsigned int > m_Aj
 
Array< OneD, double > m_Ar
 
Array< OneD, NekDoublem_locToGloSignMult
 
Array< OneD, int > m_map
 
- Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSys
const GlobalLinSysKey m_linSysKey
 Key associated with this linear system. More...
 
const std::weak_ptr< ExpListm_expList
 Local Matrix System. More...
 
const std::map< int, RobinBCInfoSharedPtrm_robinBCInfo
 Robin boundary info. More...
 
bool m_verbose
 

Detailed Description

Solves a linear system using direct methods.

Definition at line 29 of file GlobalLinSysXxt.h.

Constructor & Destructor Documentation

◆ GlobalLinSysXxt()

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

Constructor for full direct matrix solve.

Definition at line 51 of file GlobalLinSysXxt.cpp.

References m_crsData.

56  : GlobalLinSys(pKey, pExp, pLocToGloMap)
57  {
58  m_crsData = 0;
59  }
GlobalLinSys(const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Constructor for full direct matrix solve.

◆ ~GlobalLinSysXxt()

Nektar::MultiRegions::GlobalLinSysXxt::~GlobalLinSysXxt ( )
virtual

Definition at line 61 of file GlobalLinSysXxt.cpp.

References Xxt::Finalise(), and m_crsData.

62  {
64  }
static void Finalise(crs_data *pCrs)
Deallocates the crs mapping data.
Definition: Xxt.hpp:204

Member Function Documentation

◆ GlobalToLocalNoSign()

void Nektar::MultiRegions::GlobalLinSysXxt::GlobalToLocalNoSign ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  local 
)
protected

Definition at line 84 of file GlobalLinSysXxt.cpp.

References Vmath::Gathr(), m_locToGloSignMult, and m_map.

Referenced by v_SolveLinearSystem().

86  {
87  Vmath::Gathr(m_map.num_elements(), m_locToGloSignMult.get(), global.get(), m_map.get(), local.get());
88  }
void Gathr(int n, const T *x, const int *y, T *z)
Gather vector z[i] = x[y[i]].
Definition: Vmath.cpp:647
Array< OneD, NekDouble > m_locToGloSignMult

◆ LocalToGlobalNoSign()

void Nektar::MultiRegions::GlobalLinSysXxt::LocalToGlobalNoSign ( const Array< OneD, const NekDouble > &  local,
Array< OneD, NekDouble > &  global 
)
protected

Definition at line 90 of file GlobalLinSysXxt.cpp.

References m_map, and Vmath::Scatr().

Referenced by v_SolveLinearSystem().

92  {
93  Vmath::Scatr(m_map.num_elements(), local.get(), m_map.get(), global.get());
94  }
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
Definition: Vmath.cpp:676

◆ v_SolveLinearSystem()

void Nektar::MultiRegions::GlobalLinSysXxt::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 67 of file GlobalLinSysXxt.cpp.

References GlobalToLocalNoSign(), LocalToGlobalNoSign(), m_crsData, m_map, and Xxt::Solve().

73  {
74  boost::ignore_unused(pNumRows, pLocToGloMap, pNumDir);
75 
76  int nLocal = m_map.num_elements();
77  Array<OneD, NekDouble> vLocalIn(nLocal, 0.0);
78  Array<OneD, NekDouble> vLocalOut(nLocal, 0.0);
79  GlobalToLocalNoSign(pInput, vLocalIn);
80  Xxt::Solve(vLocalOut, m_crsData, vLocalIn);
81  LocalToGlobalNoSign(vLocalOut, pOutput);
82  }
void LocalToGlobalNoSign(const Array< OneD, const NekDouble > &local, Array< OneD, NekDouble > &global)
static void Solve(Nektar::Array< OneD, NekDouble > pX, struct crs_data *pCrs, Nektar::Array< OneD, NekDouble > pB)
Solve the matrix system for a given input vector b.
Definition: Xxt.hpp:188
void GlobalToLocalNoSign(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &local)

Member Data Documentation

◆ m_Ai

Array<OneD, unsigned int> Nektar::MultiRegions::GlobalLinSysXxt::m_Ai
protected

◆ m_Aj

Array<OneD, unsigned int> Nektar::MultiRegions::GlobalLinSysXxt::m_Aj
protected

◆ m_Ar

Array<OneD, double> Nektar::MultiRegions::GlobalLinSysXxt::m_Ar
protected

◆ m_crsData

struct Xxt::crs_data* Nektar::MultiRegions::GlobalLinSysXxt::m_crsData
protected

◆ m_locToGloSignMult

Array<OneD, NekDouble> Nektar::MultiRegions::GlobalLinSysXxt::m_locToGloSignMult
protected

◆ m_map

Array<OneD, int> Nektar::MultiRegions::GlobalLinSysXxt::m_map
protected