44 if (Sub_bin_array_pt != 0)
46 delete Sub_bin_array_pt;
50 if (Sample_point_pt != 0)
52 unsigned n = Sample_point_pt->size();
53 for (
unsigned i = 0;
i < n;
i++)
55 delete (*Sample_point_pt)[
i];
57 delete Sample_point_pt;
71 if (Sub_bin_array_pt != 0)
74 Sub_bin_array_pt->total_number_of_sample_points_computed_recursively();
78 if (Sample_point_pt != 0)
80 count = Sample_point_pt->size();
92 const Vector<std::pair<double, double>>& min_and_max_coordinates)
95 RefineableBinArrayParameters* ref_bin_array_parameters_pt =
96 new RefineableBinArrayParameters(Bin_array_pt->mesh_pt());
99 ref_bin_array_parameters_pt->min_and_max_coordinates() =
100 min_and_max_coordinates;
102 ref_bin_array_parameters_pt->dimensions_of_bin_array() =
103 Bin_array_pt->dimensions_of_bin_array();
106 if (Bin_array_pt->use_eulerian_coordinates_during_setup())
108 ref_bin_array_parameters_pt
109 ->enable_use_eulerian_coordinates_during_setup();
113 ref_bin_array_parameters_pt
114 ->disable_use_eulerian_coordinates_during_setup();
121 if (Bin_array_pt->ignore_halo_elements_during_locate_zeta_search())
123 ref_bin_array_parameters_pt
124 ->enable_ignore_halo_elements_during_locate_zeta_search();
128 ref_bin_array_parameters_pt
129 ->disable_ignore_halo_elements_during_locate_zeta_search();
135 ref_bin_array_parameters_pt->nsample_points_generated_per_element() =
136 Bin_array_pt->nsample_points_generated_per_element();
140 if (Bin_array_pt->bin_array_is_recursive())
142 ref_bin_array_parameters_pt->enable_bin_array_is_recursive();
146 ref_bin_array_parameters_pt->disable_bin_array_is_recursive();
150 ref_bin_array_parameters_pt->depth() = Bin_array_pt->depth() + 1;
153 ref_bin_array_parameters_pt->max_depth() = Bin_array_pt->max_depth();
156 ref_bin_array_parameters_pt->max_number_of_sample_point_per_bin() =
157 Bin_array_pt->max_number_of_sample_point_per_bin();
160 ref_bin_array_parameters_pt->root_bin_array_pt() =
161 Bin_array_pt->root_bin_array_pt();
164 BinArrayParameters* bin_array_parameters_pt = ref_bin_array_parameters_pt;
166 delete ref_bin_array_parameters_pt;
169 Sub_bin_array_pt->fill_bin_array(*Sample_point_pt);
173 delete Sample_point_pt;
184 if ((Sub_bin_array_pt != 0) && (!don_t_recurse))
186 Sub_bin_array_pt->output_bins(outfile);
190 unsigned n_lagr = Bin_array_pt->ndim_zeta();
191 Vector<std::pair<double, double>> min_and_max_coordinates(n_lagr);
192 get_bin_boundaries(min_and_max_coordinates);
195 unsigned n_sample_points = 0;
196 if (Sample_point_pt != 0)
198 n_sample_points = Sample_point_pt->size();
204 outfile <<
"ZONE I=2\n"
205 << min_and_max_coordinates[0].first <<
" " << n_sample_points
207 << min_and_max_coordinates[0].second <<
" " << n_sample_points
213 outfile <<
"ZONE I=2, J=2\n"
214 << min_and_max_coordinates[0].first <<
" "
215 << min_and_max_coordinates[1].first <<
" " << n_sample_points
218 << min_and_max_coordinates[0].second <<
" "
219 << min_and_max_coordinates[1].first <<
" " << n_sample_points
222 << min_and_max_coordinates[0].first <<
" "
223 << min_and_max_coordinates[1].second <<
" " << n_sample_points
226 << min_and_max_coordinates[0].second <<
" "
227 << min_and_max_coordinates[1].second <<
" " << n_sample_points
234 outfile <<
"ZONE I=2, J=2, K=2\n"
235 << min_and_max_coordinates[0].first <<
" "
236 << min_and_max_coordinates[1].first <<
" "
237 << min_and_max_coordinates[2].first <<
" " << n_sample_points
240 << min_and_max_coordinates[0].second <<
" "
241 << min_and_max_coordinates[1].first <<
" "
242 << min_and_max_coordinates[2].first <<
" " << n_sample_points
245 << min_and_max_coordinates[0].first <<
" "
246 << min_and_max_coordinates[1].second <<
" "
247 << min_and_max_coordinates[2].first <<
" " << n_sample_points
250 << min_and_max_coordinates[0].second <<
" "
251 << min_and_max_coordinates[1].second <<
" "
252 << min_and_max_coordinates[2].first <<
" " << n_sample_points
255 << min_and_max_coordinates[0].first <<
" "
256 << min_and_max_coordinates[1].first <<
" "
257 << min_and_max_coordinates[2].second <<
" " << n_sample_points
260 << min_and_max_coordinates[0].second <<
" "
261 << min_and_max_coordinates[1].first <<
" "
262 << min_and_max_coordinates[2].second <<
" " << n_sample_points
265 << min_and_max_coordinates[0].first <<
" "
266 << min_and_max_coordinates[1].second <<
" "
267 << min_and_max_coordinates[2].second <<
" " << n_sample_points
270 << min_and_max_coordinates[0].second <<
" "
271 << min_and_max_coordinates[1].second <<
" "
272 << min_and_max_coordinates[2].second <<
" " << n_sample_points
279 oomph_info <<
"n_lagr=" << n_lagr << std::endl;
280 throw OomphLibError(
"Wrong dimension",
281 OOMPH_CURRENT_FUNCTION,
282 OOMPH_EXCEPTION_LOCATION);
294 if (Sub_bin_array_pt != 0)
296 Sub_bin_array_pt->output_bin_vertices(outfile);
300 unsigned n_lagr = Bin_array_pt->ndim_zeta();
301 Vector<std::pair<double, double>> min_and_max_coordinates(n_lagr);
302 get_bin_boundaries(min_and_max_coordinates);
307 outfile <<
"ZONE I=2\n"
308 << min_and_max_coordinates[0].first << std::endl
309 << min_and_max_coordinates[0].second << std::endl;
314 outfile <<
"ZONE I=2, J=2\n"
315 << min_and_max_coordinates[0].first <<
" "
316 << min_and_max_coordinates[1].first <<
" "
319 << min_and_max_coordinates[0].second <<
" "
320 << min_and_max_coordinates[1].first <<
" "
323 << min_and_max_coordinates[0].first <<
" "
324 << min_and_max_coordinates[1].second <<
" "
327 << min_and_max_coordinates[0].second <<
" "
328 << min_and_max_coordinates[1].second <<
" "
335 outfile <<
"ZONE I=2, J=2, K=2\n"
336 << min_and_max_coordinates[0].first <<
" "
337 << min_and_max_coordinates[1].first <<
" "
338 << min_and_max_coordinates[2].first <<
" "
341 << min_and_max_coordinates[0].second <<
" "
342 << min_and_max_coordinates[1].first <<
" "
343 << min_and_max_coordinates[2].first <<
" "
346 << min_and_max_coordinates[0].first <<
" "
347 << min_and_max_coordinates[1].second <<
" "
348 << min_and_max_coordinates[2].first <<
" "
351 << min_and_max_coordinates[0].second <<
" "
352 << min_and_max_coordinates[1].second <<
" "
353 << min_and_max_coordinates[2].first <<
" "
356 << min_and_max_coordinates[0].first <<
" "
357 << min_and_max_coordinates[1].first <<
" "
358 << min_and_max_coordinates[2].second <<
" "
361 << min_and_max_coordinates[0].second <<
" "
362 << min_and_max_coordinates[1].first <<
" "
363 << min_and_max_coordinates[2].second <<
" "
366 << min_and_max_coordinates[0].first <<
" "
367 << min_and_max_coordinates[1].second <<
" "
368 << min_and_max_coordinates[2].second <<
" "
371 << min_and_max_coordinates[0].second <<
" "
372 << min_and_max_coordinates[1].second <<
" "
373 << min_and_max_coordinates[2].second <<
" "
380 oomph_info <<
"n_lagr=" << n_lagr << std::endl;
381 throw OomphLibError(
"Wrong dimension",
382 OOMPH_CURRENT_FUNCTION,
383 OOMPH_EXCEPTION_LOCATION);
393 const Vector<double>& zeta_coordinates)
396 if (Sub_bin_array_pt == 0)
399 if (Sample_point_pt == 0)
401 Sample_point_pt =
new Vector<SamplePoint*>;
403 this->Sample_point_pt->push_back(new_sample_point_pt);
409 if ((Bin_array_pt->bin_array_is_recursive()) &&
410 (Sample_point_pt->size() >
411 Bin_array_pt->max_number_of_sample_point_per_bin()) &&
412 (Bin_array_pt->depth() < Bin_array_pt->max_depth()))
415 Vector<std::pair<double, double>> min_and_max_coordinates(
416 Bin_array_pt->ndim_zeta());
417 get_bin_boundaries(min_and_max_coordinates);
421 this->make_sub_bin_array(min_and_max_coordinates);
427 this->Sub_bin_array_pt->add_sample_point(new_sample_point_pt,
439 GeomObject*& sub_geom_object_pt,
443 sub_geom_object_pt = 0;
446 if (Sub_bin_array_pt != 0)
448 Sub_bin_array_pt->locate_zeta(zeta, sub_geom_object_pt,
s);
458 Bin_array_pt->root_bin_array_pt()
459 ->total_number_of_sample_points_visited_during_locate_zeta_from_top_level() <
460 Bin_array_pt->root_bin_array_pt()
461 ->first_sample_point_to_actually_lookup_during_locate_zeta())
468 Bin_array_pt->root_bin_array_pt()
469 ->total_number_of_sample_points_visited_during_locate_zeta_from_top_level() >
470 Bin_array_pt->root_bin_array_pt()
471 ->last_sample_point_to_actually_lookup_during_locate_zeta())
477 double max_search_radius =
478 Bin_array_pt->root_bin_array_pt()->max_search_radius();
479 bool dont_do_it_because_of_radius =
false;
480 if (max_search_radius < DBL_MAX)
483 unsigned n = zeta.size();
484 double dist_squared = 0.0;
487 Vector<std::pair<double, double>> min_and_max_coordinates(n);
488 get_bin_boundaries(min_and_max_coordinates);
489 for (
unsigned i = 0;
i < n;
i++)
491 cog = 0.5 * (min_and_max_coordinates[
i].first +
492 min_and_max_coordinates[
i].second);
493 aux = (cog - zeta[
i]);
494 dist_squared += aux * aux;
496 if (dist_squared > max_search_radius * max_search_radius)
499 dont_do_it_because_of_radius =
true;
505 if (!dont_do_it_because_of_radius)
508 Bin_array_pt->root_bin_array_pt()
509 ->total_number_of_sample_points_visited_during_locate_zeta_from_top_level() +=
510 Sample_point_pt->size();
517 unsigned n_sample_point = Sample_point_pt->size();
519 while ((
i < n_sample_point) && (sub_geom_object_pt == 0))
522 FiniteElement* el_pt = Bin_array_pt->mesh_pt()->finite_element_pt(
523 (*Sample_point_pt)[
i]->element_index_in_mesh());
528 if ((Bin_array_pt->ignore_halo_elements_during_locate_zeta_search()) &&
538 bool use_equally_spaced_interior_sample_points =
540 unsigned j = (*Sample_point_pt)[
i]->sample_point_index_in_element();
543 Bin_array_pt->nsample_points_generated_per_element(),
545 use_equally_spaced_interior_sample_points);
551 unsigned cached_dim_zeta = Bin_array_pt->ndim_zeta();
552 Vector<double> zeta_sample(cached_dim_zeta);
553 if (Bin_array_pt->use_eulerian_coordinates_during_setup())
555 el_pt->interpolated_x(
s, zeta_sample);
559 el_pt->interpolated_zeta(
s, zeta_sample);
562 for (
unsigned ii = 0; ii < cached_dim_zeta; ii++)
566 (zeta[ii] - zeta_sample[ii]) * (zeta[ii] - zeta_sample[ii]);
569 << Bin_array_pt->root_bin_array_pt()
570 ->total_number_of_sample_points_visited_during_locate_zeta_from_top_level()
571 <<
" " << sqrt(dist) << std::endl;
576 Bin_array_pt->root_bin_array_pt()
577 ->total_number_of_sample_points_visited_during_locate_zeta_from_top_level()++;
579 bool use_coordinate_as_initial_guess =
true;
581 zeta, sub_geom_object_pt,
s, use_coordinate_as_initial_guess);
587 sub_geom_object_pt = 0;
604 Vector<std::pair<double, double>>& min_and_max_coordinates)
606 unsigned n_bin = Bin_index_in_bin_array;
609 unsigned current_dim = Bin_array_pt->ndim_zeta();
610 min_and_max_coordinates.resize(current_dim);
611 for (
unsigned u = 0; u < current_dim; u++)
614 double nbin_in_dir = n_bin % Bin_array_pt->dimension_of_bin_array(u);
615 n_bin /= Bin_array_pt->dimension_of_bin_array(u);
618 double range = (Bin_array_pt->min_and_max_coordinates(u).second -
619 Bin_array_pt->min_and_max_coordinates(u).first) /
620 double(Bin_array_pt->dimension_of_bin_array(u));
623 min_and_max_coordinates[u].first =
624 Bin_array_pt->min_and_max_coordinates(u).first + nbin_in_dir * range;
625 min_and_max_coordinates[u].second =
626 min_and_max_coordinates[u].first + range;
661 unsigned dim = ndim_zeta();
662 unsigned n_max_level = Dimensions_of_bin_array[0];
665 if (Dimensions_of_bin_array[1] > n_max_level)
667 n_max_level = Dimensions_of_bin_array[1];
672 if (Dimensions_of_bin_array[2] > n_max_level)
674 n_max_level = Dimensions_of_bin_array[2];
687 int n_lagrangian = ndim_zeta();
691 double zeta_min_local[n_lagrangian];
692 double zeta_max_local[n_lagrangian];
693 for (
int i = 0;
i < n_lagrangian;
i++)
695 zeta_min_local[
i] = DBL_MAX;
696 zeta_max_local[
i] = -DBL_MAX;
700 unsigned n_el = Mesh_pt->nelement();
701 for (
unsigned e = 0;
e < n_el;
e++)
703 FiniteElement* el_pt = Mesh_pt->finite_element_pt(
e);
707 unsigned n_plot_points = el_pt->nplot_points(n_plot);
710 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
712 Vector<double> s_local(n_lagrangian);
713 Vector<double> zeta_global(n_lagrangian);
717 bool use_equally_spaced_interior_sample_points =
false;
719 iplot, n_plot, s_local, use_equally_spaced_interior_sample_points);
722 if (Use_eulerian_coordinates_during_setup)
724 el_pt->interpolated_x(s_local, zeta_global);
728 el_pt->interpolated_zeta(s_local, zeta_global);
732 for (
int i = 0;
i < n_lagrangian;
i++)
735 if (zeta_global[
i] < zeta_min_local[
i])
737 zeta_min_local[
i] = zeta_global[
i];
740 if (zeta_global[
i] > zeta_max_local[
i])
742 zeta_max_local[
i] = zeta_global[
i];
749 double zeta_min[n_lagrangian];
750 double zeta_max[n_lagrangian];
751 for (
int i = 0;
i < n_lagrangian;
i++)
760 if (Mesh_pt->is_mesh_distributed())
763 if (Mesh_pt->communicator_pt() != 0)
765 int n_proc = Mesh_pt->communicator_pt()->nproc();
769 MPI_Allreduce(zeta_min_local,
774 Mesh_pt->communicator_pt()->mpi_comm());
775 MPI_Allreduce(zeta_max_local,
780 Mesh_pt->communicator_pt()->mpi_comm());
785 std::ostringstream error_message_stream;
786 error_message_stream <<
"Communicator not set for a Mesh\n"
787 <<
"that was created from a distributed Mesh";
788 throw OomphLibError(error_message_stream.str(),
789 OOMPH_CURRENT_FUNCTION,
790 OOMPH_EXCEPTION_LOCATION);
796 for (
int i = 0;
i < n_lagrangian;
i++)
798 zeta_min[
i] = zeta_min_local[
i];
799 zeta_max[
i] = zeta_max_local[
i];
803 for (
int i = 0;
i < n_lagrangian;
i++)
805 zeta_min[
i] = zeta_min_local[
i];
806 zeta_max[
i] = zeta_max_local[
i];
813 for (
int i = 0;
i < n_lagrangian;
i++)
815 double length = zeta_max[
i] - zeta_min[
i];
816 zeta_min[
i] -= ((Percentage_offset / 100.0) * length);
817 zeta_max[
i] += ((Percentage_offset / 100.0) * length);
821 Min_and_max_coordinates.resize(n_lagrangian);
822 for (
int i = 0;
i < n_lagrangian;
i++)
824 Min_and_max_coordinates[
i].first = zeta_min[
i];
825 Min_and_max_coordinates[
i].second = zeta_max[
i];
842 SamplePointContainerParameters* sample_point_container_parameters_pt)
844 sample_point_container_parameters_pt->mesh_pt(),
845 sample_point_container_parameters_pt->min_and_max_coordinates(),
846 sample_point_container_parameters_pt
847 ->use_eulerian_coordinates_during_setup(),
848 sample_point_container_parameters_pt
849 ->ignore_halo_elements_during_locate_zeta_search(),
850 sample_point_container_parameters_pt
851 ->nsample_points_generated_per_element()),
853 sample_point_container_parameters_pt->mesh_pt(),
854 sample_point_container_parameters_pt->min_and_max_coordinates(),
855 dynamic_cast<BinArrayParameters*>(sample_point_container_parameters_pt)
856 ->dimensions_of_bin_array(),
857 sample_point_container_parameters_pt
858 ->use_eulerian_coordinates_during_setup(),
859 sample_point_container_parameters_pt
860 ->ignore_halo_elements_during_locate_zeta_search(),
861 sample_point_container_parameters_pt
862 ->nsample_points_generated_per_element())
864 RefineableBinArrayParameters* ref_bin_array_parameters_pt =
865 dynamic_cast<RefineableBinArrayParameters*
>(
866 sample_point_container_parameters_pt);
869 if (ref_bin_array_parameters_pt == 0)
871 throw OomphLibError(
"Wrong sample_point_container_parameters_pt",
872 OOMPH_CURRENT_FUNCTION,
873 OOMPH_EXCEPTION_LOCATION);
878 ref_bin_array_parameters_pt->bin_array_is_recursive();
879 Depth = ref_bin_array_parameters_pt->depth();
880 Max_depth = ref_bin_array_parameters_pt->max_depth();
882 ref_bin_array_parameters_pt->max_number_of_sample_point_per_bin();
891 dim =
Mesh_pt->finite_element_pt(0)->dim();
898 if (
Mesh_pt->is_mesh_distributed())
901 if (
Mesh_pt->communicator_pt() != 0)
903 int n_proc =
Mesh_pt->communicator_pt()->nproc();
912 Mesh_pt->communicator_pt()->mpi_comm());
932 for (
unsigned i = 0;
i < dim;
i++)
950 "Must specify root_bin_array for lower-level bin arrays\n",
951 OOMPH_CURRENT_FUNCTION,
952 OOMPH_EXCEPTION_LOCATION);
971 double t_start = 0.0;
982 <<
"-dimensional sample point container containing " << npts
983 <<
" sample points: " << t_end - t_start
984 <<
" sec (ref_bin); third party: 0 sec ( = 0 %)"
996 const unsigned& bin_index,
997 Vector<std::pair<double, double>>& min_and_max_coordinates_of_bin)
999 unsigned bin_index_local = bin_index;
1003 min_and_max_coordinates_of_bin.resize(current_dim);
1004 for (
unsigned u = 0; u < current_dim; u++)
1016 min_and_max_coordinates_of_bin[u].first =
1018 min_and_max_coordinates_of_bin[u].second =
1019 min_and_max_coordinates_of_bin[u].first + range;
1030 unsigned n_bin =
Bin_pt.size();
1031 for (
unsigned i = 0;
i < n_bin;
i++)
1035 Bin_pt[
i]->output_bin_vertices(outfile);
1045 const unsigned& radius,
1046 std::ofstream& outfile)
1050 Vector<unsigned> neighbouring_bin_index;
1052 unsigned nneigh = neighbouring_bin_index.size();
1058 outfile <<
"ZONE I=2\n"
1065 outfile <<
"ZONE I=2, J=2\n"
1085 outfile <<
"ZONE I=2, J=2, K=2 \n"
1129 oomph_info <<
"n_lagr=" << n_lagr << std::endl;
1130 throw OomphLibError(
1131 "Wrong dimension!", OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1135 for (
unsigned i = 0;
i < nneigh;
i++)
1143 outfile <<
"ZONE I=2\n"
1150 outfile <<
"ZONE I=2, J=2\n"
1170 outfile <<
"ZONE I=2, J=2, K=2\n"
1214 oomph_info <<
"n_lagr=" << n_lagr << std::endl;
1215 throw OomphLibError(
"Wrong dimension!",
1216 OOMPH_CURRENT_FUNCTION,
1217 OOMPH_EXCEPTION_LOCATION);
1229 unsigned old_faster = 0;
1230 unsigned new_faster = 0;
1231 double t_total_new = 0.0;
1232 double t_total_old = 0.0;
1237 Vector<double> zeta(dim);
1238 for (
unsigned i = 0;
i < dim;
i++)
1250 throw OomphLibError(
"Negative bin index...",
1251 OOMPH_CURRENT_FUNCTION,
1252 OOMPH_EXCEPTION_LOCATION);
1257 unsigned radius = 0;
1261 Vector<unsigned> bin_index_v(dim);
1266 unsigned max_radius = 0;
1267 for (
unsigned k = 0; k < dim; k++)
1270 std::max((bin_index_v[k] + 1),
1272 if (local > max_radius)
1280 Vector<unsigned> bin_index_at_current_radius_old;
1281 Vector<unsigned> bin_index_at_current_radius_new;
1282 while (radius <= max_radius)
1285 bin_index_at_current_radius_old.clear();
1288 bin_index, radius, bin_index_at_current_radius_old,
true);
1289 unsigned nbin_at_current_radius_old =
1290 bin_index_at_current_radius_old.size();
1292 double t_old = t_end - t_start;
1294 bin_index_at_current_radius_new.clear();
1297 bin_index, radius, bin_index_at_current_radius_new,
false);
1298 unsigned nbin_at_current_radius_new =
1299 bin_index_at_current_radius_new.size();
1302 double t_new = t_end_new - t_start_new;
1304 if (nbin_at_current_radius_new != nbin_at_current_radius_old)
1306 oomph_info <<
"Number of bins don't match: new = "
1307 << nbin_at_current_radius_new
1308 <<
"old = " << nbin_at_current_radius_old
1309 <<
" radius = " << radius << std::endl;
1311 for (
unsigned i = 0;
i < nbin_at_current_radius_old;
i++)
1313 oomph_info << bin_index_at_current_radius_old[
i] <<
" ";
1317 for (
unsigned i = 0;
i < nbin_at_current_radius_new;
i++)
1319 oomph_info << bin_index_at_current_radius_new[
i] <<
" ";
1324 t_total_new += t_new;
1325 t_total_old += t_old;
1339 oomph_info <<
"Number of times old/new version was faster: " << old_faster
1340 <<
" " << new_faster << std::endl
1341 <<
"Total old/new time: " << t_total_old <<
" " << t_total_new
1342 <<
" " << std::endl;
1351 const unsigned& bin_index,
1352 const unsigned& radius,
1353 Vector<unsigned>& neighbouring_bin_index,
1354 const bool& use_old_version)
1357 if (use_old_version)
1359 neighbouring_bin_index.clear();
1365 neighbouring_bin_index.push_back(bin_index);
1370 unsigned level = radius;
1371 unsigned bin = bin_index;
1374 const unsigned n_lagrangian = this->
ndim_zeta();
1378 if (n_lagrangian == 1)
1382 neighbouring_bin_index.reserve(2);
1385 unsigned nbr_bin_left = bin - level;
1388 unsigned nbr_bin = nbr_bin_left;
1389 neighbouring_bin_index.push_back(nbr_bin);
1391 unsigned nbr_bin_right = bin + level;
1393 (nbr_bin_right != nbr_bin_left))
1395 unsigned nbr_bin = nbr_bin_right;
1396 neighbouring_bin_index.push_back(nbr_bin);
1399 else if (n_lagrangian == 2)
1403 const unsigned n_max_neighbour_bins = 8 * level;
1404 neighbouring_bin_index.reserve(n_max_neighbour_bins);
1406 const unsigned n_total_bin =
1419 const unsigned n_length = (level * 2) + 1;
1446 const unsigned j_initial_row = bin_row - level;
1449 for (
unsigned i = 0;
i < n_length;
i++)
1452 const unsigned initial_neighbour_bin =
1453 bin - (level -
i) - j_precomputed;
1459 const unsigned initial_neighbour_bin_row =
1465 if ((j_initial_row == initial_neighbour_bin_row) &&
1466 (initial_neighbour_bin < n_total_bin))
1468 neighbouring_bin_index.push_back(initial_neighbour_bin);
1478 for (
unsigned j = 1; j < n_length - 1; j++)
1481 const unsigned initial_neighbour_bin =
1488 const unsigned initial_neighbour_bin_row =
1492 const unsigned initial_row = bin_row - (level - j);
1498 if ((initial_row == initial_neighbour_bin_row) &&
1499 (initial_neighbour_bin < n_total_bin))
1501 neighbouring_bin_index.push_back(initial_neighbour_bin);
1505 const unsigned final_neighbour_bin =
1512 const unsigned final_neighbour_bin_row =
1516 const unsigned final_row = bin_row - (level - j);
1522 if ((final_row == final_neighbour_bin_row) &&
1523 (final_neighbour_bin < n_total_bin))
1525 neighbouring_bin_index.push_back(final_neighbour_bin);
1532 const unsigned j_final_row = bin_row + level;
1535 for (
unsigned i = 0;
i < n_length;
i++)
1538 const unsigned final_neighbour_bin =
1539 bin - (level -
i) + j_precomputed;
1545 const unsigned final_neighbour_bin_row =
1551 if ((j_final_row == final_neighbour_bin_row) &&
1552 (final_neighbour_bin < n_total_bin))
1554 neighbouring_bin_index.push_back(final_neighbour_bin);
1560 else if (n_lagrangian == 3)
1564 const unsigned n_max_neighbour_bins =
1565 8 * level * (3 + 2 * (level - 1)) +
1566 2 * (2 * (level - 1) + 1) * (2 * (level - 1) + 1);
1567 neighbouring_bin_index.reserve(n_max_neighbour_bins);
1577 unsigned bin_layer =
1588 unsigned n_length = (level * 2) + 1;
1591 for (
unsigned k = 0; k < n_length; k++)
1594 for (
unsigned j = 0; j < n_length; j++)
1597 for (
unsigned i = 0;
i < n_length;
i++)
1600 if ((k == 0) || (k == n_length - 1) || (j == 0) ||
1601 (j == n_length - 1) || (
i == 0) || (
i == n_length - 1))
1603 unsigned nbr_bin = bin - level +
i -
1615 unsigned nbr_bin_row =
1620 unsigned layer = bin_layer - level + k;
1621 unsigned row = bin_row - level + j;
1627 if ((row == nbr_bin_row) && (layer == nbr_bin_layer) &&
1628 (nbr_bin < n_total_bin))
1630 neighbouring_bin_index.push_back(nbr_bin);
1641 neighbouring_bin_index.clear();
1647 neighbouring_bin_index.push_back(bin_index);
1656 Vector<int> vector_of_positions(3);
1659 Vector<int> vector_of_dimensions(3);
1663 Vector<int> vector_of_radiuses(3);
1668 std::vector<bool> vector_of_active_dim(3);
1672 Vector<int> vector_of_coef(3);
1677 for (
unsigned u = 0; u < dim; u++)
1679 vector_of_positions[u] =
1681 vector_of_coef[u] = coef;
1684 vector_of_radiuses[u] = radius;
1685 vector_of_active_dim[u] =
true;
1688 for (
unsigned u = dim; u < 3; u++)
1690 vector_of_positions[u] = 0;
1691 vector_of_coef[u] = 0;
1692 vector_of_dimensions[u] = 1;
1693 vector_of_radiuses[u] = 0;
1694 vector_of_active_dim[u] =
false;
1700 for (
int j = -vector_of_radiuses[0]; j <= vector_of_radiuses[0];
1701 j += 2 * vector_of_radiuses[0])
1704 vector_of_positions[0] + j;
1706 if (local_tempj >= 0 && local_tempj < vector_of_dimensions[0])
1709 for (
int i = -vector_of_radiuses[1];
i <= vector_of_radiuses[1];
1713 int local_tempi = vector_of_positions[1] +
i;
1715 if (local_tempi >= 0 && local_tempi < vector_of_dimensions[1])
1717 for (
int k = -vector_of_radiuses[2]; k <= vector_of_radiuses[2];
1721 int local_tempk = vector_of_positions[2] + k;
1723 if (local_tempk >= 0 && local_tempk < vector_of_dimensions[2])
1725 neighbouring_bin_index.push_back(
1726 local_tempj * vector_of_coef[0] +
1727 local_tempi * vector_of_coef[1] +
1728 local_tempk * vector_of_coef[2]);
1737 if (vector_of_active_dim[1])
1740 for (
int i = -vector_of_radiuses[1];
i <= vector_of_radiuses[1];
1741 i += 2 * vector_of_radiuses[1])
1743 int local_tempi = vector_of_positions[1] +
i;
1744 if (local_tempi >= 0 && local_tempi < vector_of_dimensions[1])
1747 for (
int j = -vector_of_radiuses[0] + 1;
1748 j <= vector_of_radiuses[0] - 1;
1751 int local_tempj = vector_of_positions[0] + j;
1752 if (local_tempj >= 0 && local_tempj < vector_of_dimensions[0])
1754 for (
int k = -vector_of_radiuses[2];
1755 k <= vector_of_radiuses[2];
1758 int local_tempk = vector_of_positions[2] + k;
1759 if (local_tempk >= 0 &&
1760 local_tempk < vector_of_dimensions[2])
1762 neighbouring_bin_index.push_back(
1763 local_tempj * vector_of_coef[0] +
1764 local_tempi * vector_of_coef[1] +
1765 local_tempk * vector_of_coef[2]);
1775 if (vector_of_active_dim[2])
1778 for (
int k = -vector_of_radiuses[2]; k <= vector_of_radiuses[2];
1779 k += 2 * vector_of_radiuses[2])
1781 int local_tempk = vector_of_positions[2] + k;
1782 if (local_tempk >= 0 && local_tempk < vector_of_dimensions[2])
1785 for (
int j = -vector_of_radiuses[0] + 1;
1786 j <= vector_of_radiuses[0] - 1;
1789 int local_tempj = vector_of_positions[0] + j;
1790 if (local_tempj >= 0 && local_tempj < vector_of_dimensions[0])
1792 for (
int i = -vector_of_radiuses[1] + 1;
1793 i <= vector_of_radiuses[1] - 1;
1796 int local_tempi = vector_of_positions[1] +
i;
1797 if (local_tempi >= 0 &&
1798 local_tempi < vector_of_dimensions[1])
1800 neighbouring_bin_index.push_back(
1801 local_tempj * vector_of_coef[0] +
1802 local_tempi * vector_of_coef[1] +
1803 local_tempk * vector_of_coef[2]);
1823 unsigned n_bin =
nbin();
1824 for (
unsigned i = 0;
i < n_bin;
i++)
1829 Bin_pt[
i]->total_number_of_sample_points_computed_recursively();
1847 for (
unsigned u = 0; u < dim; u++)
1850 unsigned local_bin_number = 0;
1854 local_bin_number = 0;
1862 local_bin_number = (int(std::min(
1871 n_bin += local_bin_number * coef;
1885 unsigned nel =
Mesh_pt->nelement();
1886 for (
unsigned e = 0;
e < nel;
e++)
1888 FiniteElement* el_pt =
Mesh_pt->finite_element_pt(
e);
1895 for (
unsigned j = 0; j < nplot; j++)
1904 bool use_equally_spaced_interior_sample_points =
1906 el_pt->get_s_plot(j,
1909 use_equally_spaced_interior_sample_points);
1912 el_pt->interpolated_x(
s, zeta);
1916 el_pt->interpolated_zeta(
s, zeta);
1922 bool is_inside =
true;
1923 std::ostringstream error_message;
1925 for (
unsigned i = 0;
i < dim;
i++)
1931 error_message <<
"Sample point at zeta[" <<
i <<
"] = " << zeta[
i]
1932 <<
" is outside limits of bin array: "
1940 error_message <<
"Please correct the limits passed to the "
1941 <<
"constructor." << std::endl;
1942 throw OomphLibError(error_message.str(),
1943 OOMPH_CURRENT_FUNCTION,
1944 OOMPH_EXCEPTION_LOCATION);
1954 if (
Bin_pt[bin_index] == 0)
1960 Bin_pt[bin_index]->add_sample_point(new_sample_point_pt, zeta);
1970 Vector<unsigned>& bin_index)
1973 bin_index.resize(dim);
1974 for (
unsigned u = 0; u < dim; u++)
1986 bin_index[u] = (int(
2003 GeomObject*& sub_geom_object_pt,
2007 sub_geom_object_pt = 0;
2026 for (
unsigned i = 0;
i < dim;
i++)
2048 throw OomphLibError(
"Negative bin index...",
2049 OOMPH_CURRENT_FUNCTION,
2050 OOMPH_EXCEPTION_LOCATION);
2055 unsigned radius = 0;
2059 Vector<unsigned> bin_index_v(dim);
2064 unsigned max_radius = 0;
2065 for (
unsigned k = 0; k < dim; k++)
2068 std::max((bin_index_v[k] + 1),
2070 if (local > max_radius)
2078 Vector<unsigned> bin_index_at_current_radius;
2079 while (radius <= max_radius)
2082 bin_index_at_current_radius.clear();
2084 bin_index, radius, bin_index_at_current_radius);
2086 unsigned nbin_at_current_radius = bin_index_at_current_radius.size();
2087 unsigned n_bin =
nbin();
2091 while ((k < nbin_at_current_radius) && (sub_geom_object_pt == 0))
2093 int neigh_bin_index = bin_index_at_current_radius[k];
2095 if (neigh_bin_index < 0)
2097 throw OomphLibError(
"Negative neighbour bin index...",
2098 OOMPH_CURRENT_FUNCTION,
2099 OOMPH_EXCEPTION_LOCATION);
2102 if (neigh_bin_index <
int(n_bin))
2105 if (
Bin_pt[neigh_bin_index] != 0)
2108 Bin_pt[neigh_bin_index]->locate_zeta(zeta, sub_geom_object_pt,
s);
2116 if (sub_geom_object_pt != 0)
2140 std::ostringstream error_message;
2142 <<
"Zeta not found after visiting "
2144 <<
" sample points out of "
2146 <<
"Where are the missing sample points???\n";
2147 throw OomphLibError(error_message.str(),
2148 OOMPH_CURRENT_FUNCTION,
2149 OOMPH_EXCEPTION_LOCATION);
2170 SamplePointContainerParameters* sample_point_container_parameters_pt)
2172 sample_point_container_parameters_pt->mesh_pt(),
2173 sample_point_container_parameters_pt->min_and_max_coordinates(),
2174 sample_point_container_parameters_pt
2175 ->use_eulerian_coordinates_during_setup(),
2176 sample_point_container_parameters_pt
2177 ->ignore_halo_elements_during_locate_zeta_search(),
2178 sample_point_container_parameters_pt
2179 ->nsample_points_generated_per_element()),
2181 sample_point_container_parameters_pt->mesh_pt(),
2182 sample_point_container_parameters_pt->min_and_max_coordinates(),
2183 dynamic_cast<BinArrayParameters*>(sample_point_container_parameters_pt)
2184 ->dimensions_of_bin_array(),
2185 sample_point_container_parameters_pt
2186 ->use_eulerian_coordinates_during_setup(),
2187 sample_point_container_parameters_pt
2188 ->ignore_halo_elements_during_locate_zeta_search(),
2189 sample_point_container_parameters_pt
2190 ->nsample_points_generated_per_element())
2198 dim =
Mesh_pt->finite_element_pt(0)->dim();
2204 #ifdef OOMPH_HAS_MPI
2206 if (
Mesh_pt->is_mesh_distributed())
2209 if (
Mesh_pt->communicator_pt() != 0)
2211 int n_proc =
Mesh_pt->communicator_pt()->nproc();
2220 Mesh_pt->communicator_pt()->mpi_comm());
2241 NonRefineableBinArrayParameters* non_ref_bin_array_parameters_pt =
2242 dynamic_cast<NonRefineableBinArrayParameters*
>(
2243 sample_point_container_parameters_pt);
2246 if (non_ref_bin_array_parameters_pt == 0)
2248 throw OomphLibError(
"Wrong sample_point_container_parameters_pt",
2249 OOMPH_CURRENT_FUNCTION,
2250 OOMPH_EXCEPTION_LOCATION);
2254 Nspiral_chunk = non_ref_bin_array_parameters_pt->nspiral_chunk();
2258 double t_start = 0.0;
2272 <<
"-dimensional sample point container containing " << npts
2273 <<
" sample points: " << t_end - t_start
2274 <<
" sec (non-ref_bin); third party: 0 sec ( = 0 %)"
2287 const std::map<unsigned, Vector<std::pair<FiniteElement*, Vector<double>>>>*
2296 Vector<std::pair<FiniteElement*, Vector<double>>>>::const_iterator IT;
2297 for (IT it = map_pt->begin(); it != map_pt->end(); it++)
2299 count += (*it).second.size();
2311 const unsigned n_lagrangian = this->
ndim_zeta();
2314 unsigned nbin_y = 1;
2316 unsigned nbin_z = 1;
2320 for (
unsigned iz = 0; iz < nbin_z; iz++)
2322 for (
unsigned iy = 0; iy < nbin_y; iy++)
2324 for (
unsigned ix = 0; ix < nbin_x; ix++)
2327 for (
unsigned e = 0;
e < nentry;
e++)
2331 Vector<double> zeta(n_lagrangian);
2334 el_pt->interpolated_x(
s, zeta);
2338 el_pt->interpolated_zeta(
s, zeta);
2340 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2342 outfile << zeta[
i] <<
" ";
2344 outfile << ix <<
" " << iy <<
" " << iz <<
" " << b <<
" "
2360 const unsigned n_lagrangian = this->
ndim_zeta();
2366 for (
unsigned i_bin = 0; i_bin <
nbin; i_bin++)
2369 Vector<Vector<double>> bin_vertex;
2371 switch (n_lagrangian)
2374 outfile <<
"ZONE I=2\n";
2378 outfile <<
"ZONE I=2, J=2\n";
2382 outfile <<
"ZONE I=2, J=2, K=2\n";
2386 unsigned nvertex = bin_vertex.size();
2387 for (
unsigned i = 0;
i < nvertex;
i++)
2389 for (
unsigned j = 0; j < n_lagrangian; j++)
2391 outfile << bin_vertex[
i][j] <<
" ";
2393 outfile << std::endl;
2405 const unsigned n_lagrangian = this->
ndim_zeta();
2411 std::map<unsigned, Vector<std::pair<FiniteElement*, Vector<double>>>>
2412 tmp_bin_object_coord_pairs;
2415 unsigned ntotalbin =
nbin();
2425 unsigned n_mesh_element =
Mesh_pt->nelement();
2426 unsigned elements_per_bin = n_mesh_element / ntotalbin;
2433 std::ostringstream warn_message;
2435 <<
"The average (integer) number of elements per bin is \n\n"
2436 << elements_per_bin <<
", which is more than \n\n"
2438 "NonRefineableBinArray::Threshold_for_elements_per_bin_warning="
2440 <<
"\n\nIf the lookup seems slow (and you have the memory),"
2441 <<
"consider increasing\n"
2442 <<
"BinArray::Dimensions_of_bin_array from their current\n"
2445 for (
unsigned ii = 0; ii < nn; ii++)
2451 <<
"\nNOTE: You can suppress this warning by increasing\n\n"
2452 <<
" NonRefineableBinArray::"
2453 <<
"Threshold_for_elements_per_bin_warning\n\n"
2454 <<
"or by setting \n\n "
2455 <<
"NonRefineableBinArray::Suppress_warning_about_small_number_of_"
2457 <<
"to true (both are public static data).\n\n";
2458 OomphLibWarning(warn_message.str(),
2459 OOMPH_CURRENT_FUNCTION,
2460 OOMPH_EXCEPTION_LOCATION);
2479 std::ostringstream warn_message;
2481 <<
"Have allocated \n\n"
2482 <<
" NonRefineableBinArray::Total_nbin_cells_counter="
2484 <<
"\n\nbin cells, which is more than \n\n"
2485 <<
" NonRefineableBinArray::"
2486 <<
"Threshold_for_total_bin_cell_number_warning="
2487 << NonRefineableBinArray::
2488 Threshold_for_total_bin_cell_number_warning
2489 <<
"\n\nIf you run out of memory, consider reducing\n"
2490 <<
"BinArray::Dimensions_of_bin_array from their current\n"
2493 for (
unsigned ii = 0; ii < nn; ii++)
2499 <<
"\nNOTE: You can suppress this warning by increasing\n\n"
2500 <<
" NonRefineableBinArray::"
2501 <<
"Threshold_for_total_bin_cell_number_warning\n\n"
2502 <<
"or by setting \n\n NonRefineableBinArray::"
2503 <<
"Suppress_warning_about_large_total_number_of_bins\n\n"
2504 <<
"to true (both are public static data).\n\n"
2505 <<
"NOTE: I'll only issue this warning once -- total number of\n"
2506 <<
"bins may grow yet further!\n";
2507 OomphLibWarning(warn_message.str(),
2508 OOMPH_CURRENT_FUNCTION,
2509 OOMPH_EXCEPTION_LOCATION);
2515 unsigned n_sub =
Mesh_pt->nelement();
2516 for (
unsigned e = 0;
e < n_sub;
e++)
2519 FiniteElement* el_pt =
2520 dynamic_cast<FiniteElement*
>(
Mesh_pt->finite_element_pt(
e));
2523 unsigned n_plot_points =
2526 for (
unsigned iplot = 0; iplot < n_plot_points; iplot++)
2529 Vector<double> local_coord(n_lagrangian, 0.0);
2530 Vector<double> global_coord(n_lagrangian, 0.0);
2533 bool use_equally_spaced_interior_sample_points =
2535 el_pt->get_s_plot(iplot,
2538 use_equally_spaced_interior_sample_points);
2543 el_pt->interpolated_x(local_coord, global_coord);
2547 el_pt->interpolated_zeta(local_coord, global_coord);
2551 unsigned bin_number = 0;
2552 unsigned multiplier = 1;
2554 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2560 std::ostringstream error_message;
2562 <<
"Bin sample point " << iplot <<
" in element " <<
e <<
"\n"
2563 <<
"is outside bin limits in coordinate direction " <<
i <<
":\n"
2564 <<
"Sample point coordinate: " << global_coord[
i] <<
"\n"
2565 <<
"Max bin coordinate : "
2569 <<
"You should either setup the bin boundaries manually\n"
2570 <<
"or increase the percentage offset by which the\n"
2571 <<
"automatically computed bin limits are increased \n"
2572 <<
"beyond their sampled max/mins. This is defined in\n"
2573 <<
"the (public) namespace member\n\n"
2574 <<
"SamplePointContainer::Percentage_offset \n\n which \n"
2575 <<
"currently has the value: "
2577 throw OomphLibError(error_message.str(),
2578 OOMPH_CURRENT_FUNCTION,
2579 OOMPH_EXCEPTION_LOCATION);
2583 unsigned bin_number_i =
2597 bin_number += multiplier * bin_number_i;
2604 tmp_bin_object_coord_pairs[bin_number].push_back(
2605 std::make_pair(el_pt, local_coord));
2614 Vector<std::pair<FiniteElement*, Vector<double>>>>::iterator IT;
2615 for (IT it = tmp_bin_object_coord_pairs.begin();
2616 it != tmp_bin_object_coord_pairs.end();
2621 (*it).second.clear();
2630 unsigned& max_n_entry,
2631 unsigned& min_n_entry,
2632 unsigned& tot_n_entry,
2633 unsigned& n_empty)
const
2640 const std::map<unsigned, Vector<std::pair<FiniteElement*, Vector<double>>>>*
2645 min_n_entry = UINT_MAX;
2651 Vector<std::pair<FiniteElement*, Vector<double>>>>::const_iterator IT;
2652 for (IT it = map_pt->begin(); it != map_pt->end(); it++)
2654 unsigned nentry = (*it).second.size();
2655 if (nentry > max_n_entry) max_n_entry = nentry;
2656 if (nentry < min_n_entry) min_n_entry = nentry;
2657 tot_n_entry += nentry;
2668 const unsigned& bin_diffusion_radius)
2674 std::list<unsigned> empty_bins;
2675 unsigned n_bin =
nbin();
2676 std::vector<bool> was_empty_until_current_iteration(n_bin,
false);
2677 for (
unsigned i = 0;
i < n_bin;
i++)
2681 empty_bins.push_front(
i);
2682 was_empty_until_current_iteration[
i] =
true;
2688 Vector<unsigned> newly_filled_bin;
2689 while (empty_bins.size() != 0)
2691 newly_filled_bin.clear();
2692 newly_filled_bin.reserve(empty_bins.size());
2693 for (std::list<unsigned>::iterator it = empty_bins.begin();
2694 it != empty_bins.end();
2697 unsigned bin = (*it);
2700 unsigned level = bin_diffusion_radius;
2701 Vector<unsigned> neighbour_bin;
2703 unsigned n_neigh = neighbour_bin.size();
2706 double min_dist = DBL_MAX;
2707 std::pair<FiniteElement*, Vector<double>> closest_pair;
2708 for (
unsigned i = 0;
i < n_neigh;
i++)
2710 unsigned neigh_bin = neighbour_bin[
i];
2714 if (!was_empty_until_current_iteration[neigh_bin])
2717 for (
unsigned j = 0; j < nbin_content; j++)
2721 Vector<double> x(2);
2722 el_pt->interpolated_x(
s, x);
2731 if (dist < min_dist)
2741 if (min_dist != DBL_MAX)
2743 Vector<std::pair<FiniteElement*, Vector<double>>> new_entry;
2744 new_entry.push_back(closest_pair);
2748 newly_filled_bin.push_back(bin);
2752 std::list<unsigned>::iterator it_to_be_deleted = it;
2754 empty_bins.erase(it_to_be_deleted);
2761 unsigned n = newly_filled_bin.size();
2762 for (
unsigned i = 0;
i < n;
i++)
2764 was_empty_until_current_iteration[newly_filled_bin[
i]] =
false;
2772 for (
unsigned i = 0;
i < n_bin;
i++)
2776 std::ostringstream error_message_stream;
2777 error_message_stream <<
"Bin " <<
i <<
" is still empty\n"
2778 <<
"after trying to fill it by diffusion\n";
2779 throw OomphLibError(error_message_stream.str(),
2780 OOMPH_CURRENT_FUNCTION,
2781 OOMPH_EXCEPTION_LOCATION);
2801 const unsigned n_lagrangian = this->
ndim_zeta();
2806 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2827 unsigned multiplier = 1;
2830 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2833 unsigned bin_number_i =
2844 bin_number += multiplier * bin_number_i;
2853 double tol = 1.0e-10;
2855 unsigned nvertex = (int)pow(2, n_lagrangian);
2856 Vector<Vector<double>> bin_vertex(nvertex);
2857 for (
unsigned j = 0; j < nvertex; j++)
2859 bin_vertex[j].resize(n_lagrangian);
2862 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2864 double min_vertex_coord = DBL_MAX;
2865 double max_vertex_coord = -DBL_MAX;
2866 for (
unsigned j = 0; j < nvertex; j++)
2868 if (bin_vertex[j][
i] < min_vertex_coord)
2870 min_vertex_coord = bin_vertex[j][
i];
2872 if (bin_vertex[j][
i] > max_vertex_coord)
2874 max_vertex_coord = bin_vertex[j][
i];
2877 if (zeta[
i] < min_vertex_coord - tol)
2879 std::ostringstream error_message_stream;
2880 error_message_stream
2881 <<
"Trouble! " <<
i <<
" -th coordinate of sample point, " << zeta[
i]
2882 <<
" , isn't actually between limits, " << min_vertex_coord <<
" and "
2883 << max_vertex_coord <<
" [it's below by more than " << tol <<
" !] "
2885 throw OomphLibError(error_message_stream.str(),
2886 OOMPH_CURRENT_FUNCTION,
2887 OOMPH_EXCEPTION_LOCATION);
2890 if (zeta[
i] > max_vertex_coord + tol)
2892 std::ostringstream error_message_stream;
2893 error_message_stream
2894 <<
"Trouble! " <<
i <<
" -th coordinate of sample point, " << zeta[
i]
2895 <<
" , isn't actually between limits, " << min_vertex_coord <<
" and "
2896 << max_vertex_coord <<
" [it's above by more than " << tol <<
"!] "
2898 throw OomphLibError(error_message_stream.str(),
2899 OOMPH_CURRENT_FUNCTION,
2900 OOMPH_EXCEPTION_LOCATION);
2913 const unsigned& i_bin, Vector<Vector<double>>& bin_vertex)
2916 const unsigned n_lagrangian = this->
ndim_zeta();
2919 unsigned n_vertices = 1;
2920 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2924 bin_vertex.resize(n_vertices);
2928 Vector<Vector<double>> zeta_vertex_bin(2);
2929 zeta_vertex_bin[0].resize(n_lagrangian);
2930 zeta_vertex_bin[1].resize(n_lagrangian);
2932 Vector<double> dzeta;
2934 Vector<unsigned> i_1d;
2937 switch (n_lagrangian)
2946 bin_vertex[0].resize(1);
2949 bin_vertex[1].resize(1);
2970 for (
unsigned i = 0;
i < n_lagrangian;
i++)
2972 zeta_vertex_bin[0][
i] =
2974 zeta_vertex_bin[1][
i] =
2980 for (
unsigned i_min_max = 0; i_min_max < 2; i_min_max++)
2982 for (
unsigned j_min_max = 0; j_min_max < 2; j_min_max++)
2984 bin_vertex[count].resize(2);
2985 bin_vertex[count][0] = zeta_vertex_bin[i_min_max][0];
2986 bin_vertex[count][1] = zeta_vertex_bin[j_min_max][1];
3014 for (
unsigned i = 0;
i < n_lagrangian;
i++)
3016 zeta_vertex_bin[0][
i] =
3018 zeta_vertex_bin[1][
i] =
3024 for (
unsigned i_min_max = 0; i_min_max < 2; i_min_max++)
3026 for (
unsigned j_min_max = 0; j_min_max < 2; j_min_max++)
3028 for (
unsigned k_min_max = 0; k_min_max < 2; k_min_max++)
3030 bin_vertex[count].resize(3);
3031 bin_vertex[count][0] = zeta_vertex_bin[i_min_max][0];
3032 bin_vertex[count][1] = zeta_vertex_bin[j_min_max][1];
3033 bin_vertex[count][2] = zeta_vertex_bin[k_min_max][2];
3043 std::ostringstream error_message;
3044 error_message <<
"Can't deal with bins in dimension " << n_lagrangian
3046 throw OomphLibError(error_message.str(),
3047 OOMPH_CURRENT_FUNCTION,
3048 OOMPH_EXCEPTION_LOCATION);
3058 const Vector<double>& zeta)
3061 const unsigned n_lagrangian = this->
ndim_zeta();
3064 Vector<Vector<double>> bin_vertex;
3066 double min_dist = DBL_MAX;
3067 unsigned nvertex = bin_vertex.size();
3068 for (
unsigned v = 0; v < nvertex; v++)
3071 for (
unsigned i = 0;
i < n_lagrangian;
i++)
3073 dist += pow(bin_vertex[v][
i] - zeta[
i], 2);
3076 if (dist < min_dist) min_dist = dist;
3089 GeomObject*& sub_geom_object_pt,
3102 sub_geom_object_pt = 0;
3105 const unsigned n_lagrangian = this->
ndim_zeta();
3113 for (
unsigned i = 0;
i < n_lagrangian;
i++)
3130 unsigned bin_number = 0;
3133 unsigned multiplier = 1;
3136 for (
unsigned i = 0;
i < n_lagrangian;
i++)
3139 unsigned bin_number_i =
3152 bin_number += multiplier * bin_number_i;
3159 Vector<unsigned> neighbour_bin;
3162 for (
unsigned i_level = min_level; i_level <= max_level; i_level++)
3169 unsigned n_nbr_bin = neighbour_bin.size();
3225 bool found_zeta =
false;
3226 for (
unsigned i_nbr = 0; i_nbr < n_nbr_bin; i_nbr++)
3247 for (
unsigned i_sam = 0; i_sam < n_sample; i_sam++)
3250 FiniteElement* el_pt =
3259 unsigned cached_dim_zeta = this->
ndim_zeta();
3260 Vector<double> zeta_sample(cached_dim_zeta);
3263 el_pt->interpolated_x(
s, zeta_sample);
3267 el_pt->interpolated_zeta(
s, zeta_sample);
3270 for (
unsigned ii = 0; ii < cached_dim_zeta; ii++)
3275 (zeta[ii] - zeta_sample[ii]) * (zeta[ii] - zeta_sample[ii]);
3279 <<
" " << sqrt(dist) << std::endl;
3283 bool use_coordinate_as_initial_guess =
true;
3287 zeta, sub_geom_object_pt,
s, use_coordinate_as_initial_guess);
3296 sub_geom_object_pt = 0;
3300 #ifdef OOMPH_HAS_MPI
3305 FiniteElement* test_el_pt =
3306 dynamic_cast<FiniteElement*
>(sub_geom_object_pt);
3307 if (test_el_pt != 0)
3310 if (test_el_pt->is_halo())
3312 sub_geom_object_pt = 0;
3319 if (sub_geom_object_pt != 0)
3384 #ifdef OOMPH_HAS_CGAL
3391 SamplePointContainerParameters* sample_point_container_parameters_pt)
3393 sample_point_container_parameters_pt->mesh_pt(),
3394 sample_point_container_parameters_pt->min_and_max_coordinates(),
3395 sample_point_container_parameters_pt
3396 ->use_eulerian_coordinates_during_setup(),
3397 sample_point_container_parameters_pt
3398 ->ignore_halo_elements_during_locate_zeta_search(),
3399 sample_point_container_parameters_pt
3400 ->nsample_points_generated_per_element())
3406 dim =
Mesh_pt->finite_element_pt(0)->dim();
3411 #ifdef OOMPH_HAS_MPI
3413 if (
Mesh_pt->is_mesh_distributed())
3416 if (
Mesh_pt->communicator_pt() != 0)
3418 int n_proc =
Mesh_pt->communicator_pt()->nproc();
3427 Mesh_pt->communicator_pt()->mpi_comm());
3445 double t_start = 0.0;
3459 <<
"-dimensional sample point container containing " << npts
3460 <<
" sample points: " << t_end - t_start
3461 <<
" sec (cgal); third party: " << CGAL_setup_time
3462 <<
" sec ( = " << CGAL_setup_time / (t_end - t_start) * 100.0
3463 <<
" %)" << std::endl;
3483 unsigned nel =
Mesh_pt->nelement();
3486 unsigned n_sample_estimate = 0;
3489 FiniteElement* el_pt =
Mesh_pt->finite_element_pt(0);
3501 for (
unsigned e = 0;
e < nel;
e++)
3503 FiniteElement* el_pt =
Mesh_pt->finite_element_pt(
e);
3510 for (
unsigned j = 0; j < nplot; j++)
3519 bool use_equally_spaced_interior_sample_points =
3521 el_pt->get_s_plot(j,
3524 use_equally_spaced_interior_sample_points);
3527 el_pt->interpolated_x(
s, zeta);
3531 el_pt->interpolated_zeta(
s, zeta);
3537 bool is_inside =
true;
3538 std::ostringstream error_message;
3540 for (
unsigned i = 0;
i < dim;
i++)
3546 error_message <<
"Sample point at zeta[" <<
i <<
"] = " << zeta[
i]
3547 <<
" is outside limits of sample point container: "
3555 error_message <<
"Please correct the limits passed to the "
3556 <<
"constructor." << std::endl;
3557 throw OomphLibError(error_message.str(),
3558 OOMPH_CURRENT_FUNCTION,
3559 OOMPH_EXCEPTION_LOCATION);
3565 Kernel_d::Point_d(zeta.size(), zeta.begin(), zeta.end()));
3571 double CGAL_setup_time = 0.0;
3578 boost::make_zip_iterator(boost::make_tuple(
3586 return CGAL_setup_time;
3607 GeomObject*& sub_geom_object_pt,
3622 sub_geom_object_pt = 0;
3625 const unsigned n_lagrangian = this->
ndim_zeta();
3630 if (!SamplePointContainer::Always_fail_elemental_locate_zeta)
3633 for (
unsigned i = 0;
i < n_lagrangian;
i++)
3652 Point_d query(zeta.size(), zeta.begin(), zeta.end());
3655 const unsigned n_nearest_neighbours_max = std::min(
3659 unsigned n_nearest_neighbours = 1;
3660 unsigned n_neighbours_visited_last_time = 0;
3661 bool can_increase_n_nearest_neighbours =
true;
3662 bool keep_going =
true;
3666 const unsigned n_nearest_neighbours_actual =
3667 std::min(n_nearest_neighbours, n_nearest_neighbours_max);
3673 for (K_neighbor_search_d::iterator it = search.begin();
3679 if ((count > n_neighbours_visited_last_time) &&
3684 SamplePoint* sample_point_pt = boost::get<1>(it->first);
3687 FiniteElement* el_pt =
Mesh_pt->finite_element_pt(
3691 #ifdef OOMPH_HAS_MPI
3705 bool use_equally_spaced_interior_sample_points =
3708 el_pt->get_s_plot(
i,
3711 use_equally_spaced_interior_sample_points);
3717 Vector<double> zeta_sample(cached_dim_zeta);
3720 el_pt->interpolated_x(
s, zeta_sample);
3724 el_pt->interpolated_zeta(
s, zeta_sample);
3726 double dist_sq = 0.0;
3727 for (
unsigned ii = 0; ii < cached_dim_zeta; ii++)
3730 (zeta[ii] - zeta_sample[ii]) * (zeta[ii] - zeta_sample[ii]);
3743 Vector<double> zeta_sample(cached_dim_zeta);
3746 el_pt->interpolated_x(
s, zeta_sample);
3750 el_pt->interpolated_zeta(
s, zeta_sample);
3753 for (
unsigned ii = 0; ii < cached_dim_zeta; ii++)
3756 << zeta_sample[ii] <<
" ";
3758 (zeta[ii] - zeta_sample[ii]) * (zeta[ii] - zeta_sample[ii]);
3762 <<
" " << sqrt(dist) << std::endl;
3768 bool use_coordinate_as_initial_guess =
true;
3770 zeta, sub_geom_object_pt,
s, use_coordinate_as_initial_guess);
3776 sub_geom_object_pt = 0;
3779 if (sub_geom_object_pt != 0)
3785 #ifdef OOMPH_HAS_MPI
3791 n_neighbours_visited_last_time = count;
3794 if (can_increase_n_nearest_neighbours)
3796 unsigned factor_for_increase_in_nearest_neighbours = 10;
3797 n_nearest_neighbours *= factor_for_increase_in_nearest_neighbours;
3800 if (n_nearest_neighbours > n_nearest_neighbours_max)
3802 can_increase_n_nearest_neighbours =
false;
3822 const Vector<double>& zeta,
3823 const unsigned& max_sample_points_for_newton_based_search,
3824 GeomObject*& sub_geom_object_pt,
3832 sub_geom_object_pt = 0;
3838 Point_d query(zeta.size(), zeta.begin(), zeta.end());
3841 const unsigned n_nearest_neighbours_max =
3842 std::min(n_sample, max_sample_points_for_newton_based_search);
3849 for (K_neighbor_search_d::iterator it = search.begin(); it != search.end();
3853 SamplePoint* sample_point_pt = boost::get<1>(it->first);
3856 FiniteElement* el_pt =
3860 #ifdef OOMPH_HAS_MPI
3876 bool use_equally_spaced_interior_sample_points =
3879 el_pt->get_s_plot(
i,
3882 use_equally_spaced_interior_sample_points);
3888 Vector<double> zeta_sample(cached_dim_zeta);
3891 el_pt->interpolated_x(
s, zeta_sample);
3895 el_pt->interpolated_zeta(
s, zeta_sample);
3897 double dist_sq = 0.0;
3898 for (
unsigned ii = 0; ii < cached_dim_zeta; ii++)
3901 (zeta[ii] - zeta_sample[ii]) * (zeta[ii] - zeta_sample[ii]);
3914 Vector<double> zeta_sample(cached_dim_zeta);
3917 el_pt->interpolated_x(
s, zeta_sample);
3921 el_pt->interpolated_zeta(
s, zeta_sample);
3924 for (
unsigned ii = 0; ii < cached_dim_zeta; ii++)
3927 << zeta_sample[ii] <<
" ";
3929 (zeta[ii] - zeta_sample[ii]) * (zeta[ii] - zeta_sample[ii]);
3933 <<
" " << sqrt(dist) << std::endl;
3939 bool use_coordinate_as_initial_guess =
true;
3941 zeta, sub_geom_object_pt,
s, use_coordinate_as_initial_guess);
3947 sub_geom_object_pt = 0;
3950 if (sub_geom_object_pt != 0)
3956 #ifdef OOMPH_HAS_MPI
3963 K_neighbor_search_d::iterator it = search.begin();
3966 SamplePoint* sample_point_pt = boost::get<1>(it->first);
3969 FiniteElement* el_pt =
3973 bool use_equally_spaced_interior_sample_points =
3976 el_pt->get_s_plot(
i,
3979 use_equally_spaced_interior_sample_points);
3981 sub_geom_object_pt = el_pt;
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
unsigned dimension_of_bin_array(const unsigned &i) const
Number of bins in coordinate direction i.
unsigned max_bin_dimension() const
Max. bin dimension (number of bins in coordinate directions)
Vector< unsigned > dimensions_of_bin_array() const
Number of bins in coordinate directions. Const vector-based version.
void get_neighbouring_bins_helper(const unsigned &bin_index, const unsigned &radius, Vector< unsigned > &neighbouring_bin_index, const bool &use_old_version=true)
Helper function for computing the bin indices of neighbouring bins at a given "radius" of the specifi...
unsigned ndim_zeta() const
Dimension of the zeta ( = dim of local coordinate of elements)
Vector< unsigned > Dimensions_of_bin_array
Number of bins in each coordinate direction.
unsigned coords_to_bin_index(const Vector< double > &zeta)
Get (linearly enumerated) bin index of bin that contains specified zeta.
void profile_get_neighbouring_bins_helper()
Profiling function to compare performance of two different versions of the get_neighbouring_bins_help...
void coords_to_vectorial_bin_index(const Vector< double > &zeta, Vector< unsigned > &bin_index)
Get "coordinates" of bin that contains specified zeta.
void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s)
Find sub-GeomObject (finite element) and the local coordinate s within it that contains point with gl...
unsigned ndim_zeta() const
Dimension of the zeta ( = dim of local coordinate of elements)
CGAL::Orthogonal_k_neighbor_search< Traits_d > K_neighbor_search_d
CGALSamplePointContainer(SamplePointContainerParameters *sample_point_container_parameters_pt)
Constructor.
unsigned & last_sample_point_to_actually_lookup_during_locate_zeta()
When searching through sample points only actually do the locate_zeta calls when when the counter is ...
void limited_locate_zeta(const Vector< double > &zeta, const unsigned &max_sample_points_for_newton_based_search, GeomObject *&sub_geom_object_pt, Vector< double > &s)
Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordina...
Kernel_d::Point_d Point_d
unsigned Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta
Every time we've completed a "spiral", visiting a finite number of sample points in a deterministic o...
unsigned Last_sample_point_to_actually_lookup_during_locate_zeta
When searching through sample points only actually do the locate_zeta calls when when the counter is ...
Vector< SamplePoint * > Sample_point_pt
Vector storing pointers to sample point objects (which represent sample point in terms of number of e...
double get_sample_points()
Get the sample points; return time for setup of CGAL tree.
unsigned Initial_last_sample_point_to_actually_lookup_during_locate_zeta
When searching through sample points only actually do the locate_zeta calls when when the counter exc...
unsigned First_sample_point_to_actually_lookup_during_locate_zeta
When searching through sample points only actually do the locate_zeta calls when when the counter exc...
Vector< Point_d > CGAL_sample_point_zeta_d
Vector containing sample point coordinates.
K_neighbor_search_d::Tree * CGAL_tree_d_pt
Pointer to tree-based representation of sample points.
unsigned Ndim_zeta
Dimension of the zeta ( = dim of local coordinate of elements)
unsigned & first_sample_point_to_actually_lookup_during_locate_zeta()
When searching through sample points only actually do the locate_zeta calls when when the counter exc...
unsigned total_number_of_sample_points_computed_recursively() const
Compute total number of sample points in sample point container.
static bool Already_warned_about_small_number_of_bin_cells
Boolean flag to make sure that warning about small number of bin cells only gets triggered once.
void get_bin(const Vector< double > &zeta, int &bin_number)
Get the number of the bin containing the specified coordinate. Bin number is negative if the coordina...
static bool Suppress_warning_about_large_total_number_of_bins
Boolean to supppress warnings about large number of bins.
void fill_bin_array()
Fill the bin array with sample points from FiniteElements stored in mesh.
unsigned Nspiral_chunk
Number of spirals to be searched in one go.
unsigned Max_spiral_level
Max. spiralling level (for efficiency; effect similar to max_search_radius)
static unsigned long Total_nbin_cells_counter
Counter for overall number of bins allocated – used to issue warning if this exceeds a threshhold....
void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s)
Find sub-GeomObject (finite element) and the local coordinate s within it that contains point with gl...
static unsigned Threshold_for_elements_per_bin_warning
Fraction of elements/bin that triggers warning. Too many elements per bin can lead to very slow compu...
unsigned Current_min_spiral_level
Current min. spiralling level.
void get_bin_vertices(const unsigned &i_bin, Vector< Vector< double >> &bin_vertex)
Get vector of vectors containing the coordinates of the vertices of the i_bin-th bin: bin_vertex[j][i...
unsigned Current_max_spiral_level
Current max. spiralling level.
static bool Suppress_warning_about_small_number_of_bins
Boolean to supppress warnings about small number of bins.
void fill_bin_by_diffusion(const unsigned &bin_diffusion_radius=1)
Fill bin by diffusion, populating each empty bin with the same content as the first non-empty bin fou...
unsigned total_number_of_sample_points_computed_recursively() const
Compute total number of sample points recursively.
void output_bin_vertices(std::ofstream &outfile)
Output bin vertices (allowing display of bins as zones).
static bool Already_warned_about_large_number_of_bin_cells
Boolean flag to make sure that warning about large number of bin cells only gets triggered once.
SparseVector< Vector< std::pair< FiniteElement *, Vector< double > > > > Bin_object_coord_pairs
Storage for paired objects and coords in each bin.
void output_bins(std::ofstream &outfile)
Output bins.
static unsigned Default_n_bin_1d
Default number of bins (in each coordinate direction). (Note: don't move this into a common base clas...
unsigned & current_max_spiral_level()
Access function to current max. spiral level.
void get_fill_stats(unsigned &n_bin, unsigned &max_n_entry, unsigned &min_n_entry, unsigned &tot_n_entry, unsigned &n_empty) const
Provide some stats on the fill level of the associated bin.
void flush_bins_of_objects()
Flush the storage for the binning method (and decrement counter for total number of bins in active us...
static unsigned long Threshold_for_total_bin_cell_number_warning
Total number of bins above which warning is issued. (Default assignment of 100^DIM bins per MeshAsGeo...
NonRefineableBinArray(SamplePointContainerParameters *bin_array_parameters_pt)
Constructor.
unsigned & current_min_spiral_level()
Access function to current min. spiral level.
double min_distance(const unsigned &i_bin, const Vector< double > &zeta)
Compute the minimum distance of any vertex in the specified bin from the specified Lagrangian coordin...
unsigned nbin() const
Total number of bins (empty or not)
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
unsigned Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta
Every time we've completed a "spiral", visiting a finite number of sample points in a deterministic o...
Vector< RefineableBin * > Bin_pt
Vector of pointers to constituent RefineableBins.
unsigned Max_depth
Max depth of the hierarchical bin_array.
unsigned total_number_of_sample_points_computed_recursively() const
Compute total number of sample points recursively.
unsigned First_sample_point_to_actually_lookup_during_locate_zeta
When searching through sample points recursively from the top level RefineableBinArray (in determinis...
static unsigned Default_n_bin_1d
Default number of bins (in each coordinate direction) (Note: don't move this into a common base class...
void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s)
Find sub-GeomObject (finite element) and the local coordinate s within it that contains point with gl...
unsigned nbin() const
Number of bins (not taking recursion into account)
RefineableBinArray * Root_bin_array_pt
Pointer to root bin array.
unsigned Depth
Variable which stores the Depth value of the bin_array. Useful for debugging and for preventing "infi...
unsigned Max_number_of_sample_point_per_bin
Maximum number of sample points in bin (before it's subdivided recursively)
RefineableBinArray * root_bin_array_pt() const
Root bin array.
void fill_bin_array()
Fill the bin array with sample points from FiniteElements stored in mesh.
void output_bin_vertices(std::ofstream &outfile)
Output bin vertices (allowing display of bins as zones).
void output_neighbouring_bins(const unsigned &bin_index, const unsigned &radius, std::ofstream &outfile)
Output neighbouring bins at given "radius" of the specified bin.
unsigned Last_sample_point_to_actually_lookup_during_locate_zeta
When searching through sample points recursively from the top level RefineableBinArray (in determinis...
void get_bin_boundaries(const unsigned &bin_index, Vector< std::pair< double, double >> &min_and_max_coordinates)
Boundaries of specified bin in each coordinate direction. *.first = min; *.second = max.
unsigned Initial_last_sample_point_to_actually_lookup_during_locate_zeta
When searching through sample points recursively from the top level RefineableBinArray (in determinis...
RefineableBinArray(SamplePointContainerParameters *bin_array_parameters_pt)
Constructor.
bool Bin_array_is_recursive
Variable which stores if the RefineableBinArray is recursive or not.
RefineableBin class. Contains sample points and is embedded in a RefineableBinArray....
void output(std::ofstream &outfile, const bool &don_t_recurse=false)
Output bin; x,[y,[z]],n_sample_points.
void add_sample_point(SamplePoint *new_sample_point_pt, const Vector< double > &zeta_coordinates)
Add a new sample point to RefineableBin.
void get_bin_boundaries(Vector< std::pair< double, double >> &min_and_max_coordinates)
Boundaries of bin in each coordinate direction. *.first = min; *.second = max.
void output_bin_vertices(std::ofstream &outfile)
Output bin vertices (allowing display of bins as zones).
unsigned total_number_of_sample_points_computed_recursively() const
Compute total number of sample points recursively.
~RefineableBin()
Destructor.
void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s)
Find sub-GeomObject (finite element) and the local coordinate s within it that contains point with gl...
void make_sub_bin_array(const Vector< std::pair< double, double >> &min_and_max_coordinates)
Method for building a new subbin_array (called when the Bin size is greater than the Max_number_of_sa...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
static bool Always_fail_elemental_locate_zeta
Boolean flag to make to make locate zeta fail. Used for debugging/ illustration of search procedures.
static double Percentage_offset
Offset of sample point container boundaries beyond max/min coords.
Vector< std::pair< double, double > > Min_and_max_coordinates
Vector of pairs of doubles for min and maximum coordinates. Call: Min_and_max_coordinates[j] gives me...
static bool Enable_timing_of_setup
Time setup?
bool ignore_halo_elements_during_locate_zeta_search() const
Ignore halo elements?
unsigned & nsample_points_generated_per_element()
"Measure of" number of sample points generated in each element
bool Ignore_halo_elements_during_locate_zeta_search
Ignore halo elements?
const Vector< std::pair< double, double > > & min_and_max_coordinates() const
Vector of pair of doubles for min and maximum coordinates. min (first) and max. (second) coordinates.
bool use_eulerian_coordinates_during_setup() const
Use Eulerian coordinates (i.e. interpolated_x) rather than zeta itself (i.e. interpolated_zeta) to id...
unsigned Nsample_points_generated_per_element
"Measure of" number of sample points generated in each element
unsigned Total_number_of_sample_points_visited_during_locate_zeta_from_top_level
Counter to keep track of how many sample points we've visited during top level call to locate_zeta.
bool Use_eulerian_coordinates_during_setup
Use Eulerian coordinates (i.e. interpolated_x) rather than zeta itself (i.e. interpolated_zeta) to id...
Mesh * Mesh_pt
Pointer to mesh from whose FiniteElements sample points are created.
double Max_search_radius
Max radius beyond which we stop searching the bin. Initialised to DBL_MAX so keep going until the poi...
static std::ofstream Visited_sample_points_file
File to record sequence of visited sample points in. Used for debugging/ illustration of search proce...
double & max_search_radius()
Set maximum search radius for locate zeta. This is initialised do DBL_MAX so we brutally search throu...
virtual unsigned & total_number_of_sample_points_visited_during_locate_zeta_from_top_level()
Counter to keep track of how many sample points we've visited during top level call to locate_zeta....
void setup_min_and_max_coordinates()
Helper function to compute the min and max coordinates for the mesh, in each dimension.
static bool Use_equally_spaced_interior_sample_points
Use equally spaced sample points? (otherwise vertices are sampled repeatedly.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
unsigned element_index_in_mesh() const
Access function to the index of finite element in its mesh.
unsigned sample_point_index_in_element() const
Index of sample point within element.
double timer()
returns the time in seconds after some point in past
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...