Nektar++
Diffusion.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Diffusion.cpp
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: Abstract base class for diffusion.
32//
33///////////////////////////////////////////////////////////////////////////////
34
36
37namespace Nektar::SolverUtils
38{
40{
41 static DiffusionFactory instance;
42 return instance;
43}
44
47{
48 v_InitObject(pSession, pFields);
49
50 // Div curl storage
51 int nPts = pFields[0]->GetTotPoints();
55}
56
58 [[maybe_unused]] const std::size_t nConvectiveFields,
59 [[maybe_unused]] const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
60 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &inarray,
61 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &outarray,
62 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pFwd,
63 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pBwd)
64{
65 NEKERROR(ErrorUtil::efatal, "v_DiffuseCoeffs not defined");
66}
67
69{
70 NEKERROR(ErrorUtil::efatal, "v_GetTraceNormal not defined");
72}
73
75 [[maybe_unused]] const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
76 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &inarray,
77 [[maybe_unused]] TensorOfArray3D<NekDouble> &qfields,
78 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pFwd,
79 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pBwd)
80{
81 NEKERROR(ErrorUtil::efatal, "Not defined for function DiffuseVolumeFLux.");
82}
83
85 [[maybe_unused]] const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
86 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &inarray,
87 [[maybe_unused]] TensorOfArray3D<NekDouble> &qfields,
88 [[maybe_unused]] TensorOfArray3D<NekDouble> &VolumeFlux,
89 [[maybe_unused]] Array<OneD, int> &nonZeroIndex)
90{
91 NEKERROR(ErrorUtil::efatal, "Not defined for function DiffuseVolumeFLux.");
92}
93
95 [[maybe_unused]] const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
96 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &inarray,
97 [[maybe_unused]] TensorOfArray3D<NekDouble> &qfields,
98 [[maybe_unused]] TensorOfArray3D<NekDouble> &VolumeFlux,
99 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &TraceFlux,
100 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pFwd,
101 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &pBwd,
102 [[maybe_unused]] Array<OneD, int> &nonZeroIndex)
103{
104 NEKERROR(ErrorUtil::efatal, "Not defined function DiffuseTraceFLux.");
105}
106
107} // namespace Nektar::SolverUtils
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
Provides a generic Factory class.
Array< OneD, NekDouble > m_divVelSquare
Definition: Diffusion.h:350
virtual SOLVER_UTILS_EXPORT void v_DiffuseCoeffs(const std::size_t nConvectiveFields, 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)
Definition: Diffusion.cpp:57
Array< OneD, NekDouble > m_divVel
Params for Ducros sensor.
Definition: Diffusion.h:349
virtual SOLVER_UTILS_EXPORT 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)
Diffusion Volume Flux.
Definition: Diffusion.cpp:84
Array< OneD, NekDouble > m_curlVelSquare
Definition: Diffusion.h:351
SOLVER_UTILS_EXPORT void InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Definition: Diffusion.cpp:45
virtual SOLVER_UTILS_EXPORT 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)
Diffusion Flux, calculate the physical derivatives.
Definition: Diffusion.cpp:74
virtual SOLVER_UTILS_EXPORT void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)=0
virtual SOLVER_UTILS_EXPORT 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)
Diffusion term Trace Flux.
Definition: Diffusion.cpp:94
virtual SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & v_GetTraceNormal()
Definition: Diffusion.cpp:68
std::shared_ptr< SessionReader > SessionReaderSharedPtr
DiffusionFactory & GetDiffusionFactory()
Definition: Diffusion.cpp:39
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray