--- trunk/src/io/Globals.cpp 2004/09/24 16:27:58 3 +++ trunk/src/io/Globals.cpp 2005/01/25 17:45:23 273 @@ -1,3 +1,44 @@ + /* + * 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. + */ + #include #include #include @@ -71,7 +112,7 @@ #define G_THERM_INT_LAMBDA 50 #define G_THERM_INT_K 51 #define G_FORCEFIELD_VARIANT 52 - +#define G_FORCEFIELD_FILENAME 53 Globals::Globals(){ initalize(); } @@ -155,7 +196,8 @@ void Globals::initalize(){ addHash( "thermodynamicIntegrationLambda", G_THERM_INT_LAMBDA); addHash( "thermodynamicIntegrationK", G_THERM_INT_K); addHash( "forceFieldVariant", G_FORCEFIELD_VARIANT); - + addHash( "forceFieldFileName", G_FORCEFIELD_FILENAME); + strcpy( mixingRule,"standard"); //default mixing rules to standard. usePBC = 1; //default periodic boundry conditions to on useRF = 0; @@ -212,6 +254,7 @@ void Globals::initalize(){ have_thermodynamic_integration_lambda = 0; have_thermodynamic_integration_k = 0; have_forcefield_variant = 0; + have_forcefield_filename = 0; } @@ -1389,13 +1432,13 @@ int Globals::globalAssign( event* the_event ){ case STRING: the_event->err_msg = - strdup( "Error in parsing meta-data file!\n\tminimizer_writefrq is not a double or int.\n" ); + strdup( "Error in parsing meta-data file!\n\tminimizer_writefrq is not an int.\n" ); return 1; break; case DOUBLE: - minimizer_writefrq= the_event->evt.asmt.rhs.dval; - have_minimizer_writefrq = 1; + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tminimizer_writefrq is not an int.\n" ); return 1; break; @@ -1505,13 +1548,13 @@ int Globals::globalAssign( event* the_event ){ case STRING: the_event->err_msg = - strdup( "Error in parsing meta-data file!\n\tminimizer_ls_maxiteration is not a double or int.\n" ); + strdup( "Error in parsing meta-data file!\n\tminimizer_ls_maxiteration is not an int.\n" ); return 1; break; case DOUBLE: - minimizer_ls_maxiteration = the_event->evt.asmt.rhs.dval; - have_minimizer_ls_maxiteration = 1; + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tminimizer_ls_maxiteration is not an int.\n" ); return 1; break; @@ -1694,6 +1737,19 @@ int Globals::globalAssign( event* the_event ){ return 0; break; // add more token cases here. + + case G_FORCEFIELD_FILENAME: + if( the_type == STRING ){ + strcpy( forcefield_filename, the_event->evt.asmt.rhs.sval ); + have_forcefield_filename = 1; + return 1; + } + + the_event->err_msg = + strdup( "Error in parsing meta-data file!\n\tforceFieldFileName was not a string assignment.\n" ); + return 0; + break; + // add more token cases here. } }