94 double min = top.
getBox().diagonal().minCoeff();
96 std::vector<Segment*> segs;
103 std::cout << std::endl;
104 std::cout <<
"Evaluating " << segs.size() <<
" segments for neighborlist. ";
105 if ((top.
Segments().size() - segs.size()) != 0) {
106 std::cout << top.
Segments().size() - segs.size()
107 <<
" segments are not taken into account as specified"
110 std::cout << std::endl;
113 std::cout <<
"The following segments are used in the neigborlist creation"
115 std::cout <<
"\t" << std::flush;
117 std::cout <<
" " << st;
119 std::cout << std::endl;
122 std::cout <<
"\r ... ... Evaluating " << std::flush;
123 std::vector<std::string> skippedpairs;
127 boost::timer::progress_display progress(segs.size());
129 std::vector<double> approxsize = std::vector<double>(segs.size(), 0.0);
130#pragma omp parallel for
131 for (
Index i = 0; i <
Index(segs.size()); i++) {
132 approxsize[i] = segs[i]->getApproxSize();
134#pragma omp parallel for schedule(guided)
135 for (
Index i = 0; i <
Index(segs.size()); i++) {
138 for (
Index j = i + 1; j <
Index(segs.size()); j++) {
143 }
catch (
const std::exception&) {
145 if (!
InVector(skippedpairs, pairstring)) {
147 if (!
InVector(skippedpairs, pairstring)) {
151 skippedpairs.push_back(pairstring);
158 if (cutoff > 0.5 * min) {
159 throw std::runtime_error(
160 (boost::format(
"Cutoff is larger than half the box size. Maximum "
161 "allowed cutoff is %1$1.1f (nm)") %
165 double cutoff2 = cutoff * cutoff;
166 Eigen::Vector3d segdistance =
168 double segdistance2 = segdistance.squaredNorm();
169 double outside = cutoff + approxsize[i] + approxsize[j];
171 if (segdistance2 < cutoff2) {
173 { top.
NBList().
Add(*seg1, *seg2, segdistance); }
175 }
else if (segdistance2 > (outside * outside)) {
179 if ((R * R) < cutoff2) {
181 { top.
NBList().
Add(*seg1, *seg2, segdistance); }
189 if (skippedpairs.size() > 0) {
190 std::cout <<
"WARNING: No cut-off specified for segment pairs of type "
192 for (
const std::string& st : skippedpairs) {
193 std::cout << st << std::endl;
195 std::cout <<
"pairs were skipped" << std::endl;
198 std::cout << std::endl
199 <<
" ... ... Created " << top.
NBList().
size() <<
" direct pairs.";
201 std::cout << std::endl
202 <<
" ... ... Determining classical pairs " << std::endl;
204 std::cout <<
" ... ... Found " << classical_pairs <<
" classical pairs "