Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion src/Action_Radial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ void Action_Radial::calcRDF_singleMask(Frame const& frmIn) {
int outer_max = OuterMask_.Nselected();
int idx1;

double boxX = frmIn.BoxCrd().Param(Box::X);
double boxY = frmIn.BoxCrd().Param(Box::Y);
double boxZ = frmIn.BoxCrd().Param(Box::Z);
bool isOrtho = (imageOpt_.ImagingType() == ImageOption::ORTHO &&
boxX != 0.0 && boxY != 0.0 && boxZ != 0.0);

long unsigned* myRDF = &RDF_[0];
# ifdef _OPENMP
# pragma omp parallel private(idx1, myRDF)
Expand All @@ -495,7 +501,27 @@ void Action_Radial::calcRDF_singleMask(Frame const& frmIn) {
const double* xyz1 = frmIn.XYZ( OuterMask_[idx1] );
for (int idx2 = idx1 + 1; idx2 < outer_max; idx2++) {
const double* xyz2 = frmIn.XYZ( OuterMask_[idx2] );
double D2 = DIST2( imageOpt_.ImagingType(), xyz1, xyz2, frmIn.BoxCrd() );
double D2;
if (isOrtho) {
double x = xyz1[0] - xyz2[0];
double y = xyz1[1] - xyz2[1];
double z = xyz1[2] - xyz2[2];
x = std::fabs(x);
y = std::fabs(y);
z = std::fabs(z);
while (x > boxX) x -= boxX;
while (y > boxY) y -= boxY;
while (z > boxZ) z -= boxZ;
double D = boxX - x;
if (D < x) x = D;
D = boxY - y;
if (D < y) y = D;
D = boxZ - z;
if (D < z) z = D;
D2 = x*x + y*y + z*z;
}
else
D2 = DIST2(imageOpt_.ImagingType(), xyz1, xyz2, frmIn.BoxCrd());
if (D2 <= maximum2_) {
// NOTE: Can we modify the histogram to store D^2?
double dist = sqrt(D2);
Expand Down
Loading