Logo
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ on Travis-CI Feel++ on Twitter Feel++ on YouTube Feel++ community
 All Classes Files Functions Variables Typedefs Pages
drivencavity.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*-
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <prudhomme@unistra.fr>
6  Date: 2013-11-22
7 
8  Copyright (C) 2013 Université de Strasbourg
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef FEELPP_DRIVENCAVITY_HPP_H
30 #define FEELPP_DRIVENCAVITY_HPP_H 1
31 
32 #include <feel/feel.hpp>
33 
34 namespace Feel
35 {
36 template<int Dim>
37 class DrivenCavity : public Application
38 {
39  typedef Application super;
40 public:
41 
42 
43  typedef double value_type;
44 
45  typedef Simplex<Dim> convex_type;
46  typedef Mesh<convex_type> mesh_type;
47  typedef boost::shared_ptr<mesh_type> mesh_ptrtype;
48 
49  /*basis*/
50 
51  typedef Lagrange<2, Vectorial> basis_u_type;
52  typedef Lagrange<1, Scalar> basis_p_type;
53  typedef Lagrange<0, Scalar> basis_l_type;
54  //#if defined( FEELPP_USE_LM )
55  typedef bases<basis_u_type,basis_p_type, basis_l_type> basis_type;
56  //#else
57  //typedef bases<basis_u_type,basis_p_type> basis_type;
58  //#endif
59 
60 
61  typedef bases<basis_u_type> basis_type_U;
62  typedef FunctionSpace<mesh_type, basis_type_U> space_type_U;
63  typedef boost::shared_ptr<space_type_U> space_ptrtype_U;
64 
65  /*space*/
66  //# marker2 #
67  typedef FunctionSpace<mesh_type, basis_type> space_type;
68  typedef boost::shared_ptr<space_type> space_ptrtype;
69  //# endmarker2 #
70 
71  /* functions */
72  //# marker3 #
73  typedef typename space_type::element_type element_type;
74  //# endmarker3 #
75 
76  /* export */
77  typedef Exporter<mesh_type> export_type;
78 
79  DrivenCavity( );
80 
81  // init mesh and space
82  FEELPP_DONT_INLINE void init();
83 
84  FEELPP_DONT_INLINE void run();
85 
86  FEELPP_DONT_INLINE void exportResults( element_type const& U );
87 
88  FEELPP_DONT_INLINE void Jacobian(const vector_ptrtype& X, sparse_matrix_ptrtype& J);
89  FEELPP_DONT_INLINE void Residual(const vector_ptrtype& X, vector_ptrtype& R);
90 
91 private:
92 
93  double meshSize;
94 
95  double Re;
96  double penalbc;
97 
98  mesh_ptrtype mesh;
99  space_ptrtype Vh;
100 
101  boost::shared_ptr<export_type> exporter;
102 }; // DrivenCavity
103 } // namespace Feel
104 #endif /* FEELPP_DRIVENCAVITY_HPP_H */
Definition: drivencavity.hpp:37