diff --git a/mm_trj/README b/mm_trj/README index 5789488..d4fdab8 100644 --- a/mm_trj/README +++ b/mm_trj/README @@ -3,22 +3,16 @@ Version : 1.0.1 License : GPL Usage: -mm_radf -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -o OUTPUT [ -r MIN,MAX ] [ -rs R_STEP ] - [ -a MIN,MAX ] [ -as ANG_STEP ] [ -m ] [ -l LOGFILE ] [ -q ] [ -h ] +mm_trj -i INPUT_TRJ -t INPUT_TYPE -s NUMBER -a INPUT_ATOMS -o OUTPUT [ -tt TOTAL_TYPES ] + [ -l LOGFILE ] [ -q ] [ -h ] Parametrs: - -i - mask of input files - -s - trajectory steps (integer) - -c - cell size (float), A - -a - atom types (integer). Format: 'ATOM1-ATOM2' or 'A1,A2,A3-B1,B2,B3' - (will enable RDF calculation for center mass automaticaly) - -o - output file name - -r - minimal and maximal radii for analyze (float), A. Default is '2.0,15.0' - -rs - radius step for analyze (float), A. Default is '0.2' - -a - minimal and maximal angles for analyze (float), deg. Default is '0.0,90.0' - -as - angle step for analyze (float), deg. This option will enable RADF - calculation automaticaly - -m - matrix output enable + -i - input file name + -t - type of trajectory. Supported formats: gmx, puma + -s - number of trajectory steps (integer) + -a - input file with atom types. See file format in manual + -o - mask of output files + -tt - number of different atom types. Default is 1024 -l - log enable -q - quiet enable -h - show this help and exit diff --git a/mm_trj/src/main.c b/mm_trj/src/main.c index 76b809d..aab5a38 100644 --- a/mm_trj/src/main.c +++ b/mm_trj/src/main.c @@ -24,21 +24,15 @@ * @section How-To-Use How to use * Usage: *
- * mm_radf -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -o OUTPUT [ -r MIN,MAX ] [ -rs R_STEP ] 
- *                    [ -a MIN,MAX ] [ -as ANG_STEP ] [ -m ] [ -l LOGFILE ] [ -q ] [ -h ]
+ * mm_trj -i INPUT_TRJ -t INPUT_TYPE -s NUMBER -a INPUT_ATOMS -o OUTPUT [ -tt TOTAL_TYPES ]
+ *                                                             [ -l LOGFILE ] [ -q ] [ -h ]
  * Parametrs:
- *    -i          - mask of input files
- *    -s          - trajectory steps (integer)
- *    -c          - cell size (float), A
- *    -a          - atom types (integer). Format: 'ATOM1-ATOM2' or 'A1,A2,A3-B1,B2,B3' 
- *                  (will enable RDF calculation for center mass automaticaly)
- *    -o          - output file name
- *    -r          - minimal and maximal radii for analyze (float), A. Default is '2.0,15.0'
- *    -rs         - radius step for analyze (float), A. Default is '0.2'
- *    -a          - minimal and maximal angles for analyze (float), deg. Default is '0.0,90.0'
- *    -as         - angle step for analyze (float), deg. This option will enable RADF 
- *                  calculation automaticaly
- *    -m          - matrix output enable
+ *    -i          - input file name
+ *    -t          - type of trajectory. Supported formats: gmx, puma
+ *    -s          - number of trajectory steps (integer)
+ *    -a          - input file with atom types. See file format in manual
+ *    -o          - mask of output files
+ *    -tt         - number of different atom types. Default is 1024
  *    -l          - log enable
  *    -q          - quiet enable
  *    -h          - show this help and exit
@@ -269,6 +263,7 @@ int main(int argc, char *argv[])
   error = 1;
   error = reading_atoms (input_at, &num_types, num_mol, num_atoms, ch_atom_types, 
                          atom_types, total_types);
+  
   if (error == 0)
   {
     sprintf (tmp_str, "%6cLog: %i;\n%6cQuiet: %i;\n%6cInput file: %s;\n%6cTrajectory type: %i;\n\
diff --git a/mm_trj/src/mm_trj b/mm_trj/src/mm_trj
deleted file mode 100755
index 91075b7..0000000
Binary files a/mm_trj/src/mm_trj and /dev/null differ
diff --git a/mm_trj/src/read_gmx.c b/mm_trj/src/read_gmx.c
index ed44643..260c5fa 100644
--- a/mm_trj/src/read_gmx.c
+++ b/mm_trj/src/read_gmx.c
@@ -2,11 +2,37 @@
  * @file
  */
 
+#include 
 #include 
 
 #include "print_trj.h"
 
 
+/**
+ * @fn translate_coords
+ */
+int translate_coords (const float coords, const float cell, float *trans)
+/**
+ * @brief funtion that translates coordinate
+ * @code
+ * 
+ * @endcode
+ * 
+ * @param coords          coordinate
+ * @param cell            cell size
+ * @param trans           massive of translated coordinates
+ * 
+ * @return 0              - exit without errors
+ */
+{
+    trans[0] = coords;
+    trans[1] = coords - cell;
+    trans[2] = coords + cell;
+   
+  return 0;
+}
+
+
 /**
  * @fn rw_gmx
  */
@@ -34,5 +60,95 @@ int rw_gmx (const char *input, const int step, const char *output, const int num
  * @return 0              - exit without errors
  */
 {
+  char filename[256], tmp_str[256];
+  float cell[3], trans[3], r_min;
+  int atoms, i, j, k, l, m, n;
+  FILE *f_inp;
+  
+/* filename               output file name
+ * cell                   cell size
+ * trans                  translated coordinates
+ * r_min                  minimal radius
+ * atom                   number of atoms
+ * f_inp                  input file
+ */
+  
+  f_inp = fopen (input, "r");
+  if (f_inp == NULL)
+    return 1;
+  
+  for (i=0; i cell[m]/2)
+              for (n=j; n cell[m]/2)
-                for (n=j; n cell[m]/2)
+              for (n=j; n