Nektar++
PreconCfs.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PreconCfs.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: PreconCfs header
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_PRECONCFS
36 #define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_PRECONCFS
37 
41 #include <MultiRegions/ExpList.h>
42 
43 namespace Nektar
44 {
46 {
47  eNull, ///< No Solution type specified
50 };
51 
52 class PreconCfs
53 {
54 public:
57  const LibUtilities::CommSharedPtr &vComm);
58 
59  virtual ~PreconCfs()
60  {
61  }
62 
64  const Array<OneD, NekDouble> &pInput,
65  Array<OneD, NekDouble> &pOutput, const bool &flag);
66 
67  inline void BuildPreconCfs(
69  const Array<OneD, const Array<OneD, NekDouble>> &intmp,
70  const NekDouble time, const NekDouble lambda);
71 
72  inline void InitObject();
73 
74  virtual bool UpdatePreconMatCheck(const Array<OneD, const NekDouble> &res,
75  const NekDouble dtLambda);
76 
77 protected:
78  // PreconCfsType m_preconType;
80  bool m_root;
81  bool m_verbose;
83 
86 
89 
90  bool m_CalcPreconMatFlag = false;
91 
92  virtual void v_InitObject();
93 
94  void DoNullPrecon(const Array<OneD, NekDouble> &pInput,
95  Array<OneD, NekDouble> &pOutput, const bool &flag);
96 
97 private:
98  virtual void v_DoPreconCfs(
100  const Array<OneD, NekDouble> &pInput, Array<OneD, NekDouble> &pOutput,
101  const bool &flag);
102 
103  virtual void v_BuildPreconCfs(
105  const Array<OneD, const Array<OneD, NekDouble>> &intmp,
106  const NekDouble time, const NekDouble lambda);
107 };
108 typedef std::shared_ptr<PreconCfs> PreconCfsSharedPtr;
109 
110 /**
111  *
112  */
114 {
115  v_InitObject();
116 }
117 
118 /**
119  *
120  */
123  const Array<OneD, const Array<OneD, NekDouble>> &intmp,
124  const NekDouble time, const NekDouble lambda)
125 {
126  v_BuildPreconCfs(pFields, intmp, time, lambda);
127 }
128 } // namespace Nektar
129 
130 #endif
virtual void v_InitObject()
Definition: PreconCfs.cpp:59
virtual ~PreconCfs()
Definition: PreconCfs.h:59
virtual bool UpdatePreconMatCheck(const Array< OneD, const NekDouble > &res, const NekDouble dtLambda)
Definition: PreconCfs.cpp:102
int m_PreconTimesCounter
Definition: PreconCfs.h:85
int m_PreconMatFreezNumb
Definition: PreconCfs.h:84
void BuildPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, const Array< OneD, NekDouble >> &intmp, const NekDouble time, const NekDouble lambda)
Definition: PreconCfs.h:121
void DoNullPrecon(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag)
Definition: PreconCfs.cpp:63
NekDouble m_DtLambdaPreconMat
Definition: PreconCfs.h:87
bool m_CalcPreconMatFlag
Definition: PreconCfs.h:90
virtual void v_DoPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag)
Definition: PreconCfs.cpp:84
NekDouble m_BndEvaluateTime
Definition: PreconCfs.h:88
virtual void v_BuildPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, const Array< OneD, NekDouble >> &intmp, const NekDouble time, const NekDouble lambda)
Definition: PreconCfs.cpp:93
PreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm)
Definition: PreconCfs.cpp:42
void DoPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag)
Definition: PreconCfs.cpp:73
LibUtilities::CommSharedPtr m_Comm
Definition: PreconCfs.h:79
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:54
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
PrecType
Definition: PreconCfs.h:46
@ eNull
No Solution type specified.
Definition: PreconCfs.h:47
@ eDiagonal
Definition: PreconCfs.h:48
@ eSparse
Definition: PreconCfs.h:49
std::shared_ptr< PreconCfs > PreconCfsSharedPtr
Definition: PreconCfs.h:108
double NekDouble