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
38{
39namespace SolverUtils
40{
42{
43 static DiffusionFactory instance;
44 return instance;
45}
46
49{
50 v_InitObject(pSession, pFields);
51
52 // Div curl storage
53 int nPts = pFields[0]->GetTotPoints();
57}
58
60 const std::size_t nConvectiveFields,
62 const Array<OneD, Array<OneD, NekDouble>> &inarray,
64 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
65 const Array<OneD, Array<OneD, NekDouble>> &pBwd)
66{
67 boost::ignore_unused(nConvectiveFields, fields, inarray, outarray, pFwd,
68 pBwd);
69 NEKERROR(ErrorUtil::efatal, "v_DiffuseCoeffs not defined");
70}
71
73{
74 NEKERROR(ErrorUtil::efatal, "v_GetTraceNormal not defined");
76}
77
80 const Array<OneD, Array<OneD, NekDouble>> &inarray,
82 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
83 const Array<OneD, Array<OneD, NekDouble>> &pBwd)
84{
85 boost::ignore_unused(fields, inarray, qfields, pFwd, pBwd);
86 NEKERROR(ErrorUtil::efatal, "Not defined for function DiffuseVolumeFLux.");
87}
88
91 const Array<OneD, Array<OneD, NekDouble>> &inarray,
93 Array<OneD, int> &nonZeroIndex)
94{
95 boost::ignore_unused(fields, inarray, qfields, VolumeFlux, nonZeroIndex);
96 NEKERROR(ErrorUtil::efatal, "Not defined for function DiffuseVolumeFLux.");
97}
98
101 const Array<OneD, Array<OneD, NekDouble>> &inarray,
103 Array<OneD, Array<OneD, NekDouble>> &TraceFlux,
104 const Array<OneD, Array<OneD, NekDouble>> &pFwd,
105 const Array<OneD, Array<OneD, NekDouble>> &pBwd,
106 Array<OneD, int> &nonZeroIndex)
107{
108 boost::ignore_unused(fields, inarray, qfields, VolumeFlux, TraceFlux, pFwd,
109 pBwd, nonZeroIndex);
110 NEKERROR(ErrorUtil::efatal, "Not defined function DiffuseTraceFLux.");
111}
112
113} // namespace SolverUtils
114} // namespace Nektar
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
Provides a generic Factory class.
Definition: NekFactory.hpp:105
Array< OneD, NekDouble > m_divVelSquare
Definition: Diffusion.h:347
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:59
Array< OneD, NekDouble > m_divVel
Params for Ducros sensor.
Definition: Diffusion.h:346
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:89
Array< OneD, NekDouble > m_curlVelSquare
Definition: Diffusion.h:348
SOLVER_UTILS_EXPORT void InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Definition: Diffusion.cpp:47
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:78
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:99
virtual SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & v_GetTraceNormal()
Definition: Diffusion.cpp:72
std::shared_ptr< SessionReader > SessionReaderSharedPtr
DiffusionFactory & GetDiffusionFactory()
Definition: Diffusion.cpp:41
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray