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