28 data.d_neighPd.resize(
data.d_x.size());
30 auto t1 = steady_clock::now();
33 tf::Taskflow taskflow;
35 taskflow.for_each_index((std::size_t) 0,
data.d_x.size(), (std::size_t) 1, [&
data](std::size_t i) {
36 const auto &pi = data.d_ptId[i];
37 double search_r = data.d_particlesListTypeAll[pi]->d_material_p->getHorizon();
39 std::vector<size_t> neighs;
40 std::vector<double> sqr_dist;
41 if (data.d_nsearch_p->radiusSearchIncludeTag(data.d_x[i],
47 for (std::size_t j = 0; j < neighs.size(); ++j)
48 if (neighs[j] != i && data.d_ptId[neighs[j]] == pi) {
49 data.d_neighPd[i].push_back(size_t(neighs[j]));
56 executor.run(taskflow).get();
58 auto t2 = steady_clock::now();
59 util::io::log(2, std::format(
"{}: Peridynamics neighbor update time = {}\n",
void log(std::ostringstream &oss, bool screen_out=false, int printMpiRank=print_default_mpi_rank)
Global method to log the message.
float timeDiff(std::chrono::steady_clock::time_point begin, std::chrono::steady_clock::time_point end, std::string unit="microseconds")
Returns difference between two times.