58 virtual void calculate();
60 static void registerKeywords(
Keywords& keys );
63 PLUMED_REGISTER_ACTION(
Cell,
"CELL")
68 std::vector<AtomNumber> atoms;
71 addComponentWithDerivatives(
"ax"); componentIsNotPeriodic(
"ax"); components[0][0]=getPntrToComponent(
"ax");
72 addComponentWithDerivatives(
"ay"); componentIsNotPeriodic(
"ay"); components[0][1]=getPntrToComponent(
"ay");
73 addComponentWithDerivatives(
"az"); componentIsNotPeriodic(
"az"); components[0][2]=getPntrToComponent(
"az");
74 addComponentWithDerivatives(
"bx"); componentIsNotPeriodic(
"bx"); components[1][0]=getPntrToComponent(
"bx");
75 addComponentWithDerivatives(
"by"); componentIsNotPeriodic(
"by"); components[1][1]=getPntrToComponent(
"by");
76 addComponentWithDerivatives(
"bz"); componentIsNotPeriodic(
"bz"); components[1][2]=getPntrToComponent(
"bz");
77 addComponentWithDerivatives(
"cx"); componentIsNotPeriodic(
"cx"); components[2][0]=getPntrToComponent(
"cx");
78 addComponentWithDerivatives(
"cy"); componentIsNotPeriodic(
"cy"); components[2][1]=getPntrToComponent(
"cy");
79 addComponentWithDerivatives(
"cz"); componentIsNotPeriodic(
"cz"); components[2][2]=getPntrToComponent(
"cz");
84 Action::registerKeywords( keys );
85 ActionWithValue::registerKeywords( keys );
86 ActionAtomistic::registerKeywords( keys );
87 componentsAreNotOptional(keys);
101 void Cell::calculate(){
103 for(
int i=0;i<3;i++)
for(
int j=0;j<3;j++) components[i][j]->set(getBox()[i][j]);
104 for(
int l=0;l<3;l++)
for(
int m=0;
m<3;
m++){
105 Tensor der;
for(
int i=0;i<3;i++) der[i][
m]=getBox()[l][i];
106 setBoxDerivatives(components[l][
m],-der);
Class implementing fixed size matrices of doubles.
A class for holding the value of a function together with its derivatives.
Provides the keyword CELL
#define PLUMED_COLVAR_INIT(ao)
void addOutputComponent(const std::string &name, const std::string &key, const std::string &descr)
Add a potential component which can be output by this particular action.
This class holds the keywords and their documentation.
This class is used to bring the relevant information to the Action constructor.
This is the abstract base class to use for implementing new collective variables, within it there is ...