Changeset a67d19 for src/ellipsoid.cpp
- Timestamp:
- Apr 22, 2010, 2:00:03 PM (15 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, 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:
- 299554
- Parents:
- 6613ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ellipsoid.cpp
r6613ec ra67d19 146 146 { 147 147 int status = GSL_SUCCESS; 148 Log() << Verbose(2) << "Begin of FitPointSetToEllipsoid " << endl;148 DoLog(2) && (Log() << Verbose(2) << "Begin of FitPointSetToEllipsoid " << endl); 149 149 if (N >= 3) { // check that enough points are given (9 d.o.f.) 150 150 struct EllipsoidMinimisation par; … … 199 199 EllipsoidAngle[i] = gsl_vector_get (s->x, i+6); 200 200 } 201 Log() << Verbose(4) << setprecision(3) << "Converged fit at: " << *EllipsoidCenter << ", lengths " << EllipsoidLength[0] << ", " << EllipsoidLength[1] << ", " << EllipsoidLength[2] << ", angles " << EllipsoidAngle[0] << ", " << EllipsoidAngle[1] << ", " << EllipsoidAngle[2] << " with summed distance " << s->fval << "." << endl;201 DoLog(4) && (Log() << Verbose(4) << setprecision(3) << "Converged fit at: " << *EllipsoidCenter << ", lengths " << EllipsoidLength[0] << ", " << EllipsoidLength[1] << ", " << EllipsoidLength[2] << ", angles " << EllipsoidAngle[0] << ", " << EllipsoidAngle[1] << ", " << EllipsoidAngle[2] << " with summed distance " << s->fval << "." << endl); 202 202 } 203 203 … … 209 209 210 210 } else { 211 Log() << Verbose(3) << "Not enough points provided for fit to ellipsoid." << endl;211 DoLog(3) && (Log() << Verbose(3) << "Not enough points provided for fit to ellipsoid." << endl); 212 212 return false; 213 213 } 214 Log() << Verbose(2) << "End of FitPointSetToEllipsoid" << endl;214 DoLog(2) && (Log() << Verbose(2) << "End of FitPointSetToEllipsoid" << endl); 215 215 if (status == GSL_SUCCESS) 216 216 return true; … … 235 235 int index; 236 236 TesselPoint *Candidate = NULL; 237 Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl;237 DoLog(2) && (Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl); 238 238 239 239 // allocate array … … 247 247 for(int i=0;i<NDIM;i++) // pick three random indices 248 248 LC->n[i] = (rand() % LC->N[i]); 249 Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... ";249 DoLog(2) && (Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... "); 250 250 // get random cell 251 251 const LinkedCell::LinkedNodes *List = LC->GetCurrentCell(); … … 253 253 continue; 254 254 } 255 Log() << Verbose(2) << "with No. " << LC->index << "." << endl;256 257 Log() << Verbose(2) << "LC Intervals:";255 DoLog(2) && (Log() << Verbose(2) << "with No. " << LC->index << "." << endl); 256 257 DoLog(2) && (Log() << Verbose(2) << "LC Intervals:"); 258 258 for (int i=0;i<NDIM;i++) { 259 259 Nlower[i] = ((LC->n[i]-1) >= 0) ? LC->n[i]-1 : 0; 260 260 Nupper[i] = ((LC->n[i]+1) < LC->N[i]) ? LC->n[i]+1 : LC->N[i]-1; 261 Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ";262 } 263 Log() << Verbose(0) << endl;261 DoLog(0) && (Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] "); 262 } 263 DoLog(0) && (Log() << Verbose(0) << endl); 264 264 265 265 // count whether there are sufficient atoms in this cell+neighbors … … 271 271 PointsLeft += List->size(); 272 272 } 273 Log() << Verbose(2) << "There are " << PointsLeft << " atoms in this neighbourhood." << endl;273 DoLog(2) && (Log() << Verbose(2) << "There are " << PointsLeft << " atoms in this neighbourhood." << endl); 274 274 if (PointsLeft < PointsToPick) { // ensure that we can pick enough points in its neighbourhood at all. 275 275 continue; … … 303 303 if ((current != PickedAtomNrs.end()) && (*current == index)) { 304 304 Candidate = (*Runner); 305 Log() << Verbose(2) << "Current picked node is " << **Runner << " with index " << index << "." << endl;305 DoLog(2) && (Log() << Verbose(2) << "Current picked node is " << **Runner << " with index " << index << "." << endl); 306 306 x[PointsPicked++].CopyVector(Candidate->node); // we have one more atom picked 307 307 current++; // next pre-picked atom … … 313 313 } 314 314 } 315 Log() << Verbose(2) << "The following points were picked: " << endl;315 DoLog(2) && (Log() << Verbose(2) << "The following points were picked: " << endl); 316 316 for (size_t i=0;i<PointsPicked;i++) 317 Log() << Verbose(2) << x[i] << endl;317 DoLog(2) && (Log() << Verbose(2) << x[i] << endl); 318 318 if (PointsPicked == PointsToPick) // break out of loop if we have all 319 319 break; 320 320 } while(1); 321 321 322 Log() << Verbose(2) << "End of PickRandomPointSet" << endl;322 DoLog(2) && (Log() << Verbose(2) << "End of PickRandomPointSet" << endl); 323 323 }; 324 324 … … 335 335 double value, threshold; 336 336 PointMap *List = &T->PointsOnBoundary; 337 Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl;337 DoLog(2) && (Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl); 338 338 339 339 // allocate array … … 358 358 PointsLeft--; 359 359 } 360 Log() << Verbose(2) << "The following points were picked: " << endl;360 DoLog(2) && (Log() << Verbose(2) << "The following points were picked: " << endl); 361 361 for (size_t i=0;i<PointsPicked;i++) 362 Log() << Verbose(3) << x[i] << endl;363 364 Log() << Verbose(2) << "End of PickRandomPointSet" << endl;362 DoLog(3) && (Log() << Verbose(3) << x[i] << endl); 363 364 DoLog(2) && (Log() << Verbose(2) << "End of PickRandomPointSet" << endl); 365 365 }; 366 366 … … 382 382 double EllipsoidAngle[3]; 383 383 double distance, MaxDistance, MinDistance; 384 Log() << Verbose(0) << "Begin of FindDistributionOfEllipsoids" << endl;384 DoLog(0) && (Log() << Verbose(0) << "Begin of FindDistributionOfEllipsoids" << endl); 385 385 386 386 // construct center of gravity of boundary point set for initial ellipsoid center … … 389 389 Center.AddVector(Runner->second->node->node); 390 390 Center.Scale(1./T->PointsOnBoundaryCount); 391 Log() << Verbose(1) << "Center is at " << Center << "." << endl;391 DoLog(1) && (Log() << Verbose(1) << "Center is at " << Center << "." << endl); 392 392 393 393 // Output header … … 397 397 // loop over desired number of parameter sets 398 398 for (;number >0;number--) { 399 Log() << Verbose(1) << "Determining data set " << number << " ... " << endl;399 DoLog(1) && (Log() << Verbose(1) << "Determining data set " << number << " ... " << endl); 400 400 // pick the point set 401 401 x = NULL; … … 423 423 // fit the parameters 424 424 if (FitPointSetToEllipsoid(x, N, &EllipsoidCenter, &EllipsoidLength[0], &EllipsoidAngle[0])) { 425 Log() << Verbose(1) << "Picking succeeded!" << endl;425 DoLog(1) && (Log() << Verbose(1) << "Picking succeeded!" << endl); 426 426 // output obtained parameter set 427 427 output << number << "\t"; … … 434 434 output << endl; 435 435 } else { // increase N to pick one more 436 Log() << Verbose(1) << "Picking failed!" << endl;436 DoLog(1) && (Log() << Verbose(1) << "Picking failed!" << endl); 437 437 number++; 438 438 } … … 442 442 output.close(); 443 443 444 Log() << Verbose(0) << "End of FindDistributionOfEllipsoids" << endl;445 }; 444 DoLog(0) && (Log() << Verbose(0) << "End of FindDistributionOfEllipsoids" << endl); 445 };
Note:
See TracChangeset
for help on using the changeset viewer.