Changeset 0a4f7f for src/config.cpp


Ignore:
Timestamp:
Apr 7, 2010, 3:45:38 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
72e7fa
Parents:
f9352d
Message:

Made data internal data-structure of vector class private

  • Replaced occurences of access to internals with operator
  • moved Vector-class into LinAlg-Module
  • Reworked Vector to allow clean modularization
  • Added Plane class to describe arbitrary planes in 3d space
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config.cpp

    rf9352d r0a4f7f  
    740740              neues = AtomList[i][j];
    741741            status = (status &&
    742                     ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &neues->x.x[0], 1, (repetition == 0) ? critical : optional) &&
    743                     ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &neues->x.x[1], 1, (repetition == 0) ? critical : optional) &&
    744                     ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &neues->x.x[2], 1, (repetition == 0) ? critical : optional) &&
     742                    ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &neues->x[0], 1, (repetition == 0) ? critical : optional) &&
     743                    ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &neues->x[1], 1, (repetition == 0) ? critical : optional) &&
     744                    ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &neues->x[2], 1, (repetition == 0) ? critical : optional) &&
    745745                    ParseForParameter(verbose,FileBuffer, keyword, 0, 4, 1, int_type, &neues->FixedIon, 1, (repetition == 0) ? critical : optional));
    746746            if (!status) break;
     
    756756            // put into trajectories list
    757757            for (int d=0;d<NDIM;d++)
    758               neues->Trajectory.R.at(repetition).x[d] = neues->x.x[d];
     758              neues->Trajectory.R.at(repetition)[d] = neues->x[d];
    759759
    760760            // parse velocities if present
    761             if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues->v.x[0], 1,optional))
    762               neues->v.x[0] = 0.;
    763             if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues->v.x[1], 1,optional))
    764               neues->v.x[1] = 0.;
    765             if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues->v.x[2], 1,optional))
    766               neues->v.x[2] = 0.;
     761            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues->v[0], 1,optional))
     762              neues->v[0] = 0.;
     763            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues->v[1], 1,optional))
     764              neues->v[1] = 0.;
     765            if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues->v[2], 1,optional))
     766              neues->v[2] = 0.;
    767767            for (int d=0;d<NDIM;d++)
    768               neues->Trajectory.U.at(repetition).x[d] = neues->v.x[d];
     768              neues->Trajectory.U.at(repetition)[d] = neues->v[d];
    769769
    770770            // parse forces if present
     
    776776              value[2] = 0.;
    777777            for (int d=0;d<NDIM;d++)
    778               neues->Trajectory.F.at(repetition).x[d] = value[d];
     778              neues->Trajectory.F.at(repetition)[d] = value[d];
    779779
    780780  //            Log() << Verbose(0) << "Parsed position of step " << (repetition) << ": (";
     
    819819            neues = AtomList[i][j];
    820820          // then parse for each atom the coordinates as often as present
    821           ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &neues->x.x[0], repetition,critical);
    822           ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &neues->x.x[1], repetition,critical);
    823           ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &neues->x.x[2], repetition,critical);
     821          ParseForParameter(verbose,FileBuffer, keyword, 0, 1, 1, double_type, &neues->x[0], repetition,critical);
     822          ParseForParameter(verbose,FileBuffer, keyword, 0, 2, 1, double_type, &neues->x[1], repetition,critical);
     823          ParseForParameter(verbose,FileBuffer, keyword, 0, 3, 1, double_type, &neues->x[2], repetition,critical);
    824824          ParseForParameter(verbose,FileBuffer, keyword, 0, 4, 1, int_type, &neues->FixedIon, repetition,critical);
    825           if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues->v.x[0], repetition,optional))
    826             neues->v.x[0] = 0.;
    827           if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues->v.x[1], repetition,optional))
    828             neues->v.x[1] = 0.;
    829           if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues->v.x[2], repetition,optional))
    830             neues->v.x[2] = 0.;
     825          if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 5, 1, double_type, &neues->v[0], repetition,optional))
     826            neues->v[0] = 0.;
     827          if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 6, 1, double_type, &neues->v[1], repetition,optional))
     828            neues->v[1] = 0.;
     829          if(!ParseForParameter(verbose,FileBuffer, keyword, 0, 7, 1, double_type, &neues->v[2], repetition,optional))
     830            neues->v[2] = 0.;
    831831          // here we don't care if forces are present (last in trajectories is always equal to current position)
    832832          neues->type = elementhash[i]; // find element type
     
    12891289        istringstream input2(zeile);
    12901290        atom *neues = World::getInstance().createAtom();
    1291         input2 >> neues->x.x[0]; // x
    1292         input2 >> neues->x.x[1]; // y
    1293         input2 >> neues->x.x[2]; // z
     1291        input2 >> neues->x[0]; // x
     1292        input2 >> neues->x[1]; // y
     1293        input2 >> neues->x[2]; // z
    12941294        input2 >> l;
    12951295        neues->type = elementhash[No]; // find element type
     
    15701570             'a'+(unsigned char)(AtomNo % 26),           /* letter for chain */
    15711571             MolNo,         /* residue sequence number */
    1572              Walker->node->x[0],                 /* position X in Angstroem */
    1573              Walker->node->x[1],                 /* position Y in Angstroem */
    1574              Walker->node->x[2],                 /* position Z in Angstroem */
     1572             Walker->node->at(0),                 /* position X in Angstroem */
     1573             Walker->node->at(1),                 /* position Y in Angstroem */
     1574             Walker->node->at(2),                 /* position Z in Angstroem */
    15751575             (double)Walker->type->Valence,         /* occupancy */
    15761576             (double)Walker->type->NoValenceOrbitals,          /* temperature factor */
     
    16241624           'a'+(unsigned char)(AtomNo % 26),           /* letter for chain */
    16251625           0,         /* residue sequence number */
    1626            Walker->node->x[0],                 /* position X in Angstroem */
    1627            Walker->node->x[1],                 /* position Y in Angstroem */
    1628            Walker->node->x[2],                 /* position Z in Angstroem */
     1626           Walker->node->at(0),                 /* position X in Angstroem */
     1627           Walker->node->at(1),                 /* position Y in Angstroem */
     1628           Walker->node->at(2),                 /* position Z in Angstroem */
    16291629           (double)Walker->type->Valence,         /* occupancy */
    16301630           (double)Walker->type->NoValenceOrbitals,          /* temperature factor */
     
    16771677    *output << mol->name << "\t";
    16781678    *output << 0 << "\t";
    1679     *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t";
    1680     *output << (double)Walker->type->Valence << "\t";
     1679    *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t";
     1680    *output << static_cast<double>(Walker->type->Valence) << "\t";
    16811681    *output << Walker->type->symbol << "\t";
    16821682    for (BondList::iterator runner = Walker->ListOfBonds.begin(); runner != Walker->ListOfBonds.end(); runner++)
     
    17521752        *output << (*MolWalker)->name << "\t";
    17531753        *output << MolCounter << "\t";
    1754         *output << Walker->node->x[0] << "\t" << Walker->node->x[1] << "\t" << Walker->node->x[2] << "\t";
     1754        *output << Walker->node->at(0) << "\t" << Walker->node->at(1) << "\t" << Walker->node->at(2) << "\t";
    17551755        *output << (double)Walker->type->Valence << "\t";
    17561756        *output << Walker->type->symbol << "\t";
Note: See TracChangeset for help on using the changeset viewer.