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
42
43namespace Nektar
44{
45
46// Forward declaration
47class PreconCfs;
48
49/// Declaration of the boundary condition factory
50typedef LibUtilities::NekFactory<
51 std::string, PreconCfs, const Array<OneD, MultiRegions::ExpListSharedPtr> &,
55
56/// Declaration of the boundary condition factory singleton
58
60{
61public:
64 const LibUtilities::CommSharedPtr &vComm);
65
66 virtual ~PreconCfs() = default;
67
68 inline void InitObject()
69 {
71 }
72
73 inline void DoPreconCfs(
75 const Array<OneD, NekDouble> &pInput, Array<OneD, NekDouble> &pOutput,
76 const bool &flag)
77 {
78 v_DoPreconCfs(pFields, pInput, pOutput, flag);
79 }
80
81 inline void BuildPreconCfs(
83 const Array<OneD, const Array<OneD, NekDouble>> &intmp,
84 const NekDouble time, const NekDouble lambda)
85 {
86 v_BuildPreconCfs(pFields, intmp, time, lambda);
87 }
88
90 const NekDouble dtLambda)
91 {
92 return v_UpdatePreconMatCheck(res, dtLambda);
93 }
94
95 inline void SetOperators(const NekPreconCfsOperators &in)
96 {
97 m_operator = in;
98 }
99
100protected:
109
110 virtual void v_InitObject() = 0;
111
112 virtual void v_DoPreconCfs(
114 const Array<OneD, NekDouble> &pInput, Array<OneD, NekDouble> &pOutput,
115 const bool &flag) = 0;
116
117 virtual void v_BuildPreconCfs(
119 const Array<OneD, const Array<OneD, NekDouble>> &intmp,
120 const NekDouble time, const NekDouble lambda) = 0;
121
123 const NekDouble dtLambda) = 0;
124};
125
126typedef std::shared_ptr<PreconCfs> PreconCfsSharedPtr;
127
128} // namespace Nektar
129
130#endif
Provides a generic Factory class.
NekPreconCfsOperators m_operator
Definition: PreconCfs.h:104
bool UpdatePreconMatCheck(const Array< OneD, const NekDouble > &res, const NekDouble dtLambda)
Definition: PreconCfs.h:89
void SetOperators(const NekPreconCfsOperators &in)
Definition: PreconCfs.h:95
int m_PreconTimesCounter
Definition: PreconCfs.h:106
int m_PreconMatFreezNumb
Definition: PreconCfs.h:105
NekDouble m_DtLambdaPreconMat
Definition: PreconCfs.h:107
bool m_CalcPreconMatFlag
Definition: PreconCfs.h:108
virtual void v_BuildPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, const Array< OneD, NekDouble > > &intmp, const NekDouble time, const NekDouble lambda)=0
PreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm)
Definition: PreconCfs.cpp:47
virtual bool v_UpdatePreconMatCheck(const Array< OneD, const NekDouble > &res, const NekDouble dtLambda)=0
virtual void v_DoPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag)=0
void DoPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag)
Definition: PreconCfs.h:73
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:81
virtual ~PreconCfs()=default
LibUtilities::CommSharedPtr m_Comm
Definition: PreconCfs.h:101
void InitObject()
Definition: PreconCfs.h:68
virtual void v_InitObject()=0
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
LibUtilities::NekFactory< std::string, PreconCfs, const Array< OneD, MultiRegions::ExpListSharedPtr > &, const LibUtilities::SessionReaderSharedPtr &, const LibUtilities::CommSharedPtr & > PreconCfsFactory
Declaration of the boundary condition factory.
Definition: PreconCfs.h:54
PreconCfsFactory & GetPreconCfsFactory()
Declaration of the boundary condition factory singleton.
Definition: PreconCfs.cpp:41
std::shared_ptr< PreconCfs > PreconCfsSharedPtr
Definition: PreconCfs.h:126
double NekDouble