From 631e0f8860430909e330a8308628803c33fc8143 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Tue, 25 Jun 2013 14:18:27 +0400 Subject: [PATCH] Added envir --- envir/envir.c | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 envir/envir.c diff --git a/envir/envir.c b/envir/envir.c new file mode 100644 index 0000000..4cabf0f --- /dev/null +++ b/envir/envir.c @@ -0,0 +1,219 @@ +/* envir + * Version: 1.0 + * License: GPL + * Author: Evgeniy Alexeev aka arcanis + * Email: esalexeev@gmail.com + * + * 'envir' is a program for search environment for chosen molecule by geometric + * criterion + * + * Usage: + * envir -i FILENAME -o FILEMANE [ -n NUM_OF_MOLECULE ] [ -r RADIUS ] [ -h ] + * + * Compile: + * gcc envir.c -o envir -lm + * Dependence: + * * gcc + * * libs: stdio.h, stdlib.h, string.h, math.h + */ + +#include +#include +#include +#include + + +char atom_type[5000][30][2]; +double centr_coord[5000][3], coord[5000][30][3], rad; +int at_in_mol[5000], mol, needed_mol[50], num_of_mol; +/* at_in_mol - number of atoms in molecules + * atom_type - massive of atom names + * centr_coord - coordinates of molecule mass center + * coord - coordinates of atoms + * mol - number of molecule in system + * needed_mol - massive of mulecules found + * num_of_mol - number of molecule for search + * rad - geometric criterion + */ + + +void printing(char output_file[]) +{ + int cur_mol=0, i, j=1; + FILE *out; + + out = fopen (output_file, "w+"); + while (needed_mol[cur_mol] != 10000) + { + for (i=0; i