43 #ifdef NEKTAR_USING_PETSC
54 namespace MultiRegions
60 string PreconditionerLinear::className1
63 PreconditionerLinear::create,
64 "Full Linear space inverse Preconditioning");
66 std::string PreconditionerLinear::solveType =
67 LibUtilities::SessionReader::RegisterDefaultSolverInfo(
70 std::string PreconditionerLinear::solveTypeIds[] = {
71 LibUtilities::SessionReader::RegisterEnumValue(
75 LibUtilities::SessionReader::RegisterEnumValue(
88 PreconditionerLinear::PreconditionerLinear(
89 const boost::shared_ptr<GlobalLinSys> &plinsys,
103 "This type of preconditioning is not implemented "
106 boost::shared_ptr<MultiRegions::ExpList>
107 expList=((
m_linsys.lock())->GetLocMat()).lock();
111 "LinearPreconSolver");
120 #ifndef NEKTAR_USING_PETSC
121 ASSERTL0(
false,
"Nektar++ has not been compiled with "
153 #ifdef NEKTAR_USING_PETSC
157 ASSERTL0(
false,
"Nektar++ has not been compiled with "
206 for(i = 0; i < nloc; ++i)
208 val = LocToGloBnd[i];
211 In[LocToGlo[i]] = pInput[val-nDirFull];
219 m_vertLocToGloMap->GetNumGlobalDirBndCoeffs());
224 ASSERTL1(pNonVertOutput.num_elements() >= pOutput.num_elements(),
"Non Vert output is not of sufficient length");
225 Vmath::Vcopy(pOutput.num_elements(),pNonVertOutput,1,pOutput,1);
236 Vmath::Zero(pVertForce.num_elements(),pVertForce,1);
238 for(i = 0; i < nloc; ++i)
240 val = LocToGloBnd[i];
243 pOutput[val-nDirFull] = Out[LocToGlo[i]];
245 pVertForce[val-nDirFull] = In[LocToGlo[i]];
252 for(i = 0; i < nloc; ++i)
254 val = LocToGloBnd[i];
257 pOutput[val-nDirFull] = Out[LocToGlo[i]];
264 ASSERTL0(0,
"Unsupported solver type");
boost::shared_ptr< AssemblyMap > m_locToGloMap
#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.
static Array< OneD, NekDouble > NullNekDouble1DArray
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
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()
boost::shared_ptr< AssemblyMap > m_vertLocToGloMap
const boost::weak_ptr< GlobalLinSys > m_linsys
GlobalLinSysSharedPtr m_vertLinsys
Describe a linear system.
static std::string solveType
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)
virtual void v_BuildPreconditioner()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.