Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DiffusionLDGNS.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: DiffusionLDGNS.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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: LDG diffusion class.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_DIFFUSIONLDGNS
37 #define NEKTAR_SOLVERUTILS_DIFFUSIONLDGNS
38 
40 
41 namespace Nektar
42 {
43  namespace SolverUtils
44  {
45  class DiffusionLDGNS : public Diffusion
46  {
47  public:
48  static DiffusionSharedPtr create(std::string diffType)
49  {
50  return DiffusionSharedPtr(new DiffusionLDGNS());
51  }
52 
53  static std::string type;
54 
55  protected:
57 
58  Array<OneD, Array<OneD, NekDouble> > m_traceVel;
59  Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
64  std::string m_ViscosityType;
69 
70  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_viscTensor;
71 
72  Array<OneD, Array<OneD, NekDouble> > m_homoDerivs;
73 
75  int m_diffDim;
76 
77  virtual void v_InitObject(
79  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
80 
81  virtual void v_Diffuse(
82  const int nConvective,
83  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
84  const Array<OneD, Array<OneD, NekDouble> > &inarray,
85  Array<OneD, Array<OneD, NekDouble> > &outarray);
86 
87  virtual void v_NumericalFluxO1(
88  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
89  const Array<OneD, Array<OneD, NekDouble> > &inarray,
90  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
91  &numericalFluxO1);
92 
93  virtual void v_WeakPenaltyO1(
94  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
95  const Array<OneD, Array<OneD, NekDouble> > &inarray,
96  Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1);
97 
98  virtual void v_NumericalFluxO2(
99  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
100  const Array<OneD, Array<OneD, NekDouble> > &ufield,
101  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&qfield,
102  Array<OneD, Array<OneD, NekDouble> > &qflux);
103 
104  virtual void v_WeakPenaltyO2(
105  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
106  const int var,
107  const int dir,
108  const Array<OneD, const NekDouble> &qfield,
109  Array<OneD, NekDouble> &penaltyflux);
110 
111  virtual void v_SetHomoDerivs(
112  Array<OneD, Array<OneD, NekDouble> > &deriv)
113  {
114  m_homoDerivs = deriv;
115  }
116 
117  virtual Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &v_GetFluxTensor()
118  {
119  return m_viscTensor;
120  }
121  };
122 
123  typedef boost::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
124  }
125 }
126 
127 #endif
128