Nektar++
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Nektar::MultiRegions::GlobalLinSysIterativeStaticCond Class Reference

A global linear system. More...

#include <GlobalLinSysIterativeStaticCond.h>

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

Public Types

typedef NekSparseDiagBlkMatrix< StorageSmvBsr< NekDouble > > DNekSmvBsrDiagBlkMat
 
typedef std::shared_ptr< DNekSmvBsrDiagBlkMatDNekSmvBsrDiagBlkMatSharedPtr
 

Public Member Functions

 GlobalLinSysIterativeStaticCond (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
 Constructor for full direct matrix solve. More...
 
 GlobalLinSysIterativeStaticCond (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const std::shared_ptr< AssemblyMap > &locToGloMap, const PreconditionerSharedPtr pPrecon)
 Constructor for full direct matrix solve. More...
 
 ~GlobalLinSysIterativeStaticCond () override
 
- Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSysIterative
 GlobalLinSysIterative (const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
 Constructor for full direct matrix solve. More...
 
 ~GlobalLinSysIterative () override
 
void DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
- 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)
 
void DropBlock (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...
 
- Public Member Functions inherited from Nektar::MultiRegions::GlobalLinSysStaticCond
 GlobalLinSysStaticCond (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
 Constructor for full direct matrix solve. More...
 
 ~GlobalLinSysStaticCond () override
 

Static Public Member Functions

static GlobalLinSysSharedPtr create (const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 
static std::string className2
 

Protected Member Functions

void v_InitObject () override
 
void v_AssembleSchurComplement (const std::shared_ptr< AssemblyMap > locToGloMap) override
 Assemble the Schur complement matrix. More...
 
void v_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
 Perform a Shur-complement matrix multiply operation. More...
 
void v_UniqueMap () override
 
DNekScalBlkMatSharedPtr v_GetStaticCondBlock (unsigned int n) override
 Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided by the m_linSysKey. More...
 
GlobalLinSysStaticCondSharedPtr v_Recurse (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const std::shared_ptr< AssemblyMap > &locToGloMap) override
 
void v_PreSolve (int scLevel, Array< OneD, NekDouble > &F_bnd) override
 
void v_BasisFwdTransform (Array< OneD, NekDouble > &pInOut) override
 
void v_CoeffsBwdTransform (Array< OneD, NekDouble > &pInOut) override
 
void v_CoeffsFwdTransform (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
 
- Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSysIterative
void DoProjection (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int pNumDir, const NekDouble tol, const bool isAconjugate)
 projection technique More...
 
void Set_Rhs_Magnitude (const NekVector< NekDouble > &pIn)
 
virtual void v_UniqueMap ()=0
 
virtual void v_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)=0
 
- Protected Member Functions inherited from Nektar::MultiRegions::GlobalLinSys
virtual void v_Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)=0
 Solve a linear system based on mapping. More...
 
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 a basic matrix system. More...
 
virtual void v_InitObject ()
 
virtual void v_Initialise (const std::shared_ptr< AssemblyMap > &pLocToGloMap)
 
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 void v_DropBlock (unsigned int n)
 Releases the local block matrix from NekManager of 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 Member Functions inherited from Nektar::MultiRegions::GlobalLinSysStaticCond
virtual void v_PreSolve (int scLevel, Array< OneD, NekDouble > &F_bnd)
 
virtual void v_BasisFwdTransform (Array< OneD, NekDouble > &pInOut)
 
virtual void v_CoeffsBwdTransform (Array< OneD, NekDouble > &pInOut)
 
virtual void v_CoeffsFwdTransform (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
virtual void v_AssembleSchurComplement (std::shared_ptr< AssemblyMap > pLoctoGloMap)
 
int v_GetNumBlocks () override
 Get the number of blocks in this system. More...
 
virtual GlobalLinSysStaticCondSharedPtr v_Recurse (const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const std::shared_ptr< AssemblyMap > &locToGloMap)=0
 
void v_Solve (const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray) override
 Solve the linear system for given input and output vectors using a specified local to global map. More...
 
void v_InitObject () override
 
void v_Initialise (const std::shared_ptr< AssemblyMap > &locToGloMap) override
 Initialise this object. More...
 
void SetupTopLevel (const std::shared_ptr< AssemblyMap > &locToGloMap)
 Set up the storage for the Schur complement or the top level of the multi-level Schur complement. More...
 
void ConstructNextLevelCondensedSystem (const std::shared_ptr< AssemblyMap > &locToGloMap)
 

Private Member Functions

void PrepareLocalSchurComplement ()
 Prepares local representation of Schur complement stored as a sparse block-diagonal matrix. More...
 
void v_SolveLinearSystem (const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) override
 Solve the matrix system. More...
 

Private Attributes

std::vector< double > m_storage
 Dense storage for block Schur complement matrix. More...
 
std::vector< const double * > m_denseBlocks
 Vector of pointers to local matrix data. More...
 
Array< OneD, unsigned int > m_rows
 Ranks of local matrices. More...
 
Array< OneD, NekDoublem_scale
 Scaling factors for local matrices. More...
 
DNekSmvBsrDiagBlkMatSharedPtr m_sparseSchurCompl
 Sparse representation of Schur complement matrix at this level. More...
 

Static Private Attributes

static std::string storagedef
 Utility strings. More...
 
static std::string storagelookupIds []
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative
Array< OneD, int > m_map
 Global to universal unique map. More...
 
NekDouble m_tolerance
 Tolerance of iterative solver. More...
 
NekDouble m_rhs_magnitude
 dot product of rhs to normalise stopping criterion More...
 
NekDouble m_rhs_mag_sm
 cnt to how many times rhs_magnitude is called More...
 
PreconditionerSharedPtr m_precon
 
std::string m_precontype
 
int m_totalIterations
 
bool m_useProjection
 Whether to apply projection technique. More...
 
bool m_root
 Root if parallel. More...
 
std::string m_linSysIterSolver
 Iterative solver: Conjugate Gradient, GMRES. More...
 
std::vector< Array< OneD, NekDouble > > m_prevLinSol
 Storage for solutions to previous linear problems. More...
 
std::vector< Array< OneD, NekDouble > > m_prevBasis
 
DNekMatSharedPtr m_coeffMatrix
 
Array< OneD, NekDoublem_coeffMatrixFactor
 
Array< OneD, int > m_ipivot
 
int m_numSuccessiveRHS
 
bool m_isAconjugate
 
std::string m_matrixType
 
bool m_isNonSymmetricLinSys
 
int m_numPrevSols
 
bool m_isAbsoluteTolerance
 
LibUtilities::NekSysOperators m_NekSysOp
 
LibUtilities::NekLinSysIterSharedPtr m_linsol
 
- 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
 
- Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysStaticCond
GlobalLinSysStaticCondSharedPtr m_recursiveSchurCompl
 Schur complement for Direct Static Condensation. More...
 
DNekScalBlkMatSharedPtr m_schurCompl
 Block Schur complement matrix. More...
 
DNekScalBlkMatSharedPtr m_BinvD
 Block \( BD^{-1} \) matrix. More...
 
DNekScalBlkMatSharedPtr m_C
 Block \( C \) matrix. More...
 
DNekScalBlkMatSharedPtr m_invD
 Block \( D^{-1} \) matrix. More...
 
std::weak_ptr< AssemblyMapm_locToGloMap
 Local to global map. More...
 
Array< OneD, NekDoublem_wsp
 Workspace array for matrix multiplication. More...
 
Array< OneD, const NekDoublem_sign
 
- Static Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative
static std::string IteratSolverlookupIds []
 
static std::string IteratSolverdef
 

Detailed Description

A global linear system.

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

Definition at line 63 of file GlobalLinSysIterativeStaticCond.h.

Member Typedef Documentation

◆ DNekSmvBsrDiagBlkMat

Definition at line 68 of file GlobalLinSysIterativeStaticCond.h.

◆ DNekSmvBsrDiagBlkMatSharedPtr

Definition at line 69 of file GlobalLinSysIterativeStaticCond.h.

Constructor & Destructor Documentation

◆ GlobalLinSysIterativeStaticCond() [1/2]

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

Constructor for full direct matrix solve.

For a matrix system of the form

\[ \left[ \begin{array}{cc} \boldsymbol{A} & \boldsymbol{B}\\ \boldsymbol{C} & \boldsymbol{D} \end{array} \right] \left[ \begin{array}{c} \boldsymbol{x_1}\\ \boldsymbol{x_2} \end{array}\right] = \left[ \begin{array}{c} \boldsymbol{y_1}\\ \boldsymbol{y_2} \end{array}\right], \]

where \(\boldsymbol{D}\) and \((\boldsymbol{A-BD^{-1}C})\) are invertible, store and assemble a static condensation system, according to a given local to global mapping. #m_linSys is constructed by AssembleSchurComplement().

Parameters
mKeyAssociated matrix key.
pLocMatSysLocalMatrixSystem
locToGloMapLocal to global mapping.

Definition at line 99 of file GlobalLinSysIterativeStaticCond.cpp.

102 : GlobalLinSys(pKey, pExpList, pLocToGloMap),
103 GlobalLinSysIterative(pKey, pExpList, pLocToGloMap),
104 GlobalLinSysStaticCond(pKey, pExpList, pLocToGloMap)
105{
106 ASSERTL1(
107 (pKey.GetGlobalSysSolnType() == eIterativeStaticCond) ||
108 (pKey.GetGlobalSysSolnType() == eIterativeMultiLevelStaticCond),
109 "This constructor is only valid when using static "
110 "condensation");
111 ASSERTL1(pKey.GetGlobalSysSolnType() ==
112 pLocToGloMap->GetGlobalSysSolnType(),
113 "The local to global map is not set up for the requested "
114 "solution type");
115}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
GlobalLinSys(const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Constructor for full direct matrix solve.
GlobalLinSysIterative(const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Constructor for full direct matrix solve.
GlobalLinSysStaticCond(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.

References ASSERTL1, Nektar::MultiRegions::eIterativeMultiLevelStaticCond, Nektar::MultiRegions::eIterativeStaticCond, and Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType().

◆ GlobalLinSysIterativeStaticCond() [2/2]

Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::GlobalLinSysIterativeStaticCond ( const GlobalLinSysKey mkey,
const std::weak_ptr< ExpList > &  pExpList,
const DNekScalBlkMatSharedPtr  pSchurCompl,
const DNekScalBlkMatSharedPtr  pBinvD,
const DNekScalBlkMatSharedPtr  pC,
const DNekScalBlkMatSharedPtr  pInvD,
const std::shared_ptr< AssemblyMap > &  locToGloMap,
const PreconditionerSharedPtr  pPrecon 
)

Constructor for full direct matrix solve.

Definition at line 120 of file GlobalLinSysIterativeStaticCond.cpp.

127 : GlobalLinSys(pKey, pExpList, pLocToGloMap),
128 GlobalLinSysIterative(pKey, pExpList, pLocToGloMap),
129 GlobalLinSysStaticCond(pKey, pExpList, pLocToGloMap)
130{
131 m_schurCompl = pSchurCompl;
132 m_BinvD = pBinvD;
133 m_C = pC;
134 m_invD = pInvD;
135 m_precon = pPrecon;
136}
DNekScalBlkMatSharedPtr m_schurCompl
Block Schur complement matrix.
DNekScalBlkMatSharedPtr m_BinvD
Block matrix.
DNekScalBlkMatSharedPtr m_C
Block matrix.
DNekScalBlkMatSharedPtr m_invD
Block matrix.

References Nektar::MultiRegions::GlobalLinSysStaticCond::m_BinvD, Nektar::MultiRegions::GlobalLinSysStaticCond::m_C, Nektar::MultiRegions::GlobalLinSysStaticCond::m_invD, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl.

◆ ~GlobalLinSysIterativeStaticCond()

Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::~GlobalLinSysIterativeStaticCond ( )
override

Definition at line 174 of file GlobalLinSysIterativeStaticCond.cpp.

175{
176}

Member Function Documentation

◆ create()

static GlobalLinSysSharedPtr Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::create ( const GlobalLinSysKey pLinSysKey,
const std::weak_ptr< ExpList > &  pExpList,
const std::shared_ptr< AssemblyMap > &  pLocToGloMap 
)
inlinestatic

Creates an instance of this class.

Definition at line 72 of file GlobalLinSysIterativeStaticCond.h.

76 {
79 pLinSysKey, pExpList, pLocToGloMap);
80 p->InitObject();
81 return p;
82 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:51

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

◆ PrepareLocalSchurComplement()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::PrepareLocalSchurComplement ( )
private

Prepares local representation of Schur complement stored as a sparse block-diagonal matrix.

Populates sparse block-diagonal schur complement matrix from the block matrices stored in #m_blkMatrices.

Definition at line 220 of file GlobalLinSysIterativeStaticCond.cpp.

221{
222 LocalMatrixStorageStrategy storageStrategy =
223 m_expList.lock()
224 ->GetSession()
225 ->GetSolverInfoAsEnum<LocalMatrixStorageStrategy>(
226 "LocalMatrixStorageStrategy");
227
228 switch (storageStrategy)
229 {
232 {
233 size_t storageSize = 0;
234 int nBlk = m_schurCompl->GetNumberOfBlockRows();
235
236 m_scale = Array<OneD, NekDouble>(nBlk, 1.0);
237 m_rows = Array<OneD, unsigned int>(nBlk, 0U);
238
239 // Determine storage requirements for dense blocks.
240 for (int i = 0; i < nBlk; ++i)
241 {
242 m_rows[i] = m_schurCompl->GetBlock(i, i)->GetRows();
243 m_scale[i] = m_schurCompl->GetBlock(i, i)->Scale();
244 storageSize += m_rows[i] * m_rows[i];
245 }
246
247 // Assemble dense storage blocks.
248 DNekScalMatSharedPtr loc_mat;
249 m_denseBlocks.resize(nBlk);
250 double *ptr = nullptr;
251
252 if (MultiRegions::eContiguous == storageStrategy)
253 {
254 m_storage.resize(storageSize);
255 ptr = &m_storage[0];
256 }
257
258 for (unsigned int n = 0; n < nBlk; ++n)
259 {
260 loc_mat = m_schurCompl->GetBlock(n, n);
261
262 if (MultiRegions::eContiguous == storageStrategy)
263 {
264 int loc_lda = loc_mat->GetRows();
265 int blockSize = loc_lda * loc_lda;
266 m_denseBlocks[n] = ptr;
267 for (int i = 0; i < loc_lda; ++i)
268 {
269 for (int j = 0; j < loc_lda; ++j)
270 {
271 ptr[j * loc_lda + i] = (*loc_mat)(i, j);
272 }
273 }
274 ptr += blockSize;
276 }
277 else
278 {
279 m_denseBlocks[n] = loc_mat->GetRawPtr();
280 }
281 }
282 break;
283 }
285 {
286 DNekScalMatSharedPtr loc_mat;
287 int loc_lda;
288 int blockSize = 0;
289
290 // First run through to split the set of local matrices into
291 // partitions of fixed block size, and count number of local
292 // matrices that belong to each partition.
293 std::vector<std::pair<int, int>> partitions;
294 for (int n = 0; n < m_schurCompl->GetNumberOfBlockRows(); ++n)
295 {
296 loc_mat = m_schurCompl->GetBlock(n, n);
297 loc_lda = loc_mat->GetRows();
298
299 ASSERTL1(loc_lda >= 0,
300 std::to_string(n) +
301 "-th "
302 "matrix block in Schur complement has "
303 "rank 0!");
304
305 if (blockSize == loc_lda)
306 {
307 partitions[partitions.size() - 1].first++;
308 }
309 else
310 {
311 blockSize = loc_lda;
312 partitions.push_back(make_pair(1, loc_lda));
313 }
314 }
315
316 MatrixStorage matStorage = eFULL;
317
318 // Create a vector of sparse storage holders
320 partitions.size());
321
322 for (int part = 0, n = 0; part < partitions.size(); ++part)
323 {
324 BCOMatType partMat;
325
326 for (int k = 0; k < partitions[part].first; ++k, ++n)
327 {
328 loc_mat = m_schurCompl->GetBlock(n, n);
329 loc_lda = loc_mat->GetRows();
330
331 ASSERTL1(loc_lda == partitions[part].second,
332 std::to_string(n) +
333 "-th"
334 " matrix block in Schur complement has "
335 "unexpected rank");
336
337 NekDouble scale = loc_mat->Scale();
338 if (fabs(scale - 1.0) > NekConstants::kNekZeroTol)
339 {
340 Array<OneD, NekDouble> matarray(loc_lda * loc_lda);
341 Vmath::Smul(loc_lda * loc_lda, scale,
342 loc_mat->GetRawPtr(), 1, &matarray[0], 1);
343 partMat[make_pair(k, k)] = BCOEntryType(matarray);
344 }
345 else // scale factor is 1.0
346 {
347 partMat[make_pair(k, k)] = BCOEntryType(
348 loc_lda * loc_lda, loc_mat->GetRawPtr());
349 }
350
352 }
353
354 sparseStorage[part] =
357 partitions[part].first, partitions[part].first,
358 partitions[part].second, partMat, matStorage);
359 }
360
361 // Create block diagonal matrix
364 sparseStorage);
365
366 break;
367 }
368 default:
369 ErrorUtil::NekError("Solver info property \
370 LocalMatrixStorageStrategy takes values \
371 Contiguous, Non-contiguous and Sparse");
372 }
373}
Nektar::ErrorUtil::NekError NekError
const std::weak_ptr< ExpList > m_expList
Local Matrix System.
Definition: GlobalLinSys.h:122
virtual void v_DropStaticCondBlock(unsigned int n)
Releases the static condensation block matrices from NekManager of n-th expansion using the matrix ke...
std::vector< const double * > m_denseBlocks
Vector of pointers to local matrix data.
std::vector< double > m_storage
Dense storage for block Schur complement matrix.
Array< OneD, unsigned int > m_rows
Ranks of local matrices.
Array< OneD, NekDouble > m_scale
Scaling factors for local matrices.
DNekSmvBsrDiagBlkMatSharedPtr m_sparseSchurCompl
Sparse representation of Schur complement matrix at this level.
Array< OneD, SparseStorageSharedPtr > SparseStorageSharedPtrVector
static const NekDouble kNekZeroTol
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::map< CoordType, BCOEntryType > BCOMatType
Array< OneD, NekDouble > BCOEntryType
double NekDouble
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL1, Nektar::MultiRegions::eContiguous, Nektar::eFULL, Nektar::MultiRegions::eNonContiguous, Nektar::MultiRegions::eSparse, Nektar::NekConstants::kNekZeroTol, m_denseBlocks, Nektar::MultiRegions::GlobalLinSys::m_expList, m_rows, m_scale, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, m_sparseSchurCompl, m_storage, Vmath::Smul(), and Nektar::MultiRegions::GlobalLinSys::v_DropStaticCondBlock().

Referenced by v_AssembleSchurComplement().

◆ v_AssembleSchurComplement()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_AssembleSchurComplement ( const std::shared_ptr< AssemblyMap locToGloMap)
overrideprotectedvirtual

Assemble the Schur complement matrix.

Assemble the schur complement matrix from the block matrices stored in #m_blkMatrices and the given local to global mapping information.

Parameters
locToGloMapLocal to global mapping information.

Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.

Definition at line 199 of file GlobalLinSysIterativeStaticCond.cpp.

201{
202 // Set up unique map
203 v_UniqueMap();
204
205 // Build precon again if we in multi-level static condensation (a
206 // bit of a hack)
208 {
210 m_precon->BuildPreconditioner();
211 }
212
214}
const GlobalLinSysKey m_linSysKey
Key associated with this linear system.
Definition: GlobalLinSys.h:120
PreconditionerSharedPtr CreatePrecon(AssemblyMapSharedPtr asmMap)
Create a preconditioner object from the parameters defined in the supplied assembly map.
void PrepareLocalSchurComplement()
Prepares local representation of Schur complement stored as a sparse block-diagonal matrix.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
std::weak_ptr< AssemblyMap > m_locToGloMap
Local to global map.

References Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::MultiRegions::eIterativeMultiLevelStaticCond, Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), Nektar::MultiRegions::GlobalLinSys::m_linSysKey, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, PrepareLocalSchurComplement(), and v_UniqueMap().

◆ v_BasisFwdTransform()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_BasisFwdTransform ( Array< OneD, NekDouble > &  pInOut)
overrideprotectedvirtual

Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.

Definition at line 493 of file GlobalLinSysIterativeStaticCond.cpp.

495{
496 m_precon->DoTransformBasisToLowEnergy(pInOut);
497}

References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.

◆ v_CoeffsBwdTransform()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_CoeffsBwdTransform ( Array< OneD, NekDouble > &  pInOut)
overrideprotectedvirtual

Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.

Definition at line 499 of file GlobalLinSysIterativeStaticCond.cpp.

501{
502 m_precon->DoTransformCoeffsFromLowEnergy(pInOut);
503}

References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.

◆ v_CoeffsFwdTransform()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_CoeffsFwdTransform ( const Array< OneD, NekDouble > &  pInput,
Array< OneD, NekDouble > &  pOutput 
)
overrideprotectedvirtual

Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.

Definition at line 505 of file GlobalLinSysIterativeStaticCond.cpp.

507{
508 m_precon->DoTransformCoeffsToLowEnergy(pInput, pOutput);
509}

References Nektar::MultiRegions::GlobalLinSysIterative::m_precon.

◆ v_DoMatrixMultiply()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_DoMatrixMultiply ( const Array< OneD, NekDouble > &  pInput,
Array< OneD, NekDouble > &  pOutput 
)
overrideprotectedvirtual

Perform a Shur-complement matrix multiply operation.

Implements Nektar::MultiRegions::GlobalLinSysIterative.

Definition at line 378 of file GlobalLinSysIterativeStaticCond.cpp.

380{
381 if (m_linsol->IsLocal())
382 {
384 {
385 m_sparseSchurCompl->Multiply(pInput, pOutput);
386 }
387 else
388 {
389 // Do matrix multiply locally, using direct BLAS calls
390 int i, cnt;
391 for (i = cnt = 0; i < m_denseBlocks.size(); cnt += m_rows[i], ++i)
392 {
393 const int rows = m_rows[i];
394 Blas::Dgemv('N', rows, rows, m_scale[i], m_denseBlocks[i], rows,
395 pInput.get() + cnt, 1, 0.0, pOutput.get() + cnt, 1);
396 }
397 }
398 }
399 else
400 {
401 int nLocal = m_locToGloMap.lock()->GetNumLocalBndCoeffs();
402 AssemblyMapSharedPtr asmMap = m_locToGloMap.lock();
403
405 {
406 // Do matrix multiply locally using block-diagonal sparse matrix
407 Array<OneD, NekDouble> tmp = m_wsp + nLocal;
408
409 asmMap->GlobalToLocalBnd(pInput, m_wsp);
410 m_sparseSchurCompl->Multiply(m_wsp, tmp);
411 asmMap->AssembleBnd(tmp, pOutput);
412 }
413 else
414 {
415 // Do matrix multiply locally, using direct BLAS calls
416 asmMap->GlobalToLocalBnd(pInput, m_wsp);
417 int i, cnt;
418 Array<OneD, NekDouble> tmpout = m_wsp + nLocal;
419 for (i = cnt = 0; i < m_denseBlocks.size(); cnt += m_rows[i], ++i)
420 {
421 const int rows = m_rows[i];
422 Blas::Dgemv('N', rows, rows, m_scale[i], m_denseBlocks[i], rows,
423 m_wsp.get() + cnt, 1, 0.0, tmpout.get() + cnt, 1);
424 }
425 asmMap->AssembleBnd(tmpout, pOutput);
426 }
427 }
428}
LibUtilities::NekLinSysIterSharedPtr m_linsol
Array< OneD, NekDouble > m_wsp
Workspace array for matrix multiplication.
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
Definition: Blas.hpp:211
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:50

References Blas::Dgemv(), m_denseBlocks, Nektar::MultiRegions::GlobalLinSysIterative::m_linsol, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, m_rows, m_scale, m_sparseSchurCompl, and Nektar::MultiRegions::GlobalLinSysStaticCond::m_wsp.

◆ v_GetStaticCondBlock()

DNekScalBlkMatSharedPtr Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_GetStaticCondBlock ( unsigned int  n)
overrideprotectedvirtual

Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided by the m_linSysKey.

Parameters
nNumber of the expansion
Returns
2x2 Block matrix holding the static condensation matrices for the n-th expansion.

Reimplemented from Nektar::MultiRegions::GlobalLinSys.

Definition at line 178 of file GlobalLinSysIterativeStaticCond.cpp.

180{
181 DNekScalBlkMatSharedPtr schurComplBlock;
182 DNekScalMatSharedPtr localMat = m_schurCompl->GetBlock(n, n);
183 unsigned int nbdry = localMat->GetRows();
184 unsigned int nblks = 1;
185 unsigned int esize[1] = {nbdry};
186
188 nblks, nblks, esize, esize);
189 schurComplBlock->SetBlock(0, 0, localMat);
190
191 return schurComplBlock;
192}
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl.

◆ v_InitObject()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_InitObject ( )
overrideprotectedvirtual

Reimplemented from Nektar::MultiRegions::GlobalLinSys.

Definition at line 138 of file GlobalLinSysIterativeStaticCond.cpp.

139{
140 auto asmMap = m_locToGloMap.lock();
141
142 m_precon = CreatePrecon(asmMap);
143
144 // Allocate memory for top-level structure
145 SetupTopLevel(asmMap);
146
147 // Setup Block Matrix systems
148 int n, n_exp = m_expList.lock()->GetNumElmts();
149
150 // Build preconditioner
151 m_precon->BuildPreconditioner();
152
153 // Do transform of Schur complement matrix
154 int cnt = 0;
155 for (n = 0; n < n_exp; ++n)
156 {
158 {
159 DNekScalMatSharedPtr mat = m_schurCompl->GetBlock(n, n);
161 m_precon->TransformedSchurCompl(n, cnt, mat);
162 m_schurCompl->SetBlock(n, n, t);
163 cnt += mat->GetRows();
164 }
165 }
166
167 // Construct this level
168 Initialise(asmMap);
169}
void Initialise(const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Definition: GlobalLinSys.h:203
void SetupTopLevel(const std::shared_ptr< AssemblyMap > &locToGloMap)
Set up the storage for the Schur complement or the top level of the multi-level Schur complement.
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.

References Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::StdRegions::eHybridDGHelmBndLam, Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalLinSys::Initialise(), Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, Nektar::MultiRegions::GlobalLinSysStaticCond::m_schurCompl, and Nektar::MultiRegions::GlobalLinSysStaticCond::SetupTopLevel().

◆ v_PreSolve()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_PreSolve ( int  scLevel,
Array< OneD, NekDouble > &  F_bnd 
)
overrideprotectedvirtual

Reimplemented from Nektar::MultiRegions::GlobalLinSysStaticCond.

Definition at line 435 of file GlobalLinSysIterativeStaticCond.cpp.

437{
439 {
440 m_rhs_magnitude = 1.0;
441 return;
442 }
443
444 if (scLevel == 0)
445 {
446 // When matrices are supplied to the constructor at the top
447 // level, the preconditioner is never set up.
448 if (!m_precon)
449 {
451 m_precon->BuildPreconditioner();
452 }
453
454 int nGloBndDofs = m_locToGloMap.lock()->GetNumGlobalBndCoeffs();
455 Array<OneD, NekDouble> F_gloBnd(nGloBndDofs);
456 NekVector<NekDouble> F_GloBnd(nGloBndDofs, F_gloBnd, eWrapper);
457 m_locToGloMap.lock()->AssembleBnd(F_bnd, F_gloBnd);
458
459 NekDouble vExchange(0.0);
460 if (m_map.size() > 0)
461 {
462 vExchange = Vmath::Dot2(F_GloBnd.GetDimension(), &F_GloBnd[0],
463 &F_GloBnd[0], &m_map[0]);
464 }
465
466 m_expList.lock()->GetComm()->GetRowComm()->AllReduce(
468
469 // To ensure that very different rhs values are not being
470 // used in subsequent solvers such as the velocity solve in
471 // INC NS. If this works we then need to work out a better
472 // way to control this.
473 NekDouble new_rhs_mag = (vExchange > 1e-6) ? vExchange : 1.0;
474
476 {
477 m_rhs_magnitude = new_rhs_mag;
478 }
479 else
480 {
482 (1.0 - m_rhs_mag_sm) * new_rhs_mag);
483 }
484 }
485 else
486 {
487 // for multilevel iterative solver always use rhs
488 // vector value with no weighting
490 }
491}
Array< OneD, int > m_map
Global to universal unique map.
NekDouble m_rhs_magnitude
dot product of rhs to normalise stopping criterion
NekDouble m_rhs_mag_sm
cnt to how many times rhs_magnitude is called
static const NekDouble kNekUnsetDouble
T Dot2(int n, const T *w, const T *x, const int *y)
dot product
Definition: Vmath.hpp:790

References Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Vmath::Dot2(), Nektar::eWrapper, Nektar::NekVector< DataType >::GetDimension(), Nektar::NekConstants::kNekUnsetDouble, Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSysIterative::m_isAbsoluteTolerance, Nektar::MultiRegions::GlobalLinSysStaticCond::m_locToGloMap, Nektar::MultiRegions::GlobalLinSysIterative::m_map, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, Nektar::MultiRegions::GlobalLinSysIterative::m_rhs_mag_sm, Nektar::MultiRegions::GlobalLinSysIterative::m_rhs_magnitude, and Nektar::LibUtilities::ReduceSum.

◆ v_Recurse()

GlobalLinSysStaticCondSharedPtr Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_Recurse ( const GlobalLinSysKey mkey,
const std::weak_ptr< ExpList > &  pExpList,
const DNekScalBlkMatSharedPtr  pSchurCompl,
const DNekScalBlkMatSharedPtr  pBinvD,
const DNekScalBlkMatSharedPtr  pC,
const DNekScalBlkMatSharedPtr  pInvD,
const std::shared_ptr< AssemblyMap > &  locToGloMap 
)
overrideprotectedvirtual

Implements Nektar::MultiRegions::GlobalLinSysStaticCond.

Definition at line 511 of file GlobalLinSysIterativeStaticCond.cpp.

517{
520 mkey, pExpList, pSchurCompl, pBinvD, pC, pInvD, l2gMap, m_precon);
521 sys->Initialise(l2gMap);
522 return sys;
523}
std::shared_ptr< GlobalLinSysIterativeStaticCond > GlobalLinSysIterativeStaticCondSharedPtr

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::MultiRegions::GlobalLinSysIterative::m_precon.

◆ v_SolveLinearSystem()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_SolveLinearSystem ( const int  pNumRows,
const Array< OneD, const NekDouble > &  pInput,
Array< OneD, NekDouble > &  pOutput,
const AssemblyMapSharedPtr locToGloMap,
const int  pNumDir 
)
overrideprivatevirtual

Solve the matrix system.

Implements Nektar::MultiRegions::GlobalLinSys.

Definition at line 528 of file GlobalLinSysIterativeStaticCond.cpp.

532{
533
534 if (!m_linsol)
535 {
537 m_expList.lock()->GetComm()->GetRowComm();
539 m_expList.lock()->GetSession();
540
541 // Check such a module exists for this equation.
544 "NekLinSysIter '" + m_linSysIterSolver +
545 "' is not defined.\n");
546
547 // Create the key to hold solver settings
548 auto sysKey = LibUtilities::NekSysKey();
549 string variable = plocToGloMap->GetVariable();
550
551 // Either get the solnInfo from <GlobalSysSolInfo> or from
552 // <Parameters>
553 if (pSession->DefinesGlobalSysSolnInfo(variable,
554 "NekLinSysMaxIterations"))
555 {
556 sysKey.m_NekLinSysMaxIterations = boost::lexical_cast<int>(
557 pSession
558 ->GetGlobalSysSolnInfo(variable, "NekLinSysMaxIterations")
559 .c_str());
560 }
561 else
562 {
563 pSession->LoadParameter("NekLinSysMaxIterations",
564 sysKey.m_NekLinSysMaxIterations, 5000);
565 }
566
567 if (pSession->DefinesGlobalSysSolnInfo(variable, "LinSysMaxStorage"))
568 {
569 sysKey.m_LinSysMaxStorage = boost::lexical_cast<int>(
570 pSession->GetGlobalSysSolnInfo(variable, "LinSysMaxStorage")
571 .c_str());
572 }
573 else
574 {
575 pSession->LoadParameter("LinSysMaxStorage",
576 sysKey.m_LinSysMaxStorage, 100);
577 }
578
579 if (pSession->DefinesGlobalSysSolnInfo(variable, "GMRESMaxHessMatBand"))
580 {
581 sysKey.m_KrylovMaxHessMatBand = boost::lexical_cast<int>(
582 pSession->GetGlobalSysSolnInfo(variable, "GMRESMaxHessMatBand")
583 .c_str());
584 }
585 else
586 {
587 pSession->LoadParameter("GMRESMaxHessMatBand",
588 sysKey.m_KrylovMaxHessMatBand,
589 sysKey.m_LinSysMaxStorage + 1);
590 }
591
592 // The following settings have no correponding tests and are rarely
593 // used.
594 pSession->MatchSolverInfo("GMRESLeftPrecon", "True",
595 sysKey.m_NekLinSysLeftPrecon, false);
596 pSession->MatchSolverInfo("GMRESRightPrecon", "True",
597 sysKey.m_NekLinSysRightPrecon, true);
598
600 m_linSysIterSolver, pSession, vRowComm, nGlobal - nDir, sysKey);
601
602 m_linsol->SetSysOperators(m_NekSysOp);
603 v_UniqueMap();
604 m_linsol->SetUniversalUniqueMap(m_map);
605 }
606
607 if (!m_precon)
608 {
609 m_precon = CreatePrecon(plocToGloMap);
610 m_precon->BuildPreconditioner();
611 }
612
613 m_linsol->setRhsMagnitude(m_rhs_magnitude);
614
615 if (m_useProjection)
616 {
617 Array<OneD, NekDouble> gloIn(nGlobal);
618 Array<OneD, NekDouble> gloOut(nGlobal, 0.0);
619 plocToGloMap->AssembleBnd(pInput, gloIn);
620 DoProjection(nGlobal, gloIn, gloOut, nDir, m_tolerance, m_isAconjugate);
621 plocToGloMap->GlobalToLocalBnd(gloOut, pOutput);
622 }
623 else
624 {
625 if (m_linsol->IsLocal())
626 {
627 int nLocDofs = plocToGloMap->GetNumLocalBndCoeffs();
628 Vmath::Zero(nLocDofs, pOutput, 1);
629 m_linsol->SolveSystem(nLocDofs, pInput, pOutput, nDir, m_tolerance);
630 }
631 else
632 {
633 Array<OneD, NekDouble> gloIn(nGlobal);
634 Array<OneD, NekDouble> gloOut(nGlobal, 0.0);
635 plocToGloMap->AssembleBnd(pInput, gloIn);
636 m_linsol->SolveSystem(nGlobal, gloIn, gloOut, nDir, m_tolerance);
637 plocToGloMap->GlobalToLocalBnd(gloOut, pOutput);
638 }
639 }
640}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:143
void DoProjection(const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int pNumDir, const NekDouble tol, const bool isAconjugate)
projection technique
bool m_useProjection
Whether to apply projection technique.
NekDouble m_tolerance
Tolerance of iterative solver.
std::string m_linSysIterSolver
Iterative solver: Conjugate Gradient, GMRES.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
NekLinSysIterFactory & GetNekLinSysIterFactory()
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::MultiRegions::GlobalLinSysIterative::DoProjection(), Nektar::LibUtilities::GetNekLinSysIterFactory(), Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSysIterative::m_isAconjugate, Nektar::MultiRegions::GlobalLinSysIterative::m_linsol, Nektar::MultiRegions::GlobalLinSysIterative::m_linSysIterSolver, Nektar::MultiRegions::GlobalLinSysIterative::m_map, Nektar::MultiRegions::GlobalLinSysIterative::m_NekSysOp, Nektar::MultiRegions::GlobalLinSysIterative::m_precon, Nektar::MultiRegions::GlobalLinSysIterative::m_rhs_magnitude, Nektar::MultiRegions::GlobalLinSysIterative::m_tolerance, Nektar::MultiRegions::GlobalLinSysIterative::m_useProjection, v_UniqueMap(), and Vmath::Zero().

◆ v_UniqueMap()

void Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::v_UniqueMap ( )
overrideprotectedvirtual

Member Data Documentation

◆ className

string Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::className
static
Initial value:
=
"Iterative static condensation.")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:197
static GlobalLinSysSharedPtr create(const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
GlobalLinSysFactory & GetGlobalLinSysFactory()

Name of class.

Registers the class with the Factory.

Definition at line 85 of file GlobalLinSysIterativeStaticCond.h.

◆ className2

string Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::className2
static
Initial value:
=
"IterativeMultiLevelStaticCond",
"Iterative multi-level static condensation.")

Definition at line 86 of file GlobalLinSysIterativeStaticCond.h.

◆ m_denseBlocks

std::vector<const double *> Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::m_denseBlocks
private

Vector of pointers to local matrix data.

Definition at line 135 of file GlobalLinSysIterativeStaticCond.h.

Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().

◆ m_rows

Array<OneD, unsigned int> Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::m_rows
private

Ranks of local matrices.

Definition at line 137 of file GlobalLinSysIterativeStaticCond.h.

Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().

◆ m_scale

Array<OneD, NekDouble> Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::m_scale
private

Scaling factors for local matrices.

Definition at line 139 of file GlobalLinSysIterativeStaticCond.h.

Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().

◆ m_sparseSchurCompl

DNekSmvBsrDiagBlkMatSharedPtr Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::m_sparseSchurCompl
private

Sparse representation of Schur complement matrix at this level.

Definition at line 141 of file GlobalLinSysIterativeStaticCond.h.

Referenced by PrepareLocalSchurComplement(), and v_DoMatrixMultiply().

◆ m_storage

std::vector<double> Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::m_storage
private

Dense storage for block Schur complement matrix.

Definition at line 133 of file GlobalLinSysIterativeStaticCond.h.

Referenced by PrepareLocalSchurComplement().

◆ storagedef

std::string Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::storagedef
staticprivate
Initial value:
=
"LocalMatrixStorageStrategy", "Sparse")
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.

Utility strings.

Definition at line 143 of file GlobalLinSysIterativeStaticCond.h.

◆ storagelookupIds

std::string Nektar::MultiRegions::GlobalLinSysIterativeStaticCond::storagelookupIds
staticprivate
Initial value:
= {
"LocalMatrixStorageStrategy", "Contiguous", MultiRegions::eContiguous),
"LocalMatrixStorageStrategy", "Non-contiguous",
"LocalMatrixStorageStrategy", "Sparse", MultiRegions::eSparse),
}
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.

Definition at line 144 of file GlobalLinSysIterativeStaticCond.h.