diff --git a/en_disp/en_disp.c b/en_disp/en_disp.c new file mode 100644 index 0000000..dbd33e8 --- /dev/null +++ b/en_disp/en_disp.c @@ -0,0 +1,287 @@ +/* en_disp + * Version: 1.0 + * License: GPL + * Author: Evgeniy Alexeev aka arcanis + * Email: esalexeev@gmail.com + * + * 'en_disp' calculate the energy difference between forms with different states + * of a salt bridge. + * + * Usage: + * en_disp -cc FILENAME -no FILENAME [ -ref REF_C-C REF_N-0 ] + * [ -s NUM_OF_SIMULATION ] [ -p POINTS_IN_SIMULATION ] [ -t TEMPERATURE ] + * [ -d FILENAME ] [ -h ] + * + * Compile: + * gcc en_disp.c -o en_disp -lm + * Dependence: + * * gcc + * * libs: math.h, stdio.h, stdlib.h, string.h + */ + +#include +#include +#include +#include + +// define new RAND_MAX - NOT long int +#ifdef RAND_MAX +#undef RAND_MAX +#define RAND_MAX 100000 +#endif + + +double cc_ref, no_ref, temp; +double dist[50000][2]; +int distrib_exists[50000], points, points_in_model, total_points; +/* cc_ref - reference distance for C-C + * dist - distance between atoms + * distrib_exists - array of number of points when ionic lock exists + * no_ref - reference distance for N-O + * points - number of simulations + * points_in_model - number of points in single simulation + * temp - temperature + * total_points - trajectory length + */ + + +void analyze() +{ +// function to analyze distributions + double aver=0.0, disp=0.0, t_ratio; + int i; +/* aver - average energy + * disp - standard deviation + * t_ratio - ratio of t(exists) to t(broken) + */ + + for (i=0; i