/**
* @file
*/
/**
* @mainpage envir
* @image latex ./logo.png
*
* @section intro_sec Introduction
*
* About this program:
*
* - Program that searchs environment for chosen molecule by geometric criterion
*
*
* Developer:
*
* - Evgeniy Alekseev aka arcanis
*
* License:
*
*
* @section How-To-Use How to use
* Usage:
*
* envir -i FILENAME -c X,Y,Z -o FILEMANE [ -n NUM_OF_MOLECULE ] [ -r RADIUS ]
* [ -l LOGFILE] [ -q ] [ -h ]
*
* Parametrs:
* -i - input file with coordinates
* -c - cell size (float), A
* -o - output file with coordinates
* -n - number of molecule for search (integer). Default is 1
* -r - radius of environment (float). Default is 6.0
* -l - log enable
* -q - quiet enable
* -h - show this help and exit
*
*
* @page Install
*
* @section Requirements Requirements
* The application statgen requires the following external stuff:
* - cmake >= 2.8
* - gcc >= 4.8
*
* @section How-To How to install
*
* @subsection Linux Linux
* @code
* mkdir build && cd build
* cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ../
* make
* make install
* @endcode
*
* @subsection Windows Windows
* @code
* create project file using 'cmake'
* compile project
* @endcode
* You may also download compiled executable file for Win_x86.
*
* @page Changelog
* V.1.0.1 (2013-07-27)
* * initial release
*/
#include
#include
#include
#include
#include "add_main.h"
#include "coords.h"
#include "envir_search.h"
#include "messages.h"
#include "print_struct.h"
#include "set_center.h"
/**
* @fn main
*/
int main(int argc, char *argv[])
/**
* @return 1 - error in error_checking
* @return 2 - input file does not exist
* @return 3 - memory error
* @return 0 - exit without errors
*/
{
char tmp_str[2048];
int error, i, *tmp_int;
FILE *f_inp, *f_log;
char *ch_type_atoms, input[256], logfile[256], output[256];
float cell[3], *centr_coords, *coords, rad;
int *label_mol, log, num_atoms, num_mol, num_needed_mol, num_of_mol,
*needed_mol, quiet, *true_label_mol;
/* ch_type_atoms massive of char atom types
* input input file name
* logfile log file name
* output output file name
*
* cell massive of cell size
* centr_coords massive of centered coordinates
* coords massive of coordinates
* rad radius of environment sphere
*
* label_mol massive of numbers of molecule for atoms
* log status of log-mode
* num_atoms number of atoms
* num_mol number of molecules
* num_needed_mol number of needed molecules
* num_of_mol number of molecule
* needed_mol massive of number of needed molecules
* quiet status of quiet-mode
* true_label_mol massive of true numbers of molecule for atoms
*/
set_defaults (cell, input, &log, &num_of_mol, output, &quiet, &rad);
for (i=1; i