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,
81 int nDirBnd =
m_locToGloMap.lock()->GetNumGlobalDirBndCoeffs();
82 int nGlobHomBnd =
m_locToGloMap.lock()->GetNumGlobalBndCoeffs() - nDirBnd;
137 const std::shared_ptr<DNekScalMat > &loc_mat)
161 int nDirBndDofs =
m_locToGloMap.lock()->GetNumGlobalDirBndCoeffs();
162 int nGlobHomBndDofs =
m_locToGloMap.lock()->GetNumGlobalBndCoeffs() - nDirBndDofs;
163 int nLocBndDofs =
m_locToGloMap.lock()->GetNumLocalBndCoeffs();
175 pInput,1,OutputLinear,1);
176 m_locToGloMap.lock()->GlobalToLocalBnd(OutputLinear,local,nDirBndDofs);
178 m_locToGloMap.lock()->AssembleBnd(local,InputLinear,nDirBndDofs);
182 (InputLinear, OutputLinear, tmp);
185 m_locToGloMap.lock()->GlobalToLocalBnd(OutputLinear,local,nDirBndDofs);
187 m_locToGloMap.lock()->LocalBndToGlobal(local,pOutput,nDirBndDofs,
false);
192 ASSERTL1(pOutput.size() >= nGlobHomBndDofs,
"Output array is not correct");
193 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)
Multiply by the block transposed inverse transformation matrix.
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
virtual void v_DoTransformCoeffsToLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Multiply by the block inverse transformation matrix.
PreconditionerSharedPtr m_linSpacePrecon
Array< OneD, NekDouble > m_invMultiplicity
virtual void v_DoTransformBasisToLowEnergy(Array< OneD, NekDouble > &pInOut)
Transform from original basis to low energy basis.
PreconditionerSharedPtr m_lowEnergyPrecon
virtual void v_InitObject()
virtual DNekScalMatSharedPtr v_TransformedSchurCompl(int n, int offset, const std::shared_ptr< DNekScalMat > &loc_mat)
Get block elemental transposed transformation matrix .
virtual void v_DoTransformCoeffsFromLowEnergy(Array< OneD, NekDouble > &pInOut)
Transform from low energy coeffs to orignal basis.
virtual void v_BuildPreconditioner()
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.