/* []----------------------------------------[] | ReadInput.h | []----------------------------------------[] | | | AUTHOR: MFSomers 2005. | | USE: Read input files ... | | | []----------------------------------------[] */ // Copyright (C) 2005 M.F. Somers, Theoretical Chemistry Department, Leiden University // // This is free software; you can redistribute it and/or modify it under the terms of // the GNU Lesser General Public License as published by the Free Software Foundation. // // http://www.gnu.org/licenses/lgpl.txt #if !defined(__READ_INPUT_INCLUDED__) #define __READ_INPUT_INCLUDED__ #include "Global.h" #include "Vector.h" #include "Constants.h" #include "ClassicalDynamics.h" #include "PointPair.h" #include "Coulomb.h" #include "Gravity.h" #include "Harmonic.h" #include "Morse.h" #include "LennardJones.h" #include "Rydberg.h" #include "NewtonDynamics.h" #include "SteepestDescent.h" #include "Bending.h" #include "Torsional.h" #include "DistanceConstraint.h" #include #include #include #define MAX_LINE_LENGTH 4096 /* ------------------------------------------------------------------------------------- */ /* definition of a color table */ typedef struct { Vector RGB; int Id; } Color; typedef Color *ColorPointer; typedef vector ColorList; typedef ColorList *ColorListPointer; /* ------------------------------------------------------------------------------------- */ /* definition of the structure of data read from files */ typedef struct { ParticleListPointer Particles; InteractionListPointer Interactions; ColorListPointer Colors; ConstraintListPointer Constraints; Particle DefaultParticle; double Time, TimeStep, EndTime, AccuracyEnergy, AutoSnapShotTimeStep, NextAutoSnapShotTime; double MaxStepSizeConformation, AccuracyConformation; int Periodicity, DoDynamics, DoConformation, MaxStepsConformation; int ConstantTemperature; unsigned int NrOfAutoSnapshotsToTake; double BoltzmannConstant, TargetTemperature, TemperatureReScaleTime, RandomMomentaFactor; double GammaFactor, CenterOfMassRemovalFactor; Vector Translation, Scale, RotationAxis, TheBox; Vector *TheBoxPointer; double RotationAngle; } InputFileDataType; /* ------------------------------------------------------------------------------------- */ int ReadDataFromFile( char *FileName, InputFileDataType& TheData, int &LineNumber, FILE *InFile = NULL ); int WriteDataToFile( char *FileName, InputFileDataType& TheData, FILE *OutFile = NULL ); void DeleteInteractionList( InteractionListPointer& Interactions ); void DeleteParticleList( ParticleListPointer& Particles ); void DeleteColorList( ColorListPointer& Colors ); void DeleteConstraintList( ConstraintListPointer& Constraints ); void DeleteTheData( InputFileDataType& TheData ); int AddParticleToList( ParticleListPointer& Particles, Particle& P ); int AddInteractionToList( InteractionListPointer& Interactions, Interaction& I ); int AddConstraintToList( ConstraintListPointer& Constraints, Constraint& C ); int AddColorToList( ColorListPointer& Colors, Color& TheColor ); int DeleteInteractionFromList( InteractionListPointer& Interactions, unsigned int Id ); int DeleteParticleFromList( ParticleListPointer& Particles, unsigned int Id ); int DeleteConstraintFromList( ConstraintListPointer& Constraints, unsigned int Id ); int DeleteColorFromList( ColorListPointer& Colors, int Id ); void SortInteractionList( InteractionListPointer& Interactions ); void SortParticleList( ParticleListPointer& Particles ); void SortColorList( ColorListPointer& Colors ); void SortConstraintList( ConstraintListPointer& Constraints ); /* ------------------------------------------------------------------------------------- */ #endif