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
operator.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 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2 
3  This file is part of the Feel library
4 
5  Author(s): Christoph Winkelmann <christoph.winkelmann@epfl.ch>
6  Date: 2006-11-16
7 
8  Copyright (C) 2006 EPFL
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 3.0 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 */
30 #ifndef _OPERATOR_HPP_
31 #define _OPERATOR_HPP_
32 
33 #include <feel/feelalg/backend.hpp>
35 
36 namespace Feel
37 {
38 
43 template<class DomainSpace, class DualImageSpace>
44 class Operator
45 {
46 public:
47 
48  // -- TYPEDEFS --
49  typedef DomainSpace domain_space_type;
50  typedef DualImageSpace dual_image_space_type;
51 
52  typedef typename domain_space_type::value_type value_type;
54  typedef boost::shared_ptr<backend_type> backend_ptrtype;
55 
56  typedef boost::shared_ptr<domain_space_type> domain_space_ptrtype;
57  typedef boost::shared_ptr<dual_image_space_type>
58  dual_image_space_ptrtype;
59  typedef typename domain_space_type::element_type domain_element_type;
60  typedef FsFunctionalLinear<dual_image_space_type> image_element_type;
61 
62  Operator()
63  :
64  M_domainSpace(),
65  M_dualImageSpace()
66  {}
67 
68  Operator( domain_space_ptrtype domainSpace,
69  dual_image_space_ptrtype dualImageSpace ) :
70  M_domainSpace( domainSpace ),
71  M_dualImageSpace( dualImageSpace )
72  {}
73 
74  virtual ~Operator() {}
75 
76  void setDomainSpace( domain_space_ptrtype const& domainspace )
77  {
78  M_domainSpace = domainspace;
79  }
80 
81  void setDualImageSpace( dual_image_space_ptrtype const& dualImageSpace )
82  {
83  M_dualImageSpace = dualImageSpace;
84  }
85 
86  // apply the operator: ie := Op de
87  virtual void
88  apply( const domain_element_type& de,
89  image_element_type& ie ) const = 0;
90 
91 
92 
93  // for convenience
94  image_element_type operator()( const domain_element_type& de ) const
95  {
96  image_element_type ie( M_dualImageSpace );
97  apply( de, ie );
98  return ie;
99  }
100 
101  domain_space_ptrtype domainSpace()
102  {
103  return M_domainSpace;
104  }
105 
106  dual_image_space_ptrtype dualImageSpace()
107  {
108  return M_dualImageSpace;
109  }
110 
111  const domain_space_ptrtype domainSpace() const
112  {
113  return M_domainSpace;
114  }
115 
116  const dual_image_space_ptrtype dualImageSpace() const
117  {
118  return M_dualImageSpace;
119  }
120 
121 private:
122 
123  domain_space_ptrtype M_domainSpace;
124  dual_image_space_ptrtype M_dualImageSpace;
125 
126 }; // class Operator
127 
128 } // Feel
129 
130 #endif /* _OPERATOR_HPP_ */

Generated on Fri Oct 25 2013 14:24:20 for Feel++ by doxygen 1.8.4