ManyRestraintsBase::ManyRestraintsBase(const ActionOptions& ao):
    Action(ao),
    ActionWithValue(ao),
    ActionPilot(ao),
    ActionWithVessel(ao),
    ActionWithInputVessel(ao)
{
    // Read in the vessel we are action on
    readArgument("bridge");
    aves=dynamic_cast<ActionWithVessel*>( getDependencies()[0] );

    plumed_assert( getDependencies().size()==1 && aves );
    log.printf("  adding restraints on variables calculated by %s action with label %s\n",
               aves->getName().c_str(),aves->getLabel().c_str());

    // Add a task list in order to avoid problems
    for(unsigned i=0; i<aves->getFullNumberOfTasks(); ++i) addTaskToList( aves->getTaskCode(i) );
    // And turn on the derivatives (note problems here because of ActionWithValue)
    turnOnDerivatives();
    needsDerivatives();

    // Now create the vessel
    std::string fake_input="LABEL=bias";
    addVessel( "SUM", fake_input, 0 );
    readVesselKeywords();
}
Exemple #2
0
void ActionWithGrid::turnOnDerivatives(){
  needsDerivatives(); ActionWithValue::turnOnDerivatives(); 
  if( getStride()==1 ) setStride(0);
  else if( getStride()!=0 ) error("conflicting instructions for grid - stride was set but must be evaluated on every step for derivatives - remove STRIDE keyword");
  if( clearstride>1 ) error("conflicting instructions for grid - CLEAR was set but grid must be reset on every step for derivatives - remove CLEAR keyword" ); 
  if( weights.size()>0 ) error("conflicting instructions for grid - LOGWEIGHTS was set but weights are not considered when derivatives of grid are evaluated - remove LOGWEIGHTS keyword"); 
}
void SecondaryStructureRMSD::turnOnDerivatives(){
  ActionWithValue::turnOnDerivatives();
  needsDerivatives();
}
Exemple #4
0
void MultiColvarBase::turnOnDerivatives(){
  ActionWithValue::turnOnDerivatives();
  needsDerivatives(); 
  forcesToApply.resize( getNumberOfDerivatives() );
} 
Exemple #5
0
void Mapping::turnOnDerivatives(){
  ActionWithValue::turnOnDerivatives();
  needsDerivatives();
}