Changeset b21a64
- Timestamp:
- Oct 30, 2009, 3:49:38 PM (15 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:
- 34e0013
- Parents:
- b70721
- git-author:
- Frederik Heber <heber@…> (10/30/09 15:33:51)
- git-committer:
- Frederik Heber <heber@…> (10/30/09 15:49:38)
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/bondgraph.cpp
rb70721 rb21a64 49 49 50 50 // parse in matrix 51 BondLengthMatrix->ParseMatrix(filename.c_str(), 0, 0, 0);51 BondLengthMatrix->ParseMatrix(filename.c_str(), 0, 1, 0); 52 52 53 53 // find greatest distance … … 113 113 void BondGraph::BondLengthMatrixMinMaxDistance(BondedParticle * const Walker, BondedParticle * const OtherWalker, double &MinDistance, double &MaxDistance, bool IsAngstroem) 114 114 { 115 MinDistance = GetBondLength(Walker->type->Z-1, OtherWalker->type->Z-1); 116 MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 117 MaxDistance = MinDistance + BONDTHRESHOLD; 118 MinDistance -= BONDTHRESHOLD; 115 if (BondLengthMatrix->Matrix == NULL) {// safety measure if no matrix has been parsed yet 116 cerr << Verbose(1) << "WARNING: BondLengthMatrixMinMaxDistance() called without having parsed the bond length matrix yet!" << endl; 117 CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 118 } else { 119 MinDistance = GetBondLength(Walker->type->Z-1, OtherWalker->type->Z-1); 120 MinDistance *= (IsAngstroem) ? 1. : 1. / AtomicLengthToAngstroem; 121 MaxDistance = MinDistance + BONDTHRESHOLD; 122 MinDistance -= BONDTHRESHOLD; 123 } 119 124 }; 120 125 -
src/builder.cpp
rb70721 rb21a64 1357 1357 int argptr; 1358 1358 molecule *mol = NULL; 1359 string BondGraphFileName(""); 1359 1360 strncpy(configuration.databasepath, LocalPath, MAXSTRINGSIZE-1); 1360 1361 … … 1384 1385 cout << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl; 1385 1386 cout << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl; 1387 cout << "\t-g <file>\tParses a bond length table from the given file." << endl; 1386 1388 cout << "\t-h/-H/-?\tGive this help screen." << endl; 1387 1389 cout << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl; … … 1420 1422 } 1421 1423 break; 1424 case 'g': 1425 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1426 cerr << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl; 1427 } else { 1428 BondGraphFileName = argv[argptr]; 1429 cout << "Using " << BondGraphFileName << " as bond length table." << endl; 1430 argptr+=1; 1431 } 1432 break; 1422 1433 case 'n': 1423 1434 cout << "I won't parse trajectories." << endl; … … 1432 1443 } while (argptr < argc); 1433 1444 1434 // 2. Parse the element database1445 // 3a. Parse the element database 1435 1446 if (periode->LoadPeriodentafel(configuration.databasepath)) { 1436 1447 cout << Verbose(0) << "Element list loaded successfully." << endl; … … 1440 1451 return 1; 1441 1452 } 1442 // 3 . Find config file name and parse if possible1453 // 3b. Find config file name and parse if possible 1443 1454 if (argv[1][0] != '-') { 1444 1455 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place … … 1483 1494 } else 1484 1495 configPresent = absent; 1496 // 3c. parse the bond graph file if given 1497 configuration.BG = new BondGraph(configuration.GetIsAngstroem()); 1498 if (configuration.BG->LoadBondLengthTable((ofstream *)&cout, BondGraphFileName)) { 1499 cout << Verbose(0) << "Bond length table loaded successfully." << endl; 1500 } else { 1501 cout << Verbose(0) << "Bond length table loading failed." << endl; 1502 return 1; 1503 } 1485 1504 // 4. parse again through options, now for those depending on elements db and config presence 1486 1505 argptr = 1; -
src/config.cpp
rb70721 rb21a64 160 160 /** Constructor for config file class. 161 161 */ 162 config::config() : PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),162 config::config() : BG(NULL), PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL), 163 163 configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), Thermostat(4), ThermostatImplemented(NULL), 164 164 ThermostatNames(NULL), TempFrequency(2.5), alpha(0.), HooverMass(0.), TargetTemp(0.00095004455), ScaleTempStep(25), mainname(NULL), defaultpath(NULL), pseudopotpath(NULL), -
src/config.hpp
rb70721 rb21a64 19 19 20 20 #include <string> 21 22 #include "bondgraph.hpp" 21 23 22 24 /****************************************** forward declarations *****************************/ … … 47 49 class config { 48 50 public: 51 class BondGraph *BG; 52 49 53 int PsiType; 50 54 int MaxPsiDouble; -
src/unittests/bondgraphunittest.cpp
rb70721 rb21a64 79 79 filename = new string("test.dat"); 80 80 ofstream test(filename->c_str()); 81 test << "# Hydrogen\tCarbon\n1.\t1.2\n1.2\t1.5" << endl; 81 test << ".\tH\tC\n"; 82 test << "H\t1.\t1.2\n"; 83 test << "C\t1.2\t1.5\n"; 82 84 BG = new BondGraph(true); 83 85 };
Note:
See TracChangeset
for help on using the changeset viewer.