本文整理汇总了C++中PDB::addBlockEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ PDB::addBlockEnd方法的具体用法?C++ PDB::addBlockEnd怎么用?C++ PDB::addBlockEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDB
的用法示例。
在下文中一共展示了PDB::addBlockEnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StoreDataVessel
TrigonometricPathVessel::TrigonometricPathVessel( const vesselbase::VesselOptions& da ):
StoreDataVessel(da),
projdir(ReferenceConfigurationOptions("DIRECTION")),
mydpack1( 1, getAction()->getNumberOfDerivatives() ),
mydpack2( 1, getAction()->getNumberOfDerivatives() ),
mydpack3( 1, getAction()->getNumberOfDerivatives() ),
mypack1( 0, 0, mydpack1 ),
mypack2( 0, 0, mydpack2 ),
mypack3( 0, 0, mydpack3 )
{
mymap=dynamic_cast<Mapping*>( getAction() );
plumed_massert( mymap, "Trigonometric path vessel can only be used with mappings");
// Retrieve the index of the property in the underlying mapping
if( mymap->getNumberOfProperties()!=1 ) error("cannot use trigonometric paths when there are multiple properties");
for(unsigned i=0; i<mymap->getFullNumberOfTasks(); ++i) {
if( mymap->getTaskCode(i)!=mymap->getPositionInFullTaskList(i) ) error("mismatched tasks and codes");
}
mymap->addComponentWithDerivatives("gspath"); mymap->componentIsNotPeriodic("gspath");
sp=mymap->copyOutput( mymap->getNumberOfComponents()-1 ); sp->resizeDerivatives( mymap->getNumberOfDerivatives() );
mymap->addComponentWithDerivatives("gzpath"); mymap->componentIsNotPeriodic("gzpath");
zp=mymap->copyOutput( mymap->getNumberOfComponents()-1 ); zp->resizeDerivatives( mymap->getNumberOfDerivatives() );
// Check we have PCA
ReferenceConfiguration* ref0=mymap->getReferenceConfiguration(0);
for(unsigned i=0; i<mymap->getFullNumberOfTasks(); ++i) {
if( !(mymap->getReferenceConfiguration(i))->pcaIsEnabledForThisReference() ) error("pca must be implemented in order to use trigometric path");
if( ref0->getName()!=(mymap->getReferenceConfiguration(i))->getName() ) error("cannot use mixed metrics");
if( mymap->getNumberOfAtoms()!=(mymap->getReferenceConfiguration(i))->getNumberOfReferencePositions() ) error("all frames must use the same set of atoms");
if( mymap->getNumberOfArguments()!=(mymap->getReferenceConfiguration(i))->getNumberOfReferenceArguments() ) error("all frames must use the same set of arguments");
}
cargs.resize( mymap->getNumberOfArguments() ); std::vector<std::string> argument_names( mymap->getNumberOfArguments() );
for(unsigned i=0; i<mymap->getNumberOfArguments(); ++i) argument_names[i] = (mymap->getPntrToArgument(i))->getName();
PDB mypdb; mypdb.setAtomNumbers( mymap->getAbsoluteIndexes() ); mypdb.addBlockEnd( mymap->getAbsoluteIndexes().size() );
if( argument_names.size()>0 ) mypdb.setArgumentNames( argument_names );
projdir.read( mypdb );
mypack1.resize( mymap->getNumberOfArguments(), mymap->getNumberOfAtoms() ); ref0->setupPCAStorage( mypack1 );
mypack2.resize( mymap->getNumberOfArguments(), mymap->getNumberOfAtoms() ); ref0->setupPCAStorage( mypack2 );
mypack3.resize( mymap->getNumberOfArguments(), mymap->getNumberOfAtoms() );
for(unsigned i=0; i<mymap->getNumberOfAtoms(); ++i) { mypack1.setAtomIndex(i,i); mypack2.setAtomIndex(i,i); mypack3.setAtomIndex(i,i); }
mypack1_stashd_atoms.resize( mymap->getNumberOfAtoms() ); mypack1_stashd_args.resize( mymap->getNumberOfArguments() );
}