Changeset 03a589


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:
47ed3d
Parents:
ce7bfd
git-author:
Frederik Heber <heber@…> (03/26/12 07:44:19)
git-committer:
Frederik Heber <heber@…> (04/04/12 11:30:11)
Message:

Removed lots of remnant output functions in atom and molecule that are not used anymore.

Location:
src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/Analysis/unittests/CountBondsUnitTest.cpp

    rce7bfd r03a589  
    129129};
    130130
    131 void OutputTestMolecule1(molecule *mol, const char *name)
    132 {
    133   ofstream output(name);
    134   mol->OutputXYZ(&output);
    135   output.close();
    136 }
    137 
    138131/** UnitTest for CountBondsTest::HydrogenBridgeBondsTest().
    139132 */
     
    146139  Vector Translator;
    147140
    148   //OutputTestMolecule1(TestMolecule1, "testmolecule1.xyz");
    149 
    150141  // create TestMolecule2 as copy
    151142  TestMolecule2 = TestMolecule1->CopyMolecule();
     
    158149  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    159150  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen, NULL) );
    160   //OutputTestMolecule1(TestMolecule1, "testmolecule2-1.xyz");
    161151  Translator = Vector(-3,0,0);
    162152  TestMolecule1->Translate(&Translator);
     
    166156  TestMolecule1->Translate(&Translator);
    167157  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    168   //OutputTestMolecule1(TestMolecule1, "testmolecule2-2.xyz");
    169158  Translator = Vector(0,-3,0);
    170159  TestMolecule1->Translate(&Translator);
     
    175164  TestMolecule1->Translate(&Translator);
    176165  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    177   //OutputTestMolecule1(TestMolecule1, "testmolecule2-3.xyz");
    178166  Translator = Vector(0,3,0);
    179167  TestMolecule1->Translate(&Translator);
     
    184172  TestMolecule1->Translate(&Translator);
    185173  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    186   //OutputTestMolecule1(TestMolecule1, "testmolecule2-4.xyz");
    187174  Translator = Vector(-2,-1,0);
    188175  TestMolecule1->Translate(&Translator);
     
    192179  TestMolecule1->Translate(&Translator);
    193180  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    194   //OutputTestMolecule1(TestMolecule1, "testmolecule2-5.xyz");
    195181  Translator = Vector(0,0,-3);
    196182  TestMolecule1->Translate(&Translator);
     
    201187  TestMolecule1->Translate(&Translator);
    202188  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    203   //OutputTestMolecule1(TestMolecule1, "testmolecule2-6.xyz");
    204189  Translator = Vector(3,0,0);
    205190  TestMolecule1->Translate(&Translator);
     
    211196  TestMolecule1->Translate(&Translator);
    212197  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    213   //OutputTestMolecule1(TestMolecule1, "testmolecule2-7.xyz");
    214198  Translator = Vector(-3,0,0);
    215199  TestMolecule1->Translate(&Translator);
     
    220204  TestMolecule1->Scale((const double ** const)&mirror);
    221205  TestMolecule1->Translate(&Translator);
    222   //OutputTestMolecule1(TestMolecule1, "testmolecule2-8.xyz");
    223206  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    224207  Translator = Vector(0,-3,0);
  • src/Atom/atom.cpp

    rce7bfd r03a589  
    159159};
    160160
    161 bool atom::OutputXYZLine(ofstream *out) const
    162 {
    163   if (out != NULL) {
    164     *out << getType()->getSymbol() << "\t" << at(0) << "\t" << at(1) << "\t" << at(2) << "\t" << endl;
    165     return true;
    166   } else
    167     return false;
    168 };
    169 
    170 bool atom::OutputTrajectory(ofstream * const out, const enumeration<const element*> &elementLookup, int *AtomNo, const int step) const
    171 {
    172   AtomNo[getType()->getAtomicNumber()]++;
    173   if (out != NULL) {
    174     const element *elemental = getType();
    175     ASSERT(elementLookup.there.find(elemental)!=elementLookup.there.end(),"Type of this atom was not in the formula upon enumeration");
    176     *out << "Ion_Type" << elementLookup.there.find(elemental)->second << "_" << AtomNo[getType()->getAtomicNumber()] << "\t"  << fixed << setprecision(9) << showpoint;
    177     *out << getPositionAtStep(step)[0] << "\t" << getPositionAtStep(step)[1] << "\t" << getPositionAtStep(step)[2];
    178     *out << "\t" << (int)(getFixedIon());
    179     if (getAtomicVelocityAtStep(step).Norm() > MYEPSILON)
    180       *out << "\t" << scientific << setprecision(6) << getAtomicVelocityAtStep(step)[0] << "\t" << getAtomicVelocityAtStep(step)[1] << "\t" << getAtomicVelocityAtStep(step)[2] << "\t";
    181     if (getAtomicForceAtStep(step).Norm() > MYEPSILON)
    182       *out << "\t" << scientific << setprecision(6) << getAtomicForceAtStep(step)[0] << "\t" << getAtomicForceAtStep(step)[1] << "\t" << getAtomicForceAtStep(step)[2] << "\t";
    183     *out << "\t# Number in molecule " << getNr() << endl;
    184     return true;
    185   } else
    186     return false;
    187 };
    188 
    189 bool atom::OutputTrajectoryXYZ(ofstream * const out, const int step) const
    190 {
    191   if (out != NULL) {
    192     *out << getType()->getSymbol() << "\t";
    193     *out << getPositionAtStep(step)[0] << "\t";
    194     *out << getPositionAtStep(step)[1] << "\t";
    195     *out << getPositionAtStep(step)[2] << endl;
    196     return true;
    197   } else
    198     return false;
    199 };
    200 
    201 void atom::OutputMPQCLine(ostream * const out, const Vector *center) const
    202 {
    203   Vector recentered(getPosition());
    204   recentered -= *center;
    205   *out << "\t\t" << getType()->getSymbol() << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << endl;
    206 };
    207 
    208 void atom::OutputPsi3Line(ostream * const out, const Vector *center) const
    209 {
    210   Vector recentered(getPosition());
    211   recentered -= *center;
    212   *out << "\t( " << getType()->getSymbol() << "\t" << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " )" << endl;
    213 };
    214 
    215161bool atom::Compare(const atom &ptr) const
    216162{
  • src/Atom/atom.hpp

    rce7bfd r03a589  
    8484   */
    8585  bool OutputArrayIndexed(ostream * const out,const enumeration<const element*>&, int *AtomNo, const char *comment = NULL) const;
    86 
    87   /** Output of a single atom as one line in xyz file.
    88    * \param *out stream to output to
    89    * \return true - \a *out present, false - \a *out is NULL
    90    */
    91   bool OutputXYZLine(ofstream *out) const;
    92 
    93   /** Output of a single atom as one line in xyz file.
    94    * \param *out stream to output to
    95    * \param *ElementNo array with ion type number in the config file this atom's element shall have
    96    * \param *AtomNo array with atom number in the config file this atom shall have, is increase by one automatically
    97    * \param step Trajectory time step to output
    98    * \return true - \a *out present, false - \a *out is NULL
    99    */
    100   bool OutputTrajectory(ofstream * const out, const enumeration<const element*>&, int *AtomNo, const int step) const;
    101 
    102   /** Output of a single atom as one lin in xyz file.
    103    * \param *out stream to output to
    104    * \param step Trajectory time step to output
    105    * \return true - \a *out present, false - \a *out is NULL
    106    */
    107   bool OutputTrajectoryXYZ(ofstream * const out, const int step) const;
    108 
    109   /** Outputs the MPQC configuration line for this atom.
    110    * \param *out output stream
    111    * \param *center center of molecule subtracted from position
    112    * \param *AtomNo pointer to atom counter that is increased by one
    113    */
    114   void OutputMPQCLine(ostream * const out, const Vector *center) const;
    115 
    116   /** Outputs the Psi3 configuration line for this atom.
    117    * \param *out output stream
    118    * \param *center center of molecule subtracted from position
    119    * \param *AtomNo pointer to atom counter that is increased by one
    120    */
    121   void OutputPsi3Line(ostream * const out, const Vector *center) const;
    12286
    12387  /** Initialises the component number array.
  • src/Parser/MpqcParser.cpp

    rce7bfd r03a589  
    1919
    2020#include <iostream>
     21#include <boost/foreach.hpp>
    2122#include <boost/tokenizer.hpp>
    2223#include <string>
     
    216217}
    217218
     219void FormatParser< mpqc >::OutputMPQCLine(ostream * const out, const atom &_atom, const Vector *center) const
     220{
     221  Vector recentered(_atom.getPosition());
     222  recentered -= *center;
     223  *out << "\t\t" << _atom.getType()->getSymbol() << " [ " << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " ]" << std::endl;
     224};
     225
     226
    218227/** Saves all atoms and data into a MPQC config file.
    219228 * \param *file output stream
     
    306315    *file << "\t{ atoms geometry } = {" << endl;
    307316    // output of atoms
    308     for (std::vector<atom *>::const_iterator AtomRunner = atoms.begin(); AtomRunner != atoms.end(); ++AtomRunner) {
    309       (*AtomRunner)->OutputMPQCLine(file, &center);
     317    BOOST_FOREACH(const atom *_atom, atoms) {
     318      OutputMPQCLine(file, *_atom, &center);
    310319    }
    311320    *file << "\t}" << endl;
  • src/Parser/MpqcParser.hpp

    rce7bfd r03a589  
    2525
    2626#include <iosfwd>
     27
     28class Vector;
    2729
    2830// declaration of specialized FormatParserTrait
     
    5961
    6062private:
     63  void OutputMPQCLine(ostream * const out, const atom &_atom, const Vector *center) const;
     64
    6165  static ConvertTo<bool> Converter;
    6266};
  • src/Parser/Psi3Parser.cpp

    rce7bfd r03a589  
    1919
    2020#include <iostream>
     21#include <boost/foreach.hpp>
    2122#include <boost/tokenizer.hpp>
    2223#include <string>
     
    153154}
    154155
     156void FormatParser< psi3 >::OutputPsi3Line(ostream * const out, const atom &_atom, const Vector *center) const
     157{
     158  Vector recentered(_atom.getPosition());
     159  recentered -= *center;
     160  *out << "\t( " << _atom.getType()->getSymbol() << "\t" << recentered[0] << "\t" << recentered[1] << "\t" << recentered[2] << " )" << endl;
     161};
     162
     163
    155164/** Saves all atoms and data into a PSI3 config file.
    156165 * \param *file output stream
     
    220229    *file << "\tgeometry = (" << std::endl;
    221230    // output of atoms
    222     for (std::vector<atom *>::const_iterator AtomRunner = atoms.begin(); AtomRunner != atoms.end(); ++AtomRunner) {
    223       (*AtomRunner)->OutputPsi3Line(file, &center);
     231    BOOST_FOREACH(const atom *_atom, atoms) {
     232      OutputPsi3Line(file, *_atom, &center);
    224233    }
    225234    *file << "\t)" << std::endl;
  • src/Parser/Psi3Parser.hpp

    rce7bfd r03a589  
    2525
    2626#include <iosfwd>
     27
     28class Vector;
    2729
    2830// declaration of specialized FormatParserTrait
     
    5961
    6062private:
     63  void OutputPsi3Line(ostream * const out, const atom &_atom, const Vector *center) const;
     64
    6165  static ConvertTo<bool> Converter;
    6266};
  • src/molecule.cpp

    rce7bfd r03a589  
    866866};
    867867
    868 /** Prints molecule with all atomic trajectory positions to *out.
    869  * \param *out output stream
    870  */
    871 bool molecule::OutputTrajectories(ofstream * const output) const
    872 {
    873   if (output == NULL) {
    874     return false;
    875   } else {
    876     for (int step = 0; step < MDSteps; step++) {
    877       if (step == 0) {
    878         *output << "#Ion_TypeNr._Nr.R[0]    R[1]    R[2]    MoveType (0 MoveIon, 1 FixedIon)" << endl;
    879       } else {
    880         *output << "# ====== MD step " << step << " =========" << endl;
    881       }
    882       int AtomNo[MAX_ELEMENTS];
    883       memset(AtomNo,0,(MAX_ELEMENTS-1)*sizeof(*AtomNo));
    884       enumeration<const element*> elementLookup = formula.enumerateElements();
    885       for_each(begin(),end(),boost::bind(&atom::OutputTrajectory,_1,output,elementLookup, AtomNo, (const int)step));
    886     }
    887     return true;
    888   }
    889 };
    890 
    891868/** Outputs contents of each atom::ListOfBonds.
    892869 * \param *out output stream
     
    911888{
    912889  return formula.checkOut(output);
    913 };
    914 
    915 /** Prints molecule with all its trajectories to *out as xyz file.
    916  * \param *out output stream
    917  */
    918 bool molecule::OutputTrajectoriesXYZ(ofstream * const output)
    919 {
    920   time_t now;
    921 
    922   if (output != NULL) {
    923     now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    924     for (int step=0;step<MDSteps;step++) {
    925       *output << getAtomCount() << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
    926       for_each(begin(),end(),boost::bind(&atom::OutputTrajectoryXYZ,_1,output,step));
    927     }
    928     return true;
    929   } else
    930     return false;
    931 };
    932 
    933 /** Prints molecule to *out as xyz file.
    934 * \param *out output stream
    935  */
    936 bool molecule::OutputXYZ(ofstream * const output) const
    937 {
    938   time_t now;
    939 
    940   if (output != NULL) {
    941     now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    942     *output << getAtomCount() << "\n\tCreated by molecuilder on " << ctime(&now);
    943     for_each(begin(),end(),bind2nd(mem_fun(&atom::OutputXYZLine),output));
    944     return true;
    945   } else
    946     return false;
    947890};
    948891
  • src/molecule.hpp

    rce7bfd r03a589  
    270270  // Output routines.
    271271  bool Output(std::ostream * const output) const;
    272   bool OutputTrajectories(ofstream * const output) const;
    273272  void OutputListOfBonds() const;
    274   bool OutputXYZ(ofstream * const output) const;
    275   bool OutputTrajectoriesXYZ(ofstream * const output);
    276273  bool Checkout(ofstream * const output) const;
    277274
Note: See TracChangeset for help on using the changeset viewer.