Changeset 34c43a for src/boundary.cpp
- Timestamp:
- Mar 1, 2011, 10:16:38 AM (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, 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:
- caa06ef
- Parents:
- ba5215
- git-author:
- Frederik Heber <heber@…> (02/21/11 18:02:41)
- git-committer:
- Frederik Heber <heber@…> (03/01/11 10:16:38)
- File:
-
- 1 edited
-
src/boundary.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
rba5215 r34c43a 18 18 #include "CodePatterns/MemDebug.hpp" 19 19 20 #include "BoundaryPointSet.hpp"21 #include "BoundaryLineSet.hpp"22 #include "BoundaryTriangleSet.hpp"23 #include "CandidateForTesselation.hpp"24 //#include "TesselPoint.hpp"25 #include "World.hpp"26 20 #include "atom.hpp" 27 21 #include "bond.hpp" 28 22 #include "boundary.hpp" 23 #include "BoundaryLineSet.hpp" 24 #include "BoundaryPointSet.hpp" 25 #include "BoundaryTriangleSet.hpp" 26 #include "Box.hpp" 27 #include "CandidateForTesselation.hpp" 28 #include "CodePatterns/Info.hpp" 29 #include "CodePatterns/Log.hpp" 30 #include "CodePatterns/Verbose.hpp" 29 31 #include "config.hpp" 30 32 #include "element.hpp" 31 33 #include "Helpers/helpers.hpp" 32 #include "CodePatterns/Info.hpp" 34 #include "LinearAlgebra/Plane.hpp" 35 #include "LinearAlgebra/RealSpaceMatrix.hpp" 33 36 #include "linkedcell.hpp" 34 #include "CodePatterns/Verbose.hpp"35 #include "CodePatterns/Log.hpp"36 37 #include "molecule.hpp" 38 #include "PointCloudAdaptor.hpp" 39 #include "RandomNumbers/RandomNumberGeneratorFactory.hpp" 40 #include "RandomNumbers/RandomNumberGenerator.hpp" 37 41 #include "tesselation.hpp" 38 42 #include "tesselationhelpers.hpp" 39 43 #include "World.hpp" 40 #include "LinearAlgebra/Plane.hpp"41 #include "LinearAlgebra/RealSpaceMatrix.hpp"42 #include "RandomNumbers/RandomNumberGeneratorFactory.hpp"43 #include "RandomNumbers/RandomNumberGenerator.hpp"44 #include "Box.hpp"45 44 46 45 #include <iostream> … … 378 377 379 378 // 3b. go through all lines, that are not yet part of two triangles (only of one so far) 380 TesselStruct->TesselateOnBoundary(mol); 379 PointCloudAdaptor< molecule > cloud(const_cast<molecule *>(mol)); 380 TesselStruct->TesselateOnBoundary(cloud); 381 381 382 382 // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point 383 if (!TesselStruct->InsertStraddlingPoints( mol, LCList))383 if (!TesselStruct->InsertStraddlingPoints(cloud, LCList)) 384 384 DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl); 385 385 … … 645 645 { 646 646 Info FunctionInfo(__func__); 647 PointCloudAdaptor< molecule > cloud(const_cast<molecule *>(mol)); 647 648 // 4. Store triangles in tecplot file 648 649 if (filename != NULL) { … … 652 653 OutputName.append(TecplotSuffix); 653 654 ofstream *tecplot = new ofstream(OutputName.c_str()); 654 WriteTecplotFile(tecplot, TesselStruct, mol, -1);655 WriteTecplotFile(tecplot, TesselStruct, cloud, -1); 655 656 tecplot->close(); 656 657 delete(tecplot); … … 661 662 OutputName.append(Raster3DSuffix); 662 663 ofstream *rasterplot = new ofstream(OutputName.c_str()); 663 WriteRaster3dFile(rasterplot, TesselStruct, mol);664 WriteRaster3dFile(rasterplot, TesselStruct, cloud); 664 665 rasterplot->close(); 665 666 delete(rasterplot); … … 699 700 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct); 700 701 GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem); 701 LinkedCell *LCList = new LinkedCell(*mol, 10.); 702 PointCloudAdaptor< molecule > cloud(mol); 703 LinkedCell *LCList = new LinkedCell(cloud, 10.); 702 704 FindConvexBorder(mol, BoundaryPoints, TesselStruct, (const LinkedCell *&)LCList, NULL); 703 705 delete (LCList); … … 808 810 if ((*ListRunner)->getAtomCount() > 0) { 809 811 DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl); 810 LCList[(*ListRunner)] = new LinkedCell(*(*ListRunner), 10.); // get linked cell list 812 PointCloudAdaptor< molecule > cloud(*ListRunner); 813 LCList[(*ListRunner)] = new LinkedCell(cloud, 10.); // get linked cell list 811 814 DoLog(1) && (Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl); 812 815 TesselStruct[(*ListRunner)] = NULL; … … 1015 1018 { 1016 1019 size_t compareTo = 0; 1017 LinkedCell::LinkedNodes* liste = LC->GetPointsInsideSphere(boundary == 0. ? MYEPSILON : boundary, &CurrentPosition);1020 TesselPointSTLList* liste = LC->GetPointsInsideSphere(boundary == 0. ? MYEPSILON : boundary, &CurrentPosition); 1018 1021 if (filler != NULL) { 1019 for ( LinkedCell::LinkedNodes::const_iterator iter = liste->begin();1022 for (TesselPointSTLList::const_iterator iter = liste->begin(); 1020 1023 iter != liste->end(); 1021 1024 ++iter) { … … 1031 1034 if (!result) { 1032 1035 DoLog(0) && (Log() << Verbose(0) << "Skipping because of the following atoms:" << std::endl); 1033 for ( LinkedCell::LinkedNodes::const_iterator iter = liste->begin();1036 for (TesselPointSTLList::const_iterator iter = liste->begin(); 1034 1037 iter != liste->end(); 1035 1038 ++iter) { … … 1084 1087 if ((*ListRunner)->getAtomCount() > 0) { 1085 1088 DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl); 1086 LCList[(*ListRunner)] = new LinkedCell(*(*ListRunner), 10.); // get linked cell list 1089 PointCloudAdaptor< molecule > cloud(*ListRunner); 1090 LCList[(*ListRunner)] = new LinkedCell(cloud, 10.); // get linked cell list 1087 1091 } 1088 1092 … … 1215 1219 * \return true - tesselation successful, false - tesselation failed 1216 1220 */ 1217 bool FindNonConvexBorder( constmolecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)1221 bool FindNonConvexBorder(molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL) 1218 1222 { 1219 1223 Info FunctionInfo(__func__); … … 1236 1240 1237 1241 // initialise Linked Cell 1242 PointCloudAdaptor< molecule > cloud(mol); 1238 1243 if (LCList == NULL) { 1239 LCList = new LinkedCell( *mol, 2.*RADIUS);1244 LCList = new LinkedCell(cloud, 2.*RADIUS); 1240 1245 freeLC = true; 1241 1246 } … … 1248 1253 if (filename != NULL) { 1249 1254 if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration 1250 TesselStruct->Output(filename, mol);1255 TesselStruct->Output(filename, cloud); 1251 1256 } 1252 1257 } … … 1288 1293 if (filename != NULL) { 1289 1294 if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration 1290 TesselStruct->Output(filename, mol);1295 TesselStruct->Output(filename, cloud); 1291 1296 } 1292 1297 }
Note:
See TracChangeset
for help on using the changeset viewer.
