Changeset 681a8a


Ignore:
Timestamp:
Oct 7, 2009, 1:16:13 PM (15 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:
23b830
Parents:
fcd7b6
Message:

in molecule::OutputTrajectoriesXYZ() ActOnAllAtoms used by new function atom::OutputTrajectoryXYZ().

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/atom.cpp

    rfcd7b6 r681a8a  
    187187};
    188188
     189/** Output of a single atom as one lin in xyz file.
     190 * \param *out stream to output to
     191 */
     192bool atom::OutputTrajectoryXYZ(ofstream *out, int step) const
     193{
     194  if (out != NULL) {
     195    *out << type->symbol << "\t";
     196    *out << Trajectory.R.at(step).x[0] << "\t";
     197    *out << Trajectory.R.at(step).x[1] << "\t";
     198    *out << Trajectory.R.at(step).x[2] << endl;
     199    return true;
     200  } else
     201    return false;
     202};
     203
    189204ostream & operator << (ostream &ost, const atom &a)
    190205{
  • src/atom.hpp

    rfcd7b6 r681a8a  
    6464  bool OutputXYZLine(ofstream *out) const;
    6565  bool OutputTrajectory(ofstream *out, int *ElementNo, int *AtomNo, int step) const;
     66  bool OutputTrajectoryXYZ(ofstream *out, int step) const;
     67
    6668  void EqualsFather ( atom *ptr, atom **res );
    6769  void CorrectFather();
  • src/molecule.cpp

    rfcd7b6 r681a8a  
    757757          ElementNo[i] = current++;
    758758      }
    759       ActOnAllAtoms( &atom::OutputTrajectory, out, ElementNo, AtomNo, step ); // (bool (atom::*)(int *, int *, ofstream *, const char *))
     759      ActOnAllAtoms( &atom::OutputTrajectory, out, ElementNo, AtomNo, step );
    760760    }
    761761    return true;
     
    799799bool molecule::OutputTrajectoriesXYZ(ofstream *out)
    800800{
    801   atom *walker = NULL;
    802801  int No = 0;
    803802  time_t now;
    804803
    805   now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    806   walker = start;
    807   while (walker->next != end) { // go through every atom and count
    808     walker = walker->next;
    809     No++;
    810   }
    811804  if (out != NULL) {
     805    now = time((time_t *)NULL);   // Get the system time and put it into 'now' as 'calender time'
    812806    for (int step=0;step<MDSteps;step++) {
    813       *out << No << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
    814       walker = start;
    815       while (walker->next != end) { // go through every atom of this element
    816         walker = walker->next;
    817         *out << walker->type->symbol << "\t" << walker->Trajectory.R.at(step).x[0] << "\t" << walker->Trajectory.R.at(step).x[1] << "\t" << walker->Trajectory.R.at(step).x[2] << endl;
    818       }
     807      *out << AtomCount << "\n\tCreated by molecuilder, step " << step << ", on " << ctime(&now);
     808      ActOnAllAtoms( &atom::OutputTrajectoryXYZ, out, step );
    819809    }
    820810    return true;
Note: See TracChangeset for help on using the changeset viewer.