96 double min = top.
getBox().diagonal().minCoeff();
98 std::vector<Segment*> segs;
101 segs.push_back(&seg);
105 std::cout << std::endl;
106 std::cout <<
"Evaluating " << segs.size() <<
" segments for neighborlist. ";
107 if ((top.
Segments().size() - segs.size()) != 0) {
108 std::cout << top.
Segments().size() - segs.size()
109 <<
" segments are not taken into account as specified"
112 std::cout << std::endl;
115 std::cout <<
"The following segments are used in the neigborlist creation"
117 std::cout <<
"\t" << std::flush;
119 std::cout <<
" " << st;
121 std::cout << std::endl;
124 std::cout <<
"\r ... ... Evaluating " << std::flush;
125 std::vector<std::string> skippedpairs;
129 boost::timer::progress_display progress(segs.size());
131 std::vector<double> approxsize = std::vector<double>(segs.size(), 0.0);
132#pragma omp parallel for
133 for (
Index i = 0; i <
Index(segs.size()); i++) {
134 approxsize[i] = segs[i]->getApproxSize();
136#pragma omp parallel for schedule(guided)
137 for (
Index i = 0; i <
Index(segs.size()); i++) {
140 for (
Index j = i + 1; j <
Index(segs.size()); j++) {
145 }
catch (
const std::exception&) {
147 if (!
InVector(skippedpairs, pairstring)) {
149 if (!
InVector(skippedpairs, pairstring)) {
153 skippedpairs.push_back(pairstring);
160 if (cutoff > 0.5 * min) {
161 throw std::runtime_error(
162 (boost::format(
"Cutoff is larger than half the box size. Maximum "
163 "allowed cutoff is %1$1.1f (nm)") %
167 double cutoff2 = cutoff * cutoff;
168 Eigen::Vector3d segdistance =
170 double segdistance2 = segdistance.squaredNorm();
171 double outside = cutoff + approxsize[i] + approxsize[j];
173 if (segdistance2 < cutoff2) {
176 top.
NBList().
Add(*seg1, *seg2, segdistance);
179 }
else if (segdistance2 > (outside * outside)) {
183 if ((R * R) < cutoff2) {
186 top.
NBList().
Add(*seg1, *seg2, segdistance);
197 if (skippedpairs.size() > 0) {
198 std::cout <<
"WARNING: No cut-off specified for segment pairs of type "
200 for (
const std::string& st : skippedpairs) {
201 std::cout << st << std::endl;
203 std::cout <<
"pairs were skipped" << std::endl;
206 std::cout << std::endl
207 <<
" ... ... Created " << top.
NBList().
size() <<
" direct pairs.";
209 std::cout << std::endl
210 <<
" ... ... Determining classical pairs " << std::endl;
212 std::cout <<
" ... ... Found " << classical_pairs <<
" classical pairs "