Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DisContField2D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File DisContField2D.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: Field definition in two-dimensions for a discontinuous LDG-H
33 // expansion.
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD2D_H
38 #define NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD2D_H
39 
42 #include <MultiRegions/ExpList2D.h>
46 
47 namespace Nektar
48 {
49  namespace MultiRegions
50  {
51  class DisContField2D : public ExpList2D
52  {
53  public:
55 
59  const std::string &variable,
60  const bool SetUpJustDG = true,
61  const bool DeclareCoeffPhysArrays = true);
62 
64  const DisContField2D &In,
66  const std::string &variable,
67  const bool SetUpJustDG = false,
68  const bool DeclareCoeffPhysArrays = true);
69 
71  const DisContField2D &In,
72  const bool DeclareCoeffPhysArrays = true);
73 
75 
77  const GlobalLinSysKey &mkey);
78 
80  const int dir,
81  const Array<OneD, const NekDouble> &soln);
82 
84  Array<OneD, NekDouble> &outarray);
85 
87  {
89  {
90  SetUpDG();
91  }
92 
93  return m_trace;
94  }
95 
96 
97  protected:
98  /**
99  * @brief An object which contains the discretised boundary
100  * conditions.
101  *
102  * It is an array of size equal to the number of boundary regions
103  * and consists of entries of the type MultiRegions#ExpList1D. Every
104  * entry corresponds to the one-dimensional spectral/hp expansion on
105  * a single boundary region. The values of the boundary conditions
106  * are stored as the coefficients of the one-dimensional expansion.
107  */
108  Array<OneD,MultiRegions::ExpListSharedPtr> m_bndCondExpansions;
109 
110  /**
111  * @brief An array which contains the information about
112  * the boundary condition on the different boundary regions.
113  */
114  Array<OneD,SpatialDomains::BoundaryConditionShPtr> m_bndConditions;
115 
119 
120  Array<OneD, Array<OneD, unsigned int> > m_mapEdgeToElmn;
121  Array<OneD, Array<OneD, unsigned int> > m_signEdgeToElmn;
122  Array<OneD,StdRegions::Orientation> m_edgedir;
123 
124  /**
125  * @brief A set storing the global IDs of any boundary edges.
126  */
127  std::set<int> m_boundaryEdges;
128 
129  /**
130  * @brief A map which identifies groups of periodic vertices.
131  */
133 
134  /**
135  * @brief A map which identifies pairs of periodic edges.
136  */
138 
139 
140  /**
141  * @brief A vector indicating degress of freedom which need to be
142  * copied from forwards to backwards space in case of a periodic
143  * boundary condition.
144  */
145  vector<int> m_periodicFwdCopy;
146  vector<int> m_periodicBwdCopy;
147 
148  /*
149  * @brief A map identifying which edges are left- and right-adjacent
150  * for DG.
151  */
152  vector<bool> m_leftAdjacentEdges;
153 
154  void SetUpDG(const std::string = "DefaultVar");
155  bool SameTypeOfBoundaryConditions(const DisContField2D &In);
157  const SpatialDomains::MeshGraphSharedPtr &graph2D,
159  const std::string &variable,
160  const bool DeclareCoeffPhysArrays = true);
161  void FindPeriodicEdges(
163  const std::string &variable);
164 
165  bool IsLeftAdjacentEdge(const int n, const int e);
166 
167  virtual void v_GetFwdBwdTracePhys(
168  const Array<OneD, const NekDouble> &field,
169  Array<OneD, NekDouble> &Fwd,
170  Array<OneD, NekDouble> &Bwd);
171  virtual void v_GetFwdBwdTracePhys(
172  Array<OneD, NekDouble> &Fwd,
173  Array<OneD, NekDouble> &Bwd);
174  virtual void v_AddTraceIntegral(
175  const Array<OneD, const NekDouble> &Fx,
176  const Array<OneD, const NekDouble> &Fy,
177  Array<OneD, NekDouble> &outarray);
178  virtual void v_AddTraceIntegral(
179  const Array<OneD, const NekDouble> &Fn,
180  Array<OneD, NekDouble> &outarray);
181  virtual void v_AddFwdBwdTraceIntegral(
182  const Array<OneD, const NekDouble> &Fwd,
183  const Array<OneD, const NekDouble> &Bwd,
184  Array<OneD, NekDouble> &outarray);
185  virtual void v_ExtractTracePhys(
186  const Array<OneD, const NekDouble> &inarray,
187  Array<OneD, NekDouble> &outarray);
188  virtual void v_ExtractTracePhys(
189  Array<OneD, NekDouble> &outarray);
190  virtual void v_FillBndCondFromField();
191  virtual void v_HelmSolve(
192  const Array<OneD, const NekDouble> &inarray,
193  Array<OneD, NekDouble> &outarray,
194  const FlagList &flags,
195  const StdRegions::ConstFactorMap &factors,
196  const StdRegions::VarCoeffMap &varcoeff,
197  const Array<OneD, const NekDouble> &dirForcing);
198  virtual void v_GeneralMatrixOp(
199  const GlobalMatrixKey &gkey,
200  const Array<OneD,const NekDouble> &inarray,
201  Array<OneD, NekDouble> &outarray,
202  CoeffState coeffstate = eLocal);
203  virtual void v_GetBoundaryToElmtMap(
204  Array<OneD, int> &ElmtID,
205  Array<OneD, int> &EdgeID);
206 
207  /**
208  * @brief Obtain a copy of the periodic edges and vertices for this
209  * field.
210  */
211  virtual void v_GetPeriodicEntities(
212  PeriodicMap &periodicVerts,
213  PeriodicMap &periodicEdges,
214  PeriodicMap &periodicFaces)
215  {
216  periodicVerts = m_periodicVerts;
217  periodicEdges = m_periodicEdges;
218  }
219 
220 
222  {
223  return m_traceMap;
224  }
225 
226  virtual const Array<OneD,const MultiRegions::ExpListSharedPtr>
228  {
229  return m_bndCondExpansions;
230  }
231 
232  virtual const
233  Array<OneD,const SpatialDomains::BoundaryConditionShPtr>
235  {
236  return m_bndConditions;
237  }
238 
241  {
242  return m_bndCondExpansions[i];
243  }
244 
245  virtual Array<OneD, SpatialDomains::BoundaryConditionShPtr>
247  {
248  return m_bndConditions;
249  }
250 
251  virtual void v_EvaluateBoundaryConditions(
252  const NekDouble time = 0.0,
253  const std::string varName = "",
256 
257  virtual map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo();
258  };
259 
260  typedef boost::shared_ptr<DisContField2D> DisContField2DSharedPtr;
261  } //end of namespace
262 } //end of namespace
263 
264 #endif // MULTIERGIONS_DISCONTFIELD2D_H