Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DiffusionLFR.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: DiffusionLFR.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: LFR diffusion class.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_DIFFUSIONLFR
37 #define NEKTAR_SOLVERUTILS_DIFFUSIONLFR
38 
40 
41 namespace Nektar
42 {
43  namespace SolverUtils
44  {
45  class DiffusionLFR : public Diffusion
46  {
47  public:
48  static DiffusionSharedPtr create(std::string diffType)
49  {
50  return DiffusionSharedPtr(new DiffusionLFR(diffType));
51  }
52 
53  static std::string type[];
54 
55  Array<OneD, NekDouble> m_jac;
56  Array<OneD, Array<OneD, NekDouble> > m_gmat;
57 
58  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e0;
59  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e1;
60  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e2;
61  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e3;
62 
63  Array<OneD, Array<OneD, NekDouble> > m_dGL_xi1;
64  Array<OneD, Array<OneD, NekDouble> > m_dGR_xi1;
65  Array<OneD, Array<OneD, NekDouble> > m_dGL_xi2;
66  Array<OneD, Array<OneD, NekDouble> > m_dGR_xi2;
67  Array<OneD, Array<OneD, NekDouble> > m_dGL_xi3;
68  Array<OneD, Array<OneD, NekDouble> > m_dGR_xi3;
71 
72  protected:
73  DiffusionLFR(std::string diffType);
74 
75  Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
77 
78  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_IF1;
79  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DU1;
80  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DFC1;
81  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_BD1;
82  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_D1;
83  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DD1;
84  Array<OneD, Array<OneD, NekDouble> > m_IF2;
85  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DFC2;
86  Array<OneD, Array<OneD, NekDouble> > m_divFD;
87  Array<OneD, Array<OneD, NekDouble> > m_divFC;
88 
89  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_tmp1;
90  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_tmp2;
91 
92  std::string m_diffType;
93 
94  virtual void v_InitObject(
96  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
97 
98  virtual void v_SetupMetrics(
100  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
101 
102  virtual void v_SetupCFunctions(
104  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
105 
106  virtual void v_Diffuse(
107  const int nConvectiveFields,
108  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
109  const Array<OneD, Array<OneD, NekDouble> > &inarray,
110  Array<OneD, Array<OneD, NekDouble> > &outarray);
111 
112  virtual void v_NumFluxforScalar(
113  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
114  const Array<OneD, Array<OneD, NekDouble> > &ufield,
115  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&uflux);
116 
117  virtual void v_WeakPenaltyforScalar(
118  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
119  const int var,
120  const Array<OneD, const NekDouble> &ufield,
121  Array<OneD, NekDouble> &penaltyflux);
122 
123  virtual void v_NumFluxforVector(
124  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
125  const Array<OneD, Array<OneD, NekDouble> > &ufield,
126  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&qfield,
127  Array<OneD, Array<OneD, NekDouble> > &qflux);
128 
129  virtual void v_WeakPenaltyforVector(
130  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
131  const int var,
132  const int dir,
133  const Array<OneD, const NekDouble> &qfield,
134  Array<OneD, NekDouble> &penaltyflux,
135  NekDouble C11);
136 
137  virtual void v_DerCFlux_1D(
138  const int nConvectiveFields,
139  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
140  const Array<OneD, const NekDouble> &flux,
141  const Array<OneD, const NekDouble> &iFlux,
142  Array<OneD, NekDouble> &derCFlux);
143 
144  virtual void v_DerCFlux_2D(
145  const int nConvectiveFields,
146  const int direction,
147  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
148  const Array<OneD, const NekDouble> &flux,
149  const Array<OneD, NekDouble> &iFlux,
150  Array<OneD, NekDouble> &derCFlux);
151 
152  virtual void v_DivCFlux_2D(
153  const int nConvectiveFields,
154  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
155  const Array<OneD, const NekDouble> &fluxX1,
156  const Array<OneD, const NekDouble> &fluxX2,
157  const Array<OneD, const NekDouble> &numericalFlux,
158  Array<OneD, NekDouble> &divCFlux);
159 
160  virtual void v_DivCFlux_2D_Gauss(
161  const int nConvectiveFields,
162  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
163  const Array<OneD, const NekDouble> &fluxX1,
164  const Array<OneD, const NekDouble> &fluxX2,
165  const Array<OneD, const NekDouble> &numericalFlux,
166  Array<OneD, NekDouble> &divCFlux);
167  };
168  }
169 }
170 
171 #endif