Nektar++
Loading...
Searching...
No Matches
PreconditionerLOR.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: PreconditionerLOR.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: PreconditionerLOR header
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIB_MULTIREGIONS_PRECONDITIONERLOR_H
36#define NEKTAR_LIB_MULTIREGIONS_PRECONDITIONERLOR_H
37
43
45{
46
47class PreconditionerLOR;
48
49/**
50 * @brief Low-order representation (LOR) preconditioner.
51 *
52 * This preconditioner works by taking a high-order element and splitting into
53 * P1 elements that 'join the dots' of a quadrature distribution on the element.
54 */
56{
57public:
58 /// Creates an instance of this class
60 const std::shared_ptr<GlobalLinSys> &plinsys,
61 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
62 {
65 pLocToGloMap);
66 p->InitObject();
67 return p;
68 }
69
70 /// Name of class
71 static std::string className;
72
73 /// Constructor.
75 const std::shared_ptr<GlobalLinSys> &plinsys,
76 const AssemblyMapSharedPtr &pLocToGloMap);
77
81
82protected:
83 void v_InitObject() override;
84
87 const bool &isLocal = false) override;
88
89 void v_BuildPreconditioner() override;
90
91private:
92 static std::string lookupIds[];
93 static std::string def;
94
95 /// Linear solver for LOR system
97 /// Solution type for LOR space, DirectFull, IterativeFull, PETScFull
98 std::string m_slvType;
99 /// Flag that determines whether to use equispaced point distributions or
100 /// GLL.
101 bool m_equiSpaced = false;
102 /// Use a simplex distribution in the LOR system so that e.g. quadrilaterals
103 /// are split into triangles.
104 bool m_useSimplex = false;
105 //// Number of points to use for splitting high-order elements, usually
106 //// nummodes-1.
107 unsigned int m_nsplit;
108 /// MeshGraph for the LOR system
110 /// Field object for the LOR system
112 /// Number of Dirichlet values on original mesh
113 unsigned int m_nDir;
114 /// Map from high-order node numbers to LOR representation
116 /// Inverse of multiplicity of each global DOF in the high-order mesh
118 /// Inverse of multiplicity of each global DOF in the LOR mesh
120 /// Whether to be verbose.
122
123 void CreateInvMultiplicity(void);
124};
125
126} // namespace Nektar::MultiRegions
127#endif
#define MULTI_REGIONS_EXPORT
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Low-order representation (LOR) preconditioner.
Array< OneD, int > m_ho2lor
Map from high-order node numbers to LOR representation.
MultiRegions::ContFieldSharedPtr m_lor_field
Field object for the LOR system.
bool m_useSimplex
Use a simplex distribution in the LOR system so that e.g. quadrilaterals are split into triangles.
GlobalLinSysSharedPtr m_LORLinSys
Linear solver for LOR system.
Array< OneD, NekDouble > m_invLinMeshMultiplicity
Inverse of multiplicity of each global DOF in the LOR mesh.
std::string m_slvType
Solution type for LOR space, DirectFull, IterativeFull, PETScFull.
static PreconditionerSharedPtr create(const std::shared_ptr< GlobalLinSys > &plinsys, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &isLocal=false) override
Apply a preconditioner to the conjugate gradient method.
static std::string className
Name of class.
unsigned int m_nDir
Number of Dirichlet values on original mesh.
Array< OneD, NekDouble > m_invMultiplicity
Inverse of multiplicity of each global DOF in the high-order mesh.
SpatialDomains::MeshGraphSharedPtr m_lor_graph
MeshGraph for the LOR system.
bool m_equiSpaced
Flag that determines whether to use equispaced point distributions or GLL.
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
std::shared_ptr< Preconditioner > PreconditionerSharedPtr
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition AssemblyMap.h:50
std::shared_ptr< ContField > ContFieldSharedPtr
Definition ContField.h:295
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224