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
geomapinv.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: 2007-06-20
7 
8  Copyright (C) 2007 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 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 __GeoMapInverse_H
30 #define __GeoMapInverse_H 1
31 
32 #include <feel/feelmesh/kdtree.hpp>
33 #include <feel/feelpoly/geomap.hpp>
34 
35 namespace Feel
36 {
44 template<int Dim,
45  int Order = 1,
46  int RealDim = Dim,
47  typename T = double,
48  template<uint16_type, uint16_type, uint16_type> class Entity = Simplex>
50 {
51 public:
52 
53 
57 
59  typedef typename gm_type::Inverse gic_type;
60  typedef T value_type;
62 
66 
67  GeoMapInverse( value_type eps = 1e-12 )
68  :
69  M_eps( eps ),
70  M_tree()
71  {}
72  GeoMapInverse( GeoMapInverse const & gmi )
73  :
74  M_eps( gmi.M_eps ),
75  M_tree( gmi.M_tree )
76  {}
77  virtual ~GeoMapInverse()
78  {}
79 
81 
85 
86 
88 
92 
93 
95 
99 
100 
102 
106 
110  void clear( void )
111  {
112  M_tree.clear();
113  }
114 
118  template<class CONT>
119  void
120  addPoints( const CONT &c )
121  {
122  M_tree.reserve( std::distance( c.begin(),c.end() ) );
123  typename CONT::const_iterator it = c.begin(), ite = c.end();
124 
125  for ( ; it != ite; ++it )
126  M_tree.addPointWithId( it->node(), it->id(), 0 );
127  }
128 
132  size_type nPoints( void ) const
133  {
134  return M_tree.nPoints();
135  }
136 
141  {
142  return M_tree.addPoint( p );
143  }
144 
150  void addPointWithId( typename node<value_type>::type const& p, size_type id, uint16_type comp )
151  {
152  M_tree.addPointWithId( p, id, comp );
153  }
154 
158  void addPointWithId( boost::tuple<typename node<value_type>::type, size_type, uint16_type > const& p )
159  {
160  M_tree.addPointWithId( boost::get<0>( p ), boost::get<1>( p ), boost::get<2>( p ) );
161  }
162 
166  size_type
167  pointsInBox( KDTree::points_type &ipts,
168  typename node<value_type>::type const& min,
169  typename node<value_type>::type const& max ) const
170  {
171  M_tree.pointsInBox( ipts, min, max );
172  return ipts.size();
173  }
174 
175 
177 
178 protected:
179 
180  value_type M_eps;
181  mutable KDTree M_tree;
182  //gic_type M_gic;
183 
184 };
185 } // Feel
186 #endif /* __GeoMapInverse_H */
size_type nPoints() const
Definition: kdtree.hpp:130
Structure for the geometrical mapping.
Definition: geomap.hpp:100
size_type nPoints(void) const
Definition: geomapinv.hpp:132
void addPointWithId(typename node< value_type >::type const &p, size_type id, uint16_type comp)
Definition: geomapinv.hpp:150
void pointsInBox(points_type &inpts, const node_type &min, const node_type &max)
Definition: kdtree.cpp:575
size_type addPoint(typename node< value_type >::type const &p)
Definition: geomapinv.hpp:140
Definition: glas.hpp:125
size_type addPoint(node_type const &n, size_type indice_global=0)
Definition: kdtree.hpp:200
handles the geometric inversion for a given (supposedly quite large) set of points ...
Definition: geomapinv.hpp:49
void reserve(size_type n)
Definition: kdtree.hpp:183
KDTree class.
Definition: kdtree.hpp:58
size_t size_type
Indices (starting from 0)
Definition: feelcore/feel.hpp:319
void clear()
Definition: kdtree.hpp:174
void addPointWithId(const node_type &n, size_type i, uint16_type comp, size_type indice_global=0)
Definition: kdtree.hpp:209
Definition: geomap.hpp:2023
void addPointWithId(boost::tuple< typename node< value_type >::type, size_type, uint16_type > const &p)
Definition: geomapinv.hpp:158
void addPoints(const CONT &c)
Definition: geomapinv.hpp:120
size_type pointsInBox(KDTree::points_type &ipts, typename node< value_type >::type const &min, typename node< value_type >::type const &max) const
Definition: geomapinv.hpp:167
void clear(void)
Definition: geomapinv.hpp:110

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