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
operatortrace.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@e.ujf-grenoble.fr>
6  Date: 2011-08-18
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 _OPERATORTRACE_HPP_
30 #define _OPERATORTRACE_HPP_
31 
33 #include <feel/feelvf/vf.hpp>
34 #include<iostream>
35 #include <feel/feeldiscr/functionspace.hpp>
36 
37 namespace Feel
38 {
39 
47 template<class fs_type>
49 {
51 
52 public :
53 
57 
58  typedef fs_type functionspace_type;
59  typedef boost::shared_ptr<functionspace_type> functionspace_ptrtype;
60  typedef typename functionspace_type::trace_functionspace_type trace_functionspace_type;
61  typedef typename trace_functionspace_type::element_type trace_element_type;
62 
64 
67 
68  OperatorTrace( functionspace_ptrtype domainSpace )
69  :
70  M_domainSpace( domainSpace )
71  {
72  }
73 
74  ~OperatorTrace() {}
76 
80 
81  BOOST_PARAMETER_MEMBER_FUNCTION( ( trace_element_type ),
82  trace,
83  tag,
84  ( required
85  ( expr, * )
86  )
87  ( optional
88  ( range, *, boundaryfaces( M_domainSpace->mesh() ) )
89  ) )
90 
91  {
92  using namespace vf;
93 
94 
95  auto Th = M_domainSpace->trace( range ) ;
96 
97  trace_element_type te = Th->element();
98 
99  te = vf::project( _space=Th, _range=elements( Th->mesh() ), _expr=expr );
100 
101  return te;
102  }
103 
105 
106 
107 private :
108 
109  functionspace_ptrtype M_domainSpace;
110 };//OperatorTrace
111 
119 template<typename self_type>
120 boost::shared_ptr< OperatorTrace<self_type> >
121 operatorTrace( boost::shared_ptr<self_type> const& domainspace )
122 {
123  typedef OperatorTrace<self_type> Trace_type;
124  boost::shared_ptr<Trace_type> trace( new Trace_type( domainspace ) );
125  return trace;
126 }
127 
128 } //namespace Feel
129 
130 
131 #endif
elements_type const & elements() const
Definition: elements.hpp:355
Polynomial< Pset, Scalar > project(Pset const &pset, Func const &f, IM const &im)
Definition: operations.hpp:436
OperatorTrace made easy.
Definition: operatortrace.hpp:48
boost::shared_ptr< OperatorTrace< self_type > > operatorTrace(boost::shared_ptr< self_type > const &domainspace)
Definition: operatortrace.hpp:121
boost::tuple< mpl::size_t< MESH_FACES >, typename MeshTraits< MeshType >::location_face_const_iterator, typename MeshTraits< MeshType >::location_face_const_iterator > boundaryfaces(MeshType const &mesh)
Definition: filters.hpp:1158

Generated on Sun Dec 22 2013 13:11:10 for Feel++ by doxygen 1.8.5