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];
220 m_vertLocToGloMap->GetNumGlobalDirBndCoeffs());
225 ASSERTL1(pNonVertOutput.num_elements() >= pOutput.num_elements(),
"Non Vert output is not of sufficient length");
226 Vmath::Vcopy(pOutput.num_elements(),pNonVertOutput,1,pOutput,1);
237 Vmath::Zero(pVertForce.num_elements(),pVertForce,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)
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Apply a preconditioner to the conjugate gradient method.
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
static Array< OneD, NekDouble > NullNekDouble1DArray
const std::weak_ptr< GlobalLinSys > m_linsys
virtual void v_InitObject()
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...
PreconFactory & GetPreconFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
GlobalLinSysSharedPtr m_vertLinsys
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Describe a linear system.
static std::string solveType
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
void Zero(int n, T *x, const int incx)
Zero vector.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
std::weak_ptr< AssemblyMap > m_locToGloMap
std::shared_ptr< AssemblyMap > m_vertLocToGloMap
virtual void v_BuildPreconditioner()