Nektar++
DiffusionLDG.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: DiffusionLDG.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: LDG diffusion class.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERUTILS_DIFFUSIONWEAKDG
36#define NEKTAR_SOLVERUTILS_DIFFUSIONWEAKDG
37
39
40namespace Nektar::SolverUtils
41{
42class DiffusionLDG : public Diffusion
43{
44public:
45 static DiffusionSharedPtr create([[maybe_unused]] std::string diffType)
46 {
47 return DiffusionSharedPtr(new DiffusionLDG());
48 }
49
50 static std::string type;
51
52protected:
54
55 void v_InitObject(
58
59 void v_Diffuse(const std::size_t nConvective,
61 const Array<OneD, Array<OneD, NekDouble>> &inarray,
63 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
64 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
65
66 void v_DiffuseCoeffs(
67 const std::size_t nConvective,
69 const Array<OneD, Array<OneD, NekDouble>> &inarray,
71 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
72 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
73
76 const Array<OneD, Array<OneD, NekDouble>> &inarray,
78 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
79 const Array<OneD, Array<OneD, NekDouble>> &pBwd) override;
80
83 const Array<OneD, Array<OneD, NekDouble>> &inarray,
86 Array<OneD, int> &nonZeroIndex) override;
87
90 const Array<OneD, Array<OneD, NekDouble>> &inarray,
94 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
95 const Array<OneD, Array<OneD, NekDouble>> &pBwd,
96 Array<OneD, int> &nonZeroIndex) override;
97
98private:
99 std::string m_shockCaptureType;
100
101 /// Coefficient of penalty term
103
106
107 void NumFluxforScalar(
109 const Array<OneD, Array<OneD, NekDouble>> &ufield,
111 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
112 const Array<OneD, Array<OneD, NekDouble>> &pBwd);
113
114 void ApplyScalarBCs(
116 const std::size_t var, const Array<OneD, const NekDouble> &ufield,
119 Array<OneD, NekDouble> &penaltyflux);
120
121 void NumFluxforVector(
123 const Array<OneD, Array<OneD, NekDouble>> &ufield,
126
127 void ApplyVectorBCs(
129 const std::size_t var, const std::size_t dir,
130 const Array<OneD, const NekDouble> &qfield,
133 Array<OneD, NekDouble> &penaltyflux);
134};
135} // namespace Nektar::SolverUtils
136
137#endif
void v_Diffuse(const std::size_t nConvective, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override
void ApplyScalarBCs(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const std::size_t var, const Array< OneD, const NekDouble > &ufield, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &penaltyflux)
void v_DiffuseVolumeFlux(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, TensorOfArray3D< NekDouble > &VolumeFlux, Array< OneD, int > &nonZeroIndex) override
Diffusion Volume Flux.
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Definition: DiffusionLDG.h:104
static DiffusionSharedPtr create(std::string diffType)
Definition: DiffusionLDG.h:45
void ApplyVectorBCs(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const std::size_t var, const std::size_t dir, const Array< OneD, const NekDouble > &qfield, const Array< OneD, const NekDouble > &qFwd, const Array< OneD, const NekDouble > &qBwd, Array< OneD, NekDouble > &penaltyflux)
void v_DiffuseCalcDerivative(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override
Diffusion Flux, calculate the physical derivatives.
void NumFluxforScalar(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &ufield, TensorOfArray3D< NekDouble > &uflux, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd)
void v_DiffuseCoeffs(const std::size_t nConvective, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override
LibUtilities::SessionReaderSharedPtr m_session
Definition: DiffusionLDG.h:105
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
void NumFluxforVector(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &ufield, TensorOfArray3D< NekDouble > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)
Build the numerical flux for the 2nd order derivatives todo: add variable coeff and h dependence to p...
NekDouble m_C11
Coefficient of penalty term.
Definition: DiffusionLDG.h:102
void v_DiffuseTraceFlux(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, TensorOfArray3D< NekDouble > &VolumeFlux, Array< OneD, Array< OneD, NekDouble > > &TraceFlux, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd, Array< OneD, int > &nonZeroIndex) override
Diffusion term Trace Flux.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Diffusion > DiffusionSharedPtr
A shared pointer to an EquationSystem object.
Definition: Diffusion.h:55
double NekDouble