Changeset 47d041 for src/Parser
- Timestamp:
- Nov 3, 2011, 7:44:01 PM (13 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:
- 41a467
- Parents:
- 50e4e5
- git-author:
- Frederik Heber <heber@…> (10/27/11 11:53:58)
- git-committer:
- Frederik Heber <heber@…> (11/03/11 19:44:01)
- Location:
- src/Parser
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ChangeTracker.cpp
r50e4e5 r47d041 63 63 */ 64 64 void ChangeTracker::saveStatus() { 65 DoLog(0) && (Log() << Verbose(0) << "Saving changes." << std::endl);65 LOG(0, "Saving changes."); 66 66 if (hasChanged()) { 67 67 notifyAll(); -
src/Parser/FormatParserStorage.cpp
r50e4e5 r47d041 183 183 { 184 184 if (ParserLookupNames.find(type) == ParserLookupNames.end()) { 185 DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);185 ELOG(1, "Unknown type " << type << "."); 186 186 return ParserTypes_end; 187 187 } else … … 192 192 { 193 193 if (ParserLookupSuffixes.find(type) == ParserLookupSuffixes.end()) { 194 DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);194 ELOG(1, "Unknown type " << type << "."); 195 195 return ParserTypes_end; 196 196 } else … … 201 201 { 202 202 if (ParserNames.find(type) == ParserNames.end()) { 203 DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);203 ELOG(1, "Unknown type " << type << "."); 204 204 return unknownTypeString; 205 205 } else … … 210 210 { 211 211 if (ParserSuffixes.find(type) == ParserSuffixes.end()) { 212 DoeLog(1) && (eLog() << Verbose(1) << "Unknown type " << type << "." << endl);212 ELOG(1, "Unknown type " << type << "."); 213 213 return unknownTypeString; 214 214 } else -
src/Parser/FormatParser_Parameters.cpp
r50e4e5 r47d041 150 150 std::string line; 151 151 std::getline( ist, line ); 152 // DoLog(0) && (Log() << Verbose(0) << "INFO: full line of parameters is '" << line << "'" << std::endl);152 //LOG(0, "INFO: full line of parameters is '" << line << "'"); 153 153 tokenizer tokens(line, semicolonsep); 154 154 ASSERT(tokens.begin() != tokens.end(), -
src/Parser/MpqcParser.cpp
r50e4e5 r47d041 121 121 newAtom->setPosition(X); 122 122 newmol->AddAtom(newAtom); 123 DoLog(1) && (Log() << Verbose(1) << "Adding atom " << *newAtom << std::endl);123 LOG(1, "Adding atom " << *newAtom); 124 124 } 125 125 } … … 156 156 linestream >> getParams(); 157 157 } else { // unknown keys are simply ignored as long as parser is incomplete 158 DoLog(2) && (Log() << Verbose(2) << "INFO: '"+key+"' is unknown and ignored." << std::endl);158 LOG(2, "INFO: '"+key+"' is unknown and ignored."); 159 159 } 160 160 } … … 233 233 // first without hessian 234 234 if (file->fail()) { 235 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file." << endl);235 ELOG(1, "Cannot open mpqc output file."); 236 236 } else { 237 237 *file << "% Created by MoleCuilder" << endl; … … 300 300 *file << "\t)" << endl; 301 301 } else { 302 DoeLog(0) && (eLog() << Verbose(0) 303 << "Unknown level of theory requested for MPQC output file." << std::endl); 302 ELOG(0, "Unknown level of theory requested for MPQC output file."); 304 303 } 305 304 *file << ")" << endl; -
src/Parser/MpqcParser_Parameters.cpp
r50e4e5 r47d041 185 185 bool MpqcParser_Parameters::checkWorldElementsAgainstCurrentBasis() const 186 186 { 187 DoeLog(0) && (eLog() << Verbose(0) 188 << "MpqcParser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet." 189 << std::endl); 187 ELOG(0, "MpqcParser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet."); 190 188 191 189 return false; -
src/Parser/PcpParser.cpp
r50e4e5 r47d041 154 154 { 155 155 if (file->fail()) { 156 DoeLog(1) && (eLog()<< Verbose(1) << "could not access given file" << endl);156 ELOG(1, "could not access given file"); 157 157 return; 158 158 } … … 175 175 // 1. parse in options 176 176 if (!ParseForParameter(verbose,FileBuffer, "mainname", 0, 1, 1, string_type, (Paths.mainname), 1, critical)) { 177 DoeLog(1) && (eLog()<< Verbose(1) << "mainname is missing, is file empty?" << endl);177 ELOG(1, "mainname is missing, is file empty?"); 178 178 } else { 179 179 ParseForParameter(verbose,FileBuffer, "defaultpath", 0, 1, 1, string_type, (Paths.defaultpath), 1, critical); … … 389 389 void FormatParser< pcp >::save(std::ostream* file, const std::vector<atom *> &atoms) 390 390 { 391 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pcp." << std::endl);391 LOG(0, "Saving changes to pcp."); 392 392 393 393 const RealSpaceMatrix &domain = World::getInstance().getDomain().getM(); … … 486 486 OutputAtoms(file, atoms, ZtoIndexMap); 487 487 } else { 488 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file." << endl);488 ELOG(1, "Cannot open output file."); 489 489 } 490 490 } … … 616 616 } else { 617 617 if ((Thermostats->TargetTemp != 0)) 618 DoLog(2) && (Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl);618 LOG(2, "No thermostat chosen despite finite temperature MD, falling back to None."); 619 619 Thermostats->chooseNone(); 620 620 } -
src/Parser/PdbParser.cpp
r50e4e5 r47d041 93 93 string token; 94 94 if (location != string::npos) { 95 // DoLog(1) && (Log() << Verbose(1) << "Found space at position " << space_location << std::endl);95 //LOG(1, "Found space at position " << space_location); 96 96 token = line.substr(0,space_location); 97 97 } else { … … 99 99 } 100 100 101 // DoLog(1) && (Log() << Verbose(1) << "Token is " << token << std::endl);101 //LOG(1, "Token is " << token); 102 102 if (knownTokens.count(token) == 0) 103 103 return PdbKey::NoToken; … … 155 155 default: 156 156 // TODO: put a throw here 157 DoeLog(2) && (eLog() << Verbose(2) << "Unknown token: '" << line << "' for time step " << step << "." << std::endl);157 ELOG(2, "Unknown token: '" << line << "' for time step " << step << "."); 158 158 //ASSERT(0, "FormatParser< pdb >::load() - Unknown token in line "+toString(linecount)+": "+line+"."); 159 159 break; … … 180 180 void FormatParser< pdb >::save(ostream* file, const std::vector<atom *> &AtomList) 181 181 { 182 DoLog(0) && (Log() << Verbose(0) << "Saving changes to pdb." << std::endl);182 LOG(0, "Saving changes to pdb."); 183 183 184 184 // check for maximum number of time steps … … 479 479 { 480 480 pair<std::map<size_t,size_t>::iterator, bool > inserter; 481 // DoLog(1) && (Log() << Verbose(1) << "FormatParser< pdb >::setAtomId() - Inserting (" 482 // << localatomid << " -> " << atomid << ")." << std::endl); 481 // LOG(1, "FormatParser< pdb >::setAtomId() - Inserting (" << localatomid << " -> " << atomid << ")."); 483 482 inserter = atomIdMap.insert( make_pair(localatomid, atomid) ); 484 483 ASSERT(inserter.second, "FormatParser< pdb >::setAtomId: atomId already present in Map."); … … 623 622 // SerialSet.insert(id); 624 623 // atomInfo.set(PdbKey::serial, toString(id)); 625 // DoeLog(2) && (eLog() << Verbose(2) 626 // << "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, " 627 // << "assigning " << toString(id) << " instead." << std::endl); 624 // ELOG(2, "Serial " << atomInfo.get<std::string>(PdbKey::serial) << " already present, " 625 // << "assigning " << toString(id) << " instead."); 628 626 // } 629 627 630 628 // check whether serial exists, if so, assign next available 631 629 632 // DoLog(2) && (Log() << Verbose(2) <<"Split line:"630 // LOG(2, "Split line:" 633 631 // << line.substr(6,5) << "|" 634 632 // << line.substr(12,4) << "|" … … 644 642 // << line.substr(60,6) << "|" 645 643 // << line.substr(76,2) << "|" 646 // << line.substr(78,2) << std::endl);644 // << line.substr(78,2)); 647 645 648 646 if (FirstTimestep) { … … 746 744 const PdbAtomInfoContainer &atomInfo = additionalAtomData.at(newAtom->getId()); // operator[] const does not exist 747 745 748 DoLog(1) && (Log() << Verbose(1) << "We know about atom " << newAtom->getId() << ":" << std::endl);749 DoLog(1) && (Log() << Verbose(1) << "\ttoken is " << atomInfo.get<std::string>(PdbKey::token) << std::endl);750 DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get<int>(PdbKey::serial) << std::endl);751 DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get<std::string>(PdbKey::name) << std::endl);752 DoLog(1) && (Log() << Verbose(1) << "\taltLoc is " << atomInfo.get<std::string>(PdbKey::altLoc) << std::endl);753 DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get<std::string>(PdbKey::resName) << std::endl);754 DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get<std::string>(PdbKey::chainID) << std::endl);755 DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get<int>(PdbKey::resSeq) << std::endl);756 DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get<std::string>(PdbKey::iCode) << std::endl);757 DoLog(1) && (Log() << Verbose(1) << "\tX is " << atomInfo.get<double>(PdbKey::X) << std::endl);758 DoLog(1) && (Log() << Verbose(1) << "\tY is " << atomInfo.get<double>(PdbKey::Y) << std::endl);759 DoLog(1) && (Log() << Verbose(1) << "\tZ is " << atomInfo.get<double>(PdbKey::Z) << std::endl);760 DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get<double>(PdbKey::occupancy) << std::endl);761 DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get<double>(PdbKey::tempFactor) << std::endl);762 DoLog(1) && (Log() << Verbose(1) << "\telement is '" << *(newAtom->getType()) << "'" << std::endl);763 DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get<int>(PdbKey::charge) << std::endl);746 LOG(1, "We know about atom " << newAtom->getId() << ":"); 747 LOG(1, "\ttoken is " << atomInfo.get<std::string>(PdbKey::token)); 748 LOG(1, "\tserial is " << atomInfo.get<int>(PdbKey::serial)); 749 LOG(1, "\tname is " << atomInfo.get<std::string>(PdbKey::name)); 750 LOG(1, "\taltLoc is " << atomInfo.get<std::string>(PdbKey::altLoc)); 751 LOG(1, "\tresName is " << atomInfo.get<std::string>(PdbKey::resName)); 752 LOG(1, "\tchainID is " << atomInfo.get<std::string>(PdbKey::chainID)); 753 LOG(1, "\tresSeq is " << atomInfo.get<int>(PdbKey::resSeq)); 754 LOG(1, "\tiCode is " << atomInfo.get<std::string>(PdbKey::iCode)); 755 LOG(1, "\tX is " << atomInfo.get<double>(PdbKey::X)); 756 LOG(1, "\tY is " << atomInfo.get<double>(PdbKey::Y)); 757 LOG(1, "\tZ is " << atomInfo.get<double>(PdbKey::Z)); 758 LOG(1, "\toccupancy is " << atomInfo.get<double>(PdbKey::occupancy)); 759 LOG(1, "\ttempFactor is " << atomInfo.get<double>(PdbKey::tempFactor)); 760 LOG(1, "\telement is '" << *(newAtom->getType()) << "'"); 761 LOG(1, "\tcharge is " << atomInfo.get<int>(PdbKey::charge)); 764 762 } 765 763 … … 855 853 856 854 status = status && (atomInfo.get<std::string>(PdbKey::serial) == OtheratomInfo.get<std::string>(PdbKey::serial)); 857 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in serials!" << std::endl);855 if (!status) ELOG(1, "Mismatch in serials!"); 858 856 status = status && (atomInfo.get<std::string>(PdbKey::name) == OtheratomInfo.get<std::string>(PdbKey::name)); 859 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in names!" << std::endl);857 if (!status) ELOG(1, "Mismatch in names!"); 860 858 status = status && (atomInfo.get<std::string>(PdbKey::altLoc) == OtheratomInfo.get<std::string>(PdbKey::altLoc)); 861 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in altLocs!" << std::endl);859 if (!status) ELOG(1, "Mismatch in altLocs!"); 862 860 status = status && (atomInfo.get<std::string>(PdbKey::resName) == OtheratomInfo.get<std::string>(PdbKey::resName)); 863 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resNames!" << std::endl);861 if (!status) ELOG(1, "Mismatch in resNames!"); 864 862 status = status && (atomInfo.get<std::string>(PdbKey::chainID) == OtheratomInfo.get<std::string>(PdbKey::chainID)); 865 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in chainIDs!" << std::endl);863 if (!status) ELOG(1, "Mismatch in chainIDs!"); 866 864 status = status && (atomInfo.get<std::string>(PdbKey::resSeq) == OtheratomInfo.get<std::string>(PdbKey::resSeq)); 867 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resSeqs!" << std::endl);865 if (!status) ELOG(1, "Mismatch in resSeqs!"); 868 866 status = status && (atomInfo.get<std::string>(PdbKey::iCode) == OtheratomInfo.get<std::string>(PdbKey::iCode)); 869 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in iCodes!" << std::endl);867 if (!status) ELOG(1, "Mismatch in iCodes!"); 870 868 status = status && (atomInfo.get<std::string>(PdbKey::occupancy) == OtheratomInfo.get<std::string>(PdbKey::occupancy)); 871 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in occupancies!" << std::endl);869 if (!status) ELOG(1, "Mismatch in occupancies!"); 872 870 status = status && (atomInfo.get<std::string>(PdbKey::tempFactor) == OtheratomInfo.get<std::string>(PdbKey::tempFactor)); 873 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in tempFactors!" << std::endl);871 if (!status) ELOG(1, "Mismatch in tempFactors!"); 874 872 status = status && (atomInfo.get<std::string>(PdbKey::charge) == OtheratomInfo.get<std::string>(PdbKey::charge)); 875 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in charges!" << std::endl);873 if (!status) ELOG(1, "Mismatch in charges!"); 876 874 } 877 875 } -
src/Parser/Psi3Parser.cpp
r50e4e5 r47d041 121 121 newAtom->setPosition(X); 122 122 newmol->AddAtom(newAtom); 123 DoLog(1) && (Log() << Verbose(1) << "Adding atom " << *newAtom << std::endl);123 LOG(1, "Adding atom " << *newAtom); 124 124 } 125 125 if ((Psi3Section) && (!GeometrySection)) { … … 171 171 // first without hessian 172 172 if (file->fail()) { 173 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open psi3 output file." << std::endl);173 ELOG(1, "Cannot open psi3 output file."); 174 174 } else { 175 175 *file << "% Created by MoleCuilder" << std::endl; … … 214 214 && (reference != getParams().getReferenceName(Psi3Parser_Parameters::TWOCON))) 215 215 { 216 DoeLog(0) && (eLog() << Verbose(0) 217 << "Unknown level of reference requested for Psi3 output file." << std::endl); 216 ELOG(0, "Unknown level of reference requested for Psi3 output file."); 218 217 } 219 218 *file << "\t" << getParams().getParameterName(Psi3Parser_Parameters::freeze_coreParam) -
src/Parser/Psi3Parser_Parameters.cpp
r50e4e5 r47d041 269 269 bool Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() const 270 270 { 271 DoeLog(0) && (eLog() << Verbose(0) 272 << "Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet." 273 << std::endl); 271 ELOG(0, "Psi3Parser_Parameters::checkWorldElementsAgainstCurrentBasis() - not implemented yet."); 274 272 275 273 return false; -
src/Parser/TremoloParser.cpp
r50e4e5 r47d041 140 140 newmol->getAtomCount(); 141 141 142 DoLog(3) && (Log() << Verbose(3) << "usedFields after load contains: " << usedFields << std::endl);142 LOG(3, "usedFields after load contains: " << usedFields); 143 143 144 144 processNeighborInformation(); … … 154 154 */ 155 155 void FormatParser< tremolo >::save(ostream* file, const std::vector<atom *> &AtomList) { 156 DoLog(0) && (Log() << Verbose(0) << "Saving changes to tremolo." << std::endl);156 LOG(0, "Saving changes to tremolo."); 157 157 158 158 vector<atom*>::const_iterator atomIt; … … 161 161 162 162 163 DoLog(3) && (Log() << Verbose(3) << "usedFields before save contains: " << usedFields << std::endl);164 165 DoLog(3) && (Log() << Verbose(3) << "additionalAtomData contains: " << additionalAtomData << std::endl);166 167 DoLog(3) && (Log() << Verbose(3) << "additionalAtomData contains: " << additionalAtomData << std::endl);163 LOG(3, "usedFields before save contains: " << usedFields); 164 165 LOG(3, "additionalAtomData contains: " << additionalAtomData); 166 167 LOG(3, "additionalAtomData contains: " << additionalAtomData); 168 168 169 169 *file << "# ATOMDATA"; … … 231 231 TremoloKey::atomDataKey currentField; 232 232 233 DoLog(4) && (Log() << Verbose(4) << "INFO: Saving atom " << *currentAtom << ", its father id is " << currentAtom->GetTrueFather()->getId() << std::endl);233 LOG(4, "INFO: Saving atom " << *currentAtom << ", its father id is " << currentAtom->GetTrueFather()->getId()); 234 234 235 235 for (it = usedFields.begin(); it != usedFields.end(); it++) { … … 238 238 case TremoloKey::x : 239 239 // for the moment, assume there are always three dimensions 240 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPosition() << std::endl);240 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getPosition()); 241 241 *file << currentAtom->at(0) << "\t"; 242 242 *file << currentAtom->at(1) << "\t"; … … 245 245 case TremoloKey::u : 246 246 // for the moment, assume there are always three dimensions 247 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocity() << std::endl);247 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getAtomicVelocity()); 248 248 *file << currentAtom->getAtomicVelocity()[0] << "\t"; 249 249 *file << currentAtom->getAtomicVelocity()[1] << "\t"; … … 253 253 if (additionalAtomData.count(currentAtom->getId())) { 254 254 if (additionalAtomData[currentAtom->getId()].get(currentField) != "-") { 255 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField) << std::endl);255 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField)); 256 256 *file << additionalAtomData[currentAtom->getId()].get(currentField) << "\t"; 257 257 } else { 258 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " default value: " << currentAtom->getType()->getSymbol() << std::endl);258 LOG(3, "Writing for type " << knownKeyNames[currentField] << " default value: " << currentAtom->getType()->getSymbol()); 259 259 *file << currentAtom->getType()->getSymbol() << "\t"; 260 260 } 261 261 } else if (additionalAtomData.count(currentAtom->GetTrueFather()->getId())) { 262 262 if (additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) != "-") { 263 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) << std::endl);263 LOG(3, "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField)); 264 264 *file << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) << "\t"; 265 265 } else { 266 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " default value from father: " << currentAtom->GetTrueFather()->getType()->getSymbol() << std::endl);266 LOG(3, "Writing for type " << knownKeyNames[currentField] << " default value from father: " << currentAtom->GetTrueFather()->getType()->getSymbol()); 267 267 *file << currentAtom->GetTrueFather()->getType()->getSymbol() << "\t"; 268 268 } 269 269 } else { 270 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " its default value: " << currentAtom->getType()->getSymbol() << std::endl);270 LOG(3, "Writing for type " << knownKeyNames[currentField] << " its default value: " << currentAtom->getType()->getSymbol()); 271 271 *file << currentAtom->getType()->getSymbol() << "\t"; 272 272 } 273 273 break; 274 274 case TremoloKey::Id : 275 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getId()+1 << std::endl);275 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << currentAtom->getId()+1); 276 276 *file << currentAtom->getId()+1 << "\t"; 277 277 break; 278 278 case TremoloKey::neighbors : 279 DoLog(3) && (Log() << Verbose(3) << "Writing type " << knownKeyNames[currentField] << std::endl);279 LOG(3, "Writing type " << knownKeyNames[currentField]); 280 280 writeNeighbors(file, atoi(it->substr(it->find("=") + 1, 1).c_str()), currentAtom); 281 281 break; 282 282 case TremoloKey::resSeq : 283 283 if (additionalAtomData.count(currentAtom->getId())) { 284 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField) << std::endl);284 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField)); 285 285 *file << additionalAtomData[currentAtom->getId()].get(currentField); 286 286 } else if (currentAtom->getMolecule() != NULL) { 287 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " its own id: " << currentAtom->getMolecule()->getId()+1 << std::endl);287 LOG(3, "Writing for type " << knownKeyNames[currentField] << " its own id: " << currentAtom->getMolecule()->getId()+1); 288 288 *file << setw(4) << currentAtom->getMolecule()->getId()+1; 289 289 } else { 290 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " default value: " << defaultAdditionalData.get(currentField) << std::endl);290 LOG(3, "Writing for type " << knownKeyNames[currentField] << " default value: " << defaultAdditionalData.get(currentField)); 291 291 *file << defaultAdditionalData.get(currentField); 292 292 } … … 295 295 default : 296 296 if (additionalAtomData.count(currentAtom->getId())) { 297 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField) << std::endl);297 LOG(3, "Writing for type " << knownKeyNames[currentField] << ": " << additionalAtomData[currentAtom->getId()].get(currentField)); 298 298 *file << additionalAtomData[currentAtom->getId()].get(currentField); 299 299 } else if (additionalAtomData.count(currentAtom->GetTrueFather()->getId())) { 300 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField) << std::endl);300 LOG(3, "Writing for type " << knownKeyNames[currentField] << " stuff from father: " << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField)); 301 301 *file << additionalAtomData[currentAtom->GetTrueFather()->getId()].get(currentField); 302 302 } else { 303 DoLog(3) && (Log() << Verbose(3) << "Writing for type " << knownKeyNames[currentField] << " the default: " << defaultAdditionalData.get(currentField) << std::endl);303 LOG(3, "Writing for type " << knownKeyNames[currentField] << " the default: " << defaultAdditionalData.get(currentField)); 304 304 *file << defaultAdditionalData.get(currentField); 305 305 } … … 360 360 usedFields.push_back(keyword); 361 361 } 362 // DoLog(1) && (Log() << Verbose(1) << "INFO: " << usedFields << std::endl);362 //LOG(1, "INFO: " << usedFields); 363 363 } 364 364 … … 409 409 currentField = knownKeys[keyName]; 410 410 const string word = *tok_iter; 411 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with remaining data " << word << std::endl);411 LOG(4, "INFO: Parsing key " << keyName << " with remaining data " << word); 412 412 switch (currentField) { 413 413 case TremoloKey::x : … … 415 415 for (int i=0;i<NDIM;i++) { 416 416 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for x["+toString(i)+"]!"); 417 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);417 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 418 418 newAtom->set(i, toDouble(*tok_iter)); 419 419 tok_iter++; … … 424 424 for (int i=0;i<NDIM;i++) { 425 425 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for u["+toString(i)+"]!"); 426 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);426 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 427 427 tempVector[i] = toDouble(*tok_iter); 428 428 tok_iter++; … … 433 433 { 434 434 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!"); 435 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);435 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 436 436 std::string element(knownTypes[(*tok_iter)]); 437 437 // put type name into container for later use 438 438 atomInfo->set(currentField, *tok_iter); 439 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing element " << (*tok_iter) << " as " << element << " according to KnownTypes." << std::endl);439 LOG(4, "INFO: Parsing element " << (*tok_iter) << " as " << element << " according to KnownTypes."); 440 440 tok_iter++; 441 441 newAtom->setType(World::getInstance().getPeriode()->FindElement(element)); … … 445 445 case TremoloKey::Id : 446 446 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!"); 447 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);447 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 448 448 atomIdMap[toInt(*tok_iter)] = newAtom->getId(); 449 449 tok_iter++; … … 452 452 for (int i=0;i<atoi(it->substr(it->find("=") + 1, 1).c_str());i++) { 453 453 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!"); 454 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);454 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 455 455 lineStream << *tok_iter << "\t"; 456 456 tok_iter++; … … 461 461 default : 462 462 ASSERT(tok_iter != tokens.end(), "FormatParser< tremolo >::readAtomDataLine() - no value for "+keyName+"!"); 463 DoLog(4) && (Log() << Verbose(4) << "INFO: Parsing key " << keyName << " with next token " << *tok_iter << std::endl);463 LOG(4, "INFO: Parsing key " << keyName << " with next token " << *tok_iter); 464 464 atomInfo->set(currentField, *tok_iter); 465 465 tok_iter++; … … 468 468 } 469 469 if (newmol != NULL) { 470 // DoLog(0) && (Log() << Verbose(0) << "New Atom: " << *newAtom << " with type " << newAtom->getType()->getName() << std::endl);470 //LOG(0, "New Atom: " << *newAtom << " with type " << newAtom->getType()->getName()); 471 471 newmol->AddAtom(newAtom); 472 472 } … … 486 486 // 0 is used to fill empty neighbor positions in the tremolo file. 487 487 if (neighborId > 0) { 488 DoLog(4) && (Log() << Verbose(4) 489 << "Atom with global id " << atomId 490 << " has neighbour with serial " << neighborId 491 << std::endl); 488 LOG(4, "INFO: Atom with global id " << atomId 489 << " has neighbour with serial " << neighborId); 492 490 additionalAtomData[atomId].neighbors.push_back(neighborId); 493 491 } … … 530 528 neighbor != currentInfo->second.neighbors.end(); neighbor++ 531 529 ) { 532 // DoLog(1) && (Log() << Verbose(1) << "Creating bond between ("530 // LOG(1, "INFO: Creating bond between (" 533 531 // << currentInfo->first 534 532 // << ") and (" 535 // << atomIdMap[*neighbor] << "|" << *neighbor << ")" << std::endl);533 // << atomIdMap[*neighbor] << "|" << *neighbor << ")"); 536 534 World::getInstance().getAtom(AtomById(currentInfo->first)) 537 535 ->addBond(WorldTime::getTime(), World::getInstance().getAtom(AtomById(atomIdMap[*neighbor]))); … … 630 628 knownTypes.clear(); 631 629 632 DoLog(3) && (Log() << Verbose(3) << "additionalAtomData contains: " << additionalAtomData << std::endl);630 LOG(3, "additionalAtomData contains: " << additionalAtomData); 633 631 634 632 // parse in file … … 640 638 while (file.good()) { 641 639 std::getline( file, line ); 642 DoLog(4) && (Log() << Verbose(4) << "INFO: full line of parameters is '" << line << "'" << std::endl);640 LOG(4, "INFO: full line of parameters is '" << line << "'"); 643 641 if (line.find("particle:") != string::npos) { 644 DoLog(3) && (Log() << Verbose(3) << "INFO: found line '" << line << "' containing keyword 'particle:'." << std::endl);642 LOG(3, "INFO: found line '" << line << "' containing keyword 'particle:'."); 645 643 tokenizer tokens(line, tokensep); 646 644 ASSERT(tokens.begin() != tokens.end(), … … 653 651 ++tok_iter) { 654 652 if ((*tok_iter).find("particle_type") != string::npos) { 655 DoLog(3) && (Log() << Verbose(3) << "INFO: found line '" << line << "' containing keyword 'particle_type'." << std::endl);653 LOG(3, "INFO: found line '" << line << "' containing keyword 'particle_type'."); 656 654 tokenizer token((*tok_iter), equalitysep); 657 655 ASSERT(token.begin() != token.end(), … … 662 660 } 663 661 if ((*tok_iter).find("element_name") != string::npos) { 664 DoLog(3) && (Log() << Verbose(3) << "INFO: found line '" << line << "' containing keyword 'element_name'." << std::endl);662 LOG(3, "INFO: found line '" << line << "' containing keyword 'element_name'."); 665 663 tokenizer token((*tok_iter), equalitysep); 666 664 ASSERT(token.begin() != token.end(), … … 673 671 if ((particle_type != "NULL") && (element_type != "NULL")) { 674 672 if (periode->FindElement(element_type) != NULL) { 675 DoLog(1) && (Log() << Verbose(1) << "INFO: Added Type " << particle_type << " as reference to element " << element_type << "." << std::endl);673 LOG(1, "INFO: Added Type " << particle_type << " as reference to element " << element_type << "."); 676 674 knownTypes.insert( make_pair (particle_type, element_type) ); 677 675 } else { 678 DoeLog(1) && (Log() << Verbose(1) << "INFO: Either Type " << particle_type << " or " << element_type << " could not be recognized." << std::endl);676 ELOG(1, "INFO: Either Type " << particle_type << " or " << element_type << " could not be recognized." ); 679 677 } 680 678 } else { 681 DoeLog(1) && (Log() << Verbose(1) << "INFO: Desired element " << element_type << " is not known." << std::endl);679 ELOG(1, "INFO: Desired element " << element_type << " is not known." ); 682 680 } 683 681 } -
src/Parser/XyzParser.cpp
r50e4e5 r47d041 139 139 */ 140 140 void FormatParser< xyz >::save(ostream* file, const std::vector<atom *> &atoms) { 141 DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl);141 LOG(0, "Saving changes to xyz."); 142 142 143 143 // get max and min trajectories
Note:
See TracChangeset
for help on using the changeset viewer.