Changeset 6ac7ee for src/atom.cpp


Ignore:
Timestamp:
Feb 9, 2009, 5:24:10 PM (17 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, 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:
d8b94a
Parents:
124df1
git-author:
Frederik Heber <heber@…> (02/09/09 15:55:37)
git-committer:
Frederik Heber <heber@…> (02/09/09 17:24:10)
Message:

Merge branch 'ConcaveHull' of ../espack2 into ConcaveHull

Conflicts:

molecuilder/src/boundary.cpp
molecuilder/src/boundary.hpp
molecuilder/src/builder.cpp
molecuilder/src/linkedcell.cpp
molecuilder/src/linkedcell.hpp
molecuilder/src/vector.cpp
molecuilder/src/vector.hpp
util/src/NanoCreator.c

Basically, this resulted from a lot of conversions two from spaces to one tab, which is my standard indentation. The mess was caused by eclipse auto-indenting. And in espack2:ConcaveHull was the new stuff, so all from ConcaveHull was replaced in case of doubt.
Additionally, vector had ofstream << operator instead ostream << ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom.cpp

    • Property mode changed from 100644 to 100755
    r124df1 r6ac7ee  
    1414{
    1515        Name = NULL;
    16   previous = NULL;
    17   next = NULL;
    18   father = this;  // generally, father is itself
    19   Ancestor = NULL;
    20   type = NULL;
    21   sort = NULL;
    22   FixedIon = 0;
    23   nr = -1;
    24   GraphNr = -1;
    25   ComponentNr = NULL;
    26   IsCyclic = false;
    27   SeparationVertex = false;
    28   LowpointNr = -1;
    29   AdaptiveOrder = 0;
    30   MaxOrder = false;
     16        previous = NULL;
     17        next = NULL;
     18        father = this;  // generally, father is itself
     19        Ancestor = NULL;
     20        type = NULL;
     21        sort = NULL;
     22        FixedIon = 0;
     23        nr = -1;
     24        GraphNr = -1;
     25        ComponentNr = NULL;
     26        IsCyclic = false;
     27        SeparationVertex = false;
     28        LowpointNr = -1;
     29        AdaptiveOrder = 0;
     30        MaxOrder = false;
    3131};
    3232
     
    3636{
    3737        Free((void **)&Name, "atom::~atom: *Name");
    38   Free((void **)&ComponentNr, "atom::~atom: *ComponentNr");
     38        Free((void **)&ComponentNr, "atom::~atom: *ComponentNr");
    3939};
    4040
     
    4545atom *atom::GetTrueFather()
    4646{
    47   atom *walker = this;
    48   do {
    49     if (walker == walker->father) // top most father is the one that points on itself
    50       break;
    51     walker = walker->father;
    52   } while (walker != NULL);
    53   return walker;
     47        atom *walker = this;
     48        do {
     49                if (walker == walker->father) // top most father is the one that points on itself
     50                        break;
     51                walker = walker->father;
     52        } while (walker != NULL);
     53        return walker;
    5454};
    5555
     
    6161bool atom::Output(int ElementNo, int AtomNo, ofstream *out) const
    6262{
    63   if (out != NULL) {
    64     *out << "Ion_Type" << ElementNo << "_" << AtomNo << "\t"  << fixed << setprecision(9) << showpoint;
    65     *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2];
    66     *out << "\t" << FixedIon;
    67     if (v.Norm() > MYEPSILON)
    68       *out << "\t" << scientific << setprecision(6) << v.x[0] << "\t" << v.x[1] << "\t" << v.x[2] << "\t";
    69     *out << " # Number in molecule " << nr << endl;
    70     return true;
    71   } else
    72     return false;
     63        if (out != NULL) {
     64                *out << "Ion_Type" << ElementNo << "_" << AtomNo << "\t"        << fixed << setprecision(9) << showpoint;
     65                *out << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2];
     66                *out << "\t" << FixedIon;
     67                if (v.Norm() > MYEPSILON)
     68                        *out << "\t" << scientific << setprecision(6) << v.x[0] << "\t" << v.x[1] << "\t" << v.x[2] << "\t";
     69                *out << " # Number in molecule " << nr << endl;
     70                return true;
     71        } else
     72                return false;
    7373};
    7474
     
    7878bool atom::OutputXYZLine(ofstream *out) const
    7979{
    80   if (out != NULL) {
    81     *out << type->symbol << "\t" << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2] << "\t" << endl;
    82     return true;
    83   } else
    84     return false;
     80        if (out != NULL) {
     81                *out << type->symbol << "\t" << x.x[0] << "\t" << x.x[1] << "\t" << x.x[2] << "\t" << endl;
     82                return true;
     83        } else
     84                return false;
    8585};
    8686
    8787ostream & operator << (ostream &ost, atom &a)
    8888{
    89   ost << "[" << a.Name << "|" << &a << "]";
    90   return ost;
     89        ost << "[" << a.Name << "|" << &a << "]";
     90        return ost;
    9191};
    9292
     
    9797bool atom::Compare(atom &ptr)
    9898{
    99   if (nr < ptr.nr)
    100     return true;
    101   else
    102     return false;
     99        if (nr < ptr.nr)
     100                return true;
     101        else
     102                return false;
    103103};
    104104
    105105bool operator < (atom &a, atom &b)
    106106{
    107   return a.Compare(b);
     107        return a.Compare(b);
    108108};
    109109
Note: See TracChangeset for help on using the changeset viewer.