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);
132 boost::ignore_unused(pInOut, offset);
142 boost::ignore_unused(pInOut, pOutput);
151 Vmath::Smul(pInput.num_elements(), 1.0, pInput, 1, pInput, 1);
161 boost::ignore_unused(pInput, pOutput);
172 boost::ignore_unused(pInput, pOutput);
185 int offset,
int bnd_offset,
186 const std::shared_ptr<DNekScalMat> &loc_mat)
188 boost::ignore_unused(offset, bnd_offset);
201 int nGlobalBnd = asmMap->GetNumGlobalBndCoeffs();
202 int nDirBnd = asmMap->GetNumGlobalDirBndCoeffs();
203 int rows = nGlobalBnd - nDirBnd;
207 int sign1, sign2, gid1, gid2, i, j, n, cnt;
212 for (cnt = n = 0; n <
m_linsys.lock()->GetNumBlocks(); ++n)
215 loc_mat = (
m_linsys.lock())->GetStaticCondBlock(n);
218 bnd_mat = loc_mat->GetBlock(0, 0);
221 int bnd_row = bnd_mat->GetRows();
223 for (i = 0; i < bnd_row; ++i)
225 gid1 = asmMap->GetLocalToGlobalBndMap (cnt + i)
227 sign1 = asmMap->GetLocalToGlobalBndSign(cnt + i);
234 for (j = 0; j < bnd_row; ++j)
236 gid2 = asmMap->GetLocalToGlobalBndMap (cnt + j)
238 sign2 = asmMap->GetLocalToGlobalBndSign(cnt + j);
242 diagonals[gid1] += sign1 * sign2 * (*bnd_mat)(i, j);
static std::string lookupIds[]
Preconditioner(const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
virtual DNekScalMatSharedPtr v_TransformedSchurCompl(int offset, int bndoffset, const std::shared_ptr< DNekScalMat > &loc_mat)
Get block elemental transposed transformation matrix .
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
virtual void v_DoMultiplybyInverseTransposedTransformationMatrix(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Multiply by the block transposed inverse transformation matrix.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
const std::weak_ptr< GlobalLinSys > m_linsys
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
PreconFactory & GetPreconFactory()
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...
virtual void v_DoMultiplybyInverseTransformationMatrix(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Multiply by the block inverse transformation matrix.
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
virtual void v_DoTransformFromLowEnergy(Array< OneD, NekDouble > &pInput)
Transform from low energy basis to orignal basis.
Array< OneD, NekDouble > AssembleStaticCondGlobalDiagonals()
Performs global assembly of diagonal entries to global Schur complement matrix.
No Solution type specified.
virtual void v_DoTransformToLowEnergy(Array< OneD, NekDouble > &pInOut, int offset)
Transform from original basis to low energy basis.
virtual void v_BuildPreconditioner()
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_InitObject()
std::weak_ptr< AssemblyMap > m_locToGloMap
Provides a generic Factory class.