- Timestamp:
- Aug 6, 2008, 8:37:04 AM (16 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:
- b4b7c3
- Parents:
- 4aa03a
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/datacreator.cpp
r4aa03a rfb9364 520 520 void AbsEnergyPlotLine(ofstream &output, class MatrixContainer &Energy, const char *prefix, const char *xargument, const char *uses) 521 521 { 522 char item[1024];523 522 stringstream line(Energy.Header); 524 525 line >> item; 523 string token; 524 525 getline(line, token, '\t'); 526 526 for (int i=2; i<= Energy.ColumnCounter;i++) { 527 line >> item; 528 output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":(abs($" << i+2 << ")) " << uses; 527 getline(line, token, '\t'); 528 while (token[0] == ' ') // remove leading white spaces 529 token.erase(0,1); 530 output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":(abs($" << i+2 << ")) " << uses; 529 531 if (i != (Energy.ColumnCounter)) 530 532 output << ", \\"; … … 542 544 void EnergyPlotLine(ofstream &output, class MatrixContainer &Energy, const char *prefix, const char *xargument, const char *uses) 543 545 { 544 char item[1024];545 546 stringstream line(Energy.Header); 546 547 line >> item; 548 for (int i=2; i<= Energy.ColumnCounter;i++) { 549 line >> item; 550 output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":" << i+2 << " " << uses; 547 string token; 548 549 getline(line, token, '\t'); 550 for (int i=1; i<= Energy.ColumnCounter;i++) { 551 getline(line, token, '\t'); 552 while (token[0] == ' ') // remove leading white spaces 553 token.erase(0,1); 554 output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":" << i+2 << " " << uses; 551 555 if (i != (Energy.ColumnCounter)) 552 556 output << ", \\"; … … 564 568 void ForceMagnitudePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 565 569 { 566 char item[1024];567 570 stringstream line(Force.Header); 568 569 line >> item; 570 line >> item; 571 line >> item; 572 line >> item; 573 line >> item; 571 string token; 572 573 getline(line, token, '\t'); 574 getline(line, token, '\t'); 575 getline(line, token, '\t'); 576 getline(line, token, '\t'); 577 getline(line, token, '\t'); 574 578 for (int i=7; i< Force.ColumnCounter;i+=NDIM) { 575 line >> item; 576 item[strlen(item)-1] = '\0'; // kill residual index char (the '0') 577 output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses; 579 getline(line, token, '\t'); 580 while (token[0] == ' ') // remove leading white spaces 581 token.erase(0,1); 582 token.erase(token.length(), 1); // kill residual index char (the '0') 583 output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses; 578 584 if (i != (Force.ColumnCounter-1)) 579 585 output << ", \\"; 580 586 output << endl; 581 line >> item;582 line >> item;587 getline(line, token, '\t'); 588 getline(line, token, '\t'); 583 589 } 584 590 }; … … 593 599 void AbsFirstForceValuePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 594 600 { 595 char item[1024];596 601 stringstream line(Force.Header); 597 598 line >> item; 599 line >> item; 600 line >> item; 601 line >> item; 602 line >> item; 602 string token; 603 604 getline(line, token, '\t'); 605 getline(line, token, '\t'); 606 getline(line, token, '\t'); 607 getline(line, token, '\t'); 608 getline(line, token, '\t'); 603 609 for (int i=7; i< Force.ColumnCounter;i+=NDIM) { 604 line >> item; 605 item[strlen(item)-1] = '\0'; // kill residual index char (the '0') 606 output << "'" << prefix << ".dat' title '" << item << "' using " << xargument << ":(abs($" << i+1 << ")) " << uses; 610 getline(line, token, '\t'); 611 while (token[0] == ' ') // remove leading white spaces 612 token.erase(0,1); 613 token.erase(token.length(), 1); // kill residual index char (the '0') 614 output << "'" << prefix << ".dat' title '" << token << "' using " << xargument << ":(abs($" << i+1 << ")) " << uses; 607 615 if (i != (Force.ColumnCounter-1)) 608 616 output << ", \\"; 609 617 output << endl; 610 line >> item;611 line >> item;618 getline(line, token, '\t'); 619 getline(line, token, '\t'); 612 620 } 613 621 }; … … 622 630 void BoxesForcePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 623 631 { 624 char item[1024];625 632 stringstream line(Force.Header); 626 633 char *fillcolor[5] = {"black", "red", "blue", "green", "cyan"}; 627 628 line >> item; 629 line >> item; 630 line >> item; 631 line >> item; 632 line >> item; 634 string token; 635 636 getline(line, token, '\t'); 637 getline(line, token, '\t'); 638 getline(line, token, '\t'); 639 getline(line, token, '\t'); 640 getline(line, token, '\t'); 633 641 for (int i=7; i< Force.ColumnCounter;i+=NDIM) { 634 line >> item; 635 item[strlen(item)-1] = '\0'; // kill residual index char (the '0') 636 output << "'" << prefix << ".dat' title '" << item << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses << " " << fillcolor[(i-7)/3]; 642 getline(line, token, '\t'); 643 while (token[0] == ' ') // remove leading white spaces 644 token.erase(0,1); 645 token.erase(token.length(), 1); // kill residual index char (the '0') 646 output << "'" << prefix << ".dat' title '" << token << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):(sqrt($" << i+1 << "*$" << i+1 << "+$" << i+2 << "*$" << i+2 << "+$" << i+3 << "*$" << i+3 << ")) " << uses << " " << fillcolor[(i-7)/3]; 637 647 if (i != (Force.ColumnCounter-1)) 638 648 output << ", \\"; 639 649 output << endl; 640 line >> item;641 line >> item;650 getline(line, token, '\t'); 651 getline(line, token, '\t'); 642 652 } 643 653 }; … … 652 662 void BoxesFirstForceValuePlotLine(ofstream &output, class MatrixContainer &Force, const char *prefix, const char *xargument, const char *uses) 653 663 { 654 char item[1024];655 664 stringstream line(Force.Header); 656 665 char *fillcolor[5] = {"black", "red", "blue", "green", "cyan"}; 657 658 line >> item; 659 line >> item; 660 line >> item; 661 line >> item; 662 line >> item; 666 string token; 667 668 getline(line, token, '\t'); 669 getline(line, token, '\t'); 670 getline(line, token, '\t'); 671 getline(line, token, '\t'); 672 getline(line, token, '\t'); 663 673 for (int i=7; i< Force.ColumnCounter;i+=NDIM) { 664 line >> item; 665 item[strlen(item)-1] = '\0'; // kill residual index char (the '0') 666 output << "'" << prefix << ".dat' title '" << item << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):" << i+1 << " " << uses << " " << fillcolor[(i-7)/3]; 674 getline(line, token, '\t'); 675 while (token[0] == ' ') // remove leading white spaces 676 token.erase(0,1); 677 token.erase(token.length(), 1); // kill residual index char (the '0') 678 output << "'" << prefix << ".dat' title '" << token << "' using ($" << xargument << "+" << fixed << setprecision(1) << (double)((i-7)/3)*0.2 << "):" << i+1 << " " << uses << " " << fillcolor[(i-7)/3]; 667 679 if (i != (Force.ColumnCounter-1)) 668 680 output << ", \\"; 669 681 output << endl; 670 line >> item;671 line >> item;672 } 673 }; 682 getline(line, token, '\t'); 683 getline(line, token, '\t'); 684 } 685 }; -
src/parser.cpp
r4aa03a rfb9364 115 115 char *FragmentNumber = NULL; 116 116 stringstream file; 117 string token; 117 118 118 119 Header = (char *) Malloc(sizeof(char)*1023, "MatrixContainer::ParseMatrix: *EnergyHeader"); … … 167 168 //cout << line.str() << endl; 168 169 ColumnCounter=0; 169 while (!line.eof()) { 170 strcpy(filename,"@"); 171 line >> filename; 172 if (filename[0] != '@') 170 while ( getline(line,token, '\t') ) { 171 if (token.length() > 0) 173 172 ColumnCounter++; 174 173 }
Note:
See TracChangeset
for help on using the changeset viewer.