Changeset 47ed3d for src/Element


Ignore:
Timestamp:
Apr 4, 2012, 11:30:11 AM (13 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:
ed26ae
Parents:
03a589
git-author:
Frederik Heber <heber@…> (03/26/12 07:48:22)
git-committer:
Frederik Heber <heber@…> (04/04/12 11:30:11)
Message:

Removed some old output functions in element, Formula, and molecule.

  • This is preparatory for refactoring element into a more general concept that can contain both chemical and derived elements suitable for empirical potential parametrization storage.
  • Removed functions in element: Output(), Checkout().
  • Removed function Formula::checkOut().
  • Removed function molecule::Checkout().
  • functionality added to periodentafel::OutputElement().
Location:
src/Element
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Element/element.cpp

    r03a589 r47ed3d  
    104104}
    105105
    106 /** Prints element data to \a *out.
    107  * \param *out outstream
    108  */
    109 bool element::Output(ostream * const out) const
    110 {
    111   if (out != NULL) {
    112     *out << name << "\t" << symbol << "\t" << period << "\t" << group << "\t" << block << "\t" << Z << "\t" << mass << "\t" << CovalentRadius << "\t" << VanDerWaalsRadius << endl;
    113     //*out << Z << "\t"  << fixed << setprecision(11) << showpoint << mass << "g/mol\t" << name << "\t" << symbol << "\t" << endl;
    114     return true;
    115   } else
    116     return false;
    117 };
    118 
    119 /** Prints element data to \a *out.
    120  * \param *out outstream
    121  * \param No  cardinal number of element
    122  * \param NoOfAtoms total number of atom of this element type
    123  */
    124 bool element::Checkout(ostream * const out, const int Number, const int NoOfAtoms) const
    125 {
    126   if (out != NULL) {
    127     *out << "Ion_Type" << Number << "\t" << NoOfAtoms << "\t" << Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << mass << "\t" << name << "\t" << symbol <<endl;
    128     return true;
    129   } else
    130     return false;
    131 };
    132 
    133106atomicNumber_t element::getNumber() const{
    134107  return Z;
  • TabularUnified src/Element/element.hpp

    r03a589 r47ed3d  
    5959    void setName(const std::string &temp);
    6060
    61     //> print element entries to screen
    62     bool Output(std::ostream * const out) const;
    63     bool Checkout(std::ostream * const out, const int No, const int NoOfAtoms) const;
    64 
    6561    bool operator==(const element &other) const;
    6662
  • TabularUnified src/Element/periodentafel.cpp

    r03a589 r47ed3d  
    181181}
    182182
     183/** Prints element data to \a *out.
     184 * \param *out outstream
     185 */
     186void periodentafel::OutputElement(ostream * const out, const element *elem) const
     187{
     188  *out << elem->getName() << "\t";
     189  *out << elem->getSymbol() << "\t";
     190  *out << elem->getAtomicNumber() << "\t";
     191  *out << elem->getMass() << "\t";
     192  *out << elem->getCovalentRadius() << "\t";
     193  *out << elem->getVanDerWaalsRadius() << std::endl;
     194  //*out << elem->getSymbol() << "\t"  << fixed << setprecision(11) << showpoint << elem->getMass() << "g/mol\t" << elem->getName() << "\t" << elem->getSymbol() << "\t" << endl;
     195};
     196
     197
    183198/** Prints period table to given stream.
    184199 * \param output stream
     
    186201bool periodentafel::Output(ostream * const output) const
    187202{
    188   bool result = true;
    189203  if (output != NULL) {
    190     for(const_iterator iter=elements.begin(); iter !=elements.end();++iter){
    191       result = result && (*iter).second->Output(output);
    192     }
    193     return result;
    194   } else
    195     return false;
    196 };
     204    for(elementSet::const_iterator iter = elements.begin(); iter != elements.end(); ++iter) {
     205      OutputElement(output, iter->second);
     206    }
     207    return true;
     208  }
     209  return false;
     210}
    197211
    198212/** Scan periodentafel contents from internal databases.
     
    612626    f << header2 << endl;
    613627    for(const_iterator iter=elements.begin();iter!=elements.end();++iter){
    614          result = result && (*iter).second->Output(&f);
     628      OutputElement(&f, iter->second);
    615629    }
    616630    f.close();
  • TabularUnified src/Element/periodentafel.hpp

    r03a589 r47ed3d  
    5757  reverse_iterator rend() const;
    5858  bool Output(std::ostream * const output) const;
     59  void OutputElement(std::ostream * const output, const element *elem) const;
    5960  bool LoadPeriodentafel(const char * const path);
    6061  bool StorePeriodentafel(const char * const path) const;
Note: See TracChangeset for help on using the changeset viewer.