Skip to content

Commit

Permalink
Change SDF logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tcmoore3 committed Oct 19, 2023
1 parent 6b8ca38 commit 7f98259
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions hoomd/hpmc/ComputeSDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,15 @@ template<class Shape> void ComputeSDF<Shape>::countHistogramLinearSearch(uint64_
if (u_ij_new != u_ij_0)
{
min_bin_compression = bin_to_sample;
hist_weight_ptl_i_compression
= 1.0 - fast::exp(-(u_ij_new - u_ij_0));
// do not let weight go below zero
hist_weight_ptl_i_compression
= fmax(0, hist_weight_ptl_i_compression);
if (u_ij_new < u_ij_0)
{
hist_weight_ptl_i_compression = 0;
}
else
{
hist_weight_ptl_i_compression
= 1.0 - fast::exp(-(u_ij_new - u_ij_0));
}
}
} // end if (!hard_overlap && m_mc->getPatchEnergy())
} // end loop over bins for compression
Expand Down Expand Up @@ -671,11 +675,15 @@ template<class Shape> void ComputeSDF<Shape>::countHistogramLinearSearch(uint64_
if (u_ij_new != u_ij_0)
{
min_bin_expansion = bin_to_sample;
hist_weight_ptl_i_expansion
= 1.0 - fast::exp(-(u_ij_new - u_ij_0));
// do not let weight go below zero
hist_weight_ptl_i_expansion
= fmax(0, hist_weight_ptl_i_expansion);
if (u_ij_new < u_ij_0)
{
hist_weight_ptl_i_expansion = 0;
}
else
{
hist_weight_ptl_i_expansion
= 1.0 - fast::exp(-(u_ij_new - u_ij_0));
}
}
} // end if (!hard_overlap && m_mc->getPatchEnergy())
} // end loop over histogram bins for expansions
Expand Down

0 comments on commit 7f98259

Please sign in to comment.