/************************************************************************************************************* The MIT License Copyright (C) 2006-2019 David Dubbeldam, Sofia Calero, Thijs Vlugt, Donald E. Ellis, and Randall Q. Snurr. D.Dubbeldam@uva.nl http://www.uva.nl/profiel/d/u/d.dubbeldam/d.dubbeldam.html scaldia@upo.es http://www.upo.es/raspa/ t.j.h.vlugt@tudelft.nl http://homepage.tudelft.nl/v9k6y don-ellis@northwestern.edu http://dvworld.northwestern.edu/ snurr@northwestern.edu http://zeolites.cqe.northwestern.edu/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "molecule.h" #include "framework.h" #include "simulation.h" #include "ewald.h" #include "potentials.h" #include "utils.h" #include "output.h" #include "input.h" #include "cbmc.h" #include "mc_moves.h" #include "ewald.h" #include "grids.h" #include "spacegroup.h" #include "recrossing.h" #include "movies.h" #include "utils.h" #include "sample.h" #include "spectra.h" #include "rigid.h" #include "integration.h" #include "statistics.h" #include "thermo_baro_stats.h" #include "equations_of_state.h" #include "inter_energy.h" #include "minimization.h" #include "scattering_factors.h" #include "framework_force.h" #include "warnings.h" #include "internal_force.h" #include "status.h" #include "charge_equilibration.h" int EwaldAutomatic; int RemoveFractionalMoleculesFromRestartFile; static int *read_frameworks; static int *InitializeBox; int VolumeChangeDirection=7; int IsActiveAtomType(int type) { int i; for(i=0;i=Framework[CurrentSystem].NumberOfFrameworks) { fprintf(stderr, "Error: framework constraint definition, framework id %d does not exist.\n",framework_nr); exit(0); } if(atom_nr>=Framework[CurrentSystem].NumberOfAtoms[framework_nr]) { fprintf(stderr, "Error: framework constraint definition, framework-atom %d of framework %d does not exist.\n",atom_nr,framework_nr); exit(0); } } void CheckConstraintInputAdsorbate(ADSORBATE_MOLECULE** adsorbates,int molecule_nr,int atom_nr) { if(!adsorbates[CurrentSystem]) { fprintf(stderr, "Error: adsorbate constraint definition, adsorbate-list does not exist.\n"); exit(0); } if(molecule_nr>=NumberOfAdsorbateMolecules[CurrentSystem]) { fprintf(stderr, "Error: adsorbate constraint definition, adsorbate-molecule id %d does not exist.\n",molecule_nr); exit(0); } if(atom_nr>=adsorbates[CurrentSystem][molecule_nr].NumberOfAtoms) { fprintf(stderr, "Error: adsorbate constraint definition, adsorbate-atom %d of molecule %d does not exist.\n",atom_nr,molecule_nr); exit(0); } } void CheckConstraintInputCation(CATION_MOLECULE** cations,int molecule_nr,int atom_nr) { if(!cations[CurrentSystem]) { fprintf(stderr, "Error: cation constraint definition, cation-list does not exist.\n"); exit(0); } if(molecule_nr>=NumberOfCationMolecules[CurrentSystem]) { fprintf(stderr, "Error: cation constraint definition, cation-molecule id %d does not exist.\n",molecule_nr); exit(0); } if(atom_nr>=Cations[CurrentSystem][molecule_nr].NumberOfAtoms) { fprintf(stderr, "Error: cations constraint definition, cation-atom %d of molecule %d does not exist.\n",atom_nr,molecule_nr); exit(0); } } // Reads at most 'length-1' characters from a file into a buffer // The character sequence is zero-terminated // more characters then the line are discarded char *ReadLine(char *buffer, size_t length, FILE *file) { char *p; size_t last; if((p=fgets(buffer,length,file))) { last=strlen(buffer)-1; if(buffer[last]=='\n') buffer[last]='\0'; // discard the trailing newline else { fscanf(file,"%*[^\n]"); (void) fgetc(file); // discard the newline } } return p; } // Loads the contents of a file specified by `path` into a string char* LoadFile(char *path) { char *buffer=0; long length; FILE *FilePtr; if(!(FilePtr=fopen(path, "r"))) { printf("Error opening input-file '%s' (routine int LoadFile(char *path))\n", path); return NULL; } fseek(FilePtr, 0, SEEK_END); length = ftell(FilePtr); fseek(FilePtr, 0, SEEK_SET); buffer = malloc(length); if (buffer) fread(buffer, 1, length, FilePtr); fclose(FilePtr); return buffer; } // Load the contents of a file into an in-memory buffer and pass to the parser // (Separating file reading from parsing exposes useful functionality) int ReadInputFile(char *filename) { return ReadInput(LoadFile(filename)); } // Reads the input and parses the options // * all string are converted to lowercase // * leading spaces are removed // * line-input after a parsed command is ignored int ReadInput(char *input) { int i,j,k,l,m,n,index,nr_sites; int Restart,RestartStyle,Type; int StartingBead,Swapable,A1,B1; char string[1024],keyword[1024],firstargument[1024],arguments[16384]; char *line,*tokptr,*arg_pointer,*tmp; REAL det,r; REAL A,B,C,tempd; int temp_int; REAL temp_real; double Wavelength; int f1,f2; VECTOR posf1,posf2,dr,s; int intinput1,intinput2,intinput3,intinput4,intinput5,intinput6,intinput7,intinput8,intinput9,intinput10,intinput11,intinput12; char charinput1,charinput2,charinput3,charinput4,charinput5,charinput6; REAL realinput1,realinput2; int LineNumber; int CurrentPrism,CurrentCylinder,CurrentSphere; int NumberOfCFBiasingFactors; REAL OverlapDistance; int CurrentReaction; // Added by Ambroise de Izarra //------------------------------------------------------------------- int CurrentAlchReaction; //------------------------------------------------------------------- int typeA,typeB; int atom1,atom2; int CFMoleculePresent=FALSE; CurrentReaction=0; // Added by Ambroise de Izarra //------------------------------------------------------------------- CurrentAlchReaction=0; //------------------------------------------------------------------- RXMCLambdaHistogramSize=21; MeasureLambdaBelow=10.0; RemoveFractionalMoleculesFromRestartFile=FALSE; NumberOfFixedAtomTypes=0; NumberOfActiveAtomTypes=0; FixedAtomTypes=NULL; ActiveAtomTypes=NULL; CurrentPrism=0; CurrentCylinder=0; CurrentSphere=0; CreateTinkerInput=FALSE; CreateDlpolyInput=FALSE; // not set, means get the random seed from the system time seed=0lu; UseReducedUnits=FALSE; therm_baro_stats.UseExternalStress=FALSE; Dimension=3; UseTabularGrid=FALSE; Swapable=FALSE; Type=0; MaxNumberOfBeads=0; MaxNumberOfBonds=0; MaxNumberOfUreyBradleys=0; MaxNumberOfTorsions=0; MaxNumberOfImproperTorsions=0; MaxNumberOfOutOfPlanes=0; MaxNumberOfIntraVDW=0; MaxNumberOfIntraChargeCharge=0; MaxNumberOfIntraChargeBondDipole=0; MaxNumberOfIntraBondDipoleBondDipole=0; CurrentIsothermPressure=0; NumberOfIsothermPressures=0; ComputeHessian=HESSIAN_ANALYTICAL; ComputeLambda=LAMBDA_METHOD_2; MinimizationVariables=CARTESIAN; UseSymmetryInMinimization=FALSE; RemoveTranslationFromHessian=FALSE; RemoveRotationFromHessian=FALSE; MaximumStepLength=0.3; MaximumStepLengthInput=0.3; MinimizationConvergenceFactor=1.0; NumberOfElementsDistanceHistogram=200; MaxRangeDistanceHistogram=12.0; WriteVTKGrids=FALSE; DensityAveragingTypeVTK=VTK_FULL_BOX; FreeEnergyAveragingTypeVTK=VTK_FULL_BOX; AverageDensityOverUnitCellsVTK=TRUE; VTKFractionalFrameworkAtomsMin.x=VTKFractionalFrameworkAtomsMin.y=VTKFractionalFrameworkAtomsMin.z=-0.001; VTKFractionalFrameworkAtomsMax.x=VTKFractionalFrameworkAtomsMax.y=VTKFractionalFrameworkAtomsMax.z=1.001; VTKFractionalFrameworkBondsMin.x=VTKFractionalFrameworkBondsMin.y=VTKFractionalFrameworkBondsMin.z=-0.151; VTKFractionalFrameworkBondsMax.x=VTKFractionalFrameworkBondsMax.y=VTKFractionalFrameworkBondsMax.z=1.151; VTKFractionalAdsorbateComMin.x=VTKFractionalAdsorbateComMin.y=VTKFractionalAdsorbateComMin.z=-0.101; VTKFractionalAdsorbateComMax.x=VTKFractionalAdsorbateComMax.y=VTKFractionalAdsorbateComMax.z=1.101; VTKFractionalCationComMin.x=VTKFractionalCationComMin.y=VTKFractionalCationComMin.z=-0.101; VTKFractionalCationComMax.x=VTKFractionalCationComMax.y=VTKFractionalCationComMax.z=1.101; MovieScale=1.0; WritePseudoAtomsToOutput=TRUE; WriteForcefieldToOutput=TRUE; WriteMoleculeDefinitionToOutput=TRUE; Restart=FALSE; RestartStyle=RASPA_STYLE; Wavelength=0.0; PrintPropertiesEvery=10000; PrintEvery=5000; OptimizeAcceptenceEvery=5000; OptimizeVolumeChange=TRUE; OptimizeGibbsVolumeChange=TRUE; OptimizeTranslation=TRUE; OptimizeRotation=TRUE; OptimizeFrameworkChange=TRUE; OptimizeFrameworkShift=TRUE; OptimizeCFLambdaChange=TRUE; OptimizeCFGibbsLambdaChange=TRUE; OptimizeCBCFLambdaChange=TRUE; OptimizeCBCFGibbsLambdaChange=TRUE; OptimizeRXMCLambdaChange=TRUE; VolumeChangeDirection=7; // default values for the restart-file ContinueAfterCrash=FALSE; WriteBinaryRestartFileEvery=0; // default values for equations-of-state MultiComponentMixingRules=VAN_DER_WAALS_MIXING_RULES; EquationOfState=PENG_ROBINSON; // default values for CBMC BiasingMethod=LJ_BIASING; MinimumInnerCycles=20; NumberOfTrialPositions=10; NumberOfTrialPositionsForTheFirstBead=10; NumberOfTrialPositionsTorsion=100; NumberOfTrialMovesPerOpenBead=150; NumberOfTrialPositionsReinsertion=10; NumberOfTrialPositionsPartialReinsertion=10; NumberOfTrialPositionsIdentityChange=10; NumberOfTrialPositionsGibbs=10; NumberOfTrialPositionsSwap=10; NumberOfTrialPositionsWidom=10; NumberOfTrialPositionsForTheFirstBeadReinsertion=10; NumberOfTrialPositionsForTheFirstBeadPartialReinsertion=10; NumberOfTrialPositionsForTheFirstBeadIdentityChange=10; NumberOfTrialPositionsForTheFirstBeadGibbs=10; NumberOfTrialPositionsForTheFirstBeadSwap=10; NumberOfTrialPositionsForTheFirstBeadWidom=10; EnergyOverlapCriteria=1.0e7; MinimumRosenbluthFactor=1.0e-150; TargetAccRatioSmallMCScheme=0.4; TargetAccRatioTranslation=0.5; TargetAccRatioRotation=0.5; TargetAccRatioLambdaChange=0.5; TargetAccRatioVolumeChange=0.5; TargetAccRatioBoxShapeChange=0.5; TargetAccRatioGibbsVolumeChange=0.5; TargetAccRatioReactionLambdaChange=0.5; BlockGridPockets=TRUE; BlockGridPores=FALSE; BlockEnergyGridOverlapCriteria=EnergyOverlapCriteria/5.0; // default value for the cut-off OverlapDistance=1.0; OverlapDistanceSquared=1.0; CutOffVDW=12.0; InverseCutOffVDW=1.0/CutOffVDW; CutOffVDWSquared=SQR(CutOffVDW); CutOffChargeBondDipole=12.0; CutOffChargeBondDipoleSquared=SQR(CutOffChargeBondDipole); CutOffBondDipoleBondDipole=12.0; CutOffBondDipoleBondDipoleSquared=SQR(CutOffBondDipoleBondDipole); CutOffIons=2.0; CutOffVDWSwitch=0.0; CutOffChargeBondDipoleSwitch=0.0; CutOffBondDipoleBondDipoleSwitch=0.0; // tail-corrections do not apply on shifted potentials ShiftPotentials=TRUE; TailCorrections=FALSE; // default values for the Ewald-summation ChargeMethod=EWALD; SymmetrizeFrameworkCharges=TRUE; ChargeEquilibrationPeriodic=TRUE; ChargeEquilibrationEwald=TRUE; ChargeFromChargeEquilibration=FALSE; ChargeEquilibrationMethod=WILMER_SNURR; EwaldPrecision=1e-6; EwaldAutomatic=TRUE; DielectricConstantOfTheMedium=1.0; OmitAdsorbateAdsorbateVDWInteractions=FALSE; OmitAdsorbateAdsorbateCoulombInteractions=FALSE; OmitCationCationVDWInteractions=FALSE; OmitCationCationCoulombInteractions=FALSE; OmitEwaldFourier=FALSE; ComputePolarization=FALSE; PolarizationMatrix=ISOTROPIC; BackPolarization=FALSE; NumberOfBackPolarizationSteps=7; OmitIntraFrameworkPolarization=TRUE; OmitAdsorbateAdsorbatePolarization=TRUE; OmitCationCationPolarization=TRUE; SampleEveryInfraRed=1; NumberOfBlockElementsMSDOrderN=25; MaxNumberOfBlocksMSDOrderN=25; ComputeIndividualMSDOrderN=FALSE; ComputeSiteTypeMSDOrderN=FALSE; ComputeMSDOrderNPerPseudoAtom=FALSE; NumberOfBlockElementsVACFOrderN=10; MaxNumberOfBlocksVACFOrderN=5000; ComputeIndividualVACFOrderN=FALSE; ComputeVACFOrderNPerPseudoAtom=FALSE; NumberOfBlockElementsRVACFOrderN=10; MaxNumberOfBlocksRVACFOrderN=5000; ComputeIndividualRVACFOrderN=FALSE; ComputeRVACFOrderNPerPseudoAtom=FALSE; NumberOfBlockElementsMolecularOrientationOrderN=10; MaxNumberOfBlocksMolecularOrientationOrderN=5000; NumberOfBlockElementsBondOrientationOrderN=25; MaxNumberOfBlocksBondOrientationOrderN=5000; NumberOfBuffersMSD=20; BufferLengthMSD=5000; NumberOfBuffersVACF=20; BufferLengthVACF=5000; ParallelMolFractionComponentA=0; ParallelMolFractionComponentB=1; // default values for the spacing in Angstrom of grid points SpacingVDWGrid=0.15; SpacingCoulombGrid=0.15; AsymmetricIons=FALSE; CorrectNetChargeOnPseudoAtom=-1; DensityProfile3DVTKGridPoints.x=150; DensityProfile3DVTKGridPoints.y=150; DensityProfile3DVTKGridPoints.z=150; WidomParticleInsertionComponent=0; ReinitializeVelocities=TRUE; QuenchCoreShellVelocities=FALSE; ComputePrincipleMomentsOfInertia=FALSE; CFWangLandauEvery=5000; // Added by Ambroise de Izarra //------------------------------------------------------------------- RelaxationStepsAlchemicalTransformationMove = 5; ChemicalPotentialAlchemical = 0.0; //------------------------------------------------------------------- NumberOfHybridNVESteps=5; NumberOfHybridNPHSteps=5; NumberOfHybridNPHPRSteps=5; therm_baro_stats.ThermostatChainLength=3; therm_baro_stats.BarostatChainLength=3; therm_baro_stats.NumberOfYoshidaSuzukiSteps=5; therm_baro_stats.NumberOfRespaSteps=5; therm_baro_stats.time_scale_parameter_thermostat=0.15; therm_baro_stats.time_scale_parameter_barostat=0.15; RemoveBondNeighboursFromLongRangeInteraction=TRUE; RemoveBendNeighboursFromLongRangeInteraction=TRUE; RemoveTorsionNeighboursFromLongRangeInteraction=FALSE; Remove12NeighboursFromVDWInteraction=FALSE; Remove13NeighboursFromVDWInteraction=FALSE; Remove14NeighboursFromVDWInteraction=FALSE; Remove12NeighboursFromChargeChargeInteraction=FALSE; Remove13NeighboursFromChargeChargeInteraction=FALSE; Remove14NeighboursFromChargeChargeInteraction=FALSE; Remove11NeighboursFromChargeBondDipoleInteraction=FALSE; Remove12NeighboursFromChargeBondDipoleInteraction=FALSE; Remove13NeighboursFromChargeBondDipoleInteraction=FALSE; Remove14NeighboursFromChargeBondDipoleInteraction=FALSE; Remove12NeighboursFromBondDipoleBondDipoleInteraction=FALSE; Remove13NeighboursFromBondDipoleBondDipoleInteraction=FALSE; Remove14NeighboursFromBondDipoleBondDipoleInteraction=FALSE; ImproperTorsionScanType=IMPROPER_TORSION_SCAN_GENERAL; InternalFrameworkLennardJonesInteractions=TRUE; ComputePowderDiffractionPattern=FALSE; ComputeNormalModes=FALSE; CorrectNormalModesForConstraints=TRUE; MinimumMode=0; MaximumMode=20; ModeResolution=100; MinimizationMethod=BAKER_MINIMIZATION; MinimizationType=SEARCH_LOCAL_MINIMUM; MinimizationPotentialMethod=ANALYTICALLY; MaximumNumberOfMinimizationSteps=10000; UseGradientInLineMinimization=TRUE; RMSGradientTolerance=1e-6; MaxGradientTolerance=1e-6; ProbabilityFrameworkChangeMove=0.0; ProbabilityVolumeChangeMove=0.0; ProbabilityBoxShapeChangeMove=0.0; ProbabilityParallelTemperingMove=0.0; ProbabilityHyperParallelTemperingMove=0.0; ProbabilityParallelMolFractionMove=0.0; ProbabilityGibbsVolumeChangeMove=0.0; ProbabilityHybridNVEMove=0.0; // Added by Ambroise de Izarra //------------------------------------------------------------------- ProbabilityAlchemicalTransformationMove=0.0; ProbabilityWidomOsmostatCalculationMove=0.0; //------------------------------------------------------------------- ProbabilityHybridNPHMove=0.0; ProbabilityHybridNPHPRMove=0.0; ProbabilityFrameworkChangeMove=0.0; ProbabilityFrameworkShiftMove=0.0; ProbabilityCFCRXMCLambdaChangeMove=0.0; // CFC-RXMC // default time step is 0.5 fs DeltaT=0.0005; // powder diffraction defaults Diffraction.Type=XRAY_DIFFRACTION; Diffraction.RadiationType=COPPER_RADIATION; Diffraction.lambda_type=DIFFRACTION_SINGLE; Diffraction.u=0.01; Diffraction.v=-0.001; Diffraction.w=0.002; Diffraction.asym=0.5; Diffraction.two_theta_min=3.0; Diffraction.two_theta_max=50.0; Diffraction.two_theta_step=0.01; Diffraction.PeakShape=DIFFRACTION_PSEUDO_VOIGT; ComputeRattleSteps=FALSE; DistanceConstraintType=DISTANCE_R_SQUARED; BendConstraintType=THETA; DihedralConstraintType=PHI; ImproperDihedralConstraintType=PHI; InversionBendConstraintType=CHI; OutOfPlaneConstraintType=DISTANCE_R; PrintFrameworkBondStatus=TRUE; PrintFrameworkUreyBradleyStatus=TRUE; PrintFrameworkBendStatus=TRUE; PrintFrameworkInversionBendStatus=TRUE; PrintFrameworkTorsionStatus=TRUE; PrintFrameworkImproperTorsionStatus=TRUE; PrintFrameworkBondBondStatus=TRUE; PrintFrameworkBondBendStatus=TRUE; PrintFrameworkBendBendStatus=TRUE; PrintFrameworkBendTorsionStatus=TRUE; PrintFrameworkIntraVDWStatus=TRUE; PrintFrameworkIntraChargeChargeStatus=TRUE; PrintFrameworkIntraChargeBondDipoleStatus=TRUE; PrintFrameworkIntraBondDipoleBondDipoleStatus=TRUE; PrintAdsorbateBondStatus=TRUE; PrintAdsorbateUreyBradleyStatus=TRUE; PrintAdsorbateBendStatus=TRUE; PrintAdsorbateTorsionStatus=TRUE; PrintAdsorbateImproperTorsionStatus=TRUE; PrintAdsorbateBondBondStatus=TRUE; PrintAdsorbateBondBendStatus=TRUE; PrintAdsorbateBendBendStatus=TRUE; PrintAdsorbateBondTorsionStatus=TRUE; PrintAdsorbateBendTorsionStatus=TRUE; PrintAdsorbateIntraVDWStatus=TRUE; PrintAdsorbateIntraChargeChargeStatus=TRUE; PrintAdsorbateIntraChargeBondDipoleStatus=TRUE; PrintAdsorbateIntraBondDipoleBondDipoleStatus=TRUE; PrintCationBondStatus=TRUE; PrintCationUreyBradleyStatus=TRUE; PrintCationBendStatus=TRUE; PrintCationTorsionStatus=TRUE; PrintCationImproperTorsionStatus=TRUE; PrintCationBondBondStatus=TRUE; PrintCationBondBendStatus=TRUE; PrintCationBendBendStatus=TRUE; PrintCationBondTorsionStatus=TRUE; PrintCationBendTorsionStatus=TRUE; PrintCationIntraVDWStatus=TRUE; PrintCationIntraChargeChargeStatus=TRUE; PrintCationIntraChargeBondDipoleStatus=TRUE; PrintCationIntraBondDipoleBondDipoleStatus=TRUE; PrintInterVDWStatus=TRUE; PrintInterChargeChargeStatus=TRUE; PrintInterChargeBondDipoleStatus=TRUE; PrintInterBondDipoleBondDipoleStatus=TRUE; PrintFrameworkAdsorbateVDWStatus=TRUE; PrintFrameworkAdsorbateChargeChargeStatus=TRUE; PrintFrameworkAdsorbateChargeBondDipoleStatus=TRUE; PrintFrameworkAdsorbateBondDipoleBondDipoleStatus=TRUE; PrintFrameworkCationVDWStatus=TRUE; PrintFrameworkCationChargeChargeStatus=TRUE; PrintFrameworkCationChargeBondDipoleStatus=TRUE; PrintFrameworkCationBondDipoleBondDipoleStatus=TRUE; // first pass to get NumberOfSystems and NumberOfComponents etc. // also loof for a binary restart-file, in that case immediately return NumberOfSystems=0; NumberOfComponents=0; NumberOfReactions=0; // Added by Ambroise de Izarra //------------------------------------------------------------------- NumberAlchemicalReactions=0; //------------------------------------------------------------------- // This loops through the string line-by-line, using the reentrant form of // `strtok` to be less ambiguous about the state of things tmp = strdup(input); for (line=strtok_r(tmp, "\n", &tokptr); line; line=strtok_r(NULL, "\n", &tokptr)) { // extract first word strcpy(keyword,"keyword"); sscanf(line,"%s%[^\n]",keyword,arguments); sscanf(arguments,"%s",firstargument); if(strcasecmp("CreateTinkerInput",keyword)==0) { if(strcasecmp("yes",firstargument)==0) CreateTinkerInput=TRUE; if(strcasecmp("no",firstargument)==0) CreateTinkerInput=FALSE; } if(strcasecmp("CreateDlpolyInput",keyword)==0) { if(strcasecmp("yes",firstargument)==0) CreateDlpolyInput=TRUE; if(strcasecmp("no",firstargument)==0) CreateDlpolyInput=FALSE; } if(strcasecmp("ReducedUnits",keyword)==0) { if(strcasecmp("yes",firstargument)==0) UseReducedUnits=TRUE; if(strcasecmp("no",firstargument)==0) UseReducedUnits=FALSE; } if(strcasecmp("Dimension",keyword)==0) sscanf(arguments,"%d",&Dimension); // read statements for the number of systems if(strcasecmp("Box",keyword)==0) { if(sscanf(arguments,"%d",&CurrentSystem)) { if(CurrentSystem<0) { fprintf(stderr, "Input error in 'Box'-command: the number of the system is incorrect (%d given, 0 <= system-number\n",CurrentSystem); exit(0); } NumberOfSystems++; } } if(strcasecmp("BoxMatrix",keyword)==0) { if(sscanf(arguments,"%d",&CurrentSystem)) { if(CurrentSystem<0) { fprintf(stderr, "Input error in 'BoxMatrix'-command: the number of the system is incorrect (%d given, 0 <= system-number\n",CurrentSystem); exit(0); } NumberOfSystems++; } } if(strcasecmp("Framework",keyword)==0) { if(sscanf(arguments,"%d",&CurrentSystem)) { if(CurrentSystem<0) { fprintf(stderr, "Input error in 'Framework'-command: the number of the system is incorrect (%d given, 0 <= system-number\n",CurrentSystem); exit(0); } NumberOfSystems++; } } // read statement for the number of components if(strcasecmp("Component",keyword)==0) { if(sscanf(arguments,"%d %*s %s",&CurrentComponent,string)) { if(CurrentComponent<0) { fprintf(stderr, "Input error in 'Component'-command: the number of the component is incorrect (%d given, 0 <= component-number)\n",CurrentComponent); exit(0); } NumberOfComponents++; } } if(strcasecmp("CFCRXMCLambdaHistogramSize",keyword)==0) sscanf(arguments,"%d",&RXMCLambdaHistogramSize); //------------------------------------------------------------------------------------------------------------------------------------------------------- // CFC-RXMC : read statements for number of reactions //------------------------------------------------------------------------------------------------------------------------------------------------------- if(strcasecmp("Reaction",keyword)==0) NumberOfReactions++; //------------------------------------------------------------------------------------------------------------------------------------------------------- // if restarted from a binary restart file we can skip everything, and read // the full system status from that binary restart-file if(strcasecmp("ContinueAfterCrash",keyword)==0) { if(strcasecmp("yes",firstargument)==0) { ContinueAfterCrash=TRUE; // no need to reed the rest of the input file // instead read the binary status file ReadBinaryRestartFiles(); if(ContinueAfterCrash) return 0; } } // Added by Ambroise de Izarra //------------------------------------------------------------------- if(strcasecmp("AlchemicalTransformation",keyword)==0) NumberAlchemicalReactions++; // store the index of salt ions. if(NumberAlchemicalReactions>0) { SaltIndex =(int**)calloc(NumberAlchemicalReactions,sizeof(int*)); MultiplicitySalt =(int**)calloc(NumberAlchemicalReactions,sizeof(int*)); ChosenMoleculeAlchemicalTransformation =(int**)calloc(NumberAlchemicalReactions,sizeof(int*)); NumberTransientMoities =(int*)calloc(NumberAlchemicalReactions,sizeof(int)); for(i=0;i0) Components=(COMPONENT*)calloc(NumberOfComponents,sizeof(COMPONENT)); MaxNumberOfAdsorbateMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfAdsorbateMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); MaxNumberOfCationMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfCationMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfAdsorbateMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfCationMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfFractionalMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfFractionalAdsorbateMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfFractionalCationMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfReactionMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfReactionAdsorbateMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfReactionCationMolecules=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfAtomsPerSystem=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfChargesPerSystem=(int*)calloc(NumberOfSystems,sizeof(int)); NumberOfBondDipolesPerSystem=(int*)calloc(NumberOfSystems,sizeof(int)); for(i=0;i=NumberOfSystems) { fprintf(stderr, "Input error in 'Framework'-command: the number of the system is incorrect (%d given, 0 <= system-number < %d)\n",CurrentSystem,NumberOfSystems); exit(0); } } if(strcasecmp("FrameworkName",keyword)==0) Framework[CurrentSystem].NumberOfFrameworks++; if(strcasecmp("ExternalPressure",keyword)==0) { arg_pointer=arguments; NumberOfIsothermPressures=0; while(sscanf(arg_pointer,"%lf%n",&tempd,&n)==1) { arg_pointer+=n; NumberOfIsothermPressures++; } } // read statement for the number of components if(strcasecmp("Component",keyword)==0) { if(sscanf(arguments,"%d %*s %s",&CurrentComponent,string)) { if(CurrentComponent<0) { fprintf(stderr, "Input error in 'Component'-command: the number of the component is incorrect (%d given, 0 <= component-number)\n",CurrentComponent); exit(0); } } } if(strcasecmp("CFLambdaHistogramSize",keyword)==0) sscanf(arguments,"%d",&Components[CurrentComponent].CFLambdaHistogramSize); if(strcasecmp("CFRXMCWangLandauScalingFactor",keyword)==0) { sscanf(arguments,"%d",&temp_int); for(i=0;i0) { Framework[i].NumberOfCoreShells=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].Atoms=(ATOM**)calloc(Framework[i].NumberOfFrameworks,sizeof(ATOM*)); Framework[i].NumberOfAtoms=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfFixedAtoms=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfFreeAtoms=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfCharges=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfUnitCellAtoms=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfAtoms=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].FrameworkProbability=(REAL*)calloc(Framework[i].NumberOfFrameworks,sizeof(REAL)); Framework[i].AtomsAsymmetric=(FRAMEWORK_ASYMMETRIC_ATOM**)calloc(Framework[i].NumberOfFrameworks,sizeof(FRAMEWORK_ASYMMETRIC_ATOM*)); Framework[i].NumberOfAsymmetricAtoms=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].Name=(char(*)[256])calloc(Framework[i].NumberOfFrameworks,sizeof(char[256])); Framework[i].FrameworkModels=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].ShiftUnitCell=(VECTOR*)calloc(Framework[i].NumberOfFrameworks,sizeof(VECTOR)); Framework[i].Asymmetric=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].SpaceGroupIdentifier=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].CalculateSpaceGroup=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].RemoveAtomNumberCodeFromLabel=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].AddAtomNumberCodeToLabel=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].InputFileType=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].SurfaceAreas=(REAL*)calloc(Framework[i].NumberOfFrameworks,sizeof(REAL)); Framework[i].FrameworkDensityPerComponent=(REAL*)calloc(Framework[i].NumberOfFrameworks,sizeof(REAL)); Framework[i].FrameworkMassPerComponent=(REAL*)calloc(Framework[i].NumberOfFrameworks,sizeof(REAL)); Framework[i].NumberOfCitations=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].CitationInformation=(CITATION_INFORMATION**)calloc(Framework[i].NumberOfFrameworks,sizeof(CITATION_INFORMATION*)); Framework[i].Connectivity=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].Neighbours=(int***)calloc(Framework[i].NumberOfFrameworks,sizeof(int**)); // allocate first dimension of bonds Framework[i].NumberOfBonds=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBonds=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].Bonds=(PAIR**)calloc(Framework[i].NumberOfFrameworks,sizeof(PAIR*)); Framework[i].BondType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BondArguments=(REAL(**)[MAX_BOND_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BOND_POTENTIAL_ARGUMENTS])); // allocate first dimension of bond-dipoles Framework[i].NumberOfBondDipoles=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBondDipoles=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].BondDipoles=(PAIR**)calloc(Framework[i].NumberOfFrameworks,sizeof(PAIR*)); Framework[i].BondDipoleMagnitude=(REAL**)calloc(Framework[i].NumberOfFrameworks,sizeof(REAL*)); // allocate first dimension of Urey-Bradleys Framework[i].NumberOfUreyBradleys=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfUreyBradleys=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].UreyBradleys=(TRIPLE**)calloc(Framework[i].NumberOfFrameworks,sizeof(TRIPLE*)); Framework[i].UreyBradleyType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].UreyBradleyArguments=(REAL(**)[MAX_UREYBRADLEY_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_UREYBRADLEY_POTENTIAL_ARGUMENTS])); // allocate first dimension of bends Framework[i].NumberOfBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].Bends=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].BendType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BendArguments=(REAL(**)[MAX_BEND_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BEND_POTENTIAL_ARGUMENTS])); // allocate first dimension of inversion-bends Framework[i].NumberOfInversionBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfInversionBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].InversionBends=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].InversionBendType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].InversionBendArguments=(REAL(**)[MAX_INVERSION_BEND_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_INVERSION_BEND_POTENTIAL_ARGUMENTS])); // allocate first dimension of torsions Framework[i].NumberOfTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].Torsions=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].TorsionType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].TorsionArguments=(REAL(**)[MAX_TORSION_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_TORSION_POTENTIAL_ARGUMENTS])); // allocate first dimension of improper torsions Framework[i].NumberOfImproperTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfImproperTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].ImproperTorsions=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].ImproperTorsionType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].ImproperTorsionArguments=(REAL(**)[MAX_IMPROPER_TORSION_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_IMPROPER_TORSION_POTENTIAL_ARGUMENTS])); // allocate first dimension of out-of-plane Framework[i].NumberOfOutOfPlanes=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfOutOfPlanes=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].OutOfPlanes=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].OutOfPlaneType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].OutOfPlaneArguments=(REAL(**)[MAX_OUT_OF_PLANE_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_OUT_OF_PLANE_POTENTIAL_ARGUMENTS])); // allocate first dimension of bond-bond Framework[i].NumberOfBondBonds=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBondBonds=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].BondBonds=(TRIPLE**)calloc(Framework[i].NumberOfFrameworks,sizeof(TRIPLE*)); Framework[i].BondBondType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BondBondArguments=(REAL(**)[MAX_BOND_BOND_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BOND_BOND_POTENTIAL_ARGUMENTS])); // allocate first dimension of bond-bend Framework[i].NumberOfBondBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBondBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].BondBends=(TRIPLE**)calloc(Framework[i].NumberOfFrameworks,sizeof(TRIPLE*)); Framework[i].BondBendType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BondBendArguments=(REAL(**)[MAX_BOND_BEND_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BOND_BEND_POTENTIAL_ARGUMENTS])); // allocate first dimension of bend-bend Framework[i].NumberOfBendBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBendBends=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].BendBends=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].BendBendType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BendBendArguments=(REAL(**)[MAX_BEND_BEND_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BEND_BEND_POTENTIAL_ARGUMENTS])); // allocate first dimension of stretch-torsion Framework[i].NumberOfBondTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBondTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].BondTorsions=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].BondTorsionType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BondTorsionArguments=(REAL(**)[MAX_BOND_TORSION_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BOND_TORSION_POTENTIAL_ARGUMENTS])); // allocate first dimension of bend-torsion Framework[i].NumberOfBendTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfBendTorsions=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].BendTorsions=(QUAD**)calloc(Framework[i].NumberOfFrameworks,sizeof(QUAD*)); Framework[i].BendTorsionType=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); Framework[i].BendTorsionArguments=(REAL(**)[MAX_BEND_TORSION_POTENTIAL_ARGUMENTS])calloc(Framework[i].NumberOfFrameworks, sizeof(REAL(*)[MAX_BEND_TORSION_POTENTIAL_ARGUMENTS])); Framework[i].NumberOfIntraVDW=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfExcludedIntraVDW=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfIntraCharges=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfIntraChargeBondDipoles=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfIntraBondDipoles=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].NumberOfExcludedIntraChargeCharge=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfExcludedIntraChargeCharge=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].ExcludedIntraChargeCharge=(PAIR**)calloc(Framework[i].NumberOfFrameworks,sizeof(PAIR*)); Framework[i].NumberOfExcludedIntraChargeBondDipole=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfExcludedIntraChargeBondDipole=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].ExcludedIntraChargeBondDipole=(PAIR**)calloc(Framework[i].NumberOfFrameworks,sizeof(PAIR*)); Framework[i].NumberOfExcludedIntraBondDipoleBondDipole=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].MaxNumberOfExcludedIntraBondDipoleBondDipole=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); Framework[i].ExcludedIntraBondDipoleBondDipole=(PAIR**)calloc(Framework[i].NumberOfFrameworks,sizeof(PAIR*)); FrameworkFixedInitialization[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfFixedFrameworkAtoms[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfFixedFrameworkAtomsX[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfFixedFrameworkAtomsY[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfFixedFrameworkAtomsZ[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfActiveFrameworkAtoms[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfActiveFrameworkAtomsX[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfActiveFrameworkAtomsY[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); NumberOfActiveFrameworkAtomsZ[i]=(int*)calloc(Framework[i].NumberOfFrameworks,sizeof(int)); FixedFrameworkAtoms[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); FixedFrameworkAtomsX[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); FixedFrameworkAtomsY[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); FixedFrameworkAtomsZ[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); ActiveFrameworkAtoms[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); ActiveFrameworkAtomsX[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); ActiveFrameworkAtomsY[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); ActiveFrameworkAtomsZ[i]=(int**)calloc(Framework[i].NumberOfFrameworks,sizeof(int*)); for(j=0;j0) { if(strcasecmp("NVE",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NVE; if(strcasecmp("NVT",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NVT; if(strcasecmp("NPT",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPT; if(strcasecmp("NPH",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPH; if(strcasecmp("NPTPR",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPTPR; if(strcasecmp("NPHPR",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPHPR; if(strcasecmp("MuPT",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=MuPT; if(strcasecmp("MuVT",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=MuVT; if(strcasecmp("MuPTPR",keyword)==0) Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=MuPTPR; if(strcasecmp("NPTPR_ISO",keyword)==0) {Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPTPR; NPTPRCellType[index]=ISOTROPIC;} if(strcasecmp("NPTPR_ANISO",keyword)==0) {Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPTPR; NPTPRCellType[index]=ANISOTROPIC;} if(strcasecmp("NPTPR_MONO",keyword)==0) {Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPTPR; NPTPRCellType[index]=MONOCLINIC;} if(strcasecmp("NPTPR_UPPER",keyword)==0) {Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPTPR; NPTPRCellType[index]=REGULAR_UPPER_TRIANGLE;} if(strcasecmp("NPTPR_MONO_UPPER",keyword)==0) {Ensemble[index]=InitEnsemble[index]=RunEnsemble[index]=NPTPR; NPTPRCellType[index]=MONOCLINIC_UPPER_TRIANGLE;} index++; } }while(index0) { if(strcasecmp("NVE",keyword)==0) InitEnsemble[index]=NVE; if(strcasecmp("NVT",keyword)==0) InitEnsemble[index]=NVT; if(strcasecmp("NPT",keyword)==0) InitEnsemble[index]=NPT; if(strcasecmp("NPH",keyword)==0) InitEnsemble[index]=NPH; if(strcasecmp("NPTPR",keyword)==0) InitEnsemble[index]=NPTPR; if(strcasecmp("NPHPR",keyword)==0) InitEnsemble[index]=NPHPR; if(strcasecmp("MuPT",keyword)==0) InitEnsemble[index]=MuPT; if(strcasecmp("MuVT",keyword)==0) InitEnsemble[index]=MuVT; if(strcasecmp("MuPTPR",keyword)==0) InitEnsemble[index]=MuPTPR; if(strcasecmp("NPTPR_ISO",keyword)==0) {InitEnsemble[index]=NPTPR; NPTPRCellType[index]=ISOTROPIC;} if(strcasecmp("NPTPR_ANISO",keyword)==0) {InitEnsemble[index]=NPTPR; NPTPRCellType[index]=ANISOTROPIC;} if(strcasecmp("NPTPR_MONO",keyword)==0) {InitEnsemble[index]=NPTPR; NPTPRCellType[index]=MONOCLINIC;} if(strcasecmp("NPTPR_UPPER",keyword)==0) {InitEnsemble[index]=NPTPR; NPTPRCellType[index]=REGULAR_UPPER_TRIANGLE;} if(strcasecmp("NPTPR_MONO_UPPER",keyword)==0) {InitEnsemble[index]=NPTPR; NPTPRCellType[index]=MONOCLINIC_UPPER_TRIANGLE;} index++; } }while(index0) { if(strcasecmp("NVE",keyword)==0) RunEnsemble[index]=NVE; if(strcasecmp("NVT",keyword)==0) RunEnsemble[index]=NVT; if(strcasecmp("NPT",keyword)==0) RunEnsemble[index]=NPT; if(strcasecmp("NPH",keyword)==0) RunEnsemble[index]=NPH; if(strcasecmp("NPTPR",keyword)==0) RunEnsemble[index]=NPTPR; if(strcasecmp("NPHPR",keyword)==0) RunEnsemble[index]=NPHPR; if(strcasecmp("MuPT",keyword)==0) RunEnsemble[index]=MuPT; if(strcasecmp("MuVT",keyword)==0) RunEnsemble[index]=MuVT; if(strcasecmp("MuPTPR",keyword)==0) RunEnsemble[index]=MuPTPR; if(strcasecmp("NPTPR_ISO",keyword)==0) {RunEnsemble[index]=NPTPR; NPTPRCellType[index]=ISOTROPIC;} if(strcasecmp("NPTPR_ANISO",keyword)==0) {RunEnsemble[index]=NPTPR; NPTPRCellType[index]=ANISOTROPIC;} if(strcasecmp("NPTPR_MONO",keyword)==0) {RunEnsemble[index]=NPTPR; NPTPRCellType[index]=MONOCLINIC;} if(strcasecmp("NPTPR_UPPER",keyword)==0) {RunEnsemble[index]=NPTPR; NPTPRCellType[index]=REGULAR_UPPER_TRIANGLE;} if(strcasecmp("NPTPR_MONO_UPPER",keyword)==0) {RunEnsemble[index]=NPTPR; NPTPRCellType[index]=MONOCLINIC_UPPER_TRIANGLE;} index++; } }while(index0) { if(strcasecmp("Regular",keyword)==0) NPTPRCellType[index]=REGULAR; if(strcasecmp("Monoclinic",keyword)==0) NPTPRCellType[index]=MONOCLINIC; if(strcasecmp("RegularUpperTriangle",keyword)==0) NPTPRCellType[index]=REGULAR_UPPER_TRIANGLE; if(strcasecmp("MonoclinicUpperTriangle",keyword)==0) NPTPRCellType[index]=MONOCLINIC_UPPER_TRIANGLE; if(strcasecmp("Isotropic",keyword)==0) NPTPRCellType[index]=ISOTROPIC; if(strcasecmp("Anisotropic",keyword)==0) NPTPRCellType[index]=ANISOTROPIC; index++; } }while(index0) { if(strcasecmp("Alpha",keyword)==0) MonoclinicAngleType[index]=MONOCLINIC_ALPHA_ANGLE; if(strcasecmp("Beta",keyword)==0) MonoclinicAngleType[index]=MONOCLINIC_BETA_ANGLE; if(strcasecmp("Gamma",keyword)==0) MonoclinicAngleType[index]=MONOCLINIC_GAMMA_ANGLE; index++; } }while(index=NumberOfSystems) { fprintf(stderr, "Input error in 'Box'-command: the number of the system is incorrect (%d given, 0 <= system-number < %d)\n",CurrentSystem,NumberOfSystems); exit(0); } if(strlen(Framework[CurrentSystem].Name[0])>0) { fprintf(stderr, "Input error in 'Box'-command: the number of the system %d is already taken\n",CurrentSystem); exit(0); } sprintf(Framework[CurrentSystem].Name[0],"Box"); InitializeBox[CurrentSystem]=TRUE; } } if(strcasecmp("BoxMatrix",keyword)==0) { if(sscanf(arguments,"%d",&CurrentSystem)) { strcpy(arguments, strtok_r(NULL, "\n", &tokptr)); sscanf(arguments,"%lf %lf %lf\n",&Box[CurrentSystem].ax,&Box[CurrentSystem].bx,&Box[CurrentSystem].cx); strcpy(arguments, strtok_r(NULL, "\n", &tokptr)); sscanf(arguments,"%lf %lf %lf\n",&Box[CurrentSystem].ax,&Box[CurrentSystem].bx,&Box[CurrentSystem].cx); sscanf(arguments,"%lf %lf %lf\n",&Box[CurrentSystem].ay,&Box[CurrentSystem].by,&Box[CurrentSystem].cy); strcpy(arguments, strtok_r(NULL, "\n", &tokptr)); sscanf(arguments,"%lf %lf %lf\n",&Box[CurrentSystem].az,&Box[CurrentSystem].bz,&Box[CurrentSystem].cz); NumberOfUnitCells[CurrentSystem].x=1; NumberOfUnitCells[CurrentSystem].y=1; NumberOfUnitCells[CurrentSystem].z=1; UnitCellBox[CurrentSystem]=Box[CurrentSystem]; CellProperties(&Box[CurrentSystem],&BoxProperties[CurrentSystem],&Volume[CurrentSystem]); InverseUnitCellBox[CurrentSystem]=InverseBox[CurrentSystem]; InverseBoxMatrix(&Box[CurrentSystem],&InverseBox[CurrentSystem]); CellProperties(&InverseBox[CurrentSystem],&InverseBoxProperties[CurrentSystem],&det); AlphaAngle[CurrentSystem]=acos(BoxProperties[CurrentSystem].bx); BetaAngle[CurrentSystem]=acos(BoxProperties[CurrentSystem].by); GammaAngle[CurrentSystem]=acos(BoxProperties[CurrentSystem].bz); InitializeBox[CurrentSystem]=FALSE; sprintf(Framework[CurrentSystem].Name[CurrentFramework],"Box"); } } if((strcasecmp("BoxLengths",keyword)==0)||(strcasecmp("CellLengths",keyword)==0)) { UnitCellSize[CurrentSystem].x=UnitCellSize[CurrentSystem].y=UnitCellSize[CurrentSystem].z=0.0; switch(Dimension) { case 2: sscanf(arguments,"%lf %lf",&UnitCellSize[CurrentSystem].x,&UnitCellSize[CurrentSystem].y); break; case 3: sscanf(arguments,"%lf %lf %lf",&UnitCellSize[CurrentSystem].x,&UnitCellSize[CurrentSystem].y,&UnitCellSize[CurrentSystem].z); break; } InitializeBox[CurrentSystem]=TRUE; } if((strcasecmp("BoxAngles",keyword)==0)||(strcasecmp("CellAngles",keyword)==0)) { AlphaAngle[CurrentSystem]=BetaAngle[CurrentSystem]=GammaAngle[CurrentSystem]=0.0; switch(Dimension) { case 2: sscanf(arguments,"%lf",&GammaAngle[CurrentSystem]); break; case 3: sscanf(arguments,"%lf %lf %lf",&AlphaAngle[CurrentSystem],&BetaAngle[CurrentSystem],&GammaAngle[CurrentSystem]); break; } AlphaAngle[CurrentSystem]*=M_PI/180.0; BetaAngle[CurrentSystem]*=M_PI/180.0; GammaAngle[CurrentSystem]*=M_PI/180.0; InitializeBox[CurrentSystem]=TRUE; } // read framework options if(strcasecmp("Framework",keyword)==0) { if(sscanf(arguments,"%d",&CurrentSystem)) { if(strlen(Framework[CurrentSystem].Name[0])>0) { fprintf(stderr, "Input error in 'Framework'-command: the number of the system %d is already taken\n",CurrentSystem); exit(0); } sprintf(Framework[CurrentSystem].Name[0],"Box"); Framework[CurrentSystem].FrameworkModel=FULL; read_frameworks[CurrentSystem]=TRUE; CurrentFramework=-1; } } if(strcasecmp("FrameworkName",keyword)==0) { CurrentFramework++; sscanf(arguments,"%s",Framework[CurrentSystem].Name[CurrentFramework]); } if(strcasecmp("FrameworkDefinitions",keyword)==0) sscanf(arguments,"%s",Framework[CurrentSystem].FrameworkDefinitions); if(strcasecmp("FlexibleModelInputType",keyword)==0) { if(strcasecmp("RASPA",firstargument)==0) Framework[CurrentSystem].FlexibleModelInputType=FLEXIBLE_FILE_TYPE_RASPA; if(strcasecmp("DLPOLY",firstargument)==0) Framework[CurrentSystem].FlexibleModelInputType=FLEXIBLE_FILE_TYPE_DLPOLY; } if(strcasecmp("HeliumVoidFraction",keyword)==0) sscanf(arguments,"%lf",&HeliumVoidFraction[CurrentSystem]); if(strcasecmp("ExcessVolume",keyword)==0) sscanf(arguments,"%lf",&ExcessVolume[CurrentSystem]); if(strcasecmp("IonsName",keyword)==0) sscanf(arguments,"%s",Framework[CurrentSystem].NameIons); if(strcasecmp("FrameworkIntra14VDWScalingValue",keyword)==0) sscanf(arguments,"%lf",&Framework[CurrentSystem].Intra14VDWScalingValue); if(strcasecmp("FrameworkIntra14ChargeChargeScalingValue",keyword)==0) sscanf(arguments,"%lf",&Framework[CurrentSystem].Intra14ChargeChargeScalingValue); if(strcasecmp("CalculateSpaceGroup",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].CalculateSpaceGroup[CurrentFramework]=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].CalculateSpaceGroup[CurrentFramework]=FALSE; } if(strcasecmp("RemoveAtomNumberCodeFromLabel",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].RemoveAtomNumberCodeFromLabel[CurrentFramework]=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].RemoveAtomNumberCodeFromLabel[CurrentFramework]=FALSE; } if(strcasecmp("AddAtomNumberCodeToLabel",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].AddAtomNumberCodeToLabel[CurrentFramework]=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].AddAtomNumberCodeToLabel[CurrentFramework]=FALSE; } if(strcasecmp("ForceSpaceGroupDetection",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].ForceSpaceGroupDetection=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].ForceSpaceGroupDetection=FALSE; } if(strcasecmp("ReadCIFAsCartesian",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].ReadCIFAsCartesian=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].ReadCIFAsCartesian=FALSE; } // Added by Ambroise de Izarra //------------------------------------------------------------------- if(strcasecmp("PrintInteractionIndexAtoms",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].PrintInteractionIndex[CurrentFramework]=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].PrintInteractionIndex[CurrentFramework]=FALSE; } //------------------------------------------------------------------- if(strcasecmp("RestrictFrameworkAtomsToBox",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Framework[CurrentSystem].RestrictFrameworkAtomsToBox=TRUE; if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].RestrictFrameworkAtomsToBox=FALSE; } if(strcasecmp("InputFileType",keyword)==0) { if(strcasecmp("xyz",firstargument)==0) Framework[CurrentSystem].InputFileType[CurrentFramework]=XYZ_FORMAT; if(strcasecmp("mol",firstargument)==0) Framework[CurrentSystem].InputFileType[CurrentFramework]=MOL_FORMAT; if(strcasecmp("cssr",firstargument)==0) Framework[CurrentSystem].InputFileType[CurrentFramework]=CSSR_FORMAT; if(strcasecmp("dlpoly",firstargument)==0) Framework[CurrentSystem].InputFileType[CurrentFramework]=DLPOLY_FORMAT; if(strcasecmp("pdb",firstargument)==0) Framework[CurrentSystem].InputFileType[CurrentFramework]=PDB_FORMAT; if(strcasecmp("cif",firstargument)==0) Framework[CurrentSystem].InputFileType[CurrentFramework]=CIF_FORMAT; } if(strcasecmp("UnitCells",keyword)==0) sscanf(arguments,"%d %d %d\n",&NumberOfUnitCells[CurrentSystem].x, &NumberOfUnitCells[CurrentSystem].y,&NumberOfUnitCells[CurrentSystem].z); if(strcasecmp("ReplicaUnitCells",keyword)==0) sscanf(arguments,"%d %d %d\n",&NumberOfReplicaCells[CurrentSystem].x, &NumberOfReplicaCells[CurrentSystem].y,&NumberOfReplicaCells[CurrentSystem].z); if(strcasecmp("ShiftUnitCells",keyword)==0) sscanf(arguments,"%lf %lf %lf", &Framework[CurrentSystem].ShiftUnitCell[CurrentFramework].x, &Framework[CurrentSystem].ShiftUnitCell[CurrentFramework].y, &Framework[CurrentSystem].ShiftUnitCell[CurrentFramework].z); if(strcasecmp("FlexibleFramework",keyword)==0) { if(strcasecmp("yes",firstargument)==0) { Framework[CurrentSystem].FrameworkModels[CurrentFramework]=FLEXIBLE; Framework[CurrentSystem].FrameworkModel=FLEXIBLE; } if(strcasecmp("no",firstargument)==0) Framework[CurrentSystem].FrameworkModels[CurrentFramework]=RIGID; } // read component and component options (MC-moves, starting bead, molfraction, etc) if(strcasecmp("Component",keyword)==0) { if(sscanf(arguments,"%d %*s %s",&CurrentComponent,string)) { if(CurrentComponent>=NumberOfComponents) { fprintf(stderr, "Input error in 'Component'-command: the number of the component is incorrect (%d given, 0 <= component-number < %d)\n",CurrentComponent,NumberOfComponents); exit(0); } if(strlen(Components[CurrentComponent].Name)>0) { fprintf(stderr, "Input error in 'Component'-command: the number of the component %d is already taken\n",CurrentComponent); exit(0); } strcpy(Components[CurrentComponent].Name,string); } } if(strcasecmp("MoleculeDefinition",keyword)==0) sscanf(arguments,"%s",Components[CurrentComponent].MoleculeDefinition); if(strcasecmp("StartingBead",keyword)==0) sscanf(arguments,"%d",&Components[CurrentComponent].StartingBead); if(strcasecmp("Intra14VDWScalingValue",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].Intra14VDWScalingValue); if(strcasecmp("Intra14ChargeChargeScalingValue",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].Intra14ChargeChargeScalingValue); if(strcasecmp("BlockPockets",keyword)==0) { index=0; do { if(sscanf(arguments,"%s %[^\n]",keyword,arguments)>0) { if(strcasecmp("yes",keyword)==0) Components[CurrentComponent].BlockPockets[index]=TRUE; if(strcasecmp("no",keyword)==0) Components[CurrentComponent].BlockPockets[index]=FALSE; index++; } }while(index0) { strcpy(Components[CurrentComponent].BlockPocketsFilename[index],keyword); index++; } }while(index0) { if(strcasecmp("yes",keyword)==0) Components[CurrentComponent].ComputeFreeEnergyProfile[index]=ComputeFreeEnergyProfile[index]=TRUE; if(strcasecmp("no",keyword)==0) Components[CurrentComponent].ComputeFreeEnergyProfile[index]=FALSE; index++; } }while(index1); } if(strcasecmp("FrameworkChangeMoveProbability",keyword)==0) sscanf(arguments,"%lf",&ProbabilityFrameworkChangeMove); if(strcasecmp("FrameworkShiftMoveProbability",keyword)==0) sscanf(arguments,"%lf",&ProbabilityFrameworkShiftMove); if(strcasecmp("VolumeChangeProbability",keyword)==0) sscanf(arguments,"%lf",&ProbabilityVolumeChangeMove); if(strcasecmp("VolumeChangeDirection", keyword)==0) { if(strcasecmp("a", firstargument)==0) VolumeChangeDirection=1; if(strcasecmp("b", firstargument)==0) VolumeChangeDirection=2; if(strcasecmp("c", firstargument)==0) VolumeChangeDirection=3; if(strcasecmp("ab", firstargument)==0) VolumeChangeDirection=4; if(strcasecmp("bc", firstargument)==0) VolumeChangeDirection=5; if(strcasecmp("ac", firstargument)==0) VolumeChangeDirection=6; if(strcasecmp("abc", firstargument)==0) VolumeChangeDirection=7; } //-------------------------------------------------------------------------------------------------------------------------------------------------------- // CFC-RXMC : reading parameters //-------------------------------------------------------------------------------------------------------------------------------------------------------- if(strcasecmp("ProbabilityCFCRXMCLambdaChangeMove",keyword)==0) sscanf(arguments,"%lf",&ProbabilityCFCRXMCLambdaChangeMove); if(strcasecmp("TargetAccRatioReactionLambdaChange",keyword)==0) sscanf(arguments,"%lf",&TargetAccRatioReactionLambdaChange); if(strcasecmp("LnPartitionFunction",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].PartitionFunction); if(strcasecmp("PartitionFunction",keyword)==0) { double partition_function=0.0; sscanf(arguments,"%lf",&partition_function); Components[CurrentComponent].PartitionFunction=log(partition_function); } if(strcasecmp("MaximumReactionLambdaChange",keyword)==0) { sscanf(arguments,"%lf",&temp_real); for(i=0;i=NumberOfComponents)) { fprintf(stderr, "Input error in 'ParallelMolFractionComponentA'-command: the number of the component %d is incorrect (should be < %d)\n",ParallelMolFractionComponentA,NumberOfComponents); exit(0); } } if(strcasecmp("ParallelMolFractionComponentB",keyword)==0) { sscanf(arguments,"%d",&ParallelMolFractionComponentB); if((ParallelMolFractionComponentB<0)||(ParallelMolFractionComponentB>=NumberOfComponents)) { fprintf(stderr, "Input error in 'ParallelMolFractionComponentB'-command: the number of the component %d is incorrect (should be < %d)\n",ParallelMolFractionComponentB,NumberOfComponents); exit(0); } } if(strcasecmp("ChiralInversionProbability",keyword)==0) sscanf(arguments,"%lf",&ProbabilityChiralInversionMove); if(strcasecmp("MaximumVolumeChange",keyword)==0) sscanf(arguments,"system %d: %lf",&CurrentSystem,&MaximumVolumeChange[CurrentSystem]); if(strcasecmp("BoxShapeChangeProbability",keyword)==0) { sscanf(arguments,"%lf",&ProbabilityBoxShapeChangeMove); if(BoundaryCondition[CurrentSystem]==UNINITIALIZED_BOUNDARY_CONDITION) BoundaryCondition[CurrentSystem]=TRICLINIC; } if(strcasecmp("BoundaryCondition",keyword)==0) { if(strcasecmp("None",firstargument)==0) BoundaryCondition[CurrentSystem]=FINITE; if(strcasecmp("Rectangular",firstargument)==0) BoundaryCondition[CurrentSystem]=RECTANGULAR; if(strcasecmp("Triclinic",firstargument)==0) BoundaryCondition[CurrentSystem]=TRICLINIC; if(strcasecmp("Cubic",firstargument)==0) BoundaryCondition[CurrentSystem]=CUBIC; } if(strcasecmp("GibbsVolumeChangeProbability",keyword)==0) sscanf(arguments,"%lf",&ProbabilityGibbsVolumeChangeMove); if(strcasecmp("MaximumGibbsVolumeChange",keyword)==0) sscanf(arguments,"system %d: %lf",&CurrentSystem,&MaximumGibbsVolumeChange[CurrentSystem]); if(strcasecmp("GibbsSwapProbability",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityGibbsChangeMove); if(Components[CurrentComponent].ProbabilityGibbsChangeMove>0.0) Swapable=TRUE; } if(strcasecmp("GibbsIdentityChangeProbability",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityGibbsIdentityChangeMove); if(Components[CurrentComponent].ProbabilityGibbsIdentityChangeMove>0.0) Swapable=TRUE; } if(strcasecmp("CFGibbsProbability",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityCFGibbsChangeMove); if(Components[CurrentComponent].ProbabilityCFGibbsChangeMove>0.0) { for(i=0;i0.0) { for(i=0;i0.0) { Components[CurrentComponent].Swapable=TRUE; Swapable=TRUE; } if(strcasecmp("CFSwapLambdaProbability",keyword)==0) if(sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityCFSwapLambdaMove)) { if(Components[CurrentComponent].ProbabilityCFSwapLambdaMove>0.0) { Components[CurrentComponent].Swapable=TRUE; for(i=0;i0.0) { Components[CurrentComponent].Swapable=TRUE; for(i=0;i0.0) Components[CurrentComponent].Widom=TRUE; } } if(strcasecmp("CFWidomProbability",keyword)==0) { if(sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityCFWidomLambdaMove)) { if(Components[CurrentComponent].ProbabilityCFWidomLambdaMove>0.0) { Components[CurrentComponent].Widom=TRUE; for(i=0;i0.0) Components[CurrentComponent].Widom=TRUE; } } if(strcasecmp("WidomParticleInsertionComponent",keyword)==0) sscanf(arguments,"%d",&WidomParticleInsertionComponent); if(strcasecmp("SurfaceAreaProbability",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilitySurfaceAreaMove); if(strcasecmp("CFGibbsSwapFractionalMoleculeToOtherBoxMoveProbability",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityCFGibbsSwapFractionalMoleculeToOtherBoxMove); if(Components[CurrentComponent].ProbabilityCFGibbsSwapFractionalMoleculeToOtherBoxMove>0.0) { Components[CurrentComponent].CFMoleculePresent[0]=TRUE; SimulationSubType=GIBBS_CFCMC_SINGLE_FRACTIONAL_PARTICLE; } } if(strcasecmp("CFGibbsLambdaChangeMoveProbability",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityCFGibbsLambdaChangeMove); if(Components[CurrentComponent].ProbabilityCFGibbsLambdaChangeMove>0.0) { Components[CurrentComponent].CFMoleculePresent[0]=TRUE; SimulationSubType=GIBBS_CFCMC_SINGLE_FRACTIONAL_PARTICLE; } } if(strcasecmp("CFGibbsFractionalToIntegerMoveProbability",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].ProbabilityCFGibbsFractionalToIntegerMove); if(Components[CurrentComponent].ProbabilityCFGibbsFractionalToIntegerMove>0.0) { Components[CurrentComponent].CFMoleculePresent[0]=TRUE; SimulationSubType=GIBBS_CFCMC_SINGLE_FRACTIONAL_PARTICLE; } } if(strcasecmp("RestrictEnantionface",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Components[CurrentComponent].RestrictEnantionface=TRUE; if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].RestrictEnantionface=FALSE; } if(strcasecmp("Enantioface",keyword)==0) { if(strcasecmp("Re",firstargument)==0) Components[CurrentComponent].Enantioface=ENANTIOFACE_RE; if(strcasecmp("Si",firstargument)==0) Components[CurrentComponent].Enantioface=ENANTIOFACE_SI; } if(strcasecmp("EnantiofaceAtoms",keyword)==0) { sscanf(arguments," %c%d%d %c%d%d %c%d%d %c%d%d %c%d%d %[^\n]",&charinput1,&intinput1,&intinput2,&charinput2,&intinput3,&intinput4, &charinput3,&intinput5,&intinput6,&charinput4,&intinput7,&intinput8,&charinput5,&intinput9,&intinput10,arguments); if((charinput1=='F')||(charinput1=='f')) Components[CurrentComponent].EnantiofaceAtomDefinitions[0][0]=FRAMEWORK; else if((charinput1=='A')||(charinput1=='a')) Components[CurrentComponent].EnantiofaceAtomDefinitions[0][0]=ADSORBATE; else if((charinput1=='C')||(charinput1=='c')) Components[CurrentComponent].EnantiofaceAtomDefinitions[0][0]=CATION; Components[CurrentComponent].EnantiofaceAtomDefinitions[0][1]=intinput1; Components[CurrentComponent].EnantiofaceAtomDefinitions[0][2]=intinput2; if((charinput2=='F')||(charinput2=='f')) Components[CurrentComponent].EnantiofaceAtomDefinitions[1][0]=FRAMEWORK; else if((charinput2=='A')||(charinput2=='a')) Components[CurrentComponent].EnantiofaceAtomDefinitions[1][0]=ADSORBATE; else if((charinput2=='C')||(charinput2=='c')) Components[CurrentComponent].EnantiofaceAtomDefinitions[1][0]=CATION; Components[CurrentComponent].EnantiofaceAtomDefinitions[1][1]=intinput3; Components[CurrentComponent].EnantiofaceAtomDefinitions[1][2]=intinput4; if((charinput3=='F')||(charinput3=='f')) Components[CurrentComponent].EnantiofaceAtomDefinitions[2][0]=FRAMEWORK; else if((charinput3=='A')||(charinput3=='a')) Components[CurrentComponent].EnantiofaceAtomDefinitions[2][0]=ADSORBATE; else if((charinput3=='C')||(charinput3=='c')) Components[CurrentComponent].EnantiofaceAtomDefinitions[2][0]=CATION; Components[CurrentComponent].EnantiofaceAtomDefinitions[2][1]=intinput5; Components[CurrentComponent].EnantiofaceAtomDefinitions[2][2]=intinput6; if((charinput4=='F')||(charinput4=='f')) Components[CurrentComponent].EnantiofaceAtomDefinitions[3][0]=FRAMEWORK; else if((charinput4=='A')||(charinput4=='a')) Components[CurrentComponent].EnantiofaceAtomDefinitions[3][0]=ADSORBATE; else if((charinput4=='C')||(charinput4=='c')) Components[CurrentComponent].EnantiofaceAtomDefinitions[3][0]=CATION; Components[CurrentComponent].EnantiofaceAtomDefinitions[3][1]=intinput7; Components[CurrentComponent].EnantiofaceAtomDefinitions[3][2]=intinput8; if((charinput5=='F')||(charinput5=='f')) Components[CurrentComponent].EnantiofaceAtomDefinitions[4][0]=FRAMEWORK; else if((charinput5=='A')||(charinput5=='a')) Components[CurrentComponent].EnantiofaceAtomDefinitions[4][0]=ADSORBATE; else if((charinput5=='C')||(charinput5=='c')) Components[CurrentComponent].EnantiofaceAtomDefinitions[4][0]=CATION; Components[CurrentComponent].EnantiofaceAtomDefinitions[4][1]=intinput9; Components[CurrentComponent].EnantiofaceAtomDefinitions[4][2]=intinput10; } if(strcasecmp("ExtraFrameworkMolecule",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Components[CurrentComponent].ExtraFrameworkMolecule=TRUE; if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].ExtraFrameworkMolecule=FALSE; } if(strcasecmp("CreateNumberOfMolecules",keyword)==0) { index=0; do { if(index==NumberOfSystems) { fprintf(stderr, "Creating molecules for more systems than the maximum allowed: %d\n",NumberOfSystems); exit(0); } }while(sscanf(arguments,"%d %[^\n]",&Components[CurrentComponent].CreateNumberOfMolecules[index++],arguments)>1); } if(strcasecmp("BinaryEOSInteractionParameter",keyword)==0) { index=0; do { if(index==NumberOfComponents) { fprintf(stderr, "Reading BinaryEOSInteractionParamter for more components than the maximum allowed: %d\n",NumberOfComponents); exit(0); } }while(sscanf(arguments,"%lf %[^\n]",&BinaryInteractionParameter[CurrentComponent][index++],arguments)>1); } if(strcasecmp("FugacityCoefficient",keyword)==0) { index=0; do { if(index==NumberOfSystems) { fprintf(stderr, "Reading fugacity coefficients (%d) for more systems than the maximum allowed: %d\n",index,NumberOfSystems); exit(0); } }while(sscanf(arguments,"%lf %[^\n]",&Components[CurrentComponent].FugacityCoefficient[index++],arguments)>1); for(i=0;i=0.0) ComputeFugacityCoefficient[i][CurrentComponent]=FALSE; } if(strcasecmp("IdealGasRosenbluthWeight",keyword)==0) { index=0; do { if(index==NumberOfSystems) { fprintf(stderr, "Reading ideal Rosenbluth weights for more systems than the maximum allowed: %d\n",NumberOfSystems); exit(0); } }while(sscanf(arguments,"%lf %[^\n]",&Components[CurrentComponent].IdealGasRosenbluthWeight[index++],arguments)>1); } if(strcasecmp("RestrictMovesToBox",keyword)==0) { if(strcasecmp("yes",firstargument)==0) { Components[CurrentComponent].RestrictMovesToBox=TRUE; Components[CurrentComponent].RestrictMoves=TRUE; } if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].RestrictMovesToBox=FALSE; } if(strcasecmp("BoxAxisABC_Min",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Min.x, &Components[CurrentComponent].BoxAxisABC_Min.y,&Components[CurrentComponent].BoxAxisABC_Min.z); if(strcasecmp("BoxAxisABC_Max",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Max.x, &Components[CurrentComponent].BoxAxisABC_Max.y,&Components[CurrentComponent].BoxAxisABC_Max.z); if(strcasecmp("BoxAxisABC_Min2",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Min2.x, &Components[CurrentComponent].BoxAxisABC_Min2.y,&Components[CurrentComponent].BoxAxisABC_Min2.z); if(strcasecmp("BoxAxisABC_Max2",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Max2.x, &Components[CurrentComponent].BoxAxisABC_Max2.y,&Components[CurrentComponent].BoxAxisABC_Max2.z); if(strcasecmp("BoxAxisABC_Min3",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Min3.x, &Components[CurrentComponent].BoxAxisABC_Min3.y,&Components[CurrentComponent].BoxAxisABC_Min3.z); if(strcasecmp("BoxAxisABC_Max3",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Max3.x, &Components[CurrentComponent].BoxAxisABC_Max3.y,&Components[CurrentComponent].BoxAxisABC_Max3.z); if(strcasecmp("BoxAxisABC_Min4",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Min4.x, &Components[CurrentComponent].BoxAxisABC_Min4.y,&Components[CurrentComponent].BoxAxisABC_Min4.z); if(strcasecmp("BoxAxisABC_Max4",keyword)==0) sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].BoxAxisABC_Max4.x, &Components[CurrentComponent].BoxAxisABC_Max4.y,&Components[CurrentComponent].BoxAxisABC_Max4.z); if(strcasecmp("RestrictMovesToPrism",keyword)==0) { if(strcasecmp("yes",firstargument)==0) { Components[CurrentComponent].RestrictMoves=TRUE; Components[CurrentComponent].RestrictMovesToPrisms=TRUE; } if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].RestrictMovesToPrisms=FALSE; } if(strcasecmp("Prism",keyword)==0) { sscanf(arguments,"%d",&CurrentPrism); Components[CurrentComponent].RestrictMovesToPrism[CurrentPrism]=TRUE; } if(strcasecmp("PrismABC_Min",keyword)==0) { sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].RestrictPrismABC_Min[CurrentPrism].x, &Components[CurrentComponent].RestrictPrismABC_Min[CurrentPrism].y,&Components[CurrentComponent].RestrictPrismABC_Min[CurrentPrism].z); } if(strcasecmp("PrismABC_Max",keyword)==0) { sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].RestrictPrismABC_Max[CurrentPrism].x, &Components[CurrentComponent].RestrictPrismABC_Max[CurrentPrism].y,&Components[CurrentComponent].RestrictPrismABC_Max[CurrentPrism].z); } if(strcasecmp("RestrictMovesToCylinder",keyword)==0) { if(strcasecmp("yes",firstargument)==0) { Components[CurrentComponent].RestrictMoves=TRUE; Components[CurrentComponent].RestrictMovesToCylinders=TRUE; } if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].RestrictMovesToCylinders=FALSE; } if(strcasecmp("Cylinder",keyword)==0) { sscanf(arguments,"%d",&CurrentCylinder); Components[CurrentComponent].RestrictMovesToCylinder[CurrentCylinder]=TRUE; } if(strcasecmp("CylinderABC_Min",keyword)==0) { sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].RestrictCylinderABC_Min[CurrentCylinder].x, &Components[CurrentComponent].RestrictCylinderABC_Min[CurrentCylinder].y,&Components[CurrentComponent].RestrictCylinderABC_Min[CurrentCylinder].z); } if(strcasecmp("CylinderABC_Max",keyword)==0) { sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].RestrictCylinderABC_Max[CurrentCylinder].x, &Components[CurrentComponent].RestrictCylinderABC_Max[CurrentCylinder].y,&Components[CurrentComponent].RestrictCylinderABC_Max[CurrentCylinder].z); } if(strcasecmp("CylinderCenter",keyword)==0) { sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].RestrictCylinderCenter[CurrentCylinder].x, &Components[CurrentComponent].RestrictCylinderCenter[CurrentCylinder].y,&Components[CurrentComponent].RestrictCylinderCenter[CurrentCylinder].z); } if(strcasecmp("CylinderRadius",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].RestrictCylinderRadius[CurrentCylinder]); if(strcasecmp("CylinderDiameter",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].RestrictCylinderRadius[CurrentCylinder]); Components[CurrentComponent].RestrictCylinderRadius[CurrentCylinder]*=0.5; } if(strcasecmp("CylinderDirection",keyword)==0) { if(strcasecmp("X",firstargument)==0) Components[CurrentComponent].RestrictCylinderDirection[CurrentCylinder]=X_DIR; if(strcasecmp("Y",firstargument)==0) Components[CurrentComponent].RestrictCylinderDirection[CurrentCylinder]=Y_DIR; if(strcasecmp("Z",firstargument)==0) Components[CurrentComponent].RestrictCylinderDirection[CurrentCylinder]=Z_DIR; } if(strcasecmp("RestrictMovesToSphere",keyword)==0) { if(strcasecmp("yes",firstargument)==0) { Components[CurrentComponent].RestrictMoves=TRUE; Components[CurrentComponent].RestrictMovesToSpheres=TRUE; } if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].RestrictMovesToSpheres=FALSE; } if(strcasecmp("Sphere",keyword)==0) { sscanf(arguments,"%d",&CurrentSphere); Components[CurrentComponent].RestrictMovesToSphere[CurrentSphere]=TRUE; } if(strcasecmp("SphereCenter",keyword)==0) { sscanf(arguments,"%lf %lf %lf",&Components[CurrentComponent].RestrictSphereCenter[CurrentSphere].x, &Components[CurrentComponent].RestrictSphereCenter[CurrentSphere].y,&Components[CurrentComponent].RestrictSphereCenter[CurrentSphere].z); } if(strcasecmp("SphereRadius",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].RestrictSphereRadius[CurrentSphere]); if(strcasecmp("SphereDiameter",keyword)==0) { sscanf(arguments,"%lf",&Components[CurrentComponent].RestrictSphereRadius[CurrentSphere]); Components[CurrentComponent].RestrictSphereRadius[CurrentSphere]*=0.5; } if(strcasecmp("TransmissionCoefficients",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Components[CurrentComponent].TransmissionCoefficient=TRUE; if(strcasecmp("no",firstargument)==0) Components[CurrentComponent].TransmissionCoefficient=FALSE; } if(strcasecmp("BiasingMethod",keyword)==0) { if(strcasecmp("umbrella",firstargument)==0) Components[CurrentComponent].Biased=UMBRELLA; if(strcasecmp("ruizmontero",firstargument)==0) Components[CurrentComponent].Biased=RUIZ_MONTERO; } if(strcasecmp("RuizMonterofactor",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].RuizMonteroFactor); if(strcasecmp("UmbrellaFactor",keyword)==0) sscanf(arguments,"%lf",&Components[CurrentComponent].UmbrellaFactor); if(strcasecmp("BiasingProfile",keyword)==0) { Components[CurrentComponent].ReadBiasingFunction=TRUE; sscanf(arguments,"%s",Components[CurrentComponent].BiasingFunctionName); } if(strcasecmp("BiasingDirection",keyword)==0) { if(strcasecmp("A",firstargument)==0) Components[CurrentComponent].BiasingDirection=A_MAPPING; if(strcasecmp("B",firstargument)==0) Components[CurrentComponent].BiasingDirection=B_MAPPING; if(strcasecmp("C",firstargument)==0) Components[CurrentComponent].BiasingDirection=C_MAPPING; if(strcasecmp("AB_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_AB_DIAGONAL; if(strcasecmp("AC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_AC_DIAGONAL; if(strcasecmp("BC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_BC_DIAGONAL; if(strcasecmp("O_AB_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_O_AB_DIAGONAL; if(strcasecmp("O_AC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_O_AC_DIAGONAL; if(strcasecmp("O_BC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_O_BC_DIAGONAL; if(strcasecmp("A_BC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_A_BC_DIAGONAL; if(strcasecmp("B_AC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_B_AC_DIAGONAL; if(strcasecmp("C_AB_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_C_AB_DIAGONAL; if(strcasecmp("O_ABC_DIAGONAL",firstargument)==0) Components[CurrentComponent].BiasingDirection=MAP_O_ABC_DIAGONAL; } if(strcasecmp("Histogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputePositionHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputePositionHistogram[CurrentSystem]=FALSE; } if(strcasecmp("PositionHistogramMappingType",keyword)==0) { if(strcasecmp("A",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=A_MAPPING; if(strcasecmp("B",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=B_MAPPING; if(strcasecmp("C",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=C_MAPPING; if(strcasecmp("ABC",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=ABC_MAPPING; if(strcasecmp("AB_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_AB_DIAGONAL; if(strcasecmp("AC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_AC_DIAGONAL; if(strcasecmp("BC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_BC_DIAGONAL; if(strcasecmp("O_AB_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_O_AB_DIAGONAL; if(strcasecmp("O_AC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_O_AC_DIAGONAL; if(strcasecmp("O_BC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_O_BC_DIAGONAL; if(strcasecmp("A_BC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_A_BC_DIAGONAL; if(strcasecmp("B_AC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_B_AC_DIAGONAL; if(strcasecmp("C_AB_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_C_AB_DIAGONAL; if(strcasecmp("O_ABC_DIAGONAL",firstargument)==0) PositionHistogramMappingType[CurrentSystem]=MAP_O_ABC_DIAGONAL; } // reading options to measure properties // ================================================================================================== if(strcasecmp("Movies",keyword)==0) { if(strcasecmp("yes",firstargument)==0) Movies[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) Movies[CurrentSystem]=FALSE; } if(strcasecmp("MovieScale",keyword)==0) sscanf(arguments,"%lf",&MovieScale); if(strcasecmp("WriteMoviesEvery",keyword)==0) sscanf(arguments,"%d",&WriteMoviesEvery[CurrentSystem]); // sampling the radial distribution function (RDF) if(strcasecmp("ComputeRDF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeRDF[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeRDF[CurrentSystem]=FALSE; } if(strcasecmp("WriteRDFEvery",keyword)==0) sscanf(arguments,"%d",&WriteRDFEvery[CurrentSystem]); if(strcasecmp("RDFHistogramSize",keyword)==0) sscanf(arguments,"%d",&RDFHistogramSize[CurrentSystem]); if(strcasecmp("RDFRange",keyword)==0) sscanf(arguments,"%lf",&RDFRange[CurrentSystem]); // sampling the projected-lengths distribution function if(strcasecmp("ComputeProjectedLengths",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeProjectedLengths[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeProjectedLengths[CurrentSystem]=FALSE; } if(strcasecmp("WriteProjectedLengthsEvery",keyword)==0) sscanf(arguments,"%d",&WriteProjectedLengthsEvery[CurrentSystem]); if(strcasecmp("ProjectedLengthsHistogramSize",keyword)==0) sscanf(arguments,"%d",&ProjectedLengthsHistogramSize[CurrentSystem]); if(strcasecmp("ProjectedLengthsRange",keyword)==0) sscanf(arguments,"%lf",&ProjectedLengthsRange[CurrentSystem]); // sampling the projected-angles distribution function if(strcasecmp("ComputeProjectedAngles",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeProjectedAngles[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeProjectedAngles[CurrentSystem]=FALSE; } if(strcasecmp("WriteProjectedAnglesEvery",keyword)==0) sscanf(arguments,"%d",&WriteProjectedAnglesEvery[CurrentSystem]); if(strcasecmp("ProjectedAnglesHistogramSize",keyword)==0) sscanf(arguments,"%d",&ProjectedAnglesHistogramSize[CurrentSystem]); if(strcasecmp("ProjectedAnglesRange",keyword)==0) sscanf(arguments,"%lf",&ProjectedAnglesRange[CurrentSystem]); //---------------------------------------------------------------------------------------------------------------------------------------------- // CFC-RXMC : sampling lambda histogram //---------------------------------------------------------------------------------------------------------------------------------------------- if(strcasecmp("ComputeCFCRXMCLambdaHistogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeCFCRXMCLambdaHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeCFCRXMCLambdaHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WriteCFCRXMCLambdaHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteCFCRXMCLambdaHistogramEvery[CurrentSystem]); if(strcasecmp("CFCRXMCLambdaHistogramBins",keyword)==0) sscanf(arguments,"%d",&CFCRXMCLambdaHistogramBins[CurrentSystem]); //---------------------------------------------------------------------------------------------------------------------------------------------- // sampling the number-of-molecules histogram if(strcasecmp("ComputeNumberOfMoleculesHistogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeNumberOfMoleculesHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeNumberOfMoleculesHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WriteNumberOfMoleculesHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteNumberOfMoleculesHistogramEvery[CurrentSystem]); if(strcasecmp("NumberOfMoleculesHistogramSize",keyword)==0) sscanf(arguments,"%d",&NumberOfMoleculesHistogramSize[CurrentSystem]); if(strcasecmp("NumberOfMoleculesRange",keyword)==0) sscanf(arguments,"%lf",&NumberOfMoleculesRange[CurrentSystem]); // sampling position histograms/free energies if(strcasecmp("ComputePositionHistogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputePositionHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputePositionHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WritePositionHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WritePositionHistogramEvery[CurrentSystem]); if(strcasecmp("PositionHistogramSize",keyword)==0) sscanf(arguments,"%d",&PositionHistogramSize[CurrentSystem]); // samples the free energy profiles in a,b,c directions if(strcasecmp("WriteFreeEnergyProfileEvery",keyword)==0) sscanf(arguments,"%d",&WriteFreeEnergyProfileEvery[CurrentSystem]); if(strcasecmp("FreeEnergyHistogramSize",keyword)==0) sscanf(arguments,"%d",&FreeEnergyHistogramSize[CurrentSystem]); // sampling the pore-size distribution (PSD) if((strcasecmp("ComputePSDHistogram",keyword)==0)||(strcasecmp("ComputePSD",keyword)==0)) { if(strcasecmp("yes",firstargument)==0) ComputePSDHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputePSDHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WritePSDHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WritePSDHistogramEvery[CurrentSystem]); if(strcasecmp("PSDHistogramSize",keyword)==0) sscanf(arguments,"%d",&PSDHistogramSize[CurrentSystem]); if(strcasecmp("PSDRange",keyword)==0) sscanf(arguments,"%lf",&PSDRange[CurrentSystem]); if(strcasecmp("PSDProbeDistance",keyword)==0) { if(strcasecmp("Minimum",firstargument)==0) Framework[CurrentSystem].PoreSizeDistributionProbeDistance=pow(2.0,1.0/6.0); if(strcasecmp("Sigma",firstargument)==0) Framework[CurrentSystem].PoreSizeDistributionProbeDistance=1.0; } // sampling the end-to-end histograms if(strcasecmp("ComputeEndToEndDistanceHistogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeEndToEndDistanceHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeEndToEndDistanceHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WriteEndToEndDistanceHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteEndToEndDistanceHistogramEvery[CurrentSystem]); if(strcasecmp("EndToEndHistogramSize",keyword)==0) sscanf(arguments,"%d",&EndToEndHistogramSize[CurrentSystem]); if(strcasecmp("EndToEndRange",keyword)==0) sscanf(arguments,"%lf",&EndToEndRange[CurrentSystem]); // sampling the energy histogram if(strcasecmp("ComputeEnergyHistogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeEnergyHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeEnergyHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WriteEnergyHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteEnergyHistogramEvery[CurrentSystem]); if(strcasecmp("EnergyHistogramSize",keyword)==0) sscanf(arguments,"%d",&EnergyHistogramSize[CurrentSystem]); if(strcasecmp("EnergyHistogramLowerLimit",keyword)==0) sscanf(arguments,"%lf",&EnergyHistogramLowerLimit[CurrentSystem]); if(strcasecmp("EnergyHistogramUpperLimit",keyword)==0) sscanf(arguments,"%lf",&EnergyHistogramUpperLimit[CurrentSystem]); // sampling the thermodynamic factor if(strcasecmp("ComputeThermoDynamicFactor",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeThermoDynamicFactor[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeThermoDynamicFactor[CurrentSystem]=FALSE; } if(strcasecmp("WriteThermoDynamicFactorEvery",keyword)==0) sscanf(arguments,"%d",&WriteThermoDynamicFactorEvery[CurrentSystem]); // sampling the inter-framework spacing histogram if(strcasecmp("ComputeFrameworkSpacingHistogram",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeFrameworkSpacingHistogram[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeFrameworkSpacingHistogram[CurrentSystem]=FALSE; } if(strcasecmp("WriteFrameworkSpacingHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteFrameworkSpacingHistogramEvery[CurrentSystem]); if(strcasecmp("FrameworkSpacingHistogramSize",keyword)==0) sscanf(arguments,"%d",&FrameworkSpacingHistogramSize[CurrentSystem]); if(strcasecmp("FrameworkSpacingRange",keyword)==0) sscanf(arguments,"%lf",&FrameworkSpacingRange[CurrentSystem]); // sampling histograms of the residence times if(strcasecmp("ComputeResidenceTimes",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeResidenceTimes[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeResidenceTimes[CurrentSystem]=FALSE; } if(strcasecmp("WriteResidenceTimesEvery",keyword)==0) sscanf(arguments,"%d",&WriteResidenceTimesEvery[CurrentSystem]); if(strcasecmp("RangeResidenceTimes",keyword)==0) sscanf(arguments,"%lf",&RangeResidenceTimes[CurrentSystem]); if(strcasecmp("ResidenceTimesHistogramSize",keyword)==0) sscanf(arguments,"%d",&ResidenceTimesHistogramSize[CurrentSystem]); // sampling histograms of the distance between 2 selected atoms if(strcasecmp("ComputeDistanceHistograms",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeDistanceHistograms[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeDistanceHistograms[CurrentSystem]=FALSE; } if(strcasecmp("WriteDistanceHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteDistanceHistogramsEvery[CurrentSystem]); if(strcasecmp("MaxRangeDistanceHistogram",keyword)==0) sscanf(arguments,"%lf",&MaxRangeDistanceHistogram); if(strcasecmp("NumberOfElementsDistanceHistogram",keyword)==0) sscanf(arguments,"%d",&NumberOfElementsDistanceHistogram); // sampling histograms of the bend angle between 3 selected atoms if(strcasecmp("ComputeBendAngleHistograms",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeBendAngleHistograms[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeBendAngleHistograms[CurrentSystem]=FALSE; } if(strcasecmp("WriteBendAngleHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteBendAngleHistogramsEvery[CurrentSystem]); if(strcasecmp("MaxRangeBendAngleHistogram",keyword)==0) sscanf(arguments,"%lf",&MaxRangeBendAngleHistogram); if(strcasecmp("NumberOfElementsBendAngleHistogram",keyword)==0) sscanf(arguments,"%d",&NumberOfElementsBendAngleHistogram); // sampling histograms of the dihedral angle between 4 selected atoms if(strcasecmp("ComputeDihedralAngleHistograms",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeDihedralAngleHistograms[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeDihedralAngleHistograms[CurrentSystem]=FALSE; } if(strcasecmp("WriteDihedralAngleHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteDihedralAngleHistogramsEvery[CurrentSystem]); if(strcasecmp("MaxRangeDihedralAngleHistogram",keyword)==0) sscanf(arguments,"%lf",&MaxRangeDihedralAngleHistogram); if(strcasecmp("NumberOfElementsDihedralAngleHistogram",keyword)==0) sscanf(arguments,"%d",&NumberOfElementsDihedralAngleHistogram); // sampling histograms of the angle between two planes (each formed by 3 chosen atoms) if(strcasecmp("ComputeAngleBetweenPlanesHistograms",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeAngleBetweenPlanesHistograms[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeAngleBetweenPlanesHistograms[CurrentSystem]=FALSE; } if(strcasecmp("WriteAngleBetweenPlanesHistogramEvery",keyword)==0) sscanf(arguments,"%d",&WriteAngleBetweenPlanesHistogramsEvery[CurrentSystem]); if(strcasecmp("MaxRangeAngleBetweenPlanesHistogram",keyword)==0) sscanf(arguments,"%lf",&MaxRangeAngleBetweenPlanesHistogram); if(strcasecmp("NumberOfElementsAngleBetweenPlanesHistogram",keyword)==0) sscanf(arguments,"%d",&NumberOfElementsAngleBetweenPlanesHistogram); // sampling molecular properties (bond distance, bend angle, dihedral angle) if(strcasecmp("ComputeMoleculeProperties",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeMoleculeProperties[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeMoleculeProperties[CurrentSystem]=FALSE; } if(strcasecmp("WriteMoleculePropertiesEvery",keyword)==0) sscanf(arguments,"%d",&WriteMoleculePropertiesEvery[CurrentSystem]); if(strcasecmp("BondLengthHistogramSize",keyword)==0) sscanf(arguments,"%d",&BondLengthHistogramSize[CurrentSystem]); if(strcasecmp("BendAngleHistogramSize",keyword)==0) sscanf(arguments,"%d",&BendAngleHistogramSize[CurrentSystem]); if(strcasecmp("DihedralHistogramSize",keyword)==0) sscanf(arguments,"%d",&DihedralHistogramSize[CurrentSystem]); if(strcasecmp("BondLengthRange",keyword)==0) sscanf(arguments,"%lf",&BondLengthRange[CurrentSystem]); if(strcasecmp("BendAngleRange",keyword)==0) sscanf(arguments,"%lf",&BendAngleRange[CurrentSystem]); if(strcasecmp("DihedralRange",keyword)==0) sscanf(arguments,"%lf",&DihedralRange[CurrentSystem]); // sampling the IR spectra (spacings: 2048, 4196, 8192, 16384, 32768 points) if(strcasecmp("ComputeInfraRedSpectra",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeInfraRedSpectra[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeInfraRedSpectra[CurrentSystem]=FALSE; } if(strcasecmp("WriteInfraRedSpectraEvery",keyword)==0) sscanf(arguments,"%d",&WriteInfraRedSpectraEvery[CurrentSystem]); if(strcasecmp("SampleEveryInfraRed",keyword)==0) sscanf(arguments,"%d",&SampleEveryInfraRed); // sampling the mean-squared displacement using a modified order-N algorithm if(strcasecmp("ComputeMSD",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeMSDOrderN[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeMSDOrderN[CurrentSystem]=FALSE; } if(strcasecmp("WriteMSDEvery",keyword)==0) sscanf(arguments,"%d",&WriteMSDOrderNEvery[CurrentSystem]); if(strcasecmp("NumberOfSitesMSDOrderN",keyword)==0) sscanf(arguments,"%d",&NumberOfSitesMSDOrderN[CurrentSystem]); if(strcasecmp("SampleMSDEvery",keyword)==0) sscanf(arguments,"%d",&SampleMSDOrderNEvery[CurrentSystem]); if(strcasecmp("NumberOfBlockElementsMSD",keyword)==0) sscanf(arguments,"%d",&NumberOfBlockElementsMSDOrderN); if(strcasecmp("NumberOfBlocksMSD",keyword)==0) sscanf(arguments,"%d",&MaxNumberOfBlocksMSDOrderN); if(strcasecmp("ComputeIndividualMSD",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeIndividualMSDOrderN=TRUE; if(strcasecmp("no",firstargument)==0) ComputeIndividualMSDOrderN=FALSE; } if(strcasecmp("ComputeSiteTypeMSD",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeSiteTypeMSDOrderN=TRUE; if(strcasecmp("no",firstargument)==0) ComputeSiteTypeMSDOrderN=FALSE; } if(strcasecmp("ComputeMSDPerPseudoAtom",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeMSDOrderNPerPseudoAtom=TRUE; if(strcasecmp("no",firstargument)==0) ComputeMSDOrderNPerPseudoAtom=FALSE; } // sampling the velocity autocorrelation function using a modified order-N algorithm if(strcasecmp("ComputeVACF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeVACFOrderN[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeVACFOrderN[CurrentSystem]=FALSE; } if(strcasecmp("WriteVACFEvery",keyword)==0) sscanf(arguments,"%d",&WriteVACFOrderNEvery[CurrentSystem]); if(strcasecmp("SampleVACFEvery",keyword)==0) sscanf(arguments,"%d",&SampleVACFOrderNEvery[CurrentSystem]); if(strcasecmp("NumberOfBlockElementsVACF",keyword)==0) sscanf(arguments,"%d",&NumberOfBlockElementsVACFOrderN); if(strcasecmp("NumberOfBlocksVACF",keyword)==0) sscanf(arguments,"%d",&MaxNumberOfBlocksVACFOrderN); if(strcasecmp("ComputeIndividualVACF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeIndividualVACFOrderN=TRUE; if(strcasecmp("no",firstargument)==0) ComputeIndividualVACFOrderN=FALSE; } if(strcasecmp("ComputeVACFPerPseudoAtom",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeVACFOrderNPerPseudoAtom=TRUE; if(strcasecmp("no",firstargument)==0) ComputeVACFOrderNPerPseudoAtom=FALSE; } // sampling of the rotational velocity autocorrelation function using a modified order-N algorithm if(strcasecmp("ComputeRVACF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeRVACFOrderN[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeRVACFOrderN[CurrentSystem]=FALSE; } if(strcasecmp("WriteRVACFEvery",keyword)==0) sscanf(arguments,"%d",&WriteRVACFOrderNEvery[CurrentSystem]); if(strcasecmp("SampleRVACFEvery",keyword)==0) sscanf(arguments,"%d",&SampleRVACFOrderNEvery[CurrentSystem]); if(strcasecmp("NumberOfBlockElementsRVACF",keyword)==0) sscanf(arguments,"%d",&NumberOfBlockElementsRVACFOrderN); if(strcasecmp("NumberOfBlocksRVACF",keyword)==0) sscanf(arguments,"%d",&MaxNumberOfBlocksRVACFOrderN); if(strcasecmp("ComputeIndividualRVACF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeIndividualRVACFOrderN=TRUE; if(strcasecmp("no",firstargument)==0) ComputeIndividualRVACFOrderN=FALSE; } if(strcasecmp("ComputeRVACFPerPseudoAtom",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeRVACFOrderNPerPseudoAtom=TRUE; if(strcasecmp("no",firstargument)==0) ComputeRVACFOrderNPerPseudoAtom=FALSE; } // sampling of the molecular orientation autocorrelation function using a modified order-N algorithm if(strcasecmp("ComputeMOACF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeMolecularOrientationOrderN[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeMolecularOrientationOrderN[CurrentSystem]=FALSE; } if(strcasecmp("MolecularOrientationVector",keyword)==0) sscanf(arguments,"%lf %lf %lf",&MolecularOrientationVector.x, &MolecularOrientationVector.y,&MolecularOrientationVector.z); if(strcasecmp("MolecularOrientationGroup",keyword)==0) sscanf(arguments,"%d",&MolecularOrientationGroup); if(strcasecmp("MolecularOrientationType",keyword)==0) { if(strcasecmp("EndToEndvector",firstargument)==0) MolecularOrientationType=END_TO_END_VECTOR; if(strcasecmp("MolecularVector",firstargument)==0) MolecularOrientationType=MOLECULAR_VECTOR; } if(strcasecmp("WriteMOAACFEvery",keyword)==0) sscanf(arguments,"%d",&WriteMolecularOrientationOrderNEvery[CurrentSystem]); if(strcasecmp("SampleMOACFEvery",keyword)==0) sscanf(arguments,"%d",&SampleMolecularOrientationOrderNEvery[CurrentSystem]); if(strcasecmp("NumberOfBlockElementsMOACF",keyword)==0) sscanf(arguments,"%d",&NumberOfBlockElementsMolecularOrientationOrderN); if(strcasecmp("NumberOfBlocksMOACF",keyword)==0) sscanf(arguments,"%d",&MaxNumberOfBlocksMolecularOrientationOrderN); // sampling of the bond orientation autocorrelation function using a modified order-N algorithm if(strcasecmp("ComputeBOACF",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeBondOrientationOrderN[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeBondOrientationOrderN[CurrentSystem]=FALSE; } if(strcasecmp("WriteBOACFEvery",keyword)==0) sscanf(arguments,"%d",&WriteBondOrientationOrderNEvery[CurrentSystem]); if(strcasecmp("SampleBOACFEvery",keyword)==0) sscanf(arguments,"%d",&SampleBondOrientationOrderNEvery[CurrentSystem]); if(strcasecmp("NumberOfBlockElementsBOACF",keyword)==0) sscanf(arguments,"%d",&NumberOfBlockElementsBondOrientationOrderN); if(strcasecmp("NumberOfBlocksBOACF",keyword)==0) sscanf(arguments,"%d",&MaxNumberOfBlocksBondOrientationOrderN); if(strcasecmp("BondOrientationAngleHistogramSize",keyword)==0) sscanf(arguments,"%d",&BondOrientationAngleHistogramSize[CurrentSystem]); // sampling the mean-square displacement function using a conventional algorithm if(strcasecmp("ComputeMSDConventional",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeMSD[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeMSD[CurrentSystem]=FALSE; } if(strcasecmp("WriteMSDConventionalEvery",keyword)==0) sscanf(arguments,"%d",&WriteMSDEvery[CurrentSystem]); if(strcasecmp("SampleMSDConventionalEvery",keyword)==0) sscanf(arguments,"%d",&SampleMSDEvery[CurrentSystem]); if(strcasecmp("NumberOfBuffersMSDConventional",keyword)==0) sscanf(arguments,"%d",&NumberOfBuffersMSD); if(strcasecmp("BufferLengthMSDConventional",keyword)==0) sscanf(arguments,"%d",&BufferLengthMSD); // sampling the velocity autocorrelation function using a conventional algorithm if(strcasecmp("ComputeVACFConventional",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeVACF[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeVACF[CurrentSystem]=FALSE; } if(strcasecmp("WriteVACFConventionalEvery",keyword)==0) sscanf(arguments,"%d",&WriteVACFEvery[CurrentSystem]); if(strcasecmp("SampleVACFConventionalEvery",keyword)==0) sscanf(arguments,"%d",&SampleVACFEvery[CurrentSystem]); if(strcasecmp("NumberOfBuffersVACFConventional",keyword)==0) sscanf(arguments,"%d",&NumberOfBuffersVACF); if(strcasecmp("BufferLengthVACFConventional",keyword)==0) sscanf(arguments,"%d",&BufferLengthVACF); // sampling the 3D histograms of position (i.e. 3D free energy) if(strcasecmp("ComputeDensityProfile3DVTKGrid",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeDensityProfile3DVTKGrid[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeDensityProfile3DVTKGrid[CurrentSystem]=FALSE; } if(strcasecmp("WriteDensityProfile3DVTKGridEvery",keyword)==0) sscanf(arguments,"%d",&WriteDensityProfile3DVTKGridEvery[CurrentSystem]); if(strcasecmp("DensityProfile3DVTKGridPoints",keyword)==0) sscanf(arguments,"%d %d %d",&DensityProfile3DVTKGridPoints.x,&DensityProfile3DVTKGridPoints.y,&DensityProfile3DVTKGridPoints.z); if(strcasecmp("DensityAveragingTypeVTK",keyword)==0) { if((strcasecmp("unit_cell",firstargument)==0)||(strcasecmp("UnitCell",firstargument)==0)) DensityAveragingTypeVTK=VTK_UNIT_CELL; if((strcasecmp("full_box",firstargument)==0)||(strcasecmp("FullBox",firstargument)==0)) DensityAveragingTypeVTK=VTK_FULL_BOX; } if(strcasecmp("AverageDensityOverUnitCellsVTK",keyword)==0) { if(strcasecmp("yes",firstargument)==0) AverageDensityOverUnitCellsVTK=TRUE; if(strcasecmp("no",firstargument)==0) AverageDensityOverUnitCellsVTK=FALSE; } // samples the cation sites and adsorption sites if(strcasecmp("ComputeCationAndAdsorptionSites",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeCationAndAdsorptionSites[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeCationAndAdsorptionSites[CurrentSystem]=FALSE; } if(strcasecmp("WriteCationAndAdsorptionSitesEvery",keyword)==0) sscanf(arguments,"%d",&WriteCationAndAdsorptionSitesEvery[CurrentSystem]); // samples initial configurations for the tranmission coefficient (dcTST) if(strcasecmp("WritedcTSTSnapShotsEvery",keyword)==0) sscanf(arguments,"%d",&WritedcTSTSnapShotsEvery[CurrentSystem]); if(strcasecmp("WritedcTSTSnapShotsToFile",keyword)==0) { if(strcasecmp("yes",firstargument)==0) WritedcTSTSnapShotsToFile[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) WritedcTSTSnapShotsToFile[CurrentSystem]=FALSE; } // samples the principle moment of inertia if(strcasecmp("ComputePrincipleMomentsOfInertia",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputePrincipleMomentsOfInertia=TRUE; if(strcasecmp("no",firstargument)==0) ComputePrincipleMomentsOfInertia=FALSE; } if((strcasecmp("ComputeMolecularPressure",keyword)==0)||(strcasecmp("ComputePressure",keyword)==0)) { if(strcasecmp("yes",firstargument)==0) ComputeMolecularPressure[CurrentSystem]=TRUE; if(strcasecmp("no",firstargument)==0) ComputeMolecularPressure[CurrentSystem]=FALSE; } if((strcasecmp("OrientationFrameworkBond",keyword)==0)||(strcasecmp("orientation_framework_bond",keyword)==0)) { // allocate additional memory for this modification rule OrientationFrameworkBonds[CurrentSystem][CurrentFramework]=(char(*)[2][256])realloc( OrientationFrameworkBonds[CurrentSystem][CurrentFramework], (NumberOfOrientationFrameworkBonds[CurrentSystem][CurrentFramework]+1)*sizeof(char[2][256])); if(!OrientationFrameworkBonds[CurrentSystem][CurrentFramework]) { printf("Memory reallocation error of 'OrientationFrameworkBonds[CurrentSystem][CurrentFramework]' in file %s line %d\n", __FILE__, __LINE__); exit(-1); } index=NumberOfOrientationFrameworkBonds[CurrentSystem][CurrentFramework]; // scan the arguments from the input sscanf(arguments,"%s %s", OrientationFrameworkBonds[CurrentSystem][CurrentFramework][index][0], OrientationFrameworkBonds[CurrentSystem][CurrentFramework][index][1]); // increase the amount of modifcation rules by 1 NumberOfOrientationFrameworkBonds[CurrentSystem][CurrentFramework]++; } if(strcasecmp("SurfaceAreaProbeAtom",keyword)==0) sscanf(arguments,"%s",Framework[CurrentSystem].SurfaceAreaProbeAtom); if(strcasecmp("SurfaceAreaSamplingPointsPerSphere",keyword)==0) sscanf(arguments,"%d",&Framework[CurrentSystem].SurfaceAreaSamplingPointsPerShere); if(strcasecmp("SurfaceAreaProbeDistance",keyword)==0) { if(strcasecmp("Minimum",firstargument)==0) Framework[CurrentSystem].SurfaceAreaProbeDistance=pow(2.0,1.0/6.0); if(strcasecmp("Sigma",firstargument)==0) Framework[CurrentSystem].SurfaceAreaProbeDistance=1.0; } if(strcasecmp("ComputeElasticConstants",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeElasticConstants=ComputeBornTerm=ComputeCrossTerm=TRUE; if(strcasecmp("no",firstargument)==0) ComputeElasticConstants=ComputeBornTerm=ComputeCrossTerm=FALSE; } if(strcasecmp("ComputeElasticConstantsThirdOrder",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeElasticConstantsThirdOrder=ComputeElasticConstants=ComputeBornTerm=ComputeCrossTerm=TRUE; if(strcasecmp("no",firstargument)==0) ComputeElasticConstantsThirdOrder=FALSE; } if(strcasecmp("ComputePowderDiffractionPattern",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputePowderDiffractionPattern=TRUE; if(strcasecmp("no",firstargument)==0) ComputePowderDiffractionPattern=FALSE; } if(strcasecmp("DiffractionType",keyword)==0) { if(strcasecmp("xray",firstargument)==0) Diffraction.Type=XRAY_DIFFRACTION; if(strcasecmp("neutron",firstargument)==0) Diffraction.Type=NEUTRON_DIFFRACTION; if(strcasecmp("electron",firstargument)==0) Diffraction.Type=ELECTRON_DIFFRACTION; } if(strcasecmp("DiffractionRadiationType",keyword)==0) { if(strcasecmp("chromium",firstargument)==0) Diffraction.RadiationType=CHROMIUM_RADIATION; if(strcasecmp("iron",firstargument)==0) Diffraction.RadiationType=IRON_RADIATION; if(strcasecmp("copper",firstargument)==0) Diffraction.RadiationType=COPPER_RADIATION; if(strcasecmp("molybdenum",firstargument)==0) Diffraction.RadiationType=MOLYBDENUM_RADIATION; if(strcasecmp("silver",firstargument)==0) Diffraction.RadiationType=SILVER_RADIATION; if(strcasecmp("synchrotron",firstargument)==0) Diffraction.RadiationType=SYNCHROTRON_RADIATION; } if(strcasecmp("WaveLengthType",keyword)==0) { if(strcasecmp("Single",firstargument)==0) Diffraction.lambda_type=DIFFRACTION_SINGLE; if(strcasecmp("Double",firstargument)==0) Diffraction.lambda_type=DIFFRACTION_DOUBLET; } if(strcasecmp("PeakShape",keyword)==0) { if(strcasecmp("Gaussian",firstargument)==0) Diffraction.PeakShape=DIFFRACTION_GAUSSIAN; if(strcasecmp("Lorentzian",firstargument)==0) Diffraction.PeakShape=DIFFRACTION_LORENTZIAN; if(strcasecmp("PseudoVoigt",firstargument)==0) Diffraction.PeakShape=DIFFRACTION_PSEUDO_VOIGT; } if(strcasecmp("WaveLength",keyword)==0) sscanf(arguments,"%lf",&Wavelength); if(strcasecmp("TwoThetaMin",keyword)==0) sscanf(arguments,"%lf",&Diffraction.two_theta_min); if(strcasecmp("TwoThetaMax",keyword)==0) sscanf(arguments,"%lf",&Diffraction.two_theta_max); if(strcasecmp("TwoThetaStep",keyword)==0) sscanf(arguments,"%lf",&Diffraction.two_theta_step); if(strcasecmp("PeakWidthModifierU",keyword)==0) sscanf(arguments,"%lf",&Diffraction.u); if(strcasecmp("PeakWidthModifierV",keyword)==0) sscanf(arguments,"%lf",&Diffraction.v); if(strcasecmp("PeakWidthModifierW",keyword)==0) sscanf(arguments,"%lf",&Diffraction.w); if(strcasecmp("ComputeNormalModes",keyword)==0) { if(strcasecmp("yes",firstargument)==0) ComputeNormalModes=TRUE; if(strcasecmp("no",firstargument)==0) ComputeNormalModes=FALSE; } if(strcasecmp("CorrectNormalModesForConstraints",keyword)==0) { if(strcasecmp("yes",firstargument)==0) CorrectNormalModesForConstraints=TRUE; if(strcasecmp("no",firstargument)==0) CorrectNormalModesForConstraints=FALSE; } if(strcasecmp("MinimumMode",keyword)==0) sscanf(arguments,"%d",&MinimumMode); if(strcasecmp("MaximumMode",keyword)==0) sscanf(arguments,"%d",&MaximumMode); if(strcasecmp("ModeResolution",keyword)==0) sscanf(arguments,"%d",&ModeResolution); if(strcasecmp("WriteVTKGrids",keyword)==0) { if(strcasecmp("yes",firstargument)==0) WriteVTKGrids=TRUE; if(strcasecmp("no",firstargument)==0) WriteVTKGrids=FALSE; } if(strcasecmp("VTKFractionalFrameworkAtomsMin",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalFrameworkAtomsMin.x,&VTKFractionalFrameworkAtomsMin.y,&VTKFractionalFrameworkAtomsMin.z); if(strcasecmp("VTKFractionalFrameworkAtomsMax",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalFrameworkAtomsMax.x,&VTKFractionalFrameworkAtomsMax.y,&VTKFractionalFrameworkAtomsMax.z); if(strcasecmp("VTKFractionalFrameworkBondsMin",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalFrameworkBondsMin.x,&VTKFractionalFrameworkBondsMin.y,&VTKFractionalFrameworkBondsMin.z); if(strcasecmp("VTKFractionalFrameworkBondsMax",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalFrameworkBondsMax.x,&VTKFractionalFrameworkBondsMax.y,&VTKFractionalFrameworkBondsMax.z); if(strcasecmp("VTKFractionalAdsorbateMin",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalAdsorbateComMin.x,&VTKFractionalAdsorbateComMin.y,&VTKFractionalAdsorbateComMin.z); if(strcasecmp("VTKFractionalAdsorbateMax",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalAdsorbateComMax.x,&VTKFractionalAdsorbateComMax.y,&VTKFractionalAdsorbateComMax.z); if(strcasecmp("VTKFractionalCationMin",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalCationComMin.x,&VTKFractionalCationComMin.y,&VTKFractionalCationComMin.z); if(strcasecmp("VTKFractionalCationMax",keyword)==0) sscanf(arguments,"%lf %lf %lf",&VTKFractionalCationComMax.x,&VTKFractionalCationComMax.y,&VTKFractionalCationComMax.z); if(strcasecmp("FreeEnergyAveragingTypeVTK",keyword)==0) { if((strcasecmp("unit_cell",firstargument)==0)||(strcasecmp("UnitCell",firstargument)==0)) FreeEnergyAveragingTypeVTK=VTK_UNIT_CELL; if((strcasecmp("full_box",firstargument)==0)||(strcasecmp("FullBox",firstargument)==0)) FreeEnergyAveragingTypeVTK=VTK_FULL_BOX; } // read energy/force grid options if(strcasecmp("UseTabularGrid",keyword)==0) if((strcasecmp(firstargument,"yes")==0)&&(SimulationType!=MAKE_GRID)) UseTabularGrid=TRUE; if(strcasecmp("SpacingVDWGrid",keyword)==0) sscanf(arguments,"%lf",&SpacingVDWGrid); if(strcasecmp("SpacingCoulombGrid",keyword)==0) sscanf(arguments,"%lf",&SpacingCoulombGrid); if(strcasecmp("NumberOfGrids",keyword)==0) { sscanf(arguments,"%d",&NumberOfGrids); GridTypeListName=(char(*)[256])calloc(NumberOfGrids,sizeof(char[256])); } if(strcasecmp("GridTypes",keyword)==0) { for(j=0;j0.0) { for(i=0;i1) Framework[i].FrameworkModel=FLEXIBLE; } // get the random number seed from the system-time if not specified if(seed<=0lu) seed=time(0lu); // Initialize random-number generator using the "random" seed InitializeRandomNumberGenerator(seed); if(BoundaryCondition[CurrentSystem]==FINITE) { CutOffVDW=DBL_MAX; CutOffVDWSquared=DBL_MAX; for(i=0;i0) ReadIonSitingDefinition(); } } for(i=0;i=Components[i].NumberOfAtoms) { fprintf(stderr, "Starting bead (%d) not within number of atoms: %d\n", Components[i].StartingBead,Components[i].NumberOfAtoms); exit(0); } for(j=0;jLargestNumberOfCoulombicSites) LargestNumberOfCoulombicSites=nr_sites; NumberOfAtomsPerSystem[i]=0; NumberOfChargesPerSystem[i]=0; } LargestNumberOfBondDipoleSites=0; for(i=0;iLargestNumberOfBondDipoleSites) LargestNumberOfBondDipoleSites=nr_sites; NumberOfBondDipolesPerSystem[i]=0; } // the components are read, and all limits are known // allocate the memory for use in the cbmc routines AllocateCBMCMemory(); AllocateMCMovesMemory(); AllocateGridMemory(); for(i=0;i0) Adsorbates[i]=(ADSORBATE_MOLECULE*)calloc(MaxNumberOfAdsorbateMolecules[i],sizeof(ADSORBATE_MOLECULE)); } Cations=(CATION_MOLECULE**)calloc(NumberOfSystems,sizeof(CATION_MOLECULE*)); for(i=0;i0) Cations[i]=(CATION_MOLECULE*)calloc(MaxNumberOfCationMolecules[i],sizeof(CATION_MOLECULE)); } } else { // make sure these are off for a grand-canonical system for(i=0;i0) { for(i=0;i0.0) BoundaryCondition[CurrentSystem]=TRICLINIC; } // if the boundary-condition is still not set, let it default to 'triclinic' for(i=0;i create reaction fractional molecules if(Components[j].NumberOfMolecules[CurrentSystem]==0) { for(k=0;k0) { CurrentSystem=i; CalculateAnisotropicSites(); if(Components[j].ExtraFrameworkMolecule) MakeInitialCations(Components[j].CreateNumberOfMolecules[i],j); else MakeInitialAdsorbates(Components[j].CreateNumberOfMolecules[i],j); } } } switch(SimulationSubType) { case GIBBS_CFCMC_SINGLE_FRACTIONAL_PARTICLE: for(j=0;j0) { DistanceHistogramPairs[i]=(ATOM*(*)[2])calloc(NumberOfDistanceHistogramDefinitions[i],sizeof(ATOM*[2])); for(j=0;j0) { BendAngleHistogramPairs[i]=(ATOM*(*)[3])calloc(NumberOfBendAngleHistogramDefinitions[i],sizeof(ATOM*[3])); for(j=0;j0) { DihedralAngleHistogramPairs[i]=(ATOM*(*)[4])calloc(NumberOfDihedralAngleHistogramDefinitions[i],sizeof(ATOM*[4])); for(j=0;j0) { AngleBetweenPlanesHistogramPairs[i]=(ATOM*(*)[6])calloc(NumberOfAngleBetweenPlanesHistogramDefinitions[i],sizeof(ATOM*[6])); for(j=0;j0) { DistanceConstraints[i]=(ATOM*(*)[2])calloc(NumberOfDistanceConstraints[i],sizeof(ATOM*[2])); DistanceConstraintsDerivatives[i]=(VECTOR(*)[2])calloc(NumberOfDistanceConstraints[i],sizeof(VECTOR[2])); for(j=0;j0) { AngleConstraints[i]=(ATOM*(*)[3])calloc(NumberOfAngleConstraints[i],sizeof(ATOM*[3])); AngleConstraintsDerivatives[i]=(VECTOR(*)[3])calloc(NumberOfAngleConstraints[i],sizeof(VECTOR[3])); for(j=0;j0) { DihedralConstraints[i]=(ATOM*(*)[4])calloc(NumberOfDihedralConstraints[i],sizeof(ATOM*[4])); DihedralConstraintsDerivatives[i]=(VECTOR(*)[4])calloc(NumberOfDihedralConstraints[i],sizeof(VECTOR[4])); for(j=0;j0) { ImproperDihedralConstraints[i]=(ATOM*(*)[4])calloc(NumberOfImproperDihedralConstraints[i],sizeof(ATOM*[4])); ImproperDihedralConstraintsDerivatives[i]=(VECTOR(*)[4])calloc(NumberOfImproperDihedralConstraints[i],sizeof(VECTOR[4])); for(j=0;j0) { InversionBendConstraints[i]=(ATOM*(*)[4])calloc(NumberOfInversionBendConstraints[i],sizeof(ATOM*[4])); InversionBendConstraintsDerivatives[i]=(VECTOR(*)[4])calloc(NumberOfInversionBendConstraints[i],sizeof(VECTOR[4])); for(j=0;j0) { OutOfPlaneDistanceConstraints[i]=(ATOM*(*)[4])calloc(NumberOfOutOfPlaneDistanceConstraints[i],sizeof(ATOM*[4])); OutOfPlaneDistanceConstraintsDerivatives[i]=(VECTOR(*)[4])calloc(NumberOfOutOfPlaneDistanceConstraints[i],sizeof(VECTOR[4])); for(j=0;j0) { HarmonicDistanceConstraints[i]=(ATOM*(*)[2])calloc(NumberOfHarmonicDistanceConstraints[i],sizeof(ATOM*[2])); for(j=0;j0) { HarmonicAngleConstraints[i]=(ATOM*(*)[3])calloc(NumberOfHarmonicAngleConstraints[i],sizeof(ATOM*[3])); for(j=0;j0) { HarmonicDihedralConstraints[i]=(ATOM*(*)[4])calloc(NumberOfHarmonicDihedralConstraints[i],sizeof(ATOM*[4])); for(j=0;j0) { TwoPointDihedrals[i]=(ATOM*(*)[6])calloc(NumberOfTwoPointDihedralDefinitions[i],sizeof(ATOM*[6])); for(j=0;jPosition, DistanceConstraints[i][j][1]->Position); for(j=0;jPosition, AngleConstraints[i][j][1]->Position,AngleConstraints[i][j][2]->Position); for(j=0;jPosition, DihedralConstraints[i][j][1]->Position,DihedralConstraints[i][j][2]->Position, DihedralConstraints[i][j][3]->Position); for(j=0;jPosition, ImproperDihedralConstraints[i][j][1]->Position,ImproperDihedralConstraints[i][j][2]->Position, ImproperDihedralConstraints[i][j][3]->Position); for(j=0;jPosition, InversionBendConstraints[i][j][1]->Position,InversionBendConstraints[i][j][2]->Position, InversionBendConstraints[i][j][3]->Position); for(j=0;jPosition, HarmonicDistanceConstraints[i][j][1]->Position); for(j=0;jPosition, HarmonicAngleConstraints[i][j][1]->Position,HarmonicAngleConstraints[i][j][2]->Position); for(j=0;jPosition, HarmonicDihedralConstraints[i][j][1]->Position, HarmonicDihedralConstraints[i][j][2]->Position, HarmonicDihedralConstraints[i][j][3]->Position); } for(i=0;iRXMCLambdaHistogramSize) { RXMCLambdaHistogramSize=int_temp1; // realloc memory for(i=0;i0) { for(k=0;k0) { for(k=0;k=0;CurrentComponent--) { if(!Components[CurrentComponent].CFMoleculePresent[CurrentSystem]) { if(FractionalMolecules[CurrentComponent]>=0) { if(Components[CurrentComponent].ExtraFrameworkMolecule) { CurrentCationMolecule=FractionalMolecules[CurrentComponent]; RemoveCationMolecule(); } else { CurrentAdsorbateMolecule=FractionalMolecules[CurrentComponent]; RemoveAdsorbateMolecule(); } } } } // set bias-factors to zero, because in CBMC the weight should be 1.0 NumberOfFractionalMolecules[CurrentSystem]=0; NumberOfFractionalAdsorbateMolecules[CurrentSystem]=0; NumberOfFractionalCationMolecules[CurrentSystem]=0; for(i=0;i