35 #include <boost/core/ignore_unused.hpp>
44 namespace MultiRegions
48 "Preconditioner",
"Null",
eNull),
52 "Preconditioner",
"FullLinearSpaceWithDiagonal",
55 "Preconditioner",
"FullLinearSpace",
eLinear),
57 "Preconditioner",
"LowEnergyBlock",
eLowEnergy),
59 "Preconditioner",
"FullLinearSpaceWithLowEnergyBlock",
62 "Preconditioner",
"Block",
eBlock),
68 "Preconditioner",
"Diagonal");
78 const std::shared_ptr<GlobalLinSys> &plinsys,
81 m_preconType(pLocToGloMap->GetPreconType()),
82 m_locToGloMap(pLocToGloMap)
107 boost::ignore_unused(pInput, pOutput);
121 boost::ignore_unused(pInput, pOutput, pNonVertOutput, pVertForce);
131 boost::ignore_unused(pInOut);
140 boost::ignore_unused(pInOut);
150 boost::ignore_unused(pInput, pOutput);
160 boost::ignore_unused(pInput, pOutput);
173 int offset,
int bnd_offset,
174 const std::shared_ptr<DNekScalMat> &loc_mat)
176 boost::ignore_unused(offset, bnd_offset);
189 int nGlobalBnd = asmMap->GetNumGlobalBndCoeffs();
190 int nDirBnd = asmMap->GetNumGlobalDirBndCoeffs();
191 int rows = nGlobalBnd - nDirBnd;
195 int sign1, sign2, gid1, gid2, i, j, n, cnt;
200 for (cnt = n = 0; n <
m_linsys.lock()->GetNumBlocks(); ++n)
203 loc_mat = (
m_linsys.lock())->GetStaticCondBlock(n);
206 bnd_mat = loc_mat->GetBlock(0, 0);
209 int bnd_row = bnd_mat->GetRows();
211 for (i = 0; i < bnd_row; ++i)
213 gid1 = asmMap->GetLocalToGlobalBndMap (cnt + i)
215 sign1 = asmMap->GetLocalToGlobalBndSign(cnt + i);
222 for (j = 0; j < bnd_row; ++j)
224 gid2 = asmMap->GetLocalToGlobalBndMap (cnt + j)
226 sign2 = asmMap->GetLocalToGlobalBndSign(cnt + j);
230 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