35 #include "rheolef/geo.h"
43 template <
class T,
class M>
51 size_type dis_ie = _locator.seq_locate (*
this,y);
52 if (dis_ie != std::numeric_limits<size_type>::max()) {
57 bool hit = _tracer_ray_boundary.seq_trace_ray_boundary (*
this, x, v, y);
60 dis_ie = _locator.seq_locate (*
this,y);
61 check_macro (dis_ie != std::numeric_limits<size_type>::max(),
"invalid ray computation");
65 dis_ie = _locator.seq_locate (*
this,y);
66 if (dis_ie != std::numeric_limits<size_type>::max()) {
72 dis_ie = seq_nearest (y, y_nearest);
73 if (dis_ie != std::numeric_limits<size_type>::max()) {
78 error_macro (
"invalid seq_trace_move");
79 return std::numeric_limits<size_type>::max();
81 template <
class T,
class M>
89 size_type dis_ie = _locator.dis_locate (*
this,y);
90 if (dis_ie != std::numeric_limits<size_type>::max()) {
95 bool hit = _tracer_ray_boundary.dis_trace_ray_boundary (*
this, x, v, y);
98 dis_ie = _locator.dis_locate (*
this,y);
99 check_macro (dis_ie != std::numeric_limits<size_type>::max(),
"invalid ray computation");
103 error_macro (
"invalid dis_trace_move");
104 return std::numeric_limits<size_type>::max();
117 check_macro (x.ownership() == v.ownership(),
"invalid ranges for x and v argumenst");
118 dis_ie.resize (x.ownership());
119 y.resize (x.ownership());
122 dis_ie[i] = base::seq_trace_move (x[i], v[i], y[i]);
125 #ifdef _RHEOLEF_HAVE_MPI
134 trace_macro(
"trace_move...");
135 check_macro (x.ownership() == v.ownership(),
"invalid ranges for x and v argumenst");
136 if (dis_ie.ownership() != x.ownership()) dis_ie.resize (x.ownership());
137 y.resize (x.ownership());
144 bool do_stop_when_failed =
false;
145 trace_macro(
"trace_move/locate...");
146 locate (y, dis_ie, do_stop_when_failed);
151 std::list<size_type> failed;
153 if (dis_ie[i] != std::numeric_limits<size_type>::max())
continue;
155 failed.push_back (i);
158 if (fld_ownership.dis_size() == 0) {
160 trace_macro(
"trace_move done(1)");
163 disarray<point_basic<T> > fld_x (fld_ownership);
164 disarray<point_basic<T> > fld_v (fld_ownership);
165 disarray<point_basic<T> > fld_y (fld_ownership);
166 disarray<size_type> fld_dis_ie (fld_ownership, std::numeric_limits<size_type>::max());
167 typename std::list<size_type>::const_iterator iter = failed.begin();
168 for (
size_type fld_i = 0, fld_n = fld_x.size(); fld_i < fld_n; ++fld_i, ++iter) {
170 fld_x [fld_i] = x[i];
171 fld_v [fld_i] = v[i];
173 do_stop_when_failed =
true;
174 trace_macro(
"trace_move/ray_boundary...");
175 trace_ray_boundary (fld_x, fld_v, fld_dis_ie, fld_y, do_stop_when_failed);
176 trace_macro(
"trace_move/ray_boundary = "
177 << fld_x.dis_size() <<
"/" << x.dis_size() <<
" = "
178 << 1.0*fld_x.dis_size()/x.dis_size());
182 iter = failed.begin();
183 for (
size_type fld_i = 0, fld_n = fld_x.size(); fld_i < fld_n; ++fld_i, ++iter) {
185 dis_ie[i] = fld_dis_ie [fld_i];
186 y[i] = fld_y [fld_i];
188 trace_macro(
"trace_move done(2)");
194 template class geo_base_rep<Float,sequential>;
195 template class geo_rep<Float,sequential>;
196 #ifdef _RHEOLEF_HAVE_MPI
197 template class geo_base_rep<Float,distributed>;
198 template class geo_rep<Float,distributed>;
field::size_type size_type
see the disarray page for the full documentation
static const size_type decide
geo_element_hack::size_type size_type
base::size_type size_type
size_type seq_trace_move(const point_basic< T > &x, const point_basic< T > &v, point_basic< T > &y) const
size_type dis_trace_move(const point_basic< T > &x, const point_basic< T > &v, point_basic< T > &y) const
sequential mesh representation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.