Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ContField3D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ContField3D.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
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIBS_MULTIREGIONS_CONTFIELD3D_H
37 #define NEKTAR_LIBS_MULTIREGIONS_CONTFIELD3D_H
38 
46 
47 namespace Nektar
48 {
49  namespace MultiRegions
50  {
52  {
53  public:
55 
56  /// Construct a global continuous field.
60  const std::string &variable = "DefaultVar",
61  const bool CheckIfSingularSystem = false);
62 
63  /// Construct a global continuous field with solution type based on
64  /// another field but using a separate input mesh and boundary
65  /// conditions.
66  MULTI_REGIONS_EXPORT ContField3D(const ContField3D &In,
68  const std::string &variable,
69  const bool CheckIfSingularSystem = false);
70 
71  MULTI_REGIONS_EXPORT ContField3D(const ContField3D &In);
72 
74 
76  {
77  return m_bndCondExpansions;
78  }
79 
80  /// This function return the boundary conditions expansion.
82  &GetBndCondExp();
83 
85  const GlobalLinSysKey &key,
87  Array<OneD, NekDouble> &outarray);
88 
89  inline void GlobalToLocal(
90  const Array<OneD, const NekDouble> &inarray,
91  Array<OneD,NekDouble> &outarray);
92 
93  inline void LocalToGlobal(
94  const Array<OneD, const NekDouble> &inarray,
95  Array<OneD,NekDouble> &outarray);
96 
97  inline void Assemble();
98 
99  inline void Assemble(
100  const Array<OneD, const NekDouble> &inarray,
101  Array<OneD,NekDouble> &outarray);
102 
104  const;
105 
107 
108 
109  protected:
111 
112  /// (A shared pointer to) a list which collects all the global
113  /// matrices being assembled, such that they should be constructed
114  /// only once.
116 
117  /// (A shared pointer to) a list which collects all the global
118  /// linear system being assembled, such that they should be
119  /// constructed only once.
121 
122  /// Performs the backward transformation of the spectral/hp
123  /// element expansion.
124  virtual void v_BwdTrans(
125  const Array<OneD, const NekDouble> &inarray,
126  Array<OneD, NekDouble> &outarray,
127  CoeffState coeffstate = eLocal);
128 
129  /// Calculates the inner product of a function
130  /// \f$f(\boldsymbol{x})\f$ with respect to all <em>global</em>
131  /// expansion modes \f$\phi_n^e(\boldsymbol{x})\f$.
132  virtual void v_IProductWRTBase(
133  const Array<OneD, const NekDouble> &inarray,
134  Array<OneD, NekDouble> &outarray,
135  CoeffState coeffstate = eLocal);
136 
137  virtual void v_FwdTrans(
138  const Array<OneD, const NekDouble> &inarray,
139  Array<OneD, NekDouble> &outarray,
140  CoeffState coeffstate);
141 
142 
143  private:
145 
147 
148  /// Returns the global matrix specified by \a mkey.
150 
151 
152  void GlobalSolve(const GlobalLinSysKey &key,
153  const Array<OneD, const NekDouble> &rhs,
154  Array<OneD, NekDouble> &inout,
155  const Array<OneD, const NekDouble> &dirForcing
157 
158  /// Impose the Dirichlet Boundary Conditions on outarray
159  virtual void v_ImposeDirichletConditions(Array<OneD,NekDouble>& outarray);
160 
161  virtual void v_FillBndCondFromField();
162 
163  virtual void v_LocalToGlobal(void);
164 
165 
166  virtual void v_GlobalToLocal(void);
167 
168 
169  virtual void v_MultiplyByInvMassMatrix(
170  const Array<OneD, const NekDouble> &inarray,
171  Array<OneD, NekDouble> &outarray,
172  CoeffState coeffstate);
173 
174  virtual void v_HelmSolve(
175  const Array<OneD, const NekDouble> &inarray,
176  Array<OneD, NekDouble> &outarray,
177  const FlagList &flags,
178  const StdRegions::ConstFactorMap &factors,
179  const StdRegions::VarCoeffMap &varcoeff,
180  const Array<OneD, const NekDouble> &dirForcing);
181 
182  virtual void v_GeneralMatrixOp(
183  const GlobalMatrixKey &gkey,
184  const Array<OneD,const NekDouble> &inarray,
185  Array<OneD, NekDouble> &outarray,
186  CoeffState coeffstate);
187 
188  virtual void v_ClearGlobalLinSysManager(void);
189 
190  };
191  typedef boost::shared_ptr<ContField3D> ContField3DSharedPtr;
192 
195  {
196  return m_bndCondExpansions;
197  }
198 
199 
200 
202  const Array<OneD, const NekDouble> &inarray,
203  Array<OneD,NekDouble> &outarray)
204  {
205  m_locToGloMap->GlobalToLocal(inarray, outarray);
206  }
207 
208 
210  const Array<OneD, const NekDouble> &inarray,
211  Array<OneD,NekDouble> &outarray)
212  {
213  m_locToGloMap->LocalToGlobal(inarray, outarray);
214  }
215 
216  inline void ContField3D::Assemble()
217  {
218  m_locToGloMap->Assemble(m_coeffs, m_coeffs);
219  }
220 
222  const Array<OneD, const NekDouble> &inarray,
223  Array<OneD,NekDouble> &outarray)
224  {
225  m_locToGloMap->Assemble(inarray, outarray);
226  }
227 
228  inline const AssemblyMapCGSharedPtr&
230  {
231  return m_locToGloMap;
232  }
233 
234 
235  } //end of namespace
236 } //end of namespace
237 
238 #endif // MULTIERGIONS_CONTFIELD3D_H
const Array< OneD, const MultiRegions::ExpListSharedPtr > & GetBndCondExpansions()
Definition: ContField3D.h:75
GlobalMatrixSharedPtr GetGlobalMatrix(const GlobalMatrixKey &mkey)
Returns the global matrix specified by mkey.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
Local coefficients.
static Array< OneD, NekDouble > NullNekDouble1DArray
const AssemblyMapCGSharedPtr & GetLocalToGlobalMap() const
Definition: ContField3D.h:229
const Array< OneD, const MultiRegions::ExpListSharedPtr > & GetBndCondExp()
This function return the boundary conditions expansion.
Definition: ContField3D.h:194
int GetGlobalMatrixNnz(const GlobalMatrixKey &gkey)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Calculates the inner product of a function with respect to all global expansion modes ...
#define MULTI_REGIONS_EXPORT
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:251
virtual void v_GlobalToLocal(void)
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
boost::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
Definition: GlobalMatrix.h:89
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose the Dirichlet Boundary Conditions on outarray.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
GlobalLinSysSharedPtr GenGlobalLinSys(const GlobalLinSysKey &mkey)
boost::shared_ptr< GlobalMatrixMap > GlobalMatrixMapShPtr
Shared pointer to a global matrix map.
Definition: GlobalMatrix.h:93
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
Defines a list of flags.
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Calculates the result of the multiplication of a global matrix of type specified by mkey with a vecto...
Describe a linear system.
Describes a matrix with ordering defined by a local to global map.
AssemblyMapCGSharedPtr m_locToGloMap
Definition: ContField3D.h:110
void LocalToGlobal(void)
Put the coefficients into global ordering using m_coeffs.
Definition: ExpList.h:1850
GlobalLinSysSharedPtr GetGlobalLinSys(const GlobalLinSysKey &mkey)
void GenerateDirBndCondForcing(const GlobalLinSysKey &key, Array< OneD, NekDouble > &inout, Array< OneD, NekDouble > &outarray)
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing)
void GlobalSolve(const GlobalLinSysKey &key, const Array< OneD, const NekDouble > &rhs, Array< OneD, NekDouble > &inout, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
GlobalMatrixMapShPtr m_globalMat
(A shared pointer to) a list which collects all the global matrices being assembled, such that they should be constructed only once.
Definition: ContField3D.h:115
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > m_globalLinSysManager
(A shared pointer to) a list which collects all the global linear system being assembled, such that they should be constructed only once.
Definition: ContField3D.h:120
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:52
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
boost::shared_ptr< ContField3D > ContField3DSharedPtr
Definition: ContField3D.h:191
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Performs the backward transformation of the spectral/hp element expansion.
virtual void v_ClearGlobalLinSysManager(void)
boost::shared_ptr< AssemblyMapCG > AssemblyMapCGSharedPtr
Definition: AssemblyMapCG.h:52
virtual void v_LocalToGlobal(void)
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
void GlobalToLocal(void)
Put the coefficients into local ordering and place in m_coeffs.
Definition: ExpList.h:1855