26 #ifndef __Convection_H
27 #define __Convection_H 1
46 #include <feel/feeldiscr/functionspace.hpp>
50 #include <feel/feeldiscr/operatorlagrangep1.hpp>
53 #include <feel/feelfilters/exporter.hpp>
59 using namespace Feel::vf;
61 #if !defined( CONVECTION_DIM )
62 #define CONVECTION_DIM 2
64 #if !defined( CONVECTION_ORDER_U )
65 #define CONVECTION_ORDER_U 2
67 #if !defined( CONVECTION_ORDER_P )
68 #define CONVECTION_ORDER_P 1
70 #if !defined( CONVECTION_ORDER_T )
71 #define CONVECTION_ORDER_T 2
73 #if !defined( CRB_SOLVER )
92 static const int Order_s = CONVECTION_ORDER_U;
93 static const int Order_p = CONVECTION_ORDER_P;
94 static const int Order_t = CONVECTION_ORDER_T;
100 typedef boost::shared_ptr<mesh_type> mesh_ptrtype;
103 typedef boost::shared_ptr<backend_type> backend_ptrtype;
105 typedef backend_type::sparse_matrix_ptrtype sparse_matrix_ptrtype;
106 typedef backend_type::vector_ptrtype vector_ptrtype;
109 typedef Lagrange<Order_s, Vectorial,Continuous,PointSetFekete> basis_u_type;
110 typedef Lagrange<Order_p, Scalar,Continuous,PointSetFekete> basis_p_type;
111 typedef Lagrange<Order_t, Scalar,Continuous,PointSetFekete> basis_t_type;
113 #if defined( FEELPP_USE_LM )
114 typedef Lagrange<0, Scalar> basis_l_type;
115 typedef bases< basis_u_type , basis_p_type , basis_t_type,basis_l_type> basis_type;
117 typedef bases< basis_u_type , basis_p_type , basis_t_type> basis_type;
125 typedef boost::shared_ptr<space_type> space_ptrtype;
126 typedef typename space_type::element_type element_type;
127 typedef typename element_type:: sub_element<0>::type element_0_type;
128 typedef typename element_type:: sub_element<1>::type element_1_type;
129 typedef typename element_type:: sub_element<2>::type element_2_type;
130 #if defined( FEELPP_USE_LM )
131 typedef typename element_type:: sub_element<3>::type element_3_type;
135 typedef boost::shared_ptr<oplin_type> oplin_ptrtype;
136 typedef FsFunctionalLinear<space_type> funlin_type;
137 typedef boost::shared_ptr<funlin_type> funlin_ptrtype;
146 Feel::gmsh_ptrtype createMesh();
152 void updateResidual(
const vector_ptrtype& X, vector_ptrtype& R );
153 void updateJacobian(
const vector_ptrtype& X, sparse_matrix_ptrtype& J );
157 void solve( sparse_matrix_ptrtype& D, element_type& u, vector_ptrtype& F );
160 void exportResults( boost::format, element_type& U,
double t );
161 void exportResults( element_type& U,
int i );
164 void initLinearOperator( sparse_matrix_ptrtype& L );
165 void initLinearOperator2( sparse_matrix_ptrtype& L );
166 void updateJacobian1(
const vector_ptrtype& X, sparse_matrix_ptrtype& J );
167 void updateJacobian2(
const vector_ptrtype& X, sparse_matrix_ptrtype& J );
170 backend_ptrtype M_backend;
173 boost::shared_ptr<OperatorLagrangeP1<typename space_type::sub_functionspace<2>::type::element_type> > P1h;
175 oplin_ptrtype M_oplin;
178 sparse_matrix_ptrtype M_L;
179 sparse_matrix_ptrtype M_D;
186 boost::shared_ptr<export_type> exporter;
189 std::map<std::string,std::pair<boost::timer,double> > timers;
191 std::vector <double> Grashofs;
192 double M_current_Grashofs;
193 double M_current_Prandtl;