42 #ifdef NEKTAR_USING_PETSC
53 namespace MultiRegions
59 string PreconditionerLinear::className1
62 PreconditionerLinear::create,
63 "Full Linear space inverse Preconditioning");
65 std::string PreconditionerLinear::solveType =
66 LibUtilities::SessionReader::RegisterDefaultSolverInfo(
69 std::string PreconditionerLinear::solveTypeIds[] = {
70 LibUtilities::SessionReader::RegisterEnumValue(
74 LibUtilities::SessionReader::RegisterEnumValue(
87 PreconditionerLinear::PreconditionerLinear(
88 const std::shared_ptr<GlobalLinSys> &plinsys,
102 "This type of preconditioning is not implemented "
105 std::shared_ptr<MultiRegions::ExpList>
106 expList=((
m_linsys.lock())->GetLocMat()).lock();
110 "LinearPreconSolver");
119 #ifndef NEKTAR_USING_PETSC
121 "Nektar++ has not been compiled with "
154 #ifdef NEKTAR_USING_PETSC
158 ASSERTL0(
false,
"Nektar++ has not been compiled with "
201 int nDirFull =
m_locToGloMap.lock()->GetNumGlobalDirBndCoeffs();
207 for(i = 0; i < nloc; ++i)
209 val = LocToGloBnd[i];
212 In[LocToGlo[i]] = pInput[val-nDirFull];
225 ASSERTL1(pNonVertOutput.size() >= pOutput.size(),
"Non Vert output is not of sufficient length");
226 Vmath::Vcopy(pOutput.size(),pNonVertOutput,1,pOutput,1);
239 for(i = 0; i < nloc; ++i)
241 val = LocToGloBnd[i];
244 pOutput[val-nDirFull] = Out[LocToGlo[i]];
246 pVertForce[val-nDirFull] = In[LocToGlo[i]];
253 for(i = 0; i < nloc; ++i)
255 val = LocToGloBnd[i];
258 pOutput[val-nDirFull] = Out[LocToGlo[i]];
265 ASSERTL0(0,
"Unsupported solver type");
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#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.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Describe a linear system.
const std::weak_ptr< GlobalLinSys > m_linsys
std::weak_ptr< AssemblyMap > m_locToGloMap
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
virtual void v_BuildPreconditioner()
virtual void v_InitObject()
static std::string solveType
std::shared_ptr< AssemblyMap > m_vertLocToGloMap
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...
GlobalLinSysSharedPtr m_vertLinsys
PreconFactory & GetPreconFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
The above copyright notice and this permission notice shall be included.
static Array< OneD, NekDouble > NullNekDouble1DArray
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)