Changes in src/boundary.cpp [986ed3:952f38]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r986ed3 r952f38 12 12 #include "config.hpp" 13 13 #include "element.hpp" 14 #include " helpers.hpp"15 #include " info.hpp"14 #include "Helpers/helpers.hpp" 15 #include "Helpers/Info.hpp" 16 16 #include "linkedcell.hpp" 17 #include " verbose.hpp"18 #include " log.hpp"17 #include "Helpers/Verbose.hpp" 18 #include "Helpers/Log.hpp" 19 19 #include "molecule.hpp" 20 20 #include "tesselation.hpp" 21 21 #include "tesselationhelpers.hpp" 22 22 #include "World.hpp" 23 #include " Plane.hpp"24 #include " Matrix.hpp"23 #include "LinearAlgebra/Plane.hpp" 24 #include "LinearAlgebra/Matrix.hpp" 25 25 #include "Box.hpp" 26 26 … … 301 301 * \param *out output stream for debugging 302 302 * \param *mol molecule structure with Atom's and Bond's. 303 * \param *BoundaryPts set of boundary points to use or NULL 303 304 * \param *TesselStruct Tesselation filled with points, lines and triangles on boundary on return 304 305 * \param *LCList atoms in LinkedCell list … … 306 307 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename. 307 308 */ 308 void FindConvexBorder(const molecule* mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename)309 void FindConvexBorder(const molecule* mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename) 309 310 { 310 311 Info FunctionInfo(__func__); … … 317 318 318 319 // 1. Find all points on the boundary 319 if (BoundaryP oints == NULL) {320 321 320 if (BoundaryPts == NULL) { 321 BoundaryFreeFlag = true; 322 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct); 322 323 } else { 323 DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl); 324 BoundaryPoints = BoundaryPts; 325 DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl); 324 326 } 325 327 326 328 // printing all inserted for debugging 327 for (int axis=0; axis < NDIM; axis++) 328 { 329 DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl); 330 int i=0; 331 for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) { 332 if (runner != BoundaryPoints[axis].begin()) 333 DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second); 334 else 335 DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second); 336 i++; 337 } 338 DoLog(0) && (Log() << Verbose(0) << endl); 339 } 329 for (int axis=0; axis < NDIM; axis++) { 330 DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl); 331 int i=0; 332 for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) { 333 if (runner != BoundaryPoints[axis].begin()) 334 DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second); 335 else 336 DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second); 337 i++; 338 } 339 DoLog(0) && (Log() << Verbose(0) << endl); 340 } 340 341 341 342 // 2. fill the boundary point list … … 343 344 for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) 344 345 if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0)) 345 Do eLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl);346 DoLog(2) && (Log()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present." << endl); 346 347 347 348 DoLog(0) && (Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl); … … 677 678 678 679 IsAngstroem = configuration->GetIsAngstroem(); 680 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct); 679 681 GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem); 680 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);681 682 LinkedCell *LCList = new LinkedCell(mol, 10.); 682 FindConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, NULL);683 FindConvexBorder(mol, BoundaryPoints, TesselStruct, (const LinkedCell *&)LCList, NULL); 683 684 delete (LCList); 685 delete[] BoundaryPoints; 684 686 685 687 … … 689 691 else 690 692 clustervolume = ClusterVolume; 693 694 delete TesselStruct; 691 695 692 696 for (int i = 0; i < NDIM; i++) … … 741 745 mol->CenterInBox(); 742 746 } 747 delete GreatestDiameter; 743 748 // update Box of atoms by boundary 744 749 mol->SetBoxDimension(&BoxLengths); … … 895 900 } 896 901 } 902 for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) { 903 delete LCList[*ListRunner]; 904 delete TesselStruct[(*ListRunner)]; 905 } 897 906 898 907 return Filling;
Note:
See TracChangeset
for help on using the changeset viewer.