35 #include <boost/core/ignore_unused.hpp>
44 namespace MultiRegions
56 "Preconditioner",
"LowEnergyBlock",
eLowEnergy),
58 "Preconditioner",
"FullLinearSpaceWithLowEnergyBlock",
78 : m_linsys(plinsys), m_preconType(pLocToGloMap->GetPreconType()),
79 m_locToGloMap(pLocToGloMap)
103 boost::ignore_unused(pInput, pOutput);
116 boost::ignore_unused(pInput, pOutput, pNonVertOutput, pVertForce);
126 boost::ignore_unused(pInOut);
135 boost::ignore_unused(pInOut);
144 boost::ignore_unused(pInput, pOutput);
153 boost::ignore_unused(pInput, pOutput);
166 int offset,
int bnd_offset,
const std::shared_ptr<DNekScalMat> &loc_mat)
168 boost::ignore_unused(offset, bnd_offset);
180 int nGlobalBnd = asmMap->GetNumGlobalBndCoeffs();
181 int nDirBnd = asmMap->GetNumGlobalDirBndCoeffs();
182 int rows = nGlobalBnd - nDirBnd;
186 int sign1, sign2, gid1, gid2, i, j, n, cnt;
191 for (cnt = n = 0; n <
m_linsys.lock()->GetNumBlocks(); ++n)
194 loc_mat = (
m_linsys.lock())->GetStaticCondBlock(n);
197 bnd_mat = loc_mat->GetBlock(0, 0);
200 int bnd_row = bnd_mat->GetRows();
202 for (i = 0; i < bnd_row; ++i)
204 gid1 = asmMap->GetLocalToGlobalBndMap(cnt + i) - nDirBnd;
205 sign1 = asmMap->GetLocalToGlobalBndSign(cnt + i);
212 for (j = 0; j < bnd_row; ++j)
214 gid2 = asmMap->GetLocalToGlobalBndMap(cnt + j) - nDirBnd;
215 sign2 = asmMap->GetLocalToGlobalBndSign(cnt + j);
219 diagonals[gid1] += sign1 * sign2 * (*bnd_mat)(i, j);
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Provides a generic Factory class.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
virtual void v_DoTransformBasisToLowEnergy(Array< OneD, NekDouble > &pInOut)
Transform from original basis to low energy basis.
const std::weak_ptr< GlobalLinSys > m_linsys
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 free...
Array< OneD, NekDouble > AssembleStaticCondGlobalDiagonals()
Performs global assembly of diagonal entries to global Schur complement matrix.
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
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.
static std::string lookupIds[]
Preconditioner(const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
virtual void v_DoTransformCoeffsFromLowEnergy(Array< OneD, NekDouble > &pInOut)
Transform from low energy coeffs to orignal basis.
virtual DNekScalMatSharedPtr v_TransformedSchurCompl(int offset, int bndoffset, const std::shared_ptr< DNekScalMat > &loc_mat)
Get block elemental transposed transformation matrix .
virtual void v_BuildPreconditioner()
virtual void v_InitObject()
virtual void v_DoTransformCoeffsToLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Multiply by the block inverse transformation matrix.
PreconFactory & GetPreconFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
@ eNull
No Solution type specified.
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr