Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
operatorsteklovpoincare.hpp
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): Abdoulaye Samake <abdoulaye.samake@imag.fr>
6  Date: 2012-02-09
7 
8  Copyright (C) 2011 Université Joseph Fourier (Grenoble I)
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 _OPERATORSTEKLOVPC_HPP_
30 #define _OPERATORSTEKLOVPC_HPP_
31 
33 #include <feel/feeldiscr/operatorlift.hpp>
34 #include <feel/feeldiscr/functionspace.hpp>
35 #include <feel/feelvf/vf.hpp>
36 //#include<iostream>
37 
38 
39 namespace Feel
40 {
41 
49 template<class fs_type>
50 class OperatorSteklovPc : public OperatorLinear<fs_type, fs_type>
51 {
53 
54 public :
55 
61  typedef fs_type space_type;
62  typedef boost::shared_ptr<space_type> space_ptrtype;
63  typedef typename super::backend_type backend_type;
64  typedef typename super::backend_ptrtype backend_ptrtype;
65  typedef FsFunctionalLinear<fs_type> image_element_type;
66  typedef typename image_element_type::value_type value_type;
68 
71 
72  OperatorSteklovPc( space_ptrtype Xh, backend_ptrtype backend = Backend<double>::build( BACKEND_PETSC ) )
73  :
74  super_type( Xh, Xh, backend ),
75  M_backend( backend ),
76  M_Xh( Xh )
77  {}
78 
79  ~OperatorSteklovPc() {}
81 
85  template<typename Args,typename IntEltsDefault>
86  struct integrate_type
87  {
88  typedef typename vf::detail::clean_type<Args,tag::expr>::type _expr_type;
89  typedef typename vf::detail::clean2_type<Args,tag::range,IntEltsDefault>::type _range_type;
90  typedef typename vf::detail::clean2_type<Args,tag::quad, _Q< vf::ExpressionOrder<_range_type,_expr_type>::value > >::type _quad_type;
91  typedef typename vf::detail::clean2_type<Args,tag::quad1, _Q< vf::ExpressionOrder<_range_type,_expr_type>::value_1 > >::type _quad1_type;
92  };
93 
94  BOOST_PARAMETER_MEMBER_FUNCTION(
95  ( value_type ),
96  steklovpc,
97  tag,
98  ( required
99  ( domain, * )
100  ( image, * )
101  )
102  ( optional
103  ( quad, *, ( typename integrate_type<Args,decltype( elements( this->M_Xh->mesh() ) )>::_quad_type() ) )
104  ( quad1, *, ( typename integrate_type<Args,decltype( elements( this->M_Xh->mesh() ) )>::_quad1_type() ) )
105  ( geomap, *, GeomapStrategyType::GEOMAP_OPT )
106  ) )
107 
108  {
109  using namespace vf;
110 
111  auto op_lift = operatorLift( this->M_Xh,this->M_backend );
112  auto domain_lift = op_lift->lift( _range=this->M_Xh->mesh(),_expr=idv( domain ) );
113  auto image_lift = op_lift->lift( _range=this->M_Xh->mesh(),_expr=idv( image ) );
114  value_type steklovpcr = integrate( _range=elements( this->M_Xh->mesh() ), _expr=gradv( domain_lift )*trans( gradv( image_lift ) ), _quad=quad, _quad1=quad1 );
115  return steklovpcr;
116  }
117 
118  template<typename First, typename Second>
119  value_type
120  operator()( First const& first ,Second const& second )
121  {
122  return this->steklovpc( first, second );
123  }
124 
126 
127 
128 private :
129 
130  space_ptrtype M_Xh;
131  backend_ptrtype M_backend;
132 
133 };//OperatorSteklovPc
134 
142 template<typename space_type>
143 boost::shared_ptr< OperatorSteklovPc<space_type> >
144 operatorSteklPc( boost::shared_ptr<space_type> const& space,
145  typename OperatorSteklovPc<space_type>::backend_ptrtype const& backend = Backend<double>::build( BACKEND_PETSC ) )
146 {
147  typedef OperatorSteklovPc<space_type> StekPc_type;
148  boost::shared_ptr<StekPc_type> Steklov( new StekPc_type( space, backend ) );
149  return Steklov;
150 }
151 
152 } //namespace Feel
153 
154 
155 #endif

Generated on Sun Oct 20 2013 08:25:03 for Feel++ by doxygen 1.8.4