Added radf-1.0.1b

This commit is contained in:
arcan1s
2013-08-02 06:14:41 +04:00
parent 2c5664d3bd
commit 0523b2f7fa
30 changed files with 4068 additions and 93 deletions

View File

@ -3,7 +3,8 @@ Version: 1.0.1
License: GPL
Usage:
statgen -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -r ... -o OUTPUT [ -g DEPTH ] [ -l LOGFILE ] [ -q ] [ -h ]
statgen -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -r ... -o OUTPUT [ -g DEPTH ]
[ -l LOGFILE ] [ -q ] [ -h ]
Parametrs:
-i - mask of input files

View File

@ -4,7 +4,7 @@ CC=gcc
CFLAGS=-c -Wall -fPIC
LDFLAGS=-lm
SOURCES_DIR=src
SOURCES=main.c add_main.c coords.c graph.c int2char.c messages.c stat_print.c stat_select.c stat_sort.c summary_stat.c
SOURCES=main.c add_main.c coords.c graph.c messages.c stat_print.c stat_select.c stat_sort.c summary_stat.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=statgen

View File

@ -1,33 +0,0 @@
/**
* @file
*/
/**
* @fn conv
*/
char conv (const int fnumb, const int dig_pos)
/**
* @brief function that converts from integer to char
* @code
* char = conv (N, 0);
* @endcode
*
* @param fnumb integer
* @param dig_pos position: ones=1, decimals=2, hundreds=3
*
* @return char
*/
{
int d, h, o;
char const digit[] = "0123456789";
h = fnumb / 100;
d = (fnumb % 100) / 10;
o = fnumb % 10;
if (dig_pos == 1) return digit[o];
if (dig_pos == 2) return digit[d];
if (dig_pos == 3) return digit[h];
else return digit[0];
}

View File

@ -1,14 +0,0 @@
/**
* @file
*/
#ifndef INT2CHAR_H
#define INT2CHAR_H
/**
* @fn conv
*/
char conv (const int, const int);
#endif /* INT2CHAR_H */

View File

@ -25,7 +25,7 @@
* Usage:
* <pre>
* statgen -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -r ... -o OUTPUT [ -g DEPTH ]
* [ -l LOGFILE ] [ -q ] [ -h ]
* [ -l LOGFILE ] [ -q ] [ -h ]
*
* Parametrs:
* -i - mask of input files
@ -78,7 +78,6 @@
#include "add_main.h"
#include "coords.h"
#include "int2char.h"
#include "messages.h"
#include "stat_print.h"
#include "stat_select.h"
@ -98,7 +97,7 @@ int main (int argc, char *argv[])
*/
{
char filename[256], tmp_str[2048];
int error, i, index, j, k, label[2];
int error, i, index, j, label[2];
float label_fl;
FILE *f_inp, *f_log;
@ -164,7 +163,8 @@ int main (int argc, char *argv[])
sprintf (tmp_str, "%s Evgeniy Alekseev aka arcanis\n", tmp_str);
sprintf (tmp_str, "%s E-mail : esalexeev@gmail.com\n\n", tmp_str);
sprintf (tmp_str, "%sUsage:\n", tmp_str);
sprintf (tmp_str, "%sstatgen -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -r ... -o OUTPUT [ -g DEPTH ] [ -l LOGFILE ] [ -q ] [ -h ]\n\n", tmp_str);
sprintf (tmp_str, "%sstatgen -i INPUT -s FIRST,LAST -c X,Y,Z -a ... -r ... -o OUTPUT [ -g DEPTH ]\n", tmp_str);
sprintf (tmp_str, "%s [ -l LOGFILE ] [ -q ] [ -h ]\n\n", tmp_str);
sprintf (tmp_str, "%sParametrs:\n", tmp_str);
sprintf (tmp_str, "%s -i - mask of input files\n", tmp_str);
sprintf (tmp_str, "%s -s - trajectory steps (integer)\n", tmp_str);
@ -298,13 +298,7 @@ int main (int argc, char *argv[])
// processing
// initial variables
k = strlen (input);
strcpy (filename, input);
filename[k] = '.';
filename[k+1] = conv (from, 3);
filename[k+2] = conv (from, 2);
filename[k+3] = conv (from, 1);
filename[k+4] = '\0';
sprintf (filename, "%s.%03i", input, from);
print_message (quiet, stdout, log, f_log, 3, filename);
f_inp = fopen (filename, "r");
if (f_inp == NULL)
@ -327,15 +321,15 @@ int main (int argc, char *argv[])
stat_all = (int *) malloc (2 * sizeof (int));
// error checking
if ((coords == NULL) ||
(label_mol == NULL) ||
(true_label_mol == NULL) ||
(type_agl == NULL) ||
(type_atoms == NULL) ||
(agl == NULL) ||
(connect == NULL) ||
(num_mol_agl == NULL) ||
(stat == NULL) ||
(stat_all == NULL))
(label_mol == NULL) ||
(true_label_mol == NULL) ||
(type_agl == NULL) ||
(type_atoms == NULL) ||
(agl == NULL) ||
(connect == NULL) ||
(num_mol_agl == NULL) ||
(stat == NULL) ||
(stat_all == NULL))
{
print_message (quiet, stderr, log, f_log, 19, argv[0]);
return 3;
@ -371,15 +365,12 @@ int main (int argc, char *argv[])
for (i=from; i<to+1; i++)
{
// reading coordinates
filename[k+1] = conv (i, 3);
filename[k+2] = conv (i, 2);
filename[k+3] = conv (i, 1);
filename[k+4] = '\0';
sprintf (filename, "%s.%03i", input, i);
print_message (quiet, stdout, log, f_log, 7, filename);
error = reading_coords (0, filename, type_inter, label_atom, cell, &num_mol,
&num_atoms, true_label_mol, label_mol, type_atoms,
coords, tmp_str);
if (error != 1)
if (error == 0)
{
sprintf (tmp_str, "%6cNumber of molecules: %i; %6cNumber of atoms: %i\n",
' ', num_mol, ' ', num_atoms);
@ -399,10 +390,10 @@ int main (int argc, char *argv[])
}
// error checking
if ((agl == NULL) ||
(connect == NULL) ||
(num_mol_agl == NULL) ||
(stat == NULL) ||
(stat_all == NULL))
(connect == NULL) ||
(num_mol_agl == NULL) ||
(stat == NULL) ||
(stat_all == NULL))
{
print_message (quiet, stderr, log, f_log, 19, argv[0]);
return 3;