Skip to content

Commit

Permalink
fix: Fix ScatteringMatrix referencing (#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
trisyoungs authored and rprospero committed Apr 8, 2024
1 parent 7040697 commit 2155174
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/modules/epsr/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,17 +479,16 @@ Module::ExecutionResult EPSRModule::process(ModuleContext &moduleContext)
*/

// Add the unweighted from this target to our combined, unweighted S(Q) data
auto &types = unweightedSQ.atomTypeMix();
dissolve::for_each_pair(
ParallelPolicies::seq, types.begin(), types.end(),
[&](int i, const AtomTypeData &atd1, int j, const AtomTypeData &atd2)
{
auto globalI = atd1.atomType()->index();
auto globalJ = atd2.atomType()->index();
auto &types = scatteringMatrix_.atomTypes();
dissolve::for_each_pair(ParallelPolicies::seq, types.begin(), types.end(),
[&](int i, const auto &at1, int j, const auto &at2)
{
auto pairIndex = scatteringMatrix_.pairIndexOf(at1, at2);

const auto &partialIJ = unweightedSQ.unboundPartial(i, j);
Interpolator::addInterpolated(partialIJ, calculatedUnweightedSQ[{globalI, globalJ}], 1.0 / targets_.size());
});
const auto &partialIJ = unweightedSQ.unboundPartial(i, j);
Interpolator::addInterpolated(partialIJ, calculatedUnweightedSQ[pairIndex],
1.0 / targets_.size());
});

/*
* Save Data
Expand Down

0 comments on commit 2155174

Please sign in to comment.