Main plumed object.
More...
#include <Plumed.h>
|
void * | p |
| Void pointer holding the real PlumedMain structure. More...
|
|
Main plumed object.
This is an object containing a Plumed instance, which should be used in the MD engine. It should first be initialized with plumed_create(), then it communicates with the MD engine using plumed_cmd(). Finally, before the termination, it should be deallocated with plumed_finalize(). Its interface is very simple and general, and is expected not to change across plumed versions. See Reference for interfacing MD codes with PLUMED.
◆ plumed_c2f()
void plumed_c2f |
( |
plumed |
p, |
|
|
char * |
c |
|
) |
| |
|
related |
Converts a C handler to a FORTRAN handler.
- Parameters
-
p | The C handler |
c | The FORTRAN handler (a char[32]) This function can be used to convert a plumed object created in C to
a plumed handler that can be used in FORTRAN.
#include <plumed/wrapper/Plumed.h>
int main(int argc,char*argv[]){
plumed p;
p=plumed_create();
char fortran_handler[32];
plumed_c2f(p,fortran_handler);
printf("DEBUG: this is a string representation for the plumed handler: %s\n",fortran_handler);
fortran_routine(fortran_handler);
plumed_finalize(p);
return 0;
}
Here fortran_routine is a routine implemented in FORTRAN that manipulates the fortran_handler. |
◆ plumed_cmd()
void plumed_cmd |
( |
plumed |
p, |
|
|
const char * |
key, |
|
|
const void * |
val |
|
) |
| |
|
related |
Tells p to execute a command.
- Parameters
-
p | The plumed object on which command is acting |
key | The name of the command to be executed |
val | The argument. It is declared as const to allow calls like plumed_cmd(p,"A","B"), but for some choice of key it can change the content |
◆ plumed_create()
Constructor.
- Returns
- The constructed plumed object
◆ plumed_f2c()
plumed plumed_f2c |
( |
const char * |
c | ) |
|
|
related |
Converts a FORTRAN handler to a C handler.
- Parameters
-
c | The FORTRAN handler (a char[32]) |
- Returns
- The C handler
This function can be used to convert a plumed object created in FORTRAN to a plumed handler that can be used in C.
void c_routine(char handler[32]){
plumed p;
p=plumed_f2c(handler);
plumed_cmd(p,"init",NULL);
}
Here c_routine
is a C function that can be called from FORTRAN and interact with the provided plumed handler.
◆ plumed_finalize()
void plumed_finalize |
( |
plumed |
p | ) |
|
|
related |
Destructor.
- Parameters
-
p | The plumed object to be deallocated |
◆ plumed_gcmd()
void plumed_gcmd |
( |
const char * |
key, |
|
|
const void * |
val |
|
) |
| |
|
related |
Tells to the global interface to execute a command.
- Parameters
-
key | The name of the command to be executed |
val | The argument. It is declared as const to allow calls like plumed_gcmd("A","B"), but for some choice of key it can change the content |
- Note
- Equivalent to plumed_cmd(), but acting on the global plumed object. It thus does not require the plumed object to be specified.
◆ plumed_gcreate()
void plumed_gcreate |
( |
void |
| ) |
|
|
related |
Constructor for the global interface.
- Note
- Equivalent to plumed_create(), but initialize the static global plumed object
◆ plumed_gfinalize()
void plumed_gfinalize |
( |
void |
| ) |
|
|
related |
Destructor for the global interface.
- Note
- Equivalent to plumed_finalize(), but acting on the global plumed object. It thus does not require the plumed object to be specified.
◆ plumed_ginitialized()
int plumed_ginitialized |
( |
void |
| ) |
|
|
related |
Check if the global interface has been initialized.
- Returns
- 1 if plumed has been initialized, 0 otherwise
◆ plumed_global()
Retrieves an handler to the global structure.
◆ plumed_installed()
int plumed_installed |
( |
void |
| ) |
|
|
related |
Check if plumed is installed (for runtime binding)
- Returns
- 1 if plumed is installed, 0 otherwise
Void pointer holding the real PlumedMain structure.
The documentation for this struct was generated from the following file: