43 #ifdef NEKTAR_USING_PETSC
52 namespace MultiRegions
62 "Full Linear space inverse Preconditioning");
87 const boost::shared_ptr<GlobalLinSys> &plinsys,
101 "This type of preconditioning is not implemented "
104 boost::shared_ptr<MultiRegions::ExpList>
105 expList=((
m_linsys.lock())->GetLocMat()).lock();
109 "LinearPreconSolver");
118 #ifndef NEKTAR_USING_PETSC
119 ASSERTL0(
false,
"Nektar++ has not been compiled with "
151 #ifdef NEKTAR_USING_PETSC
155 ASSERTL0(
false,
"Nektar++ has not been compiled with "
204 for(i = 0; i < nloc; ++i)
206 val = LocToGloBnd[i];
209 In[LocToGlo[i]] = pInput[val-nDirFull];
217 m_vertLocToGloMap->GetNumGlobalDirBndCoeffs());
222 ASSERTL1(pNonVertOutput.num_elements() >= pOutput.num_elements(),
"Non Vert output is not of sufficient length");
223 Vmath::Vcopy(pOutput.num_elements(),pNonVertOutput,1,pOutput,1);
234 Vmath::Zero(pVertForce.num_elements(),pVertForce,1);
236 for(i = 0; i < nloc; ++i)
238 val = LocToGloBnd[i];
241 pOutput[val-nDirFull] = Out[LocToGlo[i]];
243 pVertForce[val-nDirFull] = In[LocToGlo[i]];
250 for(i = 0; i < nloc; ++i)
252 val = LocToGloBnd[i];
255 pOutput[val-nDirFull] = Out[LocToGlo[i]];
262 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 std::string solveTypeIds[]
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
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...
static std::string className1
Name of class.
PreconFactory & GetPreconFactory()
boost::shared_ptr< AssemblyMap > m_vertLocToGloMap
PreconditionerLinear(const boost::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
const boost::weak_ptr< GlobalLinSys > m_linsys
GlobalLinSysSharedPtr m_vertLinsys
static PreconditionerSharedPtr create(const boost::shared_ptr< GlobalLinSys > &plinsys, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
Describe a linear system.
static std::string solveType
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
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.