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

#include <PreconditionerDiagonal.h>

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

Public Member Functions

 PreconditionerNull (const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
 
 ~PreconditionerNull () override
 
void v_InitObject () override
 
void v_DoPreconditioner (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &isLocal=false) override
 Apply a preconditioner to the conjugate gradient method. More...
 
void v_BuildPreconditioner () override
 
- Public Member Functions inherited from Nektar::MultiRegions::Preconditioner
 Preconditioner (const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
 
virtual ~Preconditioner ()
 
void DoPreconditioner (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &IsLocal=false)
 
void DoAssembleLoc (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &ZeroDir)
 Apply an assembly and scatter back to lcoal array. More...
 
void DoPreconditionerWithNonVertOutput (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const Array< OneD, NekDouble > &pNonVertOutput, Array< OneD, NekDouble > &pVertForce=NullNekDouble1DArray)
 
void DoTransformBasisToLowEnergy (Array< OneD, NekDouble > &pInOut)
 
void DoTransformCoeffsFromLowEnergy (Array< OneD, NekDouble > &pInOut)
 
void DoTransformCoeffsToLowEnergy (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
void DoTransformBasisFromLowEnergy (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
void BuildPreconditioner ()
 
void InitObject ()
 
Array< OneD, NekDoubleAssembleStaticCondGlobalDiagonals ()
 Performs global assembly of diagonal entries to global Schur complement matrix. More...
 
const DNekScalBlkMatSharedPtrGetBlockTransformedSchurCompl () const
 
const DNekScalBlkMatSharedPtrGetBlockCMatrix () const
 
const DNekScalBlkMatSharedPtrGetBlockInvDMatrix () const
 
const DNekScalBlkMatSharedPtrGetBlockSchurCompl () const
 
const DNekScalBlkMatSharedPtrGetBlockTransformationMatrix () const
 
const DNekScalBlkMatSharedPtrGetBlockTransposedTransformationMatrix () const
 
DNekScalMatSharedPtr TransformedSchurCompl (int offset, int bndoffset, const std::shared_ptr< DNekScalMat > &loc_mat)
 

Static Public Member Functions

static PreconditionerSharedPtr create (const std::shared_ptr< GlobalLinSys > &plinsys, 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 Private Attributes

static std::string lookupIds []
 
static std::string def
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::MultiRegions::Preconditioner
virtual DNekScalMatSharedPtr v_TransformedSchurCompl (int offset, int bndoffset, const std::shared_ptr< DNekScalMat > &loc_mat)
 Get block elemental transposed transformation matrix \(\mathbf{R}^{T}\). More...
 
virtual void v_InitObject ()
 
virtual void v_DoPreconditioner (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &isLocal=false)
 Apply a preconditioner to the conjugate gradient method. More...
 
virtual void v_DoPreconditionerWithNonVertOutput (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const Array< OneD, NekDouble > &pNonVertOutput, Array< OneD, NekDouble > &pVertForce)
 Apply a preconditioner to the conjugate gradient method with an output for non-vertex degrees of freedom. More...
 
virtual void v_DoTransformBasisToLowEnergy (Array< OneD, NekDouble > &pInOut)
 Transform from original basis to low energy basis. More...
 
virtual void v_DoTransformCoeffsFromLowEnergy (Array< OneD, NekDouble > &pInOut)
 Transform from low energy coeffs to orignal basis. More...
 
virtual void v_DoTransformCoeffsToLowEnergy (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 Multiply by the block inverse transformation matrix. More...
 
virtual void v_DoTransformBasisFromLowEnergy (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 Multiply by the block transposed inverse transformation matrix. More...
 
virtual void v_BuildPreconditioner ()
 
- Protected Attributes inherited from Nektar::MultiRegions::Preconditioner
const std::weak_ptr< GlobalLinSysm_linsys
 
std::string m_preconType
 
DNekMatSharedPtr m_preconditioner
 
std::weak_ptr< AssemblyMapm_locToGloMap
 

Detailed Description

Definition at line 97 of file PreconditionerDiagonal.h.

Constructor & Destructor Documentation

◆ PreconditionerNull()

Nektar::MultiRegions::PreconditionerNull::PreconditionerNull ( const std::shared_ptr< GlobalLinSys > &  plinsys,
const AssemblyMapSharedPtr pLocToGloMap 
)

Definition at line 198 of file PreconditionerDiagonal.cpp.

201 : Preconditioner(plinsys, pLocToGloMap)
202{
203}
Preconditioner(const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)

◆ ~PreconditionerNull()

Nektar::MultiRegions::PreconditionerNull::~PreconditionerNull ( )
inlineoverride

Definition at line 120 of file PreconditionerDiagonal.h.

121 {
122 }

Member Function Documentation

◆ create()

static PreconditionerSharedPtr Nektar::MultiRegions::PreconditionerNull::create ( const std::shared_ptr< GlobalLinSys > &  plinsys,
const std::shared_ptr< AssemblyMap > &  pLocToGloMap 
)
inlinestatic

Creates an instance of this class.

Definition at line 101 of file PreconditionerDiagonal.h.

104 {
107 pLocToGloMap);
108 p->InitObject();
109 return p;
110 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< Preconditioner > PreconditionerSharedPtr
Definition: GlobalLinSys.h:58

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

◆ v_BuildPreconditioner()

void Nektar::MultiRegions::PreconditionerNull::v_BuildPreconditioner ( )
overridevirtual

Reimplemented from Nektar::MultiRegions::Preconditioner.

Definition at line 215 of file PreconditionerDiagonal.cpp.

216{
217}

◆ v_DoPreconditioner()

void Nektar::MultiRegions::PreconditionerNull::v_DoPreconditioner ( const Array< OneD, NekDouble > &  pInput,
Array< OneD, NekDouble > &  pOutput,
const bool &  isLocal = false 
)
overridevirtual

Apply a preconditioner to the conjugate gradient method.

Reimplemented from Nektar::MultiRegions::Preconditioner.

Definition at line 222 of file PreconditionerDiagonal.cpp.

226{
227 auto asmMap = m_locToGloMap.lock();
228
229 GlobalSysSolnType solvertype = asmMap->GetGlobalSysSolnType();
230
231 bool isFull = solvertype == eIterativeFull ? true : false;
232
233 int nGlobal = (isFull) ? asmMap->GetNumGlobalCoeffs()
234 : asmMap->GetNumGlobalBndCoeffs();
235 int nDir = asmMap->GetNumGlobalDirBndCoeffs();
236
237 if (isLocal)
238 {
239 Array<OneD, NekDouble> wk(nGlobal);
240 (isFull) ? asmMap->Assemble(pInput, wk)
241 : asmMap->AssembleBnd(pInput, wk);
242 Vmath::Zero(nDir, wk, 1);
243 (isFull) ? asmMap->GlobalToLocal(wk, pOutput)
244 : asmMap->GlobalToLocalBnd(wk, pOutput);
245 }
246 else
247 {
248 Vmath::Vcopy(pInput.size(), pInput, 1, pOutput, 1);
249 }
250}
std::weak_ptr< AssemblyMap > m_locToGloMap
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References Nektar::MultiRegions::eIterativeFull, Nektar::MultiRegions::Preconditioner::m_locToGloMap, Vmath::Vcopy(), and Vmath::Zero().

◆ v_InitObject()

void Nektar::MultiRegions::PreconditionerNull::v_InitObject ( )
overridevirtual

Reimplemented from Nektar::MultiRegions::Preconditioner.

Definition at line 208 of file PreconditionerDiagonal.cpp.

209{
210}

Member Data Documentation

◆ className

string Nektar::MultiRegions::PreconditionerNull::className
static
Initial value:
=
"Null", PreconditionerNull::create, "No Preconditioning")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static PreconditionerSharedPtr create(const std::shared_ptr< GlobalLinSys > &plinsys, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
PreconFactory & GetPreconFactory()

Name of class.

Definition at line 113 of file PreconditionerDiagonal.h.

◆ def

std::string Nektar::MultiRegions::PreconditionerNull::def
staticprivate

Definition at line 134 of file PreconditionerDiagonal.h.

◆ lookupIds

std::string Nektar::MultiRegions::PreconditionerNull::lookupIds[]
staticprivate

Definition at line 133 of file PreconditionerDiagonal.h.