Am 27.03.2010 16:18, schrieb Marek Maly:
The soft conservative DPD force/potential is unfortunately not
implemented. Am I right ?
You are right. I thought about implementing it one day...
If I am right I would like to know how to use/modify Espresso to be able
to carry out full DPD
simulation (including DPD conservative force).
Implementing the conservative DPD part is not difficult. Just use a
simple non-bonded interaction (like ljgen) as template.
One way is probably to use DPD thermostat together with tabulated DPD
potential/force but this is
a little bit uncomfortable solution.
And slow....
The second way is to implement conservative DPD force/potential directly
into Espresso code like Leonnard-Jones, Morse etc.
Espresso developers probably has no interest here ? but I can try it by
my self (I have experience with C/C++ however I am pretty new in TCL).
I can learn from implementations of the other potentials in Espresso but
I would be grateful for some info, about the list of all files which
I have to create or modify in order to implement successfully this new
feature.
Maybe the easiest way could be also just proper redefinition of some of
the already existing potential (Soft-sphere for example), just to
prevent
me from the problems with compilation of Espresso with new code files.
But again I need to know all the files (.h,.c,.tcl) which I have to
modify .
I would call the conservative DPD part nb_harmonic, because it is
basically like a spring, but non-bonded.
How to create a new non-bonded interaction?
-Add new interaction parameters to IA_parameters struct in
interaction_data.h
-Add these parameters to initialize_ia_params and copy_ia_params in
interaction_data.c
-Add interaction cutoff to calc_maximal_cutoff in interaction_data.c
-Add a check if interataction is on to checkIfInteraction in
interaction_data.c
-Create a new .c,.h file with the following 4 functions (see ljgen.c as
example):
int printYYYIAToResult(Tcl_Interp *interp, int i, int j);
int YYY_parser(Tcl_Interp * interp,
int part_type_a, int part_type_b,
int argc, char ** argv);
void add_YYY_pair_force(Particle *p1, Particle *p2,
IA_parameters,*ia_params,double d[3],
double dist, double force[3]);
double YYY_pair_energy(Particle *p1, Particle *p2,
IA_parameters *ia_params, double d[3],
double dist);
where YYY stands for the new interaction name (e.g. ljgen).
-Add printYYYIAToResult to printNonbondedIAToResult in interaction_data.c
-Add YYY_parser to inter_parse_non_bonded in interaction_data.c
-Add add_YYY_pair_force to calc_non_bonded_pair_force_parts in
pressure.h (!!!)
-Add YYY_pair_energy to calc_non_bonded_pair_energy in energy.h
-Add the new .h, .c file to Espresso_bin_SOURCES in Makefile-am.am and
run autogen.sh
-Compile and TEST
-Put all new code in '#ifdef YYY' blocks
-Add YYY to compilation_callback in config.c
-Add YYY to config-sample.h
-Create a patch using
cvs diff -u (CVS VERSION) or
diff -Naur original_Espresso_dir your_Espresso_dir (release version)
-Send it to us
I think that's it. If you need any help just ask again.
If you send us the patch and we are happy to include the code in our
next release.
Cheers,
Christoph
Thank you very much in advance for your help !
Best wishes,
Marek