Changeset edb650
- Timestamp:
- Jun 13, 2008, 2:26:50 PM (17 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 14d4d4
- Parents:
- 318bfd
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r318bfd redb650 561 561 * \param *configuration needed for path to store convex envelope file 562 562 * \param *mol molecule structure representing the cluster 563 * \param ClusterVolume guesstimated cluster volume, if equal 0 we used VolumeOfConvexEnvelope() instead. 563 564 * \param celldensity desired average density in final cell 564 565 */ 565 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double celldensity)566 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity) 566 567 { 567 568 // transform to PAS … … 571 572 bool IsAngstroem = configuration->GetIsAngstroem(); 572 573 Boundaries *BoundaryPoints = GetBoundaryPoints(out, mol); 573 double clustervolume = VolumeOfConvexEnvelope(out, configuration, BoundaryPoints, mol); 574 double clustervolume; 575 if (ClusterVolume == 0) 576 clustervolume = VolumeOfConvexEnvelope(out, configuration, BoundaryPoints, mol); 577 else 578 clustervolume = ClusterVolume; 574 579 double *GreatestDiameter = GetDiametersOfCluster(out, BoundaryPoints, mol, IsAngstroem); 575 580 vector BoxLengths; … … 601 606 double minimumvolume = TotalNoClusters*(GreatestDiameter[0]*GreatestDiameter[1]*GreatestDiameter[2]); 602 607 *out << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl; 603 if (minimumvolume > cellvolume) 608 if (minimumvolume > cellvolume) { 604 609 cerr << Verbose(0) << "ERROR: the containing box already has a greater volume than the envisaged cell volume!" << endl; 605 606 BoxLengths.x[0] = (repetition[0]*GreatestDiameter[0] + repetition[1]*GreatestDiameter[1] + repetition[2]*GreatestDiameter[2]); 607 BoxLengths.x[1] = (repetition[0]*repetition[1]*GreatestDiameter[0]*GreatestDiameter[1] 608 + repetition[0]*repetition[2]*GreatestDiameter[0]*GreatestDiameter[2] 609 + repetition[1]*repetition[2]*GreatestDiameter[1]*GreatestDiameter[2]); 610 BoxLengths.x[2] = minimumvolume - cellvolume; 611 double x0 = 0.,x1 = 0.,x2 = 0.; 612 if (gsl_poly_solve_cubic(BoxLengths.x[0],BoxLengths.x[1],BoxLengths.x[2],&x0,&x1,&x2) == 1) // either 1 or 3 on return 613 *out << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl; 614 else { 615 *out << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl; 616 x0 = x2; // sorted in ascending order 617 } 618 619 cellvolume = 1; 620 for(int i=0;i<NDIM;i++) { 621 BoxLengths.x[i] = repetition[i] * (x0 + GreatestDiameter[i]); 622 cellvolume *= BoxLengths.x[i]; 623 } 624 *out << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl; 625 626 // set new box dimensions 627 *out << Verbose(0) << "Translating to box with these boundaries." << endl; 628 mol->CenterInBox((ofstream *)&cout, &BoxLengths); 610 cout << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl; 611 for(int i=0;i<NDIM;i++) 612 BoxLengths.x[i] = GreatestDiameter[i]; 613 mol->CenterEdge(out, &BoxLengths); 614 } else { 615 BoxLengths.x[0] = (repetition[0]*GreatestDiameter[0] + repetition[1]*GreatestDiameter[1] + repetition[2]*GreatestDiameter[2]); 616 BoxLengths.x[1] = (repetition[0]*repetition[1]*GreatestDiameter[0]*GreatestDiameter[1] 617 + repetition[0]*repetition[2]*GreatestDiameter[0]*GreatestDiameter[2] 618 + repetition[1]*repetition[2]*GreatestDiameter[1]*GreatestDiameter[2]); 619 BoxLengths.x[2] = minimumvolume - cellvolume; 620 double x0 = 0.,x1 = 0.,x2 = 0.; 621 if (gsl_poly_solve_cubic(BoxLengths.x[0],BoxLengths.x[1],BoxLengths.x[2],&x0,&x1,&x2) == 1) // either 1 or 3 on return 622 *out << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl; 623 else { 624 *out << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl; 625 x0 = x2; // sorted in ascending order 626 } 627 628 cellvolume = 1; 629 for(int i=0;i<NDIM;i++) { 630 BoxLengths.x[i] = repetition[i] * (x0 + GreatestDiameter[i]); 631 cellvolume *= BoxLengths.x[i]; 632 } 633 634 // set new box dimensions 635 *out << Verbose(0) << "Translating to box with these boundaries." << endl; 636 mol->CenterInBox((ofstream *)&cout, &BoxLengths); 637 } 629 638 // update Box of atoms by boundary 630 639 mol->SetBoxDimension(&BoxLengths); 631 640 *out << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl; 632 641 }; 633 642 -
src/boundary.hpp
r318bfd redb650 124 124 double VolumeOfConvexEnvelope(ofstream *out, config *configuration, Boundaries *BoundaryPoints, molecule *mol); 125 125 double * GetDiametersOfCluster(ofstream *out, Boundaries *BoundaryPtr, molecule *mol, bool IsAngstroem); 126 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double celldensity);126 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity); 127 127 128 128 -
src/builder.cpp
r318bfd redb650 736 736 int ExitFlag = 0; 737 737 int j; 738 double volume = 0.; 738 739 enum ConfigStatus config_present = absent; 739 740 clock_t start,end; … … 987 988 VolumeOfConvexEnvelope((ofstream *)&cout, &configuration, NULL, mol); 988 989 break; 990 case 'U': 991 volume = atof(argv[argptr++]); 992 cout << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl; 989 993 case 'u': 990 994 { 991 double tmp;995 double density; 992 996 ExitFlag = 1; 993 997 cout << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water."; 994 tmp= atof(argv[argptr++]);995 if ( tmp< 1.0) {998 density = atof(argv[argptr++]); 999 if (density < 1.0) { 996 1000 cerr << Verbose(0) << "Density must be greater than 1.0g/cm^3 !" << endl; 997 tmp= 1.3;1001 density = 1.3; 998 1002 } 999 1003 // for(int i=0;i<NDIM;i++) { … … 1003 1007 // repetition[i] = 1; 1004 1008 // } 1005 PrepareClustersinWater((ofstream *)&cout, &configuration, mol, tmp);1009 PrepareClustersinWater((ofstream *)&cout, &configuration, mol, volume, density); 1006 1010 } 1007 1011 break;
Note:
See TracChangeset
for help on using the changeset viewer.