Changeset 34c43a for src/boundary.cpp


Ignore:
Timestamp:
Mar 1, 2011, 10:16:38 AM (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, 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)
Message:

Bigger change: Replaced PointCloud by PointCloudAdaptor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    rba5215 r34c43a  
    1818#include "CodePatterns/MemDebug.hpp"
    1919
    20 #include "BoundaryPointSet.hpp"
    21 #include "BoundaryLineSet.hpp"
    22 #include "BoundaryTriangleSet.hpp"
    23 #include "CandidateForTesselation.hpp"
    24 //#include "TesselPoint.hpp"
    25 #include "World.hpp"
    2620#include "atom.hpp"
    2721#include "bond.hpp"
    2822#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"
    2931#include "config.hpp"
    3032#include "element.hpp"
    3133#include "Helpers/helpers.hpp"
    32 #include "CodePatterns/Info.hpp"
     34#include "LinearAlgebra/Plane.hpp"
     35#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3336#include "linkedcell.hpp"
    34 #include "CodePatterns/Verbose.hpp"
    35 #include "CodePatterns/Log.hpp"
    3637#include "molecule.hpp"
     38#include "PointCloudAdaptor.hpp"
     39#include "RandomNumbers/RandomNumberGeneratorFactory.hpp"
     40#include "RandomNumbers/RandomNumberGenerator.hpp"
    3741#include "tesselation.hpp"
    3842#include "tesselationhelpers.hpp"
    3943#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"
    4544
    4645#include <iostream>
     
    378377
    379378  // 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);
    381381
    382382  // 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))
    384384    DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl);
    385385
     
    645645{
    646646        Info FunctionInfo(__func__);
     647  PointCloudAdaptor< molecule > cloud(const_cast<molecule *>(mol));
    647648  // 4. Store triangles in tecplot file
    648649  if (filename != NULL) {
     
    652653      OutputName.append(TecplotSuffix);
    653654      ofstream *tecplot = new ofstream(OutputName.c_str());
    654       WriteTecplotFile(tecplot, TesselStruct, mol, -1);
     655      WriteTecplotFile(tecplot, TesselStruct, cloud, -1);
    655656      tecplot->close();
    656657      delete(tecplot);
     
    661662      OutputName.append(Raster3DSuffix);
    662663      ofstream *rasterplot = new ofstream(OutputName.c_str());
    663       WriteRaster3dFile(rasterplot, TesselStruct, mol);
     664      WriteRaster3dFile(rasterplot, TesselStruct, cloud);
    664665      rasterplot->close();
    665666      delete(rasterplot);
     
    699700  BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    700701  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.);
    702704  FindConvexBorder(mol, BoundaryPoints, TesselStruct, (const LinkedCell *&)LCList, NULL);
    703705  delete (LCList);
     
    808810    if ((*ListRunner)->getAtomCount() > 0) {
    809811      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
    811814      DoLog(1) && (Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl);
    812815      TesselStruct[(*ListRunner)] = NULL;
     
    10151018{
    10161019  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);
    10181021  if (filler != NULL) {
    1019     for (LinkedCell::LinkedNodes::const_iterator iter = liste->begin();
     1022    for (TesselPointSTLList::const_iterator iter = liste->begin();
    10201023        iter != liste->end();
    10211024        ++iter) {
     
    10311034  if (!result) {
    10321035    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();
    10341037        iter != liste->end();
    10351038        ++iter) {
     
    10841087    if ((*ListRunner)->getAtomCount() > 0) {
    10851088      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
    10871091    }
    10881092
     
    12151219 * \return true - tesselation successful, false - tesselation failed
    12161220 */
    1217 bool FindNonConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)
     1221bool FindNonConvexBorder(molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)
    12181222{
    12191223        Info FunctionInfo(__func__);
     
    12361240
    12371241  // initialise Linked Cell
     1242  PointCloudAdaptor< molecule > cloud(mol);
    12381243  if (LCList == NULL) {
    1239     LCList = new LinkedCell(*mol, 2.*RADIUS);
     1244    LCList = new LinkedCell(cloud, 2.*RADIUS);
    12401245    freeLC = true;
    12411246  }
     
    12481253  if (filename != NULL) {
    12491254    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);
    12511256    }
    12521257  }
     
    12881293    if (filename != NULL) {
    12891294      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);
    12911296      }
    12921297    }
Note: See TracChangeset for help on using the changeset viewer.