46 namespace MultiRegions
52 string PreconditionerLinearWithLowEnergy::className =
54 "FullLinearSpaceWithLowEnergyBlock",
55 PreconditionerLinearWithLowEnergy::create,
56 "Full Linear space and low energy block preconditioning");
65 PreconditionerLinearWithLowEnergy::PreconditionerLinearWithLowEnergy(
66 const std::shared_ptr<GlobalLinSys> &plinsys,
83 int nDirBnd =
m_locToGloMap.lock()->GetNumGlobalDirBndCoeffs();
84 int nGlobHomBnd =
m_locToGloMap.lock()->GetNumGlobalBndCoeffs() - nDirBnd;
135 int n,
int offset,
const std::shared_ptr<DNekScalMat> &loc_mat)
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 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
virtual void v_DoTransformBasisFromLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Multiply by the block transposed inverse transformation matrix.
virtual void v_InitObject() override
PreconditionerSharedPtr m_linSpacePrecon
Array< OneD, NekDouble > m_invMultiplicity
virtual void v_DoTransformCoeffsFromLowEnergy(Array< OneD, NekDouble > &pInOut) override
Transform from low energy coeffs to orignal basis.
PreconditionerSharedPtr m_lowEnergyPrecon
virtual void v_DoTransformCoeffsToLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Multiply by the block inverse transformation matrix.
virtual void v_DoTransformBasisToLowEnergy(Array< OneD, NekDouble > &pInOut) override
Transform from original basis to low energy basis.
virtual void v_BuildPreconditioner() override
virtual DNekScalMatSharedPtr v_TransformedSchurCompl(int n, int offset, const std::shared_ptr< DNekScalMat > &loc_mat) override
Get block elemental transposed transformation matrix .
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Apply a preconditioner to the conjugate gradient method.
PreconFactory & GetPreconFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
The above copyright notice and this permission notice shall be included.
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/y.