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 "
203 for(i = 0; i < nloc; ++i)
205 val = LocToGloBnd[i];
208 In[LocToGlo[i]] = pInput[val-nDirFull];
216 m_vertLocToGloMap->GetNumGlobalDirBndCoeffs());
221 ASSERTL1(pNonVertOutput.num_elements() >= pOutput.num_elements(),
"Non Vert output is not of sufficient length");
222 Vmath::Vcopy(pOutput.num_elements(),pNonVertOutput,1,pOutput,1);
233 Vmath::Zero(pVertForce.num_elements(),pVertForce,1);
235 for(i = 0; i < nloc; ++i)
237 val = LocToGloBnd[i];
240 pOutput[val-nDirFull] = Out[LocToGlo[i]];
242 pVertForce[val-nDirFull] = In[LocToGlo[i]];
249 for(i = 0; i < nloc; ++i)
251 val = LocToGloBnd[i];
254 pOutput[val-nDirFull] = Out[LocToGlo[i]];
261 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.