Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | List of all members
Nektar::MultiRegions::PreconditionerLinearWithBlock Class Reference

#include <PreconditionerLinearWithBlock.h>

Inheritance diagram for Nektar::MultiRegions::PreconditionerLinearWithBlock:
Inheritance graph
[legend]
Collaboration diagram for Nektar::MultiRegions::PreconditionerLinearWithBlock:
Collaboration graph
[legend]

Public Member Functions

 PreconditionerLinearWithBlock (const boost::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
 
virtual ~PreconditionerLinearWithBlock ()
 
- Public Member Functions inherited from Nektar::MultiRegions::Preconditioner
 Preconditioner (const boost::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
 
virtual ~Preconditioner ()
 
void DoPreconditioner (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
void DoPreconditionerWithNonVertOutput (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const Array< OneD, NekDouble > &pNonVertOutput, Array< OneD, NekDouble > &pVertForce=NullNekDouble1DArray)
 
void DoTransformToLowEnergy (Array< OneD, NekDouble > &pInOut, int offset)
 
void DoTransformToLowEnergy (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
void DoTransformFromLowEnergy (Array< OneD, NekDouble > &pInOut)
 
void DoMultiplybyInverseTransformationMatrix (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
void DoMultiplybyInverseTransposedTransformationMatrix (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 
void BuildPreconditioner ()
 
void InitObject ()
 
Array< OneD, NekDoubleAssembleStaticCondGlobalDiagonals ()
 Performs global assembly of diagonal entries to global Schur complement matrix. More...
 
const DNekScalBlkMatSharedPtrGetBlockTransformedSchurCompl () const
 
const DNekScalBlkMatSharedPtrGetBlockCMatrix () const
 
const DNekScalBlkMatSharedPtrGetBlockInvDMatrix () const
 
const DNekScalBlkMatSharedPtrGetBlockSchurCompl () const
 
const DNekScalBlkMatSharedPtrGetBlockTransformationMatrix () const
 
const DNekScalBlkMatSharedPtrGetBlockTransposedTransformationMatrix () const
 
DNekScalMatSharedPtr TransformedSchurCompl (int offset, const boost::shared_ptr< DNekScalMat > &loc_mat)
 

Static Public Member Functions

static PreconditionerSharedPtr create (const boost::shared_ptr< GlobalLinSys > &plinsys, const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 

Protected Attributes

PreconditionerSharedPtr m_linSpacePrecon
 
PreconditionerSharedPtr m_blockPrecon
 
- Protected Attributes inherited from Nektar::MultiRegions::Preconditioner
const boost::weak_ptr
< GlobalLinSys
m_linsys
 
PreconditionerType m_preconType
 
DNekMatSharedPtr m_preconditioner
 
boost::shared_ptr< AssemblyMapm_locToGloMap
 
LibUtilities::CommSharedPtr m_comm
 

Private Member Functions

virtual void v_InitObject ()
 
virtual void v_DoPreconditioner (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
 Apply a preconditioner to the conjugate gradient method. More...
 
virtual void v_BuildPreconditioner ()
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::MultiRegions::Preconditioner
virtual DNekScalMatSharedPtr v_TransformedSchurCompl (int offset, const boost::shared_ptr< DNekScalMat > &loc_mat)
 Get block elemental transposed transformation matrix $\mathbf{R}^{T}$. More...
 

Detailed Description

This class implements preconditioning for the conjugate gradient matrix solver.

Definition at line 49 of file PreconditionerLinearWithBlock.h.

Constructor & Destructor Documentation

Nektar::MultiRegions::PreconditionerLinearWithBlock::PreconditionerLinearWithBlock ( const boost::shared_ptr< GlobalLinSys > &  plinsys,
const AssemblyMapSharedPtr pLocToGloMap 
)

Definition at line 65 of file PreconditionerLinearWithBlock.cpp.

68  : Preconditioner(plinsys, pLocToGloMap)
69  {
70  }
Preconditioner(const boost::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
virtual Nektar::MultiRegions::PreconditionerLinearWithBlock::~PreconditionerLinearWithBlock ( )
inlinevirtual

Definition at line 71 of file PreconditionerLinearWithBlock.h.

71 {}

Member Function Documentation

static PreconditionerSharedPtr Nektar::MultiRegions::PreconditionerLinearWithBlock::create ( const boost::shared_ptr< GlobalLinSys > &  plinsys,
const boost::shared_ptr< AssemblyMap > &  pLocToGloMap 
)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file PreconditionerLinearWithBlock.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

57  {
59  p->InitObject();
60  return p;
61  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< Preconditioner > PreconditionerSharedPtr
Definition: GlobalLinSys.h:62
void Nektar::MultiRegions::PreconditionerLinearWithBlock::v_BuildPreconditioner ( )
privatevirtual

Reimplemented from Nektar::MultiRegions::Preconditioner.

Definition at line 84 of file PreconditionerLinearWithBlock.cpp.

References m_blockPrecon, and m_linSpacePrecon.

85  {
86  m_linSpacePrecon->BuildPreconditioner();
87  m_blockPrecon->BuildPreconditioner();
88  }
void Nektar::MultiRegions::PreconditionerLinearWithBlock::v_DoPreconditioner ( const Array< OneD, NekDouble > &  pInput,
Array< OneD, NekDouble > &  pOutput 
)
privatevirtual

Apply a preconditioner to the conjugate gradient method.

Reimplemented from Nektar::MultiRegions::Preconditioner.

Definition at line 94 of file PreconditionerLinearWithBlock.cpp.

References m_blockPrecon, and m_linSpacePrecon.

97  {
98  int nGlobal = pInput.num_elements();
99 
100  Array<OneD, NekDouble> OutputBlock(nGlobal, 0.0);
101  Array<OneD, NekDouble> OutputLinear(nGlobal, 0.0);
102  Array<OneD, NekDouble> InputLinear(nGlobal, 0.0);
103 
104  //Apply Low Energy preconditioner
105  m_blockPrecon->DoPreconditioner(pInput, OutputBlock);
106 
107  //Apply linear space preconditioner
108  m_linSpacePrecon->DoPreconditionerWithNonVertOutput(pInput, pOutput,OutputBlock);
109  }
void Nektar::MultiRegions::PreconditionerLinearWithBlock::v_InitObject ( )
privatevirtual

Reimplemented from Nektar::MultiRegions::Preconditioner.

Definition at line 75 of file PreconditionerLinearWithBlock.cpp.

References Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::MultiRegions::GetPreconFactory(), m_blockPrecon, m_linSpacePrecon, Nektar::MultiRegions::Preconditioner::m_linsys, and Nektar::MultiRegions::Preconditioner::m_locToGloMap.

76  {
79  }
boost::shared_ptr< AssemblyMap > m_locToGloMap
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:162
PreconFactory & GetPreconFactory()
const boost::weak_ptr< GlobalLinSys > m_linsys

Member Data Documentation

string Nektar::MultiRegions::PreconditionerLinearWithBlock::className
static
Initial value:
"FullLinearSpaceWithBlock",
"Full Linear space and block preconditioning")

Name of class.

Registers the class with the Factory.

Definition at line 64 of file PreconditionerLinearWithBlock.h.

PreconditionerSharedPtr Nektar::MultiRegions::PreconditionerLinearWithBlock::m_blockPrecon
protected
PreconditionerSharedPtr Nektar::MultiRegions::PreconditionerLinearWithBlock::m_linSpacePrecon
protected