Changeset b453f9 for src/atom.cpp
- Timestamp:
- Oct 27, 2009, 8:54:44 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, Candidate_v1.7.0, 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:
- 70ff32
- Parents:
- 831a14
- File:
-
- 1 edited
-
src/atom.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/atom.cpp
r831a14 rb453f9 43 43 sort = &nr; 44 44 node = &x; 45 } 45 }; 46 46 47 47 … … 83 83 * \param **res return value (only set if atom::father is equal to \a *ptr) 84 84 */ 85 void atom::EqualsFather ( atom *ptr, atom **res )85 void atom::EqualsFather ( const atom *ptr, const atom **res ) const 86 86 { 87 87 if ( ptr == father ) … … 94 94 * \return true - is inside, false - is not 95 95 */ 96 bool atom::IsInParallelepiped( Vector offset, double *parallelepiped)96 bool atom::IsInParallelepiped(const Vector offset, const double *parallelepiped) const 97 97 { 98 98 return (node->IsInParallelepiped(offset, parallelepiped)); … … 110 110 }; 111 111 112 /** Output of a single atom .112 /** Output of a single atom with given numbering. 113 113 * \param ElementNo cardinal number of the element 114 114 * \param AtomNo cardinal number among these atoms of the same element … … 117 117 * \return true - \a *out present, false - \a *out is NULL 118 118 */ 119 bool atom::Output (ofstream *out, int ElementNo,int AtomNo, const char *comment) const119 bool atom::OutputIndexed(ofstream *out, const int ElementNo, const int AtomNo, const char *comment) const 120 120 { 121 121 if (out != NULL) { … … 133 133 return false; 134 134 }; 135 bool atom::Output(ofstream *out, int *ElementNo, int *AtomNo, const char *comment) 135 136 /** Output of a single atom with numbering from array according to atom::type. 137 * \param *ElementNo cardinal number of the element 138 * \param *AtomNo cardinal number among these atoms of the same element 139 * \param *out stream to output to 140 * \param *comment commentary after '#' sign 141 * \return true - \a *out present, false - \a *out is NULL 142 */ 143 bool atom::OutputArrayIndexed(ofstream *out, const int *ElementNo, int *AtomNo, const char *comment) const 136 144 { 137 145 AtomNo[type->Z]++; // increment number … … 171 179 * \return true - \a *out present, false - \a *out is NULL 172 180 */ 173 bool atom::OutputTrajectory(ofstream *out, int *ElementNo, int *AtomNo,int step) const181 bool atom::OutputTrajectory(ofstream *out, const int *ElementNo, int *AtomNo, const int step) const 174 182 { 175 183 AtomNo[type->Z]++; … … 193 201 * \return true - \a *out present, false - \a *out is NULL 194 202 */ 195 bool atom::OutputTrajectoryXYZ(ofstream *out, int step) const203 bool atom::OutputTrajectoryXYZ(ofstream *out, const int step) const 196 204 { 197 205 if (out != NULL) { … … 210 218 * \param *AtomNo pointer to atom counter that is increased by one 211 219 */ 212 void atom::OutputMPQCLine(ofstream *out, Vector *center, int *AtomNo = NULL) const220 void atom::OutputMPQCLine(ofstream *out, const Vector *center, int *AtomNo = NULL) const 213 221 { 214 222 *out << "\t\t" << type->symbol << " [ " << x.x[0]-center->x[0] << "\t" << x.x[1]-center->x[1] << "\t" << x.x[2]-center->x[2] << " ]" << endl; … … 217 225 }; 218 226 219 ostream & operator << (ostream &ost, const ParticleInfo &a)220 {221 ost << "[" << a.Name << "|" << &a << "]";222 return ost;223 };224 225 ostream & ParticleInfo::operator << (ostream &ost)226 {227 ost << "[" << Name << "|" << this << "]";228 return ost;229 };230 231 227 /** Compares the indices of \a this atom with a given \a ptr. 232 228 * \param ptr atom to compare index against 233 229 * \return true - this one's is smaller, false - not 234 230 */ 235 bool atom::Compare(const atom &ptr) 231 bool atom::Compare(const atom &ptr) const 236 232 { 237 233 if (nr < ptr.nr) … … 245 241 * \return distance squared 246 242 */ 247 double atom::DistanceSquaredToVector( Vector &origin)243 double atom::DistanceSquaredToVector(const Vector &origin) const 248 244 { 249 245 return origin.DistanceSquared(&x); … … 254 250 * \return distance 255 251 */ 256 double atom::DistanceToVector( Vector &origin)252 double atom::DistanceToVector(const Vector &origin) const 257 253 { 258 254 return origin.Distance(&x);
Note:
See TracChangeset
for help on using the changeset viewer.
