Bugs fixed
^^^^^^^^^^
+Fixed slight inaccuracies when using virtual sites with pressure coupling
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Virtual sites were reconstructed after the system was propagated, but before
+scaling due to pressure coupling. For virtual site types which are not a linear
+combination of other atoms, this is not completely correct. Since the scaling
+due to pressure coupling is very small in healthy simulations, the resulting
+inaccuracies are expected to have been extremely minor, and in most cases
+undetectable.
+
+:issue:`3866`
+
.. Note to developers!
Please use """"""" to underline the individual entries for fixed issues in the subfolders,
otherwise the formatting on the webpage is messed up.
state->box,
state->lambda[efptBONDED]);
}
- if (vsite)
- {
- /* Construct the virtual sites for the initial configuration */
- vsite->construct(state->x, ir->delta_t, {}, state->box);
- }
}
if (ir->efep != efepNO)
stateGpu->waitCoordinatesReadyOnHost(AtomLocality::Local);
}
+ if (vsite != nullptr)
+ {
+ // Virtual sites need to be updated before domain decomposition and forces are calculated
+ wallcycle_start(wcycle, ewcVSITECONSTR);
+ vsite->construct(state->x, ir->delta_t, state->v, state->box);
+ wallcycle_stop(wcycle, ewcVSITECONSTR);
+ }
+
if (bNS && !(bFirstStep && ir->bContinuation))
{
bMasterState = FALSE;
enerd->term[F_DVDL_CONSTR] += dvdl_constr;
}
- if (vsite != nullptr)
- {
- wallcycle_start(wcycle, ewcVSITECONSTR);
- vsite->construct(state->x, ir->delta_t, state->v, state->box);
- wallcycle_stop(wcycle, ewcVSITECONSTR);
- }
-
/* ############## IF NOT VV, Calculate globals HERE ############ */
/* With Leap-Frog we can skip compute_globals at
* non-communication steps, but we need to calculate
"decomposition, "
"use a single rank");
}
+ if (constructVsites)
+ {
+ wallcycle_start(wcycle, ewcVSITECONSTR);
+ vsite->construct(state->x, ir->delta_t, state->v, state->box);
+ wallcycle_stop(wcycle, ewcVSITECONSTR);
+ }
}
if (DOMAINDECOMP(cr))
stopHandler->setSignal();
- if (vsite != nullptr)
- {
- wallcycle_start(wcycle, ewcVSITECONSTR);
- vsite->construct(state->x, ir->delta_t, state->v, state->box);
- wallcycle_stop(wcycle, ewcVSITECONSTR);
- }
-
{
const bool doInterSimSignal = false;
const bool doIntraSimSignal = true;
stopHandler->setSignal();
- if (vsite != nullptr)
- {
- wallcycle_start(wcycle, ewcVSITECONSTR);
- vsite->construct(state->x, ir->delta_t, state->v, state->box);
- wallcycle_stop(wcycle, ewcVSITECONSTR);
- }
-
{
const bool doInterSimSignal = false;
const bool doIntraSimSignal = true;