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
periodic.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): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2008-09-30
7 
8  Copyright (C) 2008-2012 Universite 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 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 */
29 #ifndef __Periodic_H
30 #define __Periodic_H 1
31 
32 #include <feel/feelalg/glas.hpp>
33 
34 
35 namespace Feel
36 {
37 namespace detail
38 {
39 struct periodicity_base {};
40 }
41 
84 template<typename T = double >
85 class Periodic : public detail::periodicity_base
86 {
87 public:
88 
92 
93  typedef typename node<T>::type node_type;
94 
96 
100 
101  static const bool is_periodic = true;
102 
104 
108 
109  Periodic() : M_tag1(invalid_uint16_type_value), M_tag2(invalid_uint16_type_value), M_trans() {}
110  Periodic( uint16_type tag1, uint16_type tag2, node_type const& trans ) : M_tag1( tag1 ), M_tag2( tag2 ), M_trans( trans ) {}
111  Periodic( Periodic const & p ) : M_tag1( p.M_tag1 ), M_tag2( p.M_tag2 ), M_trans( p.M_trans ) {}
112  ~Periodic() {}
113 
115 
119 
120 
122 
126 
128  static bool isPeriodic()
129  {
130  return is_periodic;
131  }
132 
134  node_type const& translation()
135  {
136  return M_trans;
137  }
138 
140 
144 
145 
147 
151 
152  uint16_type tag1() const { return M_tag1; }
153  uint16_type tag2() const { return M_tag2; }
154 
156 
157 
158 
159 protected:
160 
161 private:
162  uint16_type M_tag1;
163  uint16_type M_tag2;
164  node_type M_trans;
165 };
177 class NoPeriodicity : public detail:: periodicity_base
178 {
179 public:
180 
184 
185  static const bool is_periodic = false;
186  //static const uint16_type tag1 = invalid_uint16_type_value;
187  //static const uint16_type tag2 = invalid_uint16_type_value;
188 
189  typedef node<double>::type node_type;
190 
192 
196 
197  NoPeriodicity() {}
198  /* for compatibility reasons with Periodic( int, int, node_type) */
199  NoPeriodicity( uint16_type tag1, uint16_type tag2, node_type const& trans ) {}
200 
202 
206 
208  static bool isPeriodic()
209  {
210  return is_periodic;
211  }
212 
214  node_type translation()
215  {
216  return node_type();
217  }
218 
219  uint16_type tag1() const { return invalid_uint16_type_value; }
220  uint16_type tag2() const { return invalid_uint16_type_value; }
221 
223 };
224 
225 }
226 #endif /* __Periodic_H */

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