Changeset 650ca8c for src/Parser
- Timestamp:
- Jun 22, 2010, 9:30:03 AM (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:
- 4ac1aa
- Parents:
- 1434c9
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/PcpParser.cpp
r1434c9 r650ca8c 26 26 PcpParser::PcpParser() 27 27 { 28 Parallelization.ProcPEGamma = 1;28 Parallelization.ProcPEGamma = 8; 29 29 Parallelization.ProcPEPsi = 1; 30 30 … … 54 54 LocalizedOrbitals.EpsWannier = 1e-7; 55 55 56 StepCounts.MaxMinStopStep = 0;57 StepCounts.InitMaxMinStopStep = 0;56 StepCounts.MaxMinStopStep = 1; 57 StepCounts.InitMaxMinStopStep = 1; 58 58 StepCounts.OutVisStep = 10; 59 59 StepCounts.OutSrcStep = 5; 60 StepCounts.MaxPsiStep = 3;60 StepCounts.MaxPsiStep = 0; 61 61 StepCounts.MaxOuterStep = 0; 62 62 StepCounts.MaxMinStep = 100; … … 67 67 StepCounts.InitRelEpsTotalEnergy = 1e-05; 68 68 StepCounts.InitRelEpsKineticEnergy = 0.0001; 69 StepCounts.InitMaxMinGapStopStep = 1;69 StepCounts.InitMaxMinGapStopStep = 0; 70 70 71 71 PlaneWaveSpecifics.PsiType = 0; … … 325 325 class ThermoStatContainer *Thermostats = World::getInstance().getThermostats(); 326 326 if (!file->fail()) { 327 // calculate number of Psis 328 vector<atom *> allatoms = World::getInstance().getAllAtoms(); 329 CalculateOrbitals(allatoms); 327 330 *file << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl; 328 331 *file << endl; 329 *file << "mainname\t" << Paths.mainname << "\t# programm name (for runtime files)" << endl; 330 *file << "defaultpath\t" << Paths.defaultpath << "\t# where to put files during runtime" << endl; 331 *file << "pseudopotpath\t" << Paths.pseudopotpath << "\t# where to find pseudopotentials" << endl; 332 if (Paths.mainname != NULL) 333 *file << "mainname\t" << Paths.mainname << "\t# programm name (for runtime files)" << endl; 334 else 335 *file << "mainname\tpcp\t# programm name (for runtime files)" << endl; 336 if (Paths.defaultpath != NULL) 337 *file << "defaultpath\t" << Paths.defaultpath << "\t# where to put files during runtime" << endl; 338 else 339 *file << "defaultpath\tnot specified\t# where to put files during runtime" << endl; 340 if (Paths.pseudopotpath != NULL) 341 *file << "pseudopotpath\t" << Paths.pseudopotpath << "\t# where to find pseudopotentials" << endl; 342 else 343 *file << "pseudopotpath\tnot specified\t# where to find pseudopotentials" << endl; 332 344 *file << endl; 333 345 *file << "ProcPEGamma\t" << Parallelization.ProcPEGamma << "\t# for parallel computing: share constants" << endl; … … 341 353 *file << "DoFullCurrent\t" << Switches.DoFullCurrent << "\t# Do full perturbation" << endl; 342 354 *file << "DoConstrainedMD\t" << Switches.DoConstrainedMD << "\t# Do perform a constrained (>0, relating to current MD step) instead of unconstrained (0) MD" << endl; 355 ASSERT(Thermostats != NULL, "PcpParser::save() - Thermostats not initialized!"); 356 ASSERT(Thermostats->ThermostatNames != NULL, "PcpParser::save() - Thermostats not initialized!"); 343 357 *file << "Thermostat\t" << Thermostats->ThermostatNames[Thermostats->Thermostat] << "\t"; 344 358 switch(Thermostats->Thermostat) { … … 411 425 } 412 426 *file << "PsiType\t\t" << PlaneWaveSpecifics.PsiType << "\t# 0 - doubly occupied, 1 - SpinUp,SpinDown" << endl; 413 // write out both types for easier changing afterwards 414 // switch (PsiType) { 415 // case 0: 416 *file << "MaxPsiDouble\t" << PlaneWaveSpecifics.MaxPsiDouble << "\t# here: specifying both maximum number of SpinUp- and -Down-states" << endl; 417 // break; 418 // case 1: 419 *file << "PsiMaxNoUp\t" << PlaneWaveSpecifics.PsiMaxNoUp << "\t# here: specifying maximum number of SpinUp-states" << endl; 420 *file << "PsiMaxNoDown\t" << PlaneWaveSpecifics.PsiMaxNoDown << "\t# here: specifying maximum number of SpinDown-states" << endl; 421 // break; 422 // } 427 *file << "MaxPsiDouble\t" << PlaneWaveSpecifics.MaxPsiDouble << "\t# here: specifying both maximum number of SpinUp- and -Down-states" << endl; 428 *file << "PsiMaxNoUp\t" << PlaneWaveSpecifics.PsiMaxNoUp << "\t# here: specifying maximum number of SpinUp-states" << endl; 429 *file << "PsiMaxNoDown\t" << PlaneWaveSpecifics.PsiMaxNoDown << "\t# here: specifying maximum number of SpinDown-states" << endl; 423 430 *file << "AddPsis\t\t" << PlaneWaveSpecifics.AddPsis << "\t# Additional unoccupied Psis for bandgap determination" << endl; 424 431 *file << endl; … … 427 434 *file << "IsAngstroem\t" << IsAngstroem << "\t# 0 - Bohr, 1 - Angstroem" << endl; 428 435 *file << "RelativeCoord\t" << RelativeCoord << "\t# whether ion coordinates are relative (1) or absolute (0)" << endl; 429 *file << endl;430 vector<atom *> allatoms = World::getInstance().getAllAtoms();431 436 map<int, int> ZtoIndexMap; 432 437 OutputElements(file, allatoms, ZtoIndexMap); 433 438 OutputAtoms(file, allatoms, ZtoIndexMap); 434 // result = result && mol->Checkout(file);435 // if (mol->MDSteps <=1 )436 // result = result && mol->Output(file);437 // else438 // result = result && mol->OutputTrajectories(file);439 439 } else { 440 440 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl); 441 441 } 442 442 } 443 444 445 /** Counts necessary number of valence electrons and returns number and SpinType. 446 * \param &allatoms all atoms to store away 447 */ 448 void PcpParser::CalculateOrbitals(vector<atom *> &allatoms) 449 { 450 PlaneWaveSpecifics.MaxPsiDouble = PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.PsiType = 0; 451 for (vector<atom *>::iterator runner = allatoms.begin(); runner != allatoms.end(); ++runner) { 452 PlaneWaveSpecifics.MaxPsiDouble += (*runner)->type->Valence; 453 } 454 cout << PlaneWaveSpecifics.MaxPsiDouble << endl; 455 PlaneWaveSpecifics.PsiMaxNoDown = PlaneWaveSpecifics.MaxPsiDouble/2 + (PlaneWaveSpecifics.MaxPsiDouble % 2); 456 PlaneWaveSpecifics.PsiMaxNoUp = PlaneWaveSpecifics.MaxPsiDouble/2; 457 PlaneWaveSpecifics.MaxPsiDouble /= 2; 458 PlaneWaveSpecifics.PsiType = (PlaneWaveSpecifics.PsiMaxNoDown == PlaneWaveSpecifics.PsiMaxNoUp) ? 0 : 1; 459 if ((PlaneWaveSpecifics.PsiType == 1) && (Parallelization.ProcPEPsi < 2) && ((PlaneWaveSpecifics.PsiMaxNoDown != 1) || (PlaneWaveSpecifics.PsiMaxNoUp != 0))) { 460 Parallelization.ProcPEGamma /= 2; 461 Parallelization.ProcPEPsi *= 2; 462 } else { 463 Parallelization.ProcPEGamma *= Parallelization.ProcPEPsi; 464 Parallelization.ProcPEPsi = 1; 465 } 466 cout << PlaneWaveSpecifics.PsiMaxNoDown << ">" << PlaneWaveSpecifics.PsiMaxNoUp << endl; 467 if (PlaneWaveSpecifics.PsiMaxNoDown > PlaneWaveSpecifics.PsiMaxNoUp) { 468 StepCounts.InitMaxMinStopStep = StepCounts.MaxMinStopStep = PlaneWaveSpecifics.PsiMaxNoDown; 469 cout << PlaneWaveSpecifics.PsiMaxNoDown << " " << StepCounts.InitMaxMinStopStep << endl; 470 } else { 471 StepCounts.InitMaxMinStopStep = StepCounts.MaxMinStopStep = PlaneWaveSpecifics.PsiMaxNoUp; 472 cout << PlaneWaveSpecifics.PsiMaxNoUp << " " << StepCounts.InitMaxMinStopStep << endl; 473 } 474 }; 443 475 444 476 /** Prints MaxTypes and list of elements to strea, … … 459 491 // print total element count 460 492 *file << "MaxTypes\t" << PresentElements.size() << "\t# maximum number of different ion types" << endl; 493 *file << endl; 461 494 // print element list 462 495 *file << "# Ion type data (PP = PseudoPotential, Z = atomic number)" << endl; … … 486 519 if (!Inserter.second) 487 520 Inserter.first->second += 1; 488 *file << "Ion_Type" << ZtoIndexMap[(*AtomRunner)->type->Z] << "_" << ZtoCountMap[Inserter.first->second] << "\t" << fixed << setprecision(9) << showpoint; 521 const int Z = (*AtomRunner)->type->Z; 522 *file << "Ion_Type" << ZtoIndexMap[Z] << "_" << ZtoCountMap[Z] << "\t" << fixed << setprecision(9) << showpoint; 489 523 *file << (*AtomRunner)->x[0] << "\t" << (*AtomRunner)->x[1] << "\t" << (*AtomRunner)->x[2]; 490 524 *file << "\t" << (*AtomRunner)->FixedIon; -
src/Parser/PcpParser.hpp
r1434c9 r650ca8c 10 10 11 11 #include <iostream> 12 #include " FormatParser.hpp"12 #include "Parser/FormatParser.hpp" 13 13 14 14 /** … … 29 29 void OutputAtoms(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap); 30 30 void OutputElements(ostream *file, vector<atom *> &allatoms, map<int, int> &ZtoIndexMap); 31 void CalculateOrbitals(vector<atom *> &allatoms); 31 32 32 33 struct StructParallelization {
Note:
See TracChangeset
for help on using the changeset viewer.