Ignore:
Timestamp:
Feb 9, 2011, 5:25:13 PM (14 years ago)
Author:
Frederik Heber <heber@…>
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:
acd638
Parents:
1a6bda
git-author:
Frederik Heber <heber@…> (02/09/11 16:18:50)
git-committer:
Frederik Heber <heber@…> (02/09/11 17:25:13)
Message:

Added tremolo's potential file parsing, reported by Daniel Dueck.

TremoloParser cannot interpret Type with HLA2 because it lacks mapping of the
value to an element. Hence, ...

  • new Action ParseTremoloPotentialsAction.
  • TremoloParser::knownTypes new map to contain: HLA2 -> H, ... map.
  • TremoloParser::createKnownTypesByIdentity() creates identity mapping.
  • TremoloParser::parseKnownTypes() parses potentials file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/unittests/ParserTremoloUnitTest.cpp

    r1a6bda r4d4d33  
    4444CPPUNIT_TEST_SUITE_REGISTRATION( ParserTremoloUnitTest );
    4545
    46 static string Tremolo_Atomdata1 = "# ATOMDATA\tId\tname\tType\tx=3\n";
    47 static string Tremolo_Atomdata2 = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
    48 static string Tremolo_invalidkey = "#\n#ATOMDATA Id name foo Type x=3\n\n\n";
    49 static string Tremolo_velocity = "#\n#ATOMDATA Id name Type u=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
    50 static string Tremolo_neighbours = "#\n#ATOMDATA Id Type neighbors=2\n1 H 3 0\n2 H 3 0\n3 O 1 2\n";
    51 static string Tremolo_improper = "#\n#ATOMDATA Id Type imprData\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
    52 static string Tremolo_torsion = "#\n#ATOMDATA Id Type torsion\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
    53 static string Tremolo_full = "# ATOMDATA\tx=3\tu=3\tF\tstress\tId\tneighbors=5\timprData\tGroupMeasureTypeNo\tType\textType\tname\tresName\tchainID\tresSeq\toccupancy\ttempFactor\tsegID\tCharge\tcharge\tGrpTypeNo\ttorsion\n0\t0\t0\t0\t0\t0\t0\t0\t1\t0\t0\t0\t0\t0\t-\t0\tH\t-\t-\t-\t0\t0\t0\t0\t0\t0\t0\t0\t-\t\n";
     46static string Tremolo_Atomdata1 = "\
     47# ATOMDATA\tId\tname\tType\tx=3\n";
     48static string Tremolo_Atomdata2 = "\
     49#\n\
     50#ATOMDATA Id name Type x=3\n\
     511 hydrogen H 3.0 4.5 0.1\n\
     52\n";
     53static string Tremolo_invalidkey = "\
     54#\n\
     55#ATOMDATA Id name foo Type x=3\n\
     56\n\n";
     57static string Tremolo_velocity = "\
     58#\n\
     59#ATOMDATA Id name Type u=3\n\
     601 hydrogen H 3.0 4.5 0.1\n\
     61\n";
     62static string Tremolo_neighbours = "#\n\
     63#ATOMDATA Id Type neighbors=2\n\
     641 H 3 0\n\
     652 H 3 0\n\
     663 O 1 2\n";
     67static string Tremolo_improper = "\
     68#\n\
     69#ATOMDATA Id Type imprData\n\
     708 H 9-10\n\
     719 H 10-8,8-10\n\
     7210 O -\n";
     73static string Tremolo_torsion = "\
     74#\n\
     75#ATOMDATA Id Type torsion\n\
     768 H 9-10\n\
     779 H 10-8,8-10\n\
     7810 O -\n";
     79static string Tremolo_full = "\
     80# ATOMDATA\tx=3\tu=3\tF\tstress\tId\tneighbors=5\timprData\tGroupMeasureTypeNo\tType\textType\tname\tresName\tchainID\tresSeq\toccupancy\ttempFactor\tsegID\tCharge\tcharge\tGrpTypeNo\ttorsion\n\
     810\t0\t0\t0\t0\t0\t0\t0\t1\t0\t0\t0\t0\t0\t-\t0\tH\t-\t-\t-\t0\t0\t0\t0\t0\t0\t0\t0\t-\t\n";
    5482
    5583void ParserTremoloUnitTest::setUp() {
     
    79107    std::vector<atom *> atoms = World::getInstance().getAllAtoms();
    80108    testParser->save(&output, atoms);
     109//    std::cout << output.str() << std::endl;
     110//    std::cout << Tremolo_Atomdata1 << std::endl;
    81111    CPPUNIT_ASSERT(Tremolo_Atomdata1 == output.str());
    82112    input.clear();
     
    90120    std::vector<atom *> atoms = World::getInstance().getAllAtoms();
    91121    testParser->save(&output, atoms);
     122    std::cout << output.str() << std::endl;
    92123    CPPUNIT_ASSERT(output.str().find("hydrogen") != string::npos);
    93124    input.clear();
     
    149180    testParser->save(&output, atoms);
    150181    CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
     182    std::cout << output.str() << std::endl;
    151183    CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
    152184    input.clear();
     
    166198    testParser->save(&output, atoms);
    167199    CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
     200    std::cout << output.str() << std::endl;
    168201    CPPUNIT_ASSERT(output.str().find("2-0,0-2") != string::npos);
    169202    input.clear();
Note: See TracChangeset for help on using the changeset viewer.