Plugins
convection_diffusion_base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3  * Author: Andreas Vogel
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__LIB_DISC__CONVECTION_DIFFUSION__CONVECTION_DIFFUSION_BASE__
34 #define __H__UG__LIB_DISC__CONVECTION_DIFFUSION__CONVECTION_DIFFUSION_BASE__
35 
36 // other ug4 modules
37 #include "common/common.h"
38 #include "lib_grid/lg_base.h"
39 
40 // library intern headers
44 
45 namespace ug{
46 namespace ConvectionDiffusionPlugin{
47 
50 
52 
76 template< typename TDomain>
78 : public IElemDisc<TDomain>
79 {
80  private:
83 
84  public:
86  static const int dim = base_type::dim;
87 
88  public:
90  ConvectionDiffusionBase(const char* functions, const char* subsets);
91  protected:
92  void init_imports();
93  public:
95 
101  void set_diffusion(number val);
102 #ifdef UG_FOR_LUA
103  void set_diffusion(const char* fctName);
105 #endif
107 
109 
115  void set_velocity(const std::vector<number>& vVel);
116 #ifdef UG_FOR_LUA
117  void set_velocity(const char* fctName);
119 #endif
121 
123 
129  void set_flux(const std::vector<number>& vVel);
130 #ifdef UG_FOR_LUA
131  void set_flux(const char* fctName);
132  void set_flux(LuaFunctionHandle fct);
133 #endif
135 
137 
142  void set_reaction_rate(number val);
143 #ifdef UG_FOR_LUA
144  void set_reaction_rate(const char* fctName);
146 #endif
148 
150 
155  void set_reaction(number val);
156 #ifdef UG_FOR_LUA
157  void set_reaction(const char* fctName);
159 #endif
161 
164 #ifdef UG_FOR_LUA
165  void set_reaction_rate_explicit(const char* fctName);
166 #endif
167 
169  void set_reaction_explicit(number val);
170 #ifdef UG_FOR_LUA
171  void set_reaction_explicit(const char* fctName);
172 #endif
173 
175  void set_source_explicit(number val);
176 #ifdef UG_FOR_LUA
177  void set_source_explicit(const char* fctName);
178 #endif
179 
181 
187  void set_source(number val);
188 #ifdef UG_FOR_LUA
189  void set_source(const char* fctName);
190  void set_source(LuaFunctionHandle fct);
191 #endif
193 
195 
202  void set_vector_source(const std::vector<number>& vVel);
203 #ifdef UG_FOR_LUA
204  void set_vector_source(const char* fctName);
206 #endif
208 
210 
215  void set_mass_scale(number val);
216 #ifdef UG_FOR_LUA
217  void set_mass_scale(const char* fctName);
219 #endif
221 
223 
228  void set_mass(number val);
229 #ifdef UG_FOR_LUA
230  void set_mass(const char* fctName);
231  void set_mass(LuaFunctionHandle fct);
232 #endif
234 
235  protected:
238 
241 
244 
247 
250 
253 
256 
259 
262 
265 
268 
271 
272  private:
274  virtual bool requests_local_time_series() {return false;}
275 
276  public:
279 
282 
285 
286  protected:
289 
292 };
293 
294 // end group convection_diffusion
296 
297 } // end ConvectionDiffusionPlugin
298 } // end namespace ug
299 
300 
301 #endif /*__H__UG__LIB_DISC__CONVECTION_DIFFUSION__CONVECTION_DIFFUSION_BASE__*/
Discretization for the Convection-Diffusion Equation.
Definition: convection_diffusion_base.h:79
DataImport< number, dim > m_imReactionRate
Data import for the reaction term.
Definition: convection_diffusion_base.h:246
DataImport< number, dim > m_imSource
Data import for the right-hand side (volume)
Definition: convection_diffusion_base.h:261
DataImport< number, dim > m_imReactionExpl
Data import for the reaction term explicit.
Definition: convection_diffusion_base.h:255
void set_diffusion(SmartPtr< CplUserData< MathMatrix< dim, dim >, dim > > user)
sets the diffusion tensor
Definition: convection_diffusion_base.cpp:51
SmartPtr< CplUserData< MathVector< dim >, dim > > GradExport
Definition: convection_diffusion_base.h:278
DataImport< number, dim > m_imSourceExpl
Data import for the source term explicit.
Definition: convection_diffusion_base.h:258
DataImport< number, dim > m_imMass
Data import for the mass scale.
Definition: convection_diffusion_base.h:270
IElemDisc< TDomain > base_type
Base class type.
Definition: convection_diffusion_base.h:82
SmartPtr< CplUserData< number, dim > > NumberExport
Definition: convection_diffusion_base.h:277
DataImport< MathVector< dim >, dim > m_imVectorSource
Data import for the right-hand side (vector)
Definition: convection_diffusion_base.h:264
void set_reaction_rate_explicit(SmartPtr< CplUserData< number, dim > > user)
Definition: convection_diffusion_base.cpp:184
void set_reaction_rate(SmartPtr< CplUserData< number, dim > > user)
sets the reaction rate
Definition: convection_diffusion_base.cpp:152
virtual SmartPtr< CplUserData< MathVector< dim >, dim > > gradient()
returns the export of the gradient of associated unknown function
Definition: convection_diffusion_base.cpp:437
virtual SmartPtr< CplUserData< number, dim > > value()
returns the export of the value of associated unknown function
Definition: convection_diffusion_base.cpp:431
void set_reaction(SmartPtr< CplUserData< number, dim > > user)
sets the reaction
Definition: convection_diffusion_base.cpp:210
SmartPtr< DataExport< number, dim > > m_exValue
Export for the concentration.
Definition: convection_diffusion_base.h:288
DataImport< MathVector< dim >, dim > m_imFlux
Data import for the Flux.
Definition: convection_diffusion_base.h:243
DataImport< MathMatrix< dim, dim >, dim > m_imDiffusion
Data import for Diffusion.
Definition: convection_diffusion_base.h:237
void set_velocity(SmartPtr< CplUserData< MathVector< dim >, dim > > user)
sets the velocity field
Definition: convection_diffusion_base.cpp:80
void set_mass_scale(SmartPtr< CplUserData< number, dim > > user)
sets mass scale
Definition: convection_diffusion_base.cpp:364
void set_source(SmartPtr< CplUserData< number, dim > > user)
sets the source / sink term
Definition: convection_diffusion_base.cpp:269
void set_flux(SmartPtr< CplUserData< MathVector< dim >, dim > > user)
sets the flux
Definition: convection_diffusion_base.cpp:116
void init_imports()
Definition: convection_diffusion_base.cpp:445
virtual bool requests_local_time_series()
returns if local time series is needed
Definition: convection_diffusion_base.h:274
ConvectionDiffusionBase(const char *functions, const char *subsets)
Constructor.
Definition: convection_diffusion_base.cpp:472
DataImport< MathVector< dim >, dim > m_imVelocity
Data import for the Velocity field.
Definition: convection_diffusion_base.h:240
void set_vector_source(SmartPtr< CplUserData< MathVector< dim >, dim > > user)
sets the vector source term
Definition: convection_diffusion_base.cpp:329
void set_mass(SmartPtr< CplUserData< number, dim > > user)
sets mass
Definition: convection_diffusion_base.cpp:396
DataImport< number, dim > m_imMassScale
Data import for the mass scale.
Definition: convection_diffusion_base.h:267
DataImport< number, dim > m_imReaction
Data import for the reaction term.
Definition: convection_diffusion_base.h:249
SmartPtr< DataExport< MathVector< dim >, dim > > m_exGrad
Export for the gradient of concentration.
Definition: convection_diffusion_base.h:291
void set_reaction_explicit(SmartPtr< CplUserData< number, dim > > user)
Definition: convection_diffusion_base.cpp:242
DataImport< number, dim > m_imReactionRateExpl
Data import for the reaction_rate term explicit.
Definition: convection_diffusion_base.h:252
static const int dim
World dimension.
Definition: convection_diffusion_base.h:86
void set_source_explicit(SmartPtr< CplUserData< number, dim > > user)
Definition: convection_diffusion_base.cpp:302
static const int dim
double number