Changeset bdc91e
- Timestamp:
- Jul 1, 2010, 2:33:13 PM (14 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:
- edb454
- Parents:
- 8e0c63
- git-author:
- Frederik Heber <heber@…> (07/01/10 14:26:41)
- git-committer:
- Frederik Heber <heber@…> (07/01/10 14:33:13)
- Location:
- src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/AnalysisAction/MolecularVolumeAction.cpp
r8e0c63 rbdc91e 47 47 LCList = new LinkedCell(mol, 10.); 48 48 config * const configuration = World::getInstance().getConfig(); 49 //FindConvexBorder(mol, LCList, argv[argptr]); 49 Boundaries *BoundaryPoints = NULL; 50 //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]); 50 51 FindNonConvexBorder(mol, TesselStruct, LCList, 5., NULL); 51 52 //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]); -
src/Actions/TesselationAction/ConvexEnvelopeAction.cpp
r8e0c63 rbdc91e 70 70 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << filenameNonConvex << "." << endl); 71 71 LCList = new LinkedCell(mol, 100.); 72 //FindConvexBorder(mol, LCList, argv[argptr]); 72 Boundaries *BoundaryPoints = NULL; 73 //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]); 73 74 // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests 74 75 FindNonConvexBorder(mol, TesselStruct, LCList, 50., filenameNonConvex.c_str()); -
src/Actions/WorldAction/RepeatBoxAction.cpp
r8e0c63 rbdc91e 69 69 Repeater[axis] = 1; 70 70 } 71 cell_size[ (abs(axis+1) == 2) ? 2 : ((abs(axis+2) == 3) ? 5 : 0)] *= Repeater[axis];71 cell_size[ ((axis == 1) ? 2 : (axis == 2) ? 5 : 0) ] *= Repeater[axis]; 72 72 } 73 73 -
src/Legacy/oldmenu.cpp
r8e0c63 rbdc91e 576 576 const LinkedCell *LCList = NULL; 577 577 LCList = new LinkedCell(mol, 10.); 578 FindConvexBorder(mol, TesselStruct, LCList, NULL); 578 Boundaries *BoundaryPoints = NULL; 579 FindConvexBorder(mol, BoundaryPoints TesselStruct, LCList, NULL); 579 580 double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration); 580 581 Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;\ -
src/boundary.cpp
r8e0c63 rbdc91e 296 296 * \param *out output stream for debugging 297 297 * \param *mol molecule structure with Atom's and Bond's. 298 * \param *BoundaryPts set of boundary points to use or NULL 298 299 * \param *TesselStruct Tesselation filled with points, lines and triangles on boundary on return 299 300 * \param *LCList atoms in LinkedCell list … … 301 302 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename. 302 303 */ 303 void FindConvexBorder(const molecule* mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename)304 void FindConvexBorder(const molecule* mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename) 304 305 { 305 306 Info FunctionInfo(__func__); … … 312 313 313 314 // 1. Find all points on the boundary 314 if (BoundaryP oints == NULL) {315 316 315 if (BoundaryPts == NULL) { 316 BoundaryFreeFlag = true; 317 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct); 317 318 } else { 318 DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl); 319 BoundaryPoints = BoundaryPts; 320 DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl); 319 321 } 320 322 321 323 // printing all inserted for debugging 322 for (int axis=0; axis < NDIM; axis++) 323 { 324 DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl); 325 int i=0; 326 for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) { 327 if (runner != BoundaryPoints[axis].begin()) 328 DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second); 329 else 330 DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second); 331 i++; 332 } 333 DoLog(0) && (Log() << Verbose(0) << endl); 334 } 324 for (int axis=0; axis < NDIM; axis++) { 325 DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl); 326 int i=0; 327 for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) { 328 if (runner != BoundaryPoints[axis].begin()) 329 DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second); 330 else 331 DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second); 332 i++; 333 } 334 DoLog(0) && (Log() << Verbose(0) << endl); 335 } 335 336 336 337 // 2. fill the boundary point list … … 338 339 for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) 339 340 if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0)) 340 Do eLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl);341 DoLog(2) && (Log()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present." << endl); 341 342 342 343 DoLog(0) && (Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl); … … 672 673 673 674 IsAngstroem = configuration->GetIsAngstroem(); 675 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct); 674 676 GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem); 675 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);676 677 LinkedCell *LCList = new LinkedCell(mol, 10.); 677 FindConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, NULL);678 FindConvexBorder(mol, BoundaryPoints, TesselStruct, (const LinkedCell *&)LCList, NULL); 678 679 delete (LCList); 680 delete[] BoundaryPoints; 679 681 680 682 … … 684 686 else 685 687 clustervolume = ClusterVolume; 688 689 delete TesselStruct; 686 690 687 691 for (int i = 0; i < NDIM; i++) … … 736 740 mol->CenterInBox(); 737 741 } 742 delete GreatestDiameter; 738 743 // update Box of atoms by boundary 739 744 mol->SetBoxDimension(&BoxLengths); … … 892 897 } 893 898 } 899 for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) { 900 delete LCList[*ListRunner]; 901 delete TesselStruct[(*ListRunner)]; 902 } 894 903 delete[](M); 895 904 delete[](MInverse); -
src/boundary.hpp
r8e0c63 rbdc91e 50 50 double ConvexizeNonconvexEnvelope(class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename); 51 51 molecule * FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double MaxDistance, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation); 52 void FindConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename);52 void FindConvexBorder(const molecule* const mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename); 53 53 Vector* FindEmbeddingHole(MoleculeListClass *mols, molecule *srcmol); 54 54 void FindNextSuitablePoint(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC); -
src/linkedcell.cpp
r8e0c63 rbdc91e 187 187 N[i] = 0; 188 188 index = -1; 189 max.Zero();190 min.Zero();191 189 }; 192 190 … … 199 197 for(int i=0;i<NDIM;i++) 200 198 status = status && ((n[i] >=0) && (n[i] < N[i])); 201 if (!status)202 DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl);199 // if (!status) 200 // DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl); 203 201 return status; 204 202 }; … … 279 277 280 278 /** Calculates the interval bounds of the linked cell grid. 281 * \param *lower lower bounds282 * \param *upper upper bounds279 * \param lower lower bounds 280 * \param upper upper bounds 283 281 * \param step how deep to check the neighbouring cells (i.e. number of layers to check) 284 282 */ … … 286 284 { 287 285 for (int i=0;i<NDIM;i++) { 288 lower[i] = n[i]; 289 for (int s=step; s>0;--s) 290 if ((n[i]-s) >= 0) { 291 lower[i] = n[i]-s; 292 break; 293 } 294 upper[i] = n[i]; 295 for (int s=step; s>0;--s) 296 if ((n[i]+s) < N[i]) { 297 upper[i] = n[i]+s; 298 break; 299 } 286 lower[i] = n[i]-step; 287 if (lower[i] < 0) 288 lower[i] = 0; 289 if (lower[i] >= N[i]) 290 lower[i] = N[i]-1; 291 upper[i] = n[i]+step; 292 if (upper[i] >= N[i]) 293 upper[i] = N[i]-1; 294 if (upper[i] < 0) 295 upper[i] = 0; 300 296 //Log() << Verbose(0) << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl; 301 297 } -
src/molecule_geometry.cpp
r8e0c63 rbdc91e 120 120 Center += (*iter)->x; 121 121 } 122 Center.Scale(-1./ Num); // divide through total number (and sign for direction)122 Center.Scale(-1./(double)Num); // divide through total number (and sign for direction) 123 123 Translate(&Center); 124 124 Center.Zero(); … … 142 142 (*a) += (*iter)->x; 143 143 } 144 a->Scale(1./ Num); // divide through total mass (and sign for direction)144 a->Scale(1./(double)Num); // divide through total mass (and sign for direction) 145 145 } 146 146 return a; … … 181 181 (*a) += tmp; 182 182 } 183 a->Scale(1./Num); // divide through total mass (and sign for direction)183 a->Scale(1./Num); // divide through total mass 184 184 } 185 185 // Log() << Verbose(1) << "Resulting center of gravity: "; -
src/tesselation.cpp
r8e0c63 rbdc91e 1648 1648 bool AddFlag = false; 1649 1649 LinkedCell *BoundaryPoints = NULL; 1650 bool SuccessFlag = true; 1650 1651 1651 1652 cloud->GoToFirst(); … … 1661 1662 // get the next triangle 1662 1663 triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints); 1663 BTS = triangles->front(); 1664 if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) { 1664 if (triangles != NULL) 1665 BTS = triangles->front(); 1666 else 1667 BTS = NULL; 1668 delete triangles; 1669 if ((BTS == NULL) || (BTS->ContainsBoundaryPoint(Walker))) { 1665 1670 DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl); 1666 1671 cloud->GoToNext(); … … 1732 1737 } else { // something is wrong with FindClosestTriangleToPoint! 1733 1738 DoeLog(1) && (eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl); 1734 return false; 1739 SuccessFlag = false; 1740 break; 1735 1741 } 1736 1742 cloud->GoToNext(); … … 1739 1745 // exit 1740 1746 delete (Center); 1741 return true; 1747 delete (BoundaryPoints); 1748 return SuccessFlag; 1742 1749 } 1743 1750 ; … … 2242 2249 for (int i = 0; i < NDIM; i++) { // each axis 2243 2250 LC->n[i] = LC->N[i] - 1; // current axis is topmost cell 2244 for (LC->n[(i + 1) % NDIM] = 0; LC->n[(i + 1) % NDIM] < LC->N[(i + 1) % NDIM]; LC->n[(i + 1) % NDIM]++) 2245 for (LC->n[(i + 2) % NDIM] = 0; LC->n[(i + 2) % NDIM] < LC->N[(i + 2) % NDIM]; LC->n[(i + 2) % NDIM]++) { 2251 const int map[NDIM] = {i, (i + 1) % NDIM, (i + 2) % NDIM}; 2252 for (LC->n[map[1]] = 0; LC->n[map[1]] < LC->N[map[1]]; LC->n[map[1]]++) 2253 for (LC->n[map[2]] = 0; LC->n[map[2]] < LC->N[map[2]]; LC->n[map[2]]++) { 2246 2254 const LinkedCell::LinkedNodes *List = LC->GetCurrentCell(); 2247 2255 //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl; 2248 2256 if (List != NULL) { 2249 2257 for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 2250 if ((*Runner)->node->at( i) > maxCoordinate[i]) {2251 DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << i<< " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl);2252 maxCoordinate[ i] = (*Runner)->node->at(i);2253 MaxPoint[ i] = (*Runner);2258 if ((*Runner)->node->at(map[0]) > maxCoordinate[map[0]]) { 2259 DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << map[0] << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl); 2260 maxCoordinate[map[0]] = (*Runner)->node->at(map[0]); 2261 MaxPoint[map[0]] = (*Runner); 2254 2262 } 2255 2263 } -
src/tesselationhelpers.cpp
r8e0c63 rbdc91e 589 589 } 590 590 } else { 591 eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," 592 << LC->n[2] << " is invalid!" << endl; 591 DoeLog(1) && (eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl); 593 592 } 594 593 } … … 645 644 } 646 645 } else { 647 eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," 648 << LC->n[2] << " is invalid!" << endl; 646 DoeLog(1) && (eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl); 649 647 } 650 648 } -
src/triangleintersectionlist.cpp
r8e0c63 rbdc91e 10 10 11 11 #include "Helpers/MemDebug.hpp" 12 13 #include <boost/scoped_ptr.hpp> 12 14 13 15 #include "triangleintersectionlist.hpp" … … 118 120 119 121 // get closest points 120 DistanceToPointMap * points = Tess->FindClosestBoundaryPointsToVector(Point,Vicinity);122 boost::scoped_ptr< DistanceToPointMap > points(Tess->FindClosestBoundaryPointsToVector(Point,Vicinity)); 121 123 if (points == NULL) { 122 124 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
Note:
See TracChangeset
for help on using the changeset viewer.