Plugins
no_normal_stress_outflow_fvcr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2014: G-CSC, Goethe University Frankfurt
3  * Author: Christian Wehner
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__NO_NORMAL_STRESS_OUTFLOW_FVCR__
34 #define __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__NO_NORMAL_STRESS_OUTFLOW_FVCR__
35 
36 // other ug4 modules
37 #include "common/common.h"
38 #include "lib_grid/lg_base.h"
39 
40 // library intern headers
44 
45 #include "../../bnd/no_normal_stress_outflow_base.h"
46 
47 namespace ug{
48 namespace NavierStokes{
49 
50 
53 
55 
69 template< typename TDomain>
72 {
73  private:
76 
79 
80  public:
82  static const int dim = base_type::dim;
83 
84  public:
87 
88  protected:
91  {m_imKinViscosity.set_data(data);}
92 
95  {m_imDensity.set_data(data);}
96 
97  public:
99  virtual void prepare_setting(const std::vector<LFEID>& vLfeID, bool bNonRegularGrid);
100 
101  public:
103  template <typename TElem, typename TFVGeom>
104  void prep_elem_loop(const ReferenceObjectID roid, const int si);
105 
107  template <typename TElem, typename TFVGeom>
108  void prep_elem(const LocalVector& u, GridObject* elem, const ReferenceObjectID roid, const MathVector<dim> vCornerCoords[]);
109 
111  template <typename TElem, typename TFVGeom>
112  void fsh_elem_loop();
113 
115  template <typename TElem, typename TFVGeom>
116  void add_jac_A_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]);
117 
119  template <typename TElem, typename TFVGeom>
120  void add_def_A_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]);
121 
122  public:
125  template <typename TElem, typename TFVGeom>
126  void add_jac_M_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]){}
127  template <typename TElem, typename TFVGeom>
128  void add_def_M_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]){}
129  template <typename TElem, typename TFVGeom>
130  void add_rhs_elem(LocalVector& d, GridObject* elem, const MathVector<dim> vCornerCoords[]){}
132 
133  private:
135  template <typename BF>
136  inline void diffusive_flux_Jac
137  (
138  const size_t ip,
139  const BF& bf,
140  LocalMatrix& J,
141  const LocalVector& u
142  );
144  template <typename BF>
145  inline void diffusive_flux_defect
146  (
147  const size_t ip,
148  const BF& bf,
149  LocalVector& d,
150  const LocalVector& u
151  );
153  template <typename BF>
154  inline void convective_flux_Jac
155  (
156  const size_t ip,
157  const BF& bf,
158  LocalMatrix& J,
159  const LocalVector& u
160  );
162  template <typename BF>
163  inline void convective_flux_defect
164  (
165  const size_t ip,
166  const BF& bf,
167  LocalVector& d,
168  const LocalVector& u
169  );
170 
171  protected:
173  static const size_t _P_ = dim;
174 
175  using base_type::m_spMaster;
177 
180 
183 
185  std::vector<MathVector<dim> > m_vLocIP;
186  std::vector<MathVector<dim> > m_vGloIP;
187 
188  protected:
189  void register_all_funcs(bool bHang);
190  template<typename TElem, typename TFVGeom>
191  void register_func();
192 
193 };
194 
196 
197 } // namespace NavierStokes
198 } // end namespace ug
199 
200 #endif /*__H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__NO_NORMAL_STRESS_OUTFLOW_FVCR__*/
function NavierStokes(fcts, subsets, discType)
void set_data(SmartPtr< CplUserData< number, dim > > spData)
Finite Volume Element Discretization for the incompressible Navier-Stokes Equation.
Definition: incompressible_navier_stokes_base.h:146
The zero-stress (neutral) outflow boundary condition for the incompressible NS equation.
Definition: no_normal_stress_outflow_base.h:72
static const int dim
World dimension.
Definition: no_normal_stress_outflow_base.h:82
std::vector< int > m_vBndSubSetIndex
Definition: no_normal_stress_outflow_base.h:108
SmartPtr< IncompressibleNavierStokesBase< TDomain > > m_spMaster
The master discretization:
Definition: no_normal_stress_outflow_base.h:104
The zero-stress (neutral) outflow boundary condition for the incompressible NS equation.
Definition: no_normal_stress_outflow_fvcr.h:72
void add_jac_M_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: no_normal_stress_outflow_fvcr.h:126
virtual void set_kinematic_viscosity(SmartPtr< CplUserData< number, dim > > data)
sets the kinematic viscosity
Definition: no_normal_stress_outflow_fvcr.h:90
void register_func()
Definition: no_normal_stress_outflow_fvcr.cpp:499
NavierStokesNoNormalStressOutflowBase< TDomain > base_type
Base class type.
Definition: no_normal_stress_outflow_fvcr.h:75
std::vector< MathVector< dim > > m_vLocIP
Boundary integration points of the viscosity and the density.
Definition: no_normal_stress_outflow_fvcr.h:185
void add_def_M_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: no_normal_stress_outflow_fvcr.h:128
void fsh_elem_loop()
finishes the element loop
Definition: no_normal_stress_outflow_fvcr.cpp:137
void convective_flux_Jac(const size_t ip, const BF &bf, LocalMatrix &J, const LocalVector &u)
adds the convective part of the local Jacobian of the momentum equation
Definition: no_normal_stress_outflow_fvcr.cpp:289
DataImport< number, dim > m_imKinViscosity
Data import for kinematic viscosity.
Definition: no_normal_stress_outflow_fvcr.h:179
void add_rhs_elem(LocalVector &d, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: no_normal_stress_outflow_fvcr.h:130
void convective_flux_defect(const size_t ip, const BF &bf, LocalVector &d, const LocalVector &u)
adds the convective part of the local defect of the momentum equation
Definition: no_normal_stress_outflow_fvcr.cpp:324
NavierStokesNoNormalStressOutflowFVCR< TDomain > this_type
own type
Definition: no_normal_stress_outflow_fvcr.h:78
void prep_elem_loop(const ReferenceObjectID roid, const int si)
prepares the element loop
Definition: no_normal_stress_outflow_fvcr.cpp:100
std::vector< MathVector< dim > > m_vGloIP
Definition: no_normal_stress_outflow_fvcr.h:186
static const int dim
World dimension.
Definition: no_normal_stress_outflow_fvcr.h:82
DataImport< number, dim > m_imDensity
Data import for density.
Definition: no_normal_stress_outflow_fvcr.h:182
NavierStokesNoNormalStressOutflowFVCR(SmartPtr< IncompressibleNavierStokesBase< TDomain > > spMaster)
Constructor (setting default values)
Definition: no_normal_stress_outflow_fvcr.cpp:47
static const size_t _P_
abbreviation for pressure
Definition: no_normal_stress_outflow_fvcr.h:173
void prep_elem(const LocalVector &u, GridObject *elem, const ReferenceObjectID roid, const MathVector< dim > vCornerCoords[])
prepares the element for evaluation
Definition: no_normal_stress_outflow_fvcr.cpp:155
void diffusive_flux_defect(const size_t ip, const BF &bf, LocalVector &d, const LocalVector &u)
adds the diffusive part of the local defect of the momentum equation
Definition: no_normal_stress_outflow_fvcr.cpp:244
void diffusive_flux_Jac(const size_t ip, const BF &bf, LocalMatrix &J, const LocalVector &u)
adds the diffusive part of the local Jacobian of the momentum equation
Definition: no_normal_stress_outflow_fvcr.cpp:199
void add_def_A_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
adds the stiffness part to the local defect
Definition: no_normal_stress_outflow_fvcr.cpp:399
virtual void set_density(SmartPtr< CplUserData< number, dim > > data)
sets the density
Definition: no_normal_stress_outflow_fvcr.h:94
virtual void prepare_setting(const std::vector< LFEID > &vLfeID, bool bNonRegularGrid)
type of trial space for each function used
Definition: no_normal_stress_outflow_fvcr.cpp:66
void add_jac_A_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
adds the stiffness part to the local jacobian
Definition: no_normal_stress_outflow_fvcr.cpp:353
ReferenceObjectID