Changeset 15b670 for src


Ignore:
Timestamp:
Jun 1, 2010, 8:25:36 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:
e0aee2b
Parents:
0de7e8
Message:

Testfixes for Tesselations/1-3 and bugfixes for molecule::DetermineCenterOfAll()

  • BUGFIX: molecule::DetermineCenterOfAll() - would scale by -1./Num, which is not the right center.
  • TESTFIX: Tesselations/1-3 all suffered ... replaced in regression dir.
    • (Non)ConvexEnvelope.r3d to be disordered, due to IonType2 appear before IonType1 in test.conf
    • (Non)ConvexEnvelope.r3d from test and from regression to differ by 4.4e-16 and 0 (now nodes coordinates are set to 0, if fabs(.) is below MYEPSILON)
    • Tesselations/3: NonConvexEnvelope.dat was disorder (but the exactly same tesselation) due to IonType (did not occur for Tesselations/1-2)
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/molecule_geometry.cpp

    r0de7e8 r15b670  
    133133  if (iter != end()) {   //list not empty?
    134134    for (; iter != end(); ++iter) {  // continue with second if present
    135       Num += 1.;
     135      Num++;
    136136      (*a) += (*iter)->x;
    137137    }
     
    175175      (*a) += tmp;
    176176    }
    177     a->Scale(-1./Num); // divide through total mass (and sign for direction)
     177    a->Scale(1./Num); // divide through total mass (and sign for direction)
    178178  }
    179179//  Log() << Verbose(1) << "Resulting center of gravity: ";
  • src/tesselationhelpers.cpp

    r0de7e8 r15b670  
    785785      Walker = cloud->GetPoint();
    786786      *rasterfile << "2" << endl << "  ";  // 2 is sphere type
    787       for (i=0;i<NDIM;i++)
    788         *rasterfile << Walker->node->at(i)-center->at(i) << " ";
     787      for (int j=0;j<NDIM;j++) { // and for each node all NDIM coordinates
     788        const double tmp = Walker->node->at(j)-center->at(j);
     789        *rasterfile << ((fabs(tmp) < MYEPSILON) ? 0 : tmp) << " ";
     790      }
    789791      *rasterfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour
    790792      cloud->GoToNext();
     
    796798      *rasterfile << "1" << endl << "  ";  // 1 is triangle type
    797799      for (i=0;i<3;i++) {  // print each node
    798         for (int j=0;j<NDIM;j++)  // and for each node all NDIM coordinates
    799           *rasterfile << TriangleRunner->second->endpoints[i]->node->node->at(j)-center->at(j) << " ";
     800        for (int j=0;j<NDIM;j++) { // and for each node all NDIM coordinates
     801          const double tmp = TriangleRunner->second->endpoints[i]->node->node->at(j)-center->at(j);
     802          *rasterfile << ((fabs(tmp) < MYEPSILON) ? 0 : tmp) << " ";
     803        }
    800804        *rasterfile << "\t";
    801805      }
     
    836840    }
    837841    *tecplot << "\", N=" << TesselStruct->PointsOnBoundary.size() << ", E=" << TesselStruct->TrianglesOnBoundary.size() << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl;
    838     int i=cloud->GetMaxId();
    839     int *LookupList = new int[i];
    840     for (cloud->GoToFirst(), i=0; !cloud->IsEnd(); cloud->GoToNext(), i++){
     842    const int MaxId=cloud->GetMaxId();
     843    int *LookupList = new int[MaxId];
     844    for (int i=0; i< MaxId ; i++){
    841845      LookupList[i] = -1;
    842846    }
     
    848852      Walker = target->second->node;
    849853      LookupList[Walker->nr] = Counter++;
    850       *tecplot << Walker->node->at(0) << " " << Walker->node->at(1) << " " << Walker->node->at(2) << " " << target->second->value << endl;
     854      for (int i=0;i<NDIM;i++) {
     855        const double tmp = Walker->node->at(i);
     856        *tecplot << ((fabs(tmp) < MYEPSILON) ? 0 : tmp) << " ";
     857      }
     858      *tecplot << target->second->value << endl;
    851859    }
    852860    *tecplot << endl;
Note: See TracChangeset for help on using the changeset viewer.