Plugins
wall_sliding_fv1.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2017: G-CSC, Goethe University Frankfurt
3  * Author: Jonas Simon
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__FV1__BND__WALL_SLIDING___
34 #define __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FV1__BND__WALL_SLIDING___
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 "../../incompressible_navier_stokes_base.h"
46 //#include "../stabilization.h"
47 
48 namespace ug{
49 namespace NavierStokes{
50 
51 template< typename TDomain>
53  : public IElemDisc<TDomain>
54 {
55  private:
58 
61 
62  public:
65 
67  static const int dim = base_type::dim;
68 
71 
72  public:
75 
77  void add(const char* subsets);
78 
80 
86  {m_imKinViscosity.set_data(data);}
87 
89 
95  {m_imDensity.set_data(data);}
96 
98 
103  void set_sliding_factor(number val);
104 #ifdef UG_FOR_LUA
105  void set_sliding_factor(const char* fctName);
106 #endif
107 
109 
114  void set_sliding_limit(number val);
115 #ifdef UG_FOR_LUA
116  void set_sliding_limit(const char* fctName);
117 #endif
118 
119  public:
121  virtual void prepare_setting(const std::vector<LFEID>& vLfeID, bool bNonRegularGrid);
122 
123  public:
125  virtual bool requests_local_time_series() {return true;}
126 
128  template <typename TElem, typename TFVGeom>
129  void prep_elem_loop(const ReferenceObjectID roid, const int si);
130 
132  template <typename TElem, typename TFVGeom>
133  void prep_elem(const LocalVector& u, GridObject* elem, const ReferenceObjectID roid, const MathVector<dim> vCornerCoords[]);
134 
136  template <typename TElem, typename TFVGeom>
137  void fsh_elem_loop();
138 
140  template <typename TElem, typename TFVGeom>
141  void add_jac_A_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]);
142 
144  template <typename TElem, typename TFVGeom>
145  void add_def_A_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]);
146 
147  template <typename TElem, typename TFVGeom>
148  void add_jac_M_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
149  template <typename TElem, typename TFVGeom>
150  void add_def_M_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
151  template <typename TElem, typename TFVGeom>
152  void add_rhs_elem(LocalVector& d, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
153 
154  private:
157 
159  std::vector<std::string> m_vScheduledBndSubSets; // names
160  std::vector<int> m_vBndSubSetIndex; // indices
161 
162  void extract_scheduled_data(); // convert m_vScheduledBndSubSets -> m_vBndSubSetIndex
163 
173  std::vector<MathVector<dim> > m_vLocIP;
174  std::vector<MathVector<dim> > m_vGloIP;
175 
178 
180  static const size_t _P_ = dim;
181 
182  protected:
183  void register_all_funcs(bool bHang);
184  template<typename TElem, typename TFVGeom>
185  void register_func();
186 };
187 
188 } // namespace NavierStokes
189 } // end namespace ug
190 
191 #endif /* __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FV1__BND__WALL_SLIDING___ */
function NavierStokes(fcts, subsets, discType)
void set_data(SmartPtr< CplUserData< number, dim > > spData)
TDomain::position_type position_type
static const int dim
Finite Volume Element Discretization for the incompressible Navier-Stokes Equation.
Definition: incompressible_navier_stokes_base.h:146
Definition: wall_sliding_fv1.h:54
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: wall_sliding_fv1.cpp:229
base_type::position_type position_type
Position type.
Definition: wall_sliding_fv1.h:70
void add_rhs_elem(LocalVector &d, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: wall_sliding_fv1.h:152
DataImport< MathVector< dim >, dim > m_imSourceSCVF
Data import for source.
Definition: wall_sliding_fv1.h:177
DataImport< number, dim > m_imSlidingFactor
Data import for sliding factor.
Definition: wall_sliding_fv1.h:169
virtual void prepare_setting(const std::vector< LFEID > &vLfeID, bool bNonRegularGrid)
type of trial space for each function used
Definition: wall_sliding_fv1.cpp:93
void set_sliding_limit(number val)
sets the sliding limit
Definition: wall_sliding_fv1.cpp:77
void prep_elem(const LocalVector &u, GridObject *elem, const ReferenceObjectID roid, const MathVector< dim > vCornerCoords[])
prepares the element for evaluation
Definition: wall_sliding_fv1.cpp:180
void set_sliding_factor(number val)
sets the wall sliding factor
Definition: wall_sliding_fv1.cpp:61
IElemDisc< TDomain > base_type
Base class type.
Definition: wall_sliding_fv1.h:57
void extract_scheduled_data()
Definition: wall_sliding_fv1.cpp:437
void add_jac_M_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: wall_sliding_fv1.h:148
DataImport< number, dim > m_imKinViscosity
Data import for kinematic viscosity.
Definition: wall_sliding_fv1.h:165
void register_func()
Definition: wall_sliding_fv1.cpp:573
void add(const char *subsets)
adds a boundary segment
Definition: wall_sliding_fv1.cpp:52
void set_kinematic_viscosity(SmartPtr< CplUserData< number, dim > > data)
sets the kinematic viscosity
Definition: wall_sliding_fv1.h:85
NavierStokesWSBCFV1< TDomain > this_type
own type
Definition: wall_sliding_fv1.h:60
std::vector< int > m_vBndSubSetIndex
Definition: wall_sliding_fv1.h:160
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: wall_sliding_fv1.cpp:343
std::vector< MathVector< dim > > m_vLocIP
Boundary integration points of the viscosity and the density.
Definition: wall_sliding_fv1.h:173
static const int dim
World dimension.
Definition: wall_sliding_fv1.h:67
void add_def_M_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: wall_sliding_fv1.h:150
DataImport< number, dim > m_imSlidingLimit
Data import for sliding limit.
Definition: wall_sliding_fv1.h:171
std::vector< std::string > m_vScheduledBndSubSets
The boundary subsets:
Definition: wall_sliding_fv1.h:159
void fsh_elem_loop()
finishes the element loop
Definition: wall_sliding_fv1.cpp:162
void prep_elem_loop(const ReferenceObjectID roid, const int si)
prepares the element loop
Definition: wall_sliding_fv1.cpp:115
NavierStokesWSBCFV1(SmartPtr< IncompressibleNavierStokesBase< TDomain > > spMaster)
Constructor (setting default values)
Definition: wall_sliding_fv1.cpp:485
void set_density(SmartPtr< CplUserData< number, dim > > data)
sets the density
Definition: wall_sliding_fv1.h:94
base_type::domain_type domain_type
Domain type.
Definition: wall_sliding_fv1.h:64
std::vector< MathVector< dim > > m_vGloIP
Definition: wall_sliding_fv1.h:174
SmartPtr< IncompressibleNavierStokesBase< TDomain > > m_spMaster
The master discretization:
Definition: wall_sliding_fv1.h:156
static const size_t _P_
abbreviation for pressure
Definition: wall_sliding_fv1.h:180
DataImport< number, dim > m_imDensity
Data import for density.
Definition: wall_sliding_fv1.h:167
virtual bool requests_local_time_series()
returns if local time series is needed
Definition: wall_sliding_fv1.h:125
double number
ReferenceObjectID