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

A global linear system. More...

#include <GlobalLinSysIterativeFull.h>

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

Public Member Functions

 GlobalLinSysIterativeFull (const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
 Constructor for full direct matrix solve. More...
 
 ~GlobalLinSysIterativeFull () override=default
 
- 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...
 

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...
 

Protected Member Functions

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_DoMatrixMultiply (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
 
void v_UniqueMap () 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...
 

Private Member Functions

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::weak_ptr< AssemblyMapm_locToGloMap
 

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
 
- Static Protected Attributes inherited from Nektar::MultiRegions::GlobalLinSysIterative
static std::string IteratSolverlookupIds []
 
static std::string IteratSolverdef
 

Detailed Description

A global linear system.

Definition at line 45 of file GlobalLinSysIterativeFull.h.

Constructor & Destructor Documentation

◆ GlobalLinSysIterativeFull()

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

Constructor for full direct matrix solve.

Constructor for full direct matrix solve.

Parameters
pKeyKey specifying matrix to solve.
pExpShared pointer to expansion list for applying matrix evaluations.
pLocToGloMapLocal to global mapping.

Definition at line 66 of file GlobalLinSysIterativeFull.cpp.

69 : GlobalLinSys(pKey, pExp, pLocToGloMap),
70 GlobalLinSysIterative(pKey, pExp, pLocToGloMap)
71{
73 "This routine should only be used when using an Iterative "
74 "conjugate gradient matrix solve.");
75}
#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.
const GlobalLinSysKey m_linSysKey
Key associated with this linear system.
Definition: GlobalLinSys.h:120
GlobalLinSysIterative(const GlobalLinSysKey &pKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Constructor for full direct matrix solve.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.

References ASSERTL1, Nektar::MultiRegions::eIterativeFull, Nektar::MultiRegions::GlobalLinSysKey::GetGlobalSysSolnType(), and Nektar::MultiRegions::GlobalLinSys::m_linSysKey.

◆ ~GlobalLinSysIterativeFull()

Nektar::MultiRegions::GlobalLinSysIterativeFull::~GlobalLinSysIterativeFull ( )
overridedefault

Member Function Documentation

◆ create()

static GlobalLinSysSharedPtr Nektar::MultiRegions::GlobalLinSysIterativeFull::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 49 of file GlobalLinSysIterativeFull.h.

53 {
55 pLinSysKey, pExpList, pLocToGloMap);
56 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ v_DoMatrixMultiply()

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

Implements Nektar::MultiRegions::GlobalLinSysIterative.

Definition at line 179 of file GlobalLinSysIterativeFull.cpp.

181{
182 bool isLocal = m_linsol->IsLocal();
183
184 std::shared_ptr<MultiRegions::ExpList> expList = m_expList.lock();
185
186 AssemblyMapSharedPtr asmMap = m_locToGloMap.lock();
187
188 int ncoeffs = expList->GetNcoeffs();
189 Array<OneD, NekDouble> InputLoc, OutputLoc;
190
191 if (isLocal)
192 {
193 InputLoc = pInput;
194 OutputLoc = pOutput;
195
196 // Perform matrix-vector operation A*d_i
197 expList->GeneralMatrixOp(m_linSysKey, InputLoc, OutputLoc);
198 }
199 else
200 {
201 InputLoc = Array<OneD, NekDouble>(ncoeffs);
202 OutputLoc = Array<OneD, NekDouble>(ncoeffs);
203
204 asmMap->GlobalToLocal(pInput, InputLoc);
205 // Perform matrix-vector operation A*d_i
206 expList->GeneralMatrixOp(m_linSysKey, InputLoc, OutputLoc);
207 }
208
209 // Apply robin boundary conditions to the solution.
210 for (auto &r : m_robinBCInfo) // add robin mass matrix
211 {
213 Array<OneD, NekDouble> tmp;
214
215 int n = r.first;
216
217 int offset = expList->GetCoeff_Offset(n);
218 LocalRegions::ExpansionSharedPtr vExp = expList->GetExp(n);
219
220 // add local matrix contribution
221 for (rBC = r.second; rBC; rBC = rBC->next)
222 {
223 vExp->AddRobinTraceContribution(
224 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs, InputLoc + offset,
225 tmp = OutputLoc + offset);
226 }
227 }
228
229 // put back in global coeffs
230 if (isLocal == false)
231 {
232 asmMap->Assemble(OutputLoc, pOutput);
233 }
234}
const std::weak_ptr< ExpList > m_expList
Local Matrix System.
Definition: GlobalLinSys.h:122
const std::map< int, RobinBCInfoSharedPtr > m_robinBCInfo
Robin boundary info.
Definition: GlobalLinSys.h:124
LibUtilities::NekLinSysIterSharedPtr m_linsol
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:66
std::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:50

References Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSysIterative::m_linsol, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, m_locToGloMap, and Nektar::MultiRegions::GlobalLinSys::m_robinBCInfo.

◆ v_Solve()

void Nektar::MultiRegions::GlobalLinSysIterativeFull::v_Solve ( const Array< OneD, const NekDouble > &  pLocInput,
Array< OneD, NekDouble > &  pLocOutput,
const AssemblyMapSharedPtr pLocToGloMap,
const Array< OneD, const NekDouble > &  pDirForcing = NullNekDouble1DArray 
)
overrideprotectedvirtual

Solve the linear system for given input and output vectors using a specified local to global map.

Solve a global linear system with Dirichlet forcing using a conjugate gradient method. This routine performs handling of the Dirichlet forcing terms and wraps the underlying iterative solver used for the remaining degrees of freedom.

Consider solving for \(x\), the matrix system \(Ax=b\), where \(b\) is known. To enforce the Dirichlet terms we instead solve

\[A(x-x_0) = b - Ax_0 \]

where \(x_0\) is the Dirichlet forcing.

Parameters
pInputRHS of linear system, \(b\).
pOutputOn input, values of dirichlet degrees of freedom with initial guess on other values. On output, the solution \(x\).
pLocToGloMapLocal to global mapping.
pDirForcingPrecalculated Dirichlet forcing.

Implements Nektar::MultiRegions::GlobalLinSys.

Definition at line 95 of file GlobalLinSysIterativeFull.cpp.

100{
101 m_locToGloMap = pLocToGloMap;
102
103 bool dirForcCalculated = (bool)pDirForcing.size();
104 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
105 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
106 int nLocDofs = pLocToGloMap->GetNumLocalCoeffs();
107
108 int nDirTotal = nDirDofs;
109 std::shared_ptr<MultiRegions::ExpList> expList = m_expList.lock();
110 expList->GetComm()->GetRowComm()->AllReduce(nDirTotal,
112
113 if (nDirTotal)
114 {
115 Array<OneD, NekDouble> rhs(nLocDofs);
116
117 // Calculate the Dirichlet forcing
118 if (dirForcCalculated)
119 {
120 // Assume pDirForcing is in local space
121 ASSERTL0(
122 pDirForcing.size() >= nLocDofs,
123 "DirForcing is not of sufficient size. Is it in local space?");
124 Vmath::Vsub(nLocDofs, pLocInput, 1, pDirForcing, 1, rhs, 1);
125 }
126 else
127 {
128 // Calculate initial condition and Dirichlet forcing and subtract it
129 // from the rhs
130 expList->GeneralMatrixOp(m_linSysKey, pLocOutput, rhs);
131
132 // Iterate over all the elements computing Robin BCs where
133 // necessary
134 for (auto &r : m_robinBCInfo) // add robin mass matrix
135 {
137 Array<OneD, NekDouble> rhsloc;
138
139 int n = r.first;
140 int offset = expList->GetCoeff_Offset(n);
141
142 LocalRegions::ExpansionSharedPtr vExp = expList->GetExp(n);
143 // Add local matrix contribution
144 for (rBC = r.second; rBC; rBC = rBC->next)
145 {
146 vExp->AddRobinTraceContribution(
147 rBC->m_robinID, rBC->m_robinPrimitiveCoeffs,
148 pLocOutput + offset, rhsloc = rhs + offset);
149 }
150 }
151 Vmath::Vsub(nLocDofs, pLocInput, 1, rhs, 1, rhs, 1);
152 }
153
154 if (std::dynamic_pointer_cast<AssemblyMapCG>(pLocToGloMap))
155 {
156 Array<OneD, NekDouble> diff(nLocDofs);
157
158 // Solve for perturbation from initial guess in pOutput
159 SolveLinearSystem(nGlobDofs, rhs, diff, pLocToGloMap, nDirDofs);
160
161 // Add back initial and boundary condition
162 Vmath::Vadd(nLocDofs, diff, 1, pLocOutput, 1, pLocOutput, 1);
163 }
164 else
165 {
166 ASSERTL0(false, "Need DG solve if using Dir BCs");
167 }
168 }
169 else
170 {
171 SolveLinearSystem(nGlobDofs, pLocInput, pLocOutput, pLocToGloMap,
172 nDirDofs);
173 }
174}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
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.
Definition: GlobalLinSys.h:190
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.hpp:180
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.hpp:220

References ASSERTL0, Nektar::MultiRegions::GlobalLinSys::m_expList, Nektar::MultiRegions::GlobalLinSys::m_linSysKey, m_locToGloMap, Nektar::MultiRegions::GlobalLinSys::m_robinBCInfo, Nektar::LibUtilities::ReduceSum, Nektar::MultiRegions::GlobalLinSys::SolveLinearSystem(), Vmath::Vadd(), and Vmath::Vsub().

◆ v_SolveLinearSystem()

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

251{
252
253 if (!m_linsol)
254 {
256 m_expList.lock()->GetComm()->GetRowComm();
258 m_expList.lock()->GetSession();
259
260 // Check such a module exists for this equation.
263 "NekLinSysIter '" + m_linSysIterSolver +
264 "' is not defined.\n");
265
266 // Create the key to hold solver settings
267 auto sysKey = LibUtilities::NekSysKey();
268 string variable = plocToGloMap->GetVariable();
269
270 // Either get the solnInfo from <GlobalSysSolInfo> or from
271 // <Parameters>
272 if (pSession->DefinesGlobalSysSolnInfo(variable,
273 "NekLinSysMaxIterations"))
274 {
275 sysKey.m_NekLinSysMaxIterations = boost::lexical_cast<int>(
276 pSession
277 ->GetGlobalSysSolnInfo(variable, "NekLinSysMaxIterations")
278 .c_str());
279 }
280 else
281 {
282 pSession->LoadParameter("NekLinSysMaxIterations",
283 sysKey.m_NekLinSysMaxIterations, 5000);
284 }
285
286 if (pSession->DefinesGlobalSysSolnInfo(variable, "LinSysMaxStorage"))
287 {
288 sysKey.m_LinSysMaxStorage = boost::lexical_cast<int>(
289 pSession->GetGlobalSysSolnInfo(variable, "LinSysMaxStorage")
290 .c_str());
291 }
292 else
293 {
294 pSession->LoadParameter("LinSysMaxStorage",
295 sysKey.m_LinSysMaxStorage, 100);
296 }
297
298 if (pSession->DefinesGlobalSysSolnInfo(variable, "GMRESMaxHessMatBand"))
299 {
300 sysKey.m_KrylovMaxHessMatBand = boost::lexical_cast<int>(
301 pSession->GetGlobalSysSolnInfo(variable, "GMRESMaxHessMatBand")
302 .c_str());
303 }
304 else
305 {
306 pSession->LoadParameter("GMRESMaxHessMatBand",
307 sysKey.m_KrylovMaxHessMatBand,
308 sysKey.m_LinSysMaxStorage + 1);
309 }
310
311 // The following settings have no correponding tests and are rarely
312 // used.
313 pSession->MatchSolverInfo("GMRESLeftPrecon", "True",
314 sysKey.m_NekLinSysLeftPrecon, false);
315 pSession->MatchSolverInfo("GMRESRightPrecon", "True",
316 sysKey.m_NekLinSysRightPrecon, true);
317
319 m_linSysIterSolver, pSession, vRowComm, nGlobal - nDir, sysKey);
320
321 m_linsol->SetSysOperators(m_NekSysOp);
322 v_UniqueMap();
323 m_linsol->SetUniversalUniqueMap(m_map);
324 }
325
326 if (!m_precon)
327 {
328 m_precon = CreatePrecon(plocToGloMap);
329 m_precon->BuildPreconditioner();
330 }
331
332 m_linsol->setRhsMagnitude(m_isAbsoluteTolerance ? 1.0 : m_rhs_magnitude);
333
334 if (m_useProjection)
335 {
336 Array<OneD, NekDouble> gloIn(nGlobal);
337 Array<OneD, NekDouble> gloOut(nGlobal, 0.0);
338 plocToGloMap->Assemble(pInput, gloIn);
339 DoProjection(nGlobal, gloIn, gloOut, nDir, m_tolerance, m_isAconjugate);
340 plocToGloMap->GlobalToLocal(gloOut, pOutput);
341 }
342 else
343 {
344 if (m_linsol->IsLocal())
345 {
346 int nLocDofs = plocToGloMap->GetNumLocalCoeffs();
347 Vmath::Zero(nLocDofs, pOutput, 1);
348 m_linsol->SolveSystem(nLocDofs, pInput, pOutput, nDir, m_tolerance);
349 }
350 else
351 {
352 Array<OneD, NekDouble> gloIn(nGlobal);
353 Array<OneD, NekDouble> gloOut(nGlobal, 0.0);
354 plocToGloMap->Assemble(pInput, gloIn);
355 m_linsol->SolveSystem(nGlobal, gloIn, gloOut, nDir, m_tolerance);
356 plocToGloMap->GlobalToLocal(gloOut, pOutput);
357 }
358 }
359}
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:143
PreconditionerSharedPtr CreatePrecon(AssemblyMapSharedPtr asmMap)
Create a preconditioner object from the parameters defined in the supplied assembly map.
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.
Array< OneD, int > m_map
Global to universal unique map.
NekDouble m_rhs_magnitude
dot product of rhs to normalise stopping criterion
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_isAbsoluteTolerance, 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::GlobalLinSysIterativeFull::v_UniqueMap ( )
overrideprotectedvirtual

Implements Nektar::MultiRegions::GlobalLinSysIterative.

Definition at line 239 of file GlobalLinSysIterativeFull.cpp.

240{
241 m_map = m_locToGloMap.lock()->GetGlobalToUniversalMapUnique();
242}

References m_locToGloMap, and Nektar::MultiRegions::GlobalLinSysIterative::m_map.

Referenced by v_SolveLinearSystem().

Member Data Documentation

◆ className

string Nektar::MultiRegions::GlobalLinSysIterativeFull::className
static
Initial value:
=
"Iterative solver for full matrix system.")
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 59 of file GlobalLinSysIterativeFull.h.

◆ m_locToGloMap

std::weak_ptr<AssemblyMap> Nektar::MultiRegions::GlobalLinSysIterativeFull::m_locToGloMap
private

Definition at line 85 of file GlobalLinSysIterativeFull.h.

Referenced by v_DoMatrixMultiply(), v_Solve(), and v_UniqueMap().