51 "FullLinearSpaceWithLowEnergyBlock",
53 "Full Linear space and low energy block preconditioning");
63 const std::shared_ptr<GlobalLinSys> &plinsys,
80 int nDirBnd =
m_locToGloMap.lock()->GetNumGlobalDirBndCoeffs();
81 int nGlobHomBnd =
m_locToGloMap.lock()->GetNumGlobalBndCoeffs() - nDirBnd;
132 int n,
int offset,
const std::shared_ptr<DNekScalMat> &loc_mat)
155 ASSERTL0(isLocal ==
false,
"PreconditionerLinearWithLowEnergy"
156 " is only set up for Global iteratives sovles");
157 int nDirBndDofs =
m_locToGloMap.lock()->GetNumGlobalDirBndCoeffs();
158 int nGlobHomBndDofs =
160 int nLocBndDofs =
m_locToGloMap.lock()->GetNumLocalBndCoeffs();
172 m_locToGloMap.lock()->GlobalToLocalBnd(OutputLinear, local, nDirBndDofs);
174 m_locToGloMap.lock()->AssembleBnd(local, InputLinear, nDirBndDofs);
181 m_locToGloMap.lock()->GlobalToLocalBnd(OutputLinear, local, nDirBndDofs);
183 m_locToGloMap.lock()->LocalBndToGlobal(local, pOutput, nDirBndDofs,
false);
188 ASSERTL1(pOutput.size() >= nGlobHomBndDofs,
"Output array is not correct");
189 Vmath::Vadd(nGlobHomBndDofs, pOutput, 1, OutputLowEnergy, 1, pOutput, 1);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
const std::weak_ptr< GlobalLinSys > m_linsys
std::weak_ptr< AssemblyMap > m_locToGloMap
void v_DoTransformBasisFromLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Multiply by the block transposed inverse transformation matrix.
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.
void v_InitObject() override
PreconditionerLinearWithLowEnergy(const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
PreconditionerSharedPtr m_linSpacePrecon
Array< OneD, NekDouble > m_invMultiplicity
void v_DoTransformCoeffsFromLowEnergy(Array< OneD, NekDouble > &pInOut) override
Transform from low energy coeffs to orignal basis.
PreconditionerSharedPtr m_lowEnergyPrecon
void v_DoTransformCoeffsToLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Multiply by the block inverse transformation matrix.
static PreconditionerSharedPtr create(const std::shared_ptr< GlobalLinSys > &plinsys, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
void v_DoTransformBasisToLowEnergy(Array< OneD, NekDouble > &pInOut) override
Transform from original basis to low energy basis.
void v_BuildPreconditioner() override
static std::string className
Name of class.
DNekScalMatSharedPtr v_TransformedSchurCompl(int n, int offset, const std::shared_ptr< DNekScalMat > &loc_mat) override
Get block elemental transposed transformation matrix .
PreconFactory & GetPreconFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
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.
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.