rheolef  6.3
geo_domain_indirect.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_DOMAIN_H
2 #define _RHEOLEF_DOMAIN_H
3 
4 #include "rheolef/geo.h"
5 #include "rheolef/domain_indirect.h"
6 
7 namespace rheolef {
8 
38 typedef geo domain;
39 
40 template <class T, class M>
42 public:
44  typedef typename base::size_type size_type;
45  typedef typename base::node_type node_type;
46  typedef typename base::variant_type variant_type;
52 
53 
57 
58 
59  const domain_indirect_basic<M>& get_indirect() const { return _indirect; }
60  const geo_basic<T,M>& get_background_geo() const { return _omega; }
61 
62 
64  std::string name() const { return _indirect.name(); }
65  std::string familyname() const { return _indirect.name(); }
66  size_type serial_number() const { return _omega.serial_number(); }
67  size_type dimension() const { return _omega.dimension(); }
68  size_type map_dimension() const { return _indirect.map_dimension(); }
69  coordinate_type coordinate_system() const { return _omega.coordinate_system(); }
70  const basis_basic<T>& get_piola_basis() const { return _omega.get_piola_basis(); }
71 
72  size_type n_node() const { return _omega.n_node(); }
73  const node_type& node (size_type inod) const { return _omega.node (inod); }
74  const array<node_type,M>& get_nodes() const { return _omega.get_nodes(); }
75  const node_type& xmin () const { return _omega.xmin (); }
76  const node_type& xmax () const { return _omega.xmax (); }
77 
78 
79  const distributor& geo_element_ownership (size_type dim) const;
81  size_type neighbour (size_type ie, size_type loc_iside) const;
82  void neighbour_guard() const;
83 
84 
86  bool have_domain_indirect(const std::string& name) const;
88  const domain_indirect_basic<M>& get_domain_indirect (const std::string& name) const;
89  void insert_domain_indirect (const domain_indirect_basic<M>& dom) const;
92  const node_type& dis_node (size_type dis_inod) const;
94  node_type piola (const geo_element& K, const node_type& hat_x) const;
95  void dis_inod (const geo_element& K, std::vector<size_type>& dis_inod) const;
96  const geo_size& sizes() const;
97  const geo_size& ios_sizes() const;
98  odiststream& put (odiststream& ops) const;
99  void set_nodes (const array<node_type,M>&);
100  void reset_order (size_type order);
101  bool check(bool verbose) const;
103  const point_basic<T>& x,
104  size_type dis_ie_guest = std::numeric_limits<size_type>::max()) const;
106  const point_basic<T>& x,
107  size_type dis_ie_guest = std::numeric_limits<size_type>::max()) const;
109  const point_basic<T>& x,
110  const point_basic<T>& v,
111  point_basic<T>& y) const;
113  const point_basic<T>& x,
114  const point_basic<T>& v,
115  point_basic<T>& y) const;
116  void locate (
117  const array<point_basic<T>,M>& x,
118  array<size_type,M>& dis_ie,
119  bool do_check = false) const;
120  void trace_ray_boundary (
121  const array<point_basic<T>,M>& x,
122  const array<point_basic<T>,M>& v,
123  array<size_type, M>& dis_ie,
124  array<point_basic<T>,M>& y,
125  bool do_check = false) const;
126  void trace_move (
127  const array<point_basic<T>,M>& x,
128  const array<point_basic<T>,M>& v,
129  array<size_type, M>& dis_ie,
130  array<point_basic<T>,M>& y) const;
131 
132 protected:
135 };
136 template <class T, class M>
137 inline
139  : geo_abstract_rep<T,M>(),
140  _indirect(),
141  _omega()
142 {
143 }
144 template <class T, class M>
145 inline
148  : geo_abstract_rep<T,M>(dom),
149  _indirect(dom._indirect),
150  _omega(dom._omega)
151 {
152 }
153 template <class T, class M>
154 inline
156  : geo_abstract_rep<T,M>(),
157  _indirect (indirect),
158  _omega (omega)
159 {
160 }
161 template <class T, class M>
163 
164 template <class T>
166 public:
168  typedef typename base::size_type size_type;
169  typedef typename base::node_type node_type;
170 
174  : base(indirect,omega) {}
175  geo_abstract_rep<T,sequential>* clone() const;
176 };
177 template <class T>
178 inline
181 {
183  return new_macro(rep(*this));
184 }
185 #ifdef _RHEOLEF_HAVE_MPI
186 template <class T>
188 public:
190  typedef typename base::size_type size_type;
191  typedef typename base::node_type node_type;
193 
197  : base(indirect,omega) {}
198  geo_abstract_rep<T,distributed>* clone() const;
199 
200 
201  distributor geo_element_ios_ownership (size_type dim) const;
202  const_reference dis_get_geo_element (size_type map_dim, size_type dis_ige) const;
203  size_type ige2ios_dis_ige (size_type dim, size_type ige) const;
204  size_type dis_ige2ios_dis_ige (size_type dim, size_type dis_ige) const;
205  size_type ios_ige2dis_ige (size_type dim, size_type ios_ige) const;
206  void set_ios_permutation (
207  boost::array<size_type,reference_element::max_variant>& loc_ndof_by_variant,
208  array<size_type,distributed>& idof2ios_dis_idof) const;
209 };
210 template <class T>
211 inline
214 {
216  return new_macro(rep(*this));
217 }
218 #endif // _RHEOLEF_HAVE_MPI
219 #define _RHEOLEF_geo_cstor(M) \
220 template<class T> \
221 inline \
222 geo_basic<T,M>::geo_basic ( \
223  const domain_indirect_basic<M>& dom, \
224  const geo_basic<T,M>& omega) \
225  : base (new_macro((geo_domain_indirect_rep<T,M>)(dom,omega))) \
226 { \
227 }
228 #define _RHEOLEF_geo_dmn_by_idx(M) \
229 template<class T> \
230 inline \
231 geo_basic<T,M> \
232 geo_basic<T,M>::get_domain (size_type i) const \
233 { \
234  const domain_indirect_basic<M>& dm = base::data().get_domain_indirect (i); \
235  return geo_basic<T,M> (dm, *this); \
236 }
237 #define _RHEOLEF_geo_dmn_by_name(M) \
238 template<class T> \
239 inline \
240 geo_basic<T,M> \
241 geo_basic<T,M>::operator[] (const std::string& name) const \
242 { \
243  const domain_indirect_basic<M>& dm = base::data().get_domain_indirect (name); \
244  return geo_basic<T,M> (dm, *this); \
245 }
246 _RHEOLEF_geo_cstor(sequential)
247 _RHEOLEF_geo_dmn_by_idx(sequential)
248 _RHEOLEF_geo_dmn_by_name(sequential)
249 
250 #ifdef _RHEOLEF_HAVE_MPI
254 #endif // _RHEOLEF_HAVE_MPI
255 
256 #undef _RHEOLEF_geo_cstor
257 #undef _RHEOLEF_geo_dmn_by_idx
258 #undef _RHEOLEF_geo_dmn_by_name
259 
260 } // namespace rheolef
261 #endif // _RHEOLEF_DOMAIN_H
262