--- trunk/src/io/Globals.hpp 2004/09/24 16:27:58 3 +++ trunk/src/io/Globals.hpp 2005/09/15 00:14:35 598 @@ -1,22 +1,69 @@ -#ifndef __GLOBALS_H__ -#define __GLOBALS_H__ +/* + * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. + * + * The University of Notre Dame grants you ("Licensee") a + * non-exclusive, royalty free, license to use, modify and + * redistribute this software in source and binary code form, provided + * that the following conditions are met: + * + * 1. Acknowledgement of the program authors must be made in any + * publication of scientific results based in part on use of the + * program. An acceptable form of acknowledgement is citation of + * the article in which the program was described (Matthew + * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher + * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented + * Parallel Simulation Engine for Molecular Dynamics," + * J. Comput. Chem. 26, pp. 252-271 (2005)) + * + * 2. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 3. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * This software is provided "AS IS," without a warranty of any + * kind. All express or implied conditions, representations and + * warranties, including any implied warranty of merchantability, + * fitness for a particular purpose or non-infringement, are hereby + * excluded. The University of Notre Dame and its licensors shall not + * be liable for any damages suffered by licensee as a result of + * using, modifying or distributing the software or its + * derivatives. In no event will the University of Notre Dame or its + * licensors be liable for any lost revenue, profit or data, or for + * direct, indirect, special, consequential, incidental or punitive + * damages, however caused and regardless of the theory of liability, + * arising out of the use of or inability to use software, even if the + * University of Notre Dame has been advised of the possibility of + * such damages. + */ + +#ifndef IO_GLOBALS_HPP +#define IO_GLOBALS_HPP #include #include #include +#include +#include #include "io/BASS_interface.h" #include "types/Component.hpp" -#include "io/LinkedCommand.hpp" #include "types/MakeStamps.hpp" #include "types/ZconStamp.hpp" -using namespace std; + +/** + * @class Globals Globals.hpp "io/Globals.hpp" + * @brief parsing and storing global parameters for simulation + * @todo need refactorying + */ class Globals{ -public: + public: Globals(); ~Globals(); @@ -88,7 +135,16 @@ class Globals{ (public) double getThermIntLambda(void) { return thermodynamic_integration_lambda; } double getThermIntK(void) { return thermodynamic_integration_k; } char* getForceFieldVariant( void ) { return forcefield_variant; } - + char* getForceFieldFileName() { return forcefield_filename; } + double getDistSpringConst(void) { return therm_int_dist_spring; } + double getThetaSpringConst(void) { return therm_int_theta_spring; } + double getOmegaSpringConst(void) { return therm_int_omega_spring; } + double getSurfaceTension(void) { return surface_tension; } + bool getPrintPressureTensor(void) { return print_pressure_tensor;} + char* getCoulombicCorrection(void) { return coulombicCorrection; } + double getDampingAlpha(void) { return dampingAlpha; } + char* getCutoffPolicy(void) { return cutoffPolicy; } + short int haveDt( void ) { return have_dt; } short int haveRunTime( void ) { return have_run_time; } short int haveEnsemble( void ) { return have_ensemble; } @@ -131,19 +187,27 @@ class Globals{ (public) short int haveMinLSMaxIter(void) { return have_minimizer_ls_maxiteration;} short int haveThermIntLambda(void) { return have_thermodynamic_integration_lambda; } short int haveThermIntK(void) { return have_thermodynamic_integration_k; } - short int haveForceFieldVariant(void) { return have_forcefield_variant; } + short int haveForceFieldVariant(void) { return have_forcefield_variant; } + short int haveForceFieldFileName(void) { return have_forcefield_filename; } + short int haveDistSpringConst(void) { return have_dist_spring_constant; } + short int haveThetaSpringConst(void) { return have_theta_spring_constant; } + short int haveOmegaSpringConst(void) { return have_omega_spring_constant; } + short int haveSurfaceTension(void) { return have_surface_tension; } + short int havePrintPressureTensor(void) {return have_print_pressure_tensor;} + short int haveCoulombicCorrection(void) {return have_coulombic_correction;} + short int haveDampingAlpha(void) { return have_damping_alpha; } + short int haveCutoffPolicy(void) { return have_cutoff_policy; } /* other accessors */ Component** getComponents( void ) { return components; } ZconStamp** getZconStamp( void ) { return zConstraints; } -private: + private: - int hash_size; - int hash_shift; - int hash( char* text ); - void addHash( char* text, int token ); - LinkedCommand** command_table; + + typedef std::map CommandMapType; + CommandMapType command_table; + char* checkMe( void ); @@ -205,7 +269,16 @@ class Globals{ (public) double thermodynamic_integration_lambda; double thermodynamic_integration_k; char forcefield_variant[100]; - + char forcefield_filename[100]; + double therm_int_dist_spring; + double therm_int_theta_spring; + double therm_int_omega_spring; + double surface_tension; + bool print_pressure_tensor; + char coulombicCorrection[100]; + double dampingAlpha; + char cutoffPolicy[100]; + //required arguments short int have_force_field, have_n_components, have_target_temp; short int have_target_pressure, have_ensemble, have_dt, have_run_time; @@ -228,6 +301,15 @@ class Globals{ (public) short int have_thermodynamic_integration_lambda; short int have_thermodynamic_integration_k; short int have_forcefield_variant; + short int have_forcefield_filename; + short int have_dist_spring_constant; + short int have_theta_spring_constant; + short int have_omega_spring_constant; + short int have_surface_tension; + short int have_print_pressure_tensor; + short int have_coulombic_correction; + short int have_damping_alpha; + short int have_cutoff_policy; }; #endif