Nektar++
PreconCfsOp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: PreconCfsOp.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: PreconCfsOp header
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_PRECONCFSOP
36#define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_PRECONCFSOP
37
41
42namespace Nektar
43{
44// =====================================================================
45// ==== Defines operators needed by operator based preconditioner in the
46// ==== CFS solver
47// =====================================================================
49{
50public:
53
54 typedef std::function<void(
55 const Array<OneD, const Array<OneD, NekDouble>> &,
61
63 static const int nfunctor = 1;
64
66 {
67 }
68
71 {
72 for (int i = 0; i < nfunctor; ++i)
73 {
74 m_functors[i] = in.m_functors[i];
75 }
76 }
77
79 {
80 for (int i = 0; i < nfunctor; ++i)
81 {
82 m_functors[i] = in.m_functors[i];
83 }
84 return *this;
85 }
86
87 template <typename FuncPointerT, typename ObjectPointerT>
88 void DefineCalcPreconMatBRJCoeff(FuncPointerT func, ObjectPointerT obj)
89 {
90 m_functors[0] = std::bind(func, obj, std::placeholders::_1,
91 std::placeholders::_2, std::placeholders::_3,
92 std::placeholders::_4, std::placeholders::_5,
93 std::placeholders::_6, std::placeholders::_7,
94 std::placeholders::_8, std::placeholders::_9);
95 }
96
98 const Array<OneD, const Array<OneD, NekDouble>> &inarray,
102 Array<OneD, Array<OneD, NekSingle>> &TraceJacDerivSign,
103 TensorOfArray4D<NekSingle> &TraceJacArray,
104 TensorOfArray4D<NekSingle> &TraceJacDerivArray,
105 TensorOfArray5D<NekSingle> &TraceIPSymJacArray)
106 {
107 ASSERTL1(m_functors[0], "DoNekSysResEval should be defined");
108 m_functors[0](inarray, gmtxarray, gmtVar, TraceJac, TraceJacDeriv,
109 TraceJacDerivSign, TraceJacArray, TraceJacDerivArray,
110 TraceIPSymJacArray);
111 }
112
113protected:
115};
116
117} // namespace Nektar
118
119#endif
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
Array< OneD, NekDouble > OutArrayType
Definition: PreconCfsOp.h:52
NekPreconCfsOperators(const NekPreconCfsOperators &in)
Definition: PreconCfsOp.h:69
const Array< OneD, NekDouble > InArrayType
Definition: PreconCfsOp.h:51
Array< OneD, Functor > FunctorArray
Definition: PreconCfsOp.h:62
void DoCalcPreconMatBRJCoeff(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, SNekBlkMatSharedPtr > > &gmtxarray, SNekBlkMatSharedPtr &gmtVar, Array< OneD, SNekBlkMatSharedPtr > &TraceJac, Array< OneD, SNekBlkMatSharedPtr > &TraceJacDeriv, Array< OneD, Array< OneD, NekSingle > > &TraceJacDerivSign, TensorOfArray4D< NekSingle > &TraceJacArray, TensorOfArray4D< NekSingle > &TraceJacDerivArray, TensorOfArray5D< NekSingle > &TraceIPSymJacArray)
Definition: PreconCfsOp.h:97
static const int nfunctor
Definition: PreconCfsOp.h:63
void DefineCalcPreconMatBRJCoeff(FuncPointerT func, ObjectPointerT obj)
Definition: PreconCfsOp.h:88
std::function< void(const Array< OneD, const Array< OneD, NekDouble > > &, Array< OneD, Array< OneD, SNekBlkMatSharedPtr > > &, SNekBlkMatSharedPtr &, Array< OneD, SNekBlkMatSharedPtr > &, Array< OneD, SNekBlkMatSharedPtr > &, Array< OneD, Array< OneD, NekSingle > > &, TensorOfArray4D< NekSingle > &, TensorOfArray4D< NekSingle > &, TensorOfArray5D< NekSingle > &)> Functor
Definition: PreconCfsOp.h:60
NekPreconCfsOperators & operator=(const NekPreconCfsOperators &in)
Definition: PreconCfsOp.h:78
std::shared_ptr< SNekBlkMat > SNekBlkMatSharedPtr