Esempio n. 1
0
ClusteringBase::ClusteringBase(const ActionOptions&ao):
  Action(ao),
  ActionWithInputMatrix(ao),
  number_of_cluster(-1)
{
  if( getAdjacencyVessel() ) {
    cluster_sizes.resize(getNumberOfNodes()); which_cluster.resize(getNumberOfNodes());
    if( getNumberOfNodeTypes()!=1 ) error("should only be running clustering with one base multicolvar in function");
    if( !getAdjacencyVessel()->undirectedGraph() ) error("input contact matrix is incompatible with clustering");
  }
  if( keywords.exists("MATRIX") ) {
    std::vector<AtomNumber> fake_atoms; setupMultiColvarBase( fake_atoms );
  }
}
Esempio n. 2
0
void ClusteringBase::turnOnDerivatives() {
  // Check base multicolvar isn't density probably other things shouldn't be allowed here as well
  if( (getAdjacencyVessel()->getMatrixAction())->getNumberOfBaseMultiColvars()>0 ) {
    if( getBaseMultiColvar(0)->isDensity() ) error("DFS clustering cannot be differentiated if base multicolvar is DENSITY");
  }

  // Ensure that derivatives are turned on in base classes
  ActionWithInputMatrix::turnOnDerivatives();
}
Esempio n. 3
0
Vector ActionWithInputMatrix::getPositionOfAtomForLinkCells( const unsigned& iatom ) const {
  return (getAdjacencyVessel()->function)->getPositionOfAtomForLinkCells( iatom );
}
Esempio n. 4
0
double ClusteringBase::getCutoffForConnection() const {
  return getAdjacencyVessel()->getCutoffForConnection();
}
Esempio n. 5
0
bool ClusteringBase::areConnected( const unsigned& iatom, const unsigned& jatom ) const {
  return getAdjacencyVessel()->nodesAreConnected( iatom, jatom );
}