DiffusionLDG.h 5.03 KB
Newer Older
1 2
///////////////////////////////////////////////////////////////////////////////
//
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
3
// File: DiffusionLDG.h
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
31
// Description: LDG diffusion class.
32 33 34 35 36 37
//
///////////////////////////////////////////////////////////////////////////////

#ifndef NEKTAR_SOLVERUTILS_DIFFUSIONWEAKDG
#define NEKTAR_SOLVERUTILS_DIFFUSIONWEAKDG

38 39
#include <boost/core/ignore_unused.hpp>

40 41 42 43 44 45
#include <SolverUtils/Diffusion/Diffusion.h>

namespace Nektar
{
    namespace SolverUtils
    {
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
46
        class DiffusionLDG : public Diffusion
47 48 49 50
        {
        public:
            static DiffusionSharedPtr create(std::string diffType)
            {
51
                boost::ignore_unused(diffType);
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
52
                return DiffusionSharedPtr(new DiffusionLDG());
53
            }
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
54

55
            static std::string type;
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
56

57
        protected:
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
58
            DiffusionLDG();
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
59 60 61 62 63 64

            std::string                            m_shockCaptureType;

            /// Coefficient of penalty term
            NekDouble                                         m_C11;

65 66
            Array<OneD, Array<OneD, NekDouble> >              m_traceNormals;
            LibUtilities::SessionReaderSharedPtr              m_session;
Dave Moxey's avatar
Dave Moxey committed
67

68
            virtual void v_InitObject(
69 70
                LibUtilities::SessionReaderSharedPtr               pSession,
                Array<OneD, MultiRegions::ExpListSharedPtr>        pFields);
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
71

72
            virtual void v_Diffuse(
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
73
                const std::size_t                                  nConvective,
74 75
                const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
                const Array<OneD, Array<OneD, NekDouble> >        &inarray,
76 77 78
                      Array<OneD, Array<OneD, NekDouble> >        &outarray,
                const Array<OneD, Array<OneD, NekDouble> > &pFwd = NullNekDoubleArrayofArray,
                const Array<OneD, Array<OneD, NekDouble> > &pBwd = NullNekDoubleArrayofArray);
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
79 80

            void NumFluxforScalar(
81 82
                const Array<OneD, MultiRegions::ExpListSharedPtr>       &fields,
                const Array<OneD, Array<OneD, NekDouble> >              &ufield,
83 84 85
                      Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&uflux,
                const Array<OneD, Array<OneD, NekDouble> > &pFwd = NullNekDoubleArrayofArray,
                const Array<OneD, Array<OneD, NekDouble> > &pBwd = NullNekDoubleArrayofArray);
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
86 87

            void ApplyScalarBCs(
88
                const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
89
                const std::size_t                                  var,
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
90
                const Array<OneD, const NekDouble>                &ufield,
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
91 92
                const Array<OneD, const NekDouble>                &Fwd,
                const Array<OneD, const NekDouble>                &Bwd,
93
                      Array<OneD,       NekDouble>                &penaltyflux);
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
94 95

            void NumFluxforVector(
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
96 97 98 99
                const Array<OneD, MultiRegions::ExpListSharedPtr>       &fields,
                const Array<OneD, Array<OneD, NekDouble> >              &ufield,
                      Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&qfield,
                      Array<OneD, Array<OneD, NekDouble> >              &qflux);
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
100 101

            void ApplyVectorBCs(
102
                const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
103 104
                const std::size_t                                  var,
                const std::size_t                                  dir,
Gianmarco Mengaldo's avatar
Gianmarco Mengaldo committed
105
                const Array<OneD, const NekDouble>                &qfield,
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
106 107 108 109
                const Array<OneD, const NekDouble>                &qFwd,
                const Array<OneD, const NekDouble>                &qBwd,
                      Array<OneD,       NekDouble>                &penaltyflux);
        };
110 111
    }
}
Giacomo Castiglioni's avatar
Giacomo Castiglioni committed
112

113
#endif