Nektar++
NekNonlinSys.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NekNonlinSys.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// License for the specific language governing rights and limitations under
14// Permission is hereby granted, free of charge, to any person obtaining a
15// copy of this software and associated documentation files (the "Software"),
16// to deal in the Software without restriction, including without limitation
17// the rights to use, copy, modify, merge, publish, distribute, sublicense,
18// and/or sell copies of the Software, and to permit persons to whom the
19// Software is furnished to do so, subject to the following conditions:
20//
21// The above copyright notice and this permission notice shall be included
22// in all copies or substantial portions of the Software.
23//
24// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30// DEALINGS IN THE SOFTWARE.
31//
32// Description: NekNonlinSys header
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_NEK_NONLINSYS_H
37#define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_NEK_NONLINSYS_H
38
41
43{
44class NekNonlinSys;
45
46typedef std::shared_ptr<NekNonlinSys> NekNonlinSysSharedPtr;
47
50 const LibUtilities::CommSharedPtr &, const int, const NekSysKey &>
53
54class NekNonlinSys : public NekSys
55{
56public:
59 const LibUtilities::CommSharedPtr &vRowComm, const int nDimen,
60 const NekSysKey &pKey);
61 LIB_UTILITIES_EXPORT ~NekNonlinSys() override = default;
62
64 const
65 {
66 return m_Solution;
67 }
68
70 const
71 {
72 return m_Residual;
73 }
74
76 const
77 {
78 return m_SourceVec;
79 }
80
82 {
83 return m_linsol;
84 }
85
87 {
88 return m_NtotLinSysIts;
89 }
90
92 {
93 m_tolerance = in;
94 }
95
97 const unsigned int in)
98 {
99 m_maxiter = in;
100 }
101
103 {
105 }
106
108 {
110 }
111
112protected:
114
117
119
122
127
128 void v_InitObject() override;
129
130private:
131};
132} // namespace Nektar::LibUtilities
133#endif
#define LIB_UTILITIES_EXPORT
Provides a generic Factory class.
Definition: NekFactory.hpp:104
void SetLinSysRelativeTolInNonlin(const NekDouble in)
Definition: NekNonlinSys.h:107
void SetNekNonlinSysTolerance(const NekDouble in)
Definition: NekNonlinSys.h:91
const Array< OneD, const NekDouble > & GetRefResidual() const
Definition: NekNonlinSys.h:69
Array< OneD, NekDouble > m_Residual
Definition: NekNonlinSys.h:124
NekNonlinSys(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vRowComm, const int nDimen, const NekSysKey &pKey)
const Array< OneD, const NekDouble > & GetRefSourceVec() const
Definition: NekNonlinSys.h:75
Array< OneD, NekDouble > m_DeltSltn
Definition: NekNonlinSys.h:125
const Array< OneD, const NekDouble > & GetRefSolution() const
Definition: NekNonlinSys.h:63
void SetNonlinIterTolRelativeL2(const NekDouble in)
Definition: NekNonlinSys.h:102
Array< OneD, NekDouble > m_SourceVec
Definition: NekNonlinSys.h:126
const NekLinSysIterSharedPtr & GetLinSys()
Definition: NekNonlinSys.h:81
NekLinSysIterSharedPtr m_linsol
Definition: NekNonlinSys.h:113
void SetNekNonlinSysMaxIterations(const unsigned int in)
Definition: NekNonlinSys.h:96
Array< OneD, NekDouble > m_Solution
Definition: NekNonlinSys.h:123
NekDouble m_tolerance
Tolerance of iterative solver.
Definition: NekSys.h:291
int m_maxiter
Maximum iterations.
Definition: NekSys.h:289
std::shared_ptr< NekLinSysIter > NekLinSysIterSharedPtr
Definition: NekLinSysIter.h:46
NekNonlinSysFactory & GetNekNonlinSysFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< NekNonlinSys > NekNonlinSysSharedPtr
Definition: NekNonlinSys.h:46
LibUtilities::NekFactory< std::string, NekNonlinSys, const LibUtilities::SessionReaderSharedPtr &, const LibUtilities::CommSharedPtr &, const int, const NekSysKey & > NekNonlinSysFactory
Definition: NekNonlinSys.h:51
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
double NekDouble