Nektar++
|
#include <PreconditionerLowEnergy.h>
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... | |
Private Member Functions | |
void | SetUpReferenceElements (void) |
Sets up the reference elements needed by the preconditioner. More... | |
void | CreateMultiplicityMap (void) |
void | SetupBlockTransformationMatrix (void) |
void | ModifyPrismTransformationMatrix (LocalRegions::TetExpSharedPtr TetExp, LocalRegions::PrismExpSharedPtr PrismExp, DNekMatSharedPtr Rmodprism, DNekMatSharedPtr RTmodprism) |
Modify the prism transformation matrix to align with the tetrahedral modes. More... | |
SpatialDomains::TetGeomSharedPtr | CreateRefTetGeom (void) |
Sets up the reference tretrahedral element needed to construct a low energy basis. More... | |
SpatialDomains::PrismGeomSharedPtr | CreateRefPrismGeom (void) |
Sets up the reference prismatic element needed to construct a low energy basis. More... | |
SpatialDomains::HexGeomSharedPtr | CreateRefHexGeom (void) |
Sets up the reference hexahedral element needed to construct a low energy basis. More... | |
virtual void | v_InitObject () |
virtual void | v_DoPreconditioner (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
virtual void | v_DoTransformToLowEnergy (Array< OneD, NekDouble > &pInOut, int offset) |
Transform the solution vector vector to low energy. More... | |
virtual void | v_DoTransformToLowEnergy (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
Transform the solution vector vector to low energy. More... | |
virtual void | v_DoTransformFromLowEnergy (Array< OneD, NekDouble > &pInOut) |
transform the solution vector from low energy back to the original basis. More... | |
virtual void | v_DoMultiplybyInverseTransformationMatrix (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
Multiply by the block inverse transformation matrix. More... | |
virtual void | v_DoMultiplybyInverseTransposedTransformationMatrix (const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) |
Multiply by the block tranposed inverse transformation matrix. More... | |
virtual void | v_BuildPreconditioner () |
Construct the low energy preconditioner from . More... | |
virtual DNekScalMatSharedPtr | v_TransformedSchurCompl (int offset, const boost::shared_ptr< DNekScalMat > &loc_mat) |
Set up the transformed block matrix system. More... | |
Additional Inherited Members |
This class implements low energy preconditioning for the conjugate gradient matrix solver.
Definition at line 53 of file PreconditionerLowEnergy.h.
Nektar::MultiRegions::PreconditionerLowEnergy::PreconditionerLowEnergy | ( | const boost::shared_ptr< GlobalLinSys > & | plinsys, |
const AssemblyMapSharedPtr & | pLocToGloMap | ||
) |
Definition at line 66 of file PreconditionerLowEnergy.cpp.
|
inlinevirtual |
Definition at line 75 of file PreconditionerLowEnergy.h.
|
inlinestatic |
Creates an instance of this class.
Definition at line 57 of file PreconditionerLowEnergy.h.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr().
Create the inverse multiplicity map.
Definition at line 1274 of file PreconditionerLowEnergy.cpp.
References m_locToGloMap, m_locToGloSignMult, m_multiplicity, Vmath::Sdiv(), and sign.
Referenced by v_InitObject().
|
private |
Sets up the reference hexahedral element needed to construct a low energy basis.
Definition at line 1513 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBackwards, and Nektar::StdRegions::eForwards.
Referenced by SetUpReferenceElements().
|
private |
Sets up the reference prismatic element needed to construct a low energy basis.
Definition at line 1331 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBackwards, and Nektar::StdRegions::eForwards.
Referenced by SetUpReferenceElements().
|
private |
Sets up the reference tretrahedral element needed to construct a low energy basis.
Definition at line 1421 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::eBackwards, and Nektar::StdRegions::eForwards.
Referenced by SetUpReferenceElements().
|
private |
Modify the prism transformation matrix to align with the tetrahedral modes.
This routine replaces the edge and triangular face components of the prismatic vertex transformation matrices and with the corresponding components from the tetrahedral transformation matrices. Additionally, triangular face components in the prismatic edge transformation matrix with the corresponding component from the tetrahedral transformation matrix.
Definition at line 1870 of file PreconditionerLowEnergy.cpp.
Referenced by SetUpReferenceElements().
Set a block transformation matrices for each element type. These are needed in routines that transform the schur complement matrix to and from the low energy basis.
Definition at line 915 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::eDIAGONAL, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, m_InvRBlk, m_InvRTBlk, m_linsys, m_locToGloMap, m_RBlk, m_Rhex, m_Rinvhex, m_Rinvprism, m_Rinvtet, m_Rprism, m_RTBlk, m_Rtet, m_RThex, m_RTinvhex, m_RTinvprism, m_RTinvtet, m_RTprism, and m_RTtet.
Referenced by v_InitObject().
Sets up the reference elements needed by the preconditioner.
Sets up reference elements which are used to preconditioning the corresponding matrices. Currently we support tetrahedral, prismatic and hexahedral elements
Definition at line 1602 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), CreateRefHexGeom(), CreateRefPrismGeom(), CreateRefTetGeom(), Nektar::eFULL, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::LibUtilities::eGaussRadauMAlpha2Beta0, Nektar::LibUtilities::eHexahedron, Nektar::StdRegions::eMass, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::StdRegions::ePreconR, Nektar::StdRegions::ePreconRMass, Nektar::StdRegions::ePreconRT, Nektar::StdRegions::ePreconRTMass, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, Nektar::MultiRegions::GlobalMatrixKey::GetConstFactors(), Nektar::MultiRegions::GlobalMatrixKey::GetMatrixType(), Nektar::MultiRegions::GlobalMatrixKey::GetNVarCoeffs(), Nektar::MultiRegions::GlobalMatrixKey::GetVarCoeffs(), m_linsys, m_Rhex, m_Rinvhex, m_Rinvprism, m_Rinvtet, m_Rprism, m_Rtet, m_RThex, m_RTinvhex, m_RTinvprism, m_RTinvtet, m_RTprism, m_RTtet, and ModifyPrismTransformationMatrix().
Referenced by v_InitObject().
|
privatevirtual |
Construct the low energy preconditioner from .
where is the transformation matrix and the Schur complement of the modified basis, given by
where is the local schur complement matrix for each element.
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 121 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::StdRegions::StdExpansion::as(), Vmath::Assmb(), Nektar::MultiRegions::DeterminePeriodicFaceOrient(), Nektar::eDIAGONAL, Nektar::SpatialDomains::eDirichlet, Nektar::eFULL, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, Gs::Gather(), Nektar::StdRegions::StdExpansion::GetEdgeNcoeffs(), Nektar::StdRegions::StdExpansion::GetFaceIntNcoeffs(), Gs::gs_add, Gs::Init(), m_BlkMat, Nektar::MultiRegions::Preconditioner::m_comm, m_linsys, m_locToGloMap, m_RBlk, m_Rhex, m_Rprism, m_RTBlk, m_Rtet, m_RThex, m_RTprism, m_RTtet, and Nektar::LibUtilities::ReduceMax.
|
privatevirtual |
Multiply by the block inverse transformation matrix.
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 1130 of file PreconditionerLowEnergy.cpp.
References ASSERTL1, Nektar::eWrapper, Vmath::Gathr(), m_InvRBlk, m_locToGloMap, m_locToGloSignMult, m_map, and Vmath::Vcopy().
|
privatevirtual |
Multiply by the block tranposed inverse transformation matrix.
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 1175 of file PreconditionerLowEnergy.cpp.
References ASSERTL1, Nektar::eWrapper, m_InvRTBlk, m_locToGloMap, m_map, m_multiplicity, and Vmath::Vmul().
|
privatevirtual |
Apply the low energy preconditioner during the conjugate gradient routine
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 894 of file PreconditionerLowEnergy.cpp.
References Nektar::eWrapper, and m_locToGloMap.
|
privatevirtual |
transform the solution vector from low energy back to the original basis.
After the conjugate gradient routine the output vector is in the low energy basis and must be trasnformed back to the original basis in order to get the correct solution out. the solution vector i.e. .
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 1088 of file PreconditionerLowEnergy.cpp.
References ASSERTL1, Vmath::Assmb(), Nektar::eWrapper, m_locToGloMap, m_locToGloSignMult, m_map, m_RTBlk, and Vmath::Vcopy().
|
privatevirtual |
Transform the solution vector vector to low energy.
As the conjugate gradient system is solved for the low energy basis, the solution vector must be transformed to the low energy basis i.e. .
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 996 of file PreconditionerLowEnergy.cpp.
References Nektar::eWrapper, Vmath::Gathr(), m_locToGloMap, m_locToGloSignMult, m_map, m_RBlk, and Vmath::Vcopy().
|
privatevirtual |
Transform the solution vector vector to low energy.
As the conjugate gradient system is solved for the low energy basis, the solution vector must be transformed to the low energy basis i.e. .
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 1037 of file PreconditionerLowEnergy.cpp.
References ASSERTL1, Nektar::eWrapper, Vmath::Gathr(), m_locToGloMap, m_locToGloSignMult, m_map, m_RBlk, and Vmath::Vcopy().
|
privatevirtual |
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 75 of file PreconditionerLowEnergy.cpp.
References ASSERTL0, CreateMultiplicityMap(), Nektar::MultiRegions::eIterativeStaticCond, Nektar::MultiRegions::ePETScStaticCond, m_linsys, m_locToGloMap, SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
privatevirtual |
Set up the transformed block matrix system.
Sets up a block elemental matrix in which each of the block matrix is the low energy equivalent i.e.
Reimplemented from Nektar::MultiRegions::Preconditioner.
Definition at line 1219 of file PreconditionerLowEnergy.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::eFULL, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, m_linsys, m_Rhex, m_Rprism, m_Rtet, m_RThex, m_RTprism, and m_RTtet.
|
static |
Name of class.
Registers the class with the Factory.
Definition at line 68 of file PreconditionerLowEnergy.h.
|
protected |
Definition at line 82 of file PreconditionerLowEnergy.h.
Referenced by v_BuildPreconditioner().
|
protected |
Definition at line 83 of file PreconditionerLowEnergy.h.
|
protected |
Definition at line 87 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and v_DoMultiplybyInverseTransformationMatrix().
|
protected |
Definition at line 88 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and v_DoMultiplybyInverseTransposedTransformationMatrix().
|
protected |
Definition at line 79 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), v_InitObject(), and v_TransformedSchurCompl().
|
protected |
Definition at line 80 of file PreconditionerLowEnergy.h.
Referenced by CreateMultiplicityMap(), SetupBlockTransformationMatrix(), v_BuildPreconditioner(), v_DoMultiplybyInverseTransformationMatrix(), v_DoMultiplybyInverseTransposedTransformationMatrix(), v_DoPreconditioner(), v_DoTransformFromLowEnergy(), v_DoTransformToLowEnergy(), and v_InitObject().
Definition at line 105 of file PreconditionerLowEnergy.h.
Referenced by CreateMultiplicityMap(), v_DoMultiplybyInverseTransformationMatrix(), v_DoTransformFromLowEnergy(), and v_DoTransformToLowEnergy().
Definition at line 107 of file PreconditionerLowEnergy.h.
Referenced by v_DoMultiplybyInverseTransformationMatrix(), v_DoMultiplybyInverseTransposedTransformationMatrix(), v_DoTransformFromLowEnergy(), and v_DoTransformToLowEnergy().
Definition at line 106 of file PreconditionerLowEnergy.h.
Referenced by CreateMultiplicityMap(), and v_DoMultiplybyInverseTransposedTransformationMatrix().
|
protected |
Definition at line 85 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), v_BuildPreconditioner(), and v_DoTransformToLowEnergy().
|
protected |
Definition at line 95 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), and v_TransformedSchurCompl().
|
protected |
Definition at line 97 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
protected |
Definition at line 102 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
protected |
Definition at line 92 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
protected |
Definition at line 100 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), and v_TransformedSchurCompl().
|
protected |
Definition at line 86 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), v_BuildPreconditioner(), and v_DoTransformFromLowEnergy().
|
protected |
Definition at line 90 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), and v_TransformedSchurCompl().
|
protected |
Definition at line 96 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), and v_TransformedSchurCompl().
|
protected |
Definition at line 98 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
protected |
Definition at line 103 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
protected |
Definition at line 93 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), and SetUpReferenceElements().
|
protected |
Definition at line 101 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), and v_TransformedSchurCompl().
|
protected |
Definition at line 91 of file PreconditionerLowEnergy.h.
Referenced by SetupBlockTransformationMatrix(), SetUpReferenceElements(), v_BuildPreconditioner(), and v_TransformedSchurCompl().