35#include "rheolef/geo.h"
43template <
class T,
class M>
52 if (dis_ie != std::numeric_limits<size_type>::max()) {
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()) {
73 if (dis_ie != std::numeric_limits<size_type>::max()) {
79 return std::numeric_limits<size_type>::max();
81template <
class T,
class M>
90 if (dis_ie != std::numeric_limits<size_type>::max()) {
98 dis_ie =
_locator.dis_locate (*
this,y);
99 check_macro (dis_ie != std::numeric_limits<size_type>::max(),
"invalid ray computation");
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());
120 for (
size_type i = 0, n = x.size(); i < n; i++) {
125#ifdef _RHEOLEF_HAVE_MPI
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());
141 for (
size_type i = 0, n = x.size(); i < n; i++) {
144 bool do_stop_when_failed =
false;
146 locate (y, dis_ie, do_stop_when_failed);
151 std::list<size_type> failed;
152 for (
size_type i = 0, n = x.size(); i < n; i++) {
153 if (dis_ie[i] != std::numeric_limits<size_type>::max())
continue;
155 failed.push_back (i);
158 if (fld_ownership.
dis_size() == 0) {
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;
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];
196#ifdef _RHEOLEF_HAVE_MPI
see the disarray page for the full documentation
see the distributor page for the full documentation
size_type dis_size() const
global and local sizes
static const size_type decide
base class for M=sequential or distributed meshes representations
geo_locate< T, M > _locator
geo_trace_ray_boundary< T, M > _tracer_ray_boundary
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 seq_nearest(const point_basic< T > &x, point_basic< T > &x_nearest) const
size_type dis_trace_move(const point_basic< T > &x, const point_basic< T > &v, point_basic< T > &y) const
const communicator & comm() const
void trace_ray_boundary(const disarray< point_basic< T >, distributed > &x, const disarray< point_basic< T >, distributed > &v, disarray< size_type, distributed > &dis_ie, disarray< point_basic< T >, distributed > &y, bool do_check=false) const
base::size_type size_type
void locate(const disarray< point_basic< T >, distributed > &x, disarray< size_type, distributed > &dis_ie, bool do_check=false) const
base::size_type size_type
sequential mesh representation
#define trace_macro(message)
#define error_macro(message)
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.