Nektar++
Loading...
Searching...
No Matches
SteadyADR.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: SteadyADR.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: Steady Advection Diffusion problem solve routines for new
32// operators
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#pragma once
37
39#include <SolverCore/EquationSystems/EquationSystem.h>
40#include <SolverCore/Forcing/Forcing.h>
41
42namespace Nektar
43{
44namespace MultiRegions
45{
46template <typename TData> class BwdTransOp;
47} // namespace MultiRegions
48
49namespace SolverCore
50{
51template <typename TData> class LinearSolverOp;
52template <typename TData> class LinearSystemOp;
53template <typename TData> class PreconOp;
54} // namespace SolverCore
55
56using namespace SolverCore;
57using namespace MultiRegions;
58
60{
61public:
62 friend class MemoryManager<SteadyADR>;
63
64 /// Creates an instance of this class
68 {
71 equ->InitObject();
72 return equ;
73 }
74
75 /// Name of class
76 static std::string className1;
77 static std::string className2;
78 static std::string className3;
79
80protected:
81 // Diffusion coefficient
82 double m_epsilon;
83 double m_lambda;
84 std::vector<double> m_diffCoeff;
85 // Own the tensor for the lifetime of the operators which borrow it.
88
89 // Setup workspaces
92
93 // Initialise operators
94 std::shared_ptr<BwdTransOp<double>> m_bwdTransOp;
95 std::shared_ptr<LinearSystemOp<double>> m_linearSystemOp;
96 std::shared_ptr<LinearSolverOp<double>> m_linearSolverOp;
97 std::shared_ptr<PreconOp<double>> m_preconOp;
98 std::vector<ForcingSharedPtr> m_forcing;
99
102
103 ~SteadyADR() override = default;
104
105 void v_InitObject(bool declareExpansionLists = true) override;
106
107 void v_DoSolve() override;
108
109 void v_GenerateSummary(SummaryList &s) override;
110
112
113 void v_InitialiseFields() override;
114
115 void SetAdvectionVel();
116
117 void SetDiffusionCoeff();
118
119 void v_InitialiseOperators() override;
120};
121
122} // namespace Nektar
A Field represents expansion data to be operated on.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Whole-field interface of the backward transform: evaluates a coefficient-space field at the quadratur...
A base class for describing how to solve specific equations.
~SteadyADR() override=default
std::shared_ptr< LinearSolverOp< double > > m_linearSolverOp
Definition SteadyADR.h:96
std::vector< ForcingSharedPtr > m_forcing
Definition SteadyADR.h:98
static std::string className1
Name of class.
Definition SteadyADR.h:76
static std::string className3
Definition SteadyADR.h:78
LibUtilities::Field< double, FieldState::Phys > m_varDiffCoeff
Definition SteadyADR.h:86
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
Definition SteadyADR.h:65
void v_InitialiseOperators() override
void SetDiffusionCoeff()
Set the diffusion Coeff. the diff. coeff., diffCoeff_{ij} := \epslion * D_{ij} where,...
void v_GenerateSummary(SummaryList &s) override
Virtual function for generating summary information.
static std::string className2
Definition SteadyADR.h:77
SessionFunctionSharedPtr m_varDiffCoeffFunction
Definition SteadyADR.h:87
std::vector< double > m_diffCoeff
Definition SteadyADR.h:84
void LoadSessionParameters()
std::shared_ptr< BwdTransOp< double > > m_bwdTransOp
Definition SteadyADR.h:94
void v_InitObject(bool declareExpansionLists=true) override
Initialisation object for the SteadyADR problem.
Definition SteadyADR.cpp:72
LibUtilities::Field< double, FieldState::Phys > m_advectionVel
Definition SteadyADR.h:91
std::shared_ptr< PreconOp< double > > m_preconOp
Definition SteadyADR.h:97
LibUtilities::Field< double, FieldState::Phys > m_fce
Definition SteadyADR.h:90
std::shared_ptr< LinearSystemOp< double > > m_linearSystemOp
Definition SteadyADR.h:95
void v_InitialiseFields() override
void v_DoSolve() override
Solves SteadyADR problem.
Definition SteadyADR.cpp:96
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< std::pair< std::string, std::string > > SummaryList
Definition Misc.h:46
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
std::shared_ptr< SessionFunction > SessionFunctionSharedPtr
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:287