Changeset ef0e6d for src


Ignore:
Timestamp:
Aug 4, 2009, 1:53:55 PM (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, 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:
9f97c5
Parents:
62bb91
Message:

find_(non)_convex_border TesselStruct is not free'd anymore, mol->TesselStruct used, find_non_convex_border fixes but incomplete

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r62bb91 ref0e6d  
    439439 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename.
    440440 */
    441 void Find_convex_border(ofstream *out, molecule* mol, class Tesselation *&TesselStruct, class LinkedCell *LCList, const char *filename)
     441void Find_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename)
    442442{
    443443  bool BoundaryFreeFlag = false;
     
    446446  cout << Verbose(1) << "Begin of find_convex_border" << endl;
    447447
    448   if (TesselStruct != NULL) // free if allocated
    449     delete(TesselStruct);
    450   TesselStruct = new class Tesselation;
     448  if (mol->TesselStruct != NULL) // free if allocated
     449    delete(mol->TesselStruct);
     450  mol->TesselStruct = new class Tesselation;
    451451
    452452  // 1. Find all points on the boundary
     
    476476  for (int axis = 0; axis < NDIM; axis++)
    477477    for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++)
    478         TesselStruct->AddPoint(runner->second.second);
    479 
    480   *out << Verbose(2) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;
     478        mol->TesselStruct->AddPoint(runner->second.second);
     479
     480  *out << Verbose(2) << "I found " << mol->TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;
    481481  // now we have the whole set of edge points in the BoundaryList
    482482
     
    489489
    490490  // 3a. guess starting triangle
    491   TesselStruct->GuessStartingTriangle(out);
     491  mol->TesselStruct->GuessStartingTriangle(out);
    492492
    493493  // 3b. go through all lines, that are not yet part of two triangles (only of one so far)
    494   TesselStruct->TesselateOnBoundary(out, mol);
     494  mol->TesselStruct->TesselateOnBoundary(out, mol);
    495495
    496496  // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point
    497   if (!TesselStruct->InsertStraddlingPoints(out, mol))
     497  if (!mol->TesselStruct->InsertStraddlingPoints(out, mol, LCList))
    498498    *out << Verbose(1) << "Insertion of straddling points failed!" << endl;
    499499
     500  *out << Verbose(2) << "I created " << mol->TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << mol->TesselStruct->LinesOnBoundary.size() << " lines and " << mol->TesselStruct->PointsOnBoundary.size() << " points." << endl;
     501
     502  // 4. Store triangles in tecplot file
     503  if (filename != NULL) {
     504    if (DoTecplotOutput) {
     505      string OutputName(filename);
     506      OutputName.append("_intermed");
     507      OutputName.append(TecplotSuffix);
     508      ofstream *tecplot = new ofstream(OutputName.c_str());
     509      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
     510      tecplot->close();
     511      delete(tecplot);
     512    }
     513    if (DoRaster3DOutput) {
     514      string OutputName(filename);
     515      OutputName.append("_intermed");
     516      OutputName.append(Raster3DSuffix);
     517      ofstream *rasterplot = new ofstream(OutputName.c_str());
     518      write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
     519      rasterplot->close();
     520      delete(rasterplot);
     521    }
     522  }
     523
    500524  // 3d. check all baselines whether the peaks of the two adjacent triangles with respect to center of baseline are convex, if not, make the baseline between the two peaks and baseline endpoints become the new peaks
    501   if (!TesselStruct->CorrectConcaveBaselines(out))
     525  if (!mol->TesselStruct->CorrectConcaveBaselines(out))
    502526    *out << Verbose(1) << "Correction of concave baselines failed!" << endl;
    503527
    504   *out << Verbose(2) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;
     528  // 3e. we need another correction here, for TesselPoints that are below the surface (i.e. have an odd number of concave triangles surrounding it)
     529//  if (!mol->TesselStruct->CorrectConcaveTesselPoints(out))
     530//    *out << Verbose(1) << "Correction of concave tesselpoints failed!" << endl;
     531
     532  *out << Verbose(2) << "I created " << mol->TesselStruct->TrianglesOnBoundary.size() << " triangles with " << mol->TesselStruct->LinesOnBoundary.size() << " lines and " << mol->TesselStruct->PointsOnBoundary.size() << " points." << endl;
    505533
    506534  // 4. Store triangles in tecplot file
     
    510538      OutputName.append(TecplotSuffix);
    511539      ofstream *tecplot = new ofstream(OutputName.c_str());
    512       write_tecplot_file(out, tecplot, TesselStruct, mol, 0);
     540      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
    513541      tecplot->close();
    514542      delete(tecplot);
     
    518546      OutputName.append(Raster3DSuffix);
    519547      ofstream *rasterplot = new ofstream(OutputName.c_str());
    520       write_raster3d_file(out, rasterplot, TesselStruct, mol);
     548      write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
    521549      rasterplot->close();
    522550      delete(rasterplot);
    523551    }
    524552  }
     553
    525554
    526555  // free reference lists
     
    600629  class Tesselation *TesselStruct = NULL;
    601630  LinkedCell LCList(mol, 10.);
    602   Find_convex_border(out, mol, TesselStruct, &LCList, NULL);
     631  Find_convex_border(out, mol, &LCList, NULL);
    603632  double clustervolume;
    604633  if (ClusterVolume == 0)
     
    728757  Vector FillerDistance;
    729758  double FillIt = false;
    730   atom *Walker = NULL, *Runner = NULL;
     759  atom *Walker = NULL;
    731760  bond *Binder = NULL;
     761  int i;
     762  LinkedCell *LCList[List->ListOfMolecules.size()];
     763
     764  *out << Verbose(0) << "Begin of FillBoxWithMolecule" << endl;
     765
     766  i=0;
     767  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
     768    *out << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl;
     769    LCList[i] = new LinkedCell((*ListRunner), 5.); // get linked cell list
     770    if ((*ListRunner)->TesselStruct == NULL) {
     771      *out << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
     772      Find_non_convex_border((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.);
     773    }
     774    i++;
     775  }
    732776
    733777  // Center filler at origin
     
    735779  filler->Center.Zero();
    736780
     781  filler->CountAtoms(out);
     782  atom * CopyAtoms[filler->AtomCount];
     783  int nr = 0;
     784
    737785  // calculate filler grid in [0,1]^3
    738786  FillerDistance.Init(distance[0], distance[1], distance[2]);
    739787  FillerDistance.InverseMatrixMultiplication(M);
    740   for(int i=0;i<NDIM;i++)
     788  *out << Verbose(1) << "INFO: Grid steps are ";
     789  for(int i=0;i<NDIM;i++) {
    741790    N[i] = (int) ceil(1./FillerDistance.x[i]);
     791    *out << N[i];
     792    if (i != NDIM-1)
     793      *out<< ", ";
     794    else
     795      *out << "." << endl;
     796  }
    742797
    743798  // go over [0,1]^3 filler grid
     
    746801      for (n[2] = 0; n[2] < N[2]; n[2]++) {
    747802        // calculate position of current grid vector in untransformed box
    748         CurrentPosition.Init(n[0], n[1], n[2]);
     803        CurrentPosition.Init((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]);
    749804        CurrentPosition.MatrixMultiplication(M);
     805        *out << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "." << endl;
    750806        // Check whether point is in- or outside
    751807        FillIt = true;
     808        i=0;
    752809        for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
    753           FillIt = FillIt && (!(*ListRunner)->TesselStruct->IsInside(&CurrentPosition));
     810          // get linked cell list
     811          if ((*ListRunner)->TesselStruct == NULL) {
     812            *out << Verbose(1) << "ERROR: TesselStruct of " << (*ListRunner) << " is NULL. Didn't we pre-create it?" << endl;
     813            FillIt = false;
     814          } else
     815            FillIt = FillIt && (!(*ListRunner)->TesselStruct->IsInnerPoint(out, CurrentPosition, LCList[i++]));
    754816        }
    755817
     
    761823          for (int i=0;i<NDIM;i++)
    762824            FillerTranslations.x[i] = RandomMolDisplacement*(rand()/(RAND_MAX/2.) - 1.);
     825          *out << Verbose(3) << "INFO: Translating this filler by " << FillerTranslations << "." << endl;
    763826
    764827          // go through all atoms
     828          nr=0;
    765829          Walker = filler->start;
    766           while (Walker != filler->end) {
     830          while (Walker->next != filler->end) {
    767831            Walker = Walker->next;
    768832            // copy atom ...
    769             *Runner = new atom(Walker);
     833            CopyAtoms[Walker->nr] = new atom(Walker);
    770834
    771835            // create atomic random translation vector ...
     
    793857            // ... and put at new position
    794858            if (DoRandomRotation)
    795               Runner->x.MatrixMultiplication(Rotations);
    796             Runner->x.AddVector(&AtomTranslations);
    797             Runner->x.AddVector(&FillerTranslations);
    798             Runner->x.AddVector(&CurrentPosition);
     859              CopyAtoms[Walker->nr]->x.MatrixMultiplication(Rotations);
     860            CopyAtoms[Walker->nr]->x.AddVector(&AtomTranslations);
     861            CopyAtoms[Walker->nr]->x.AddVector(&FillerTranslations);
     862            CopyAtoms[Walker->nr]->x.AddVector(&CurrentPosition);
     863
    799864            // insert into Filling
    800             Filling->AddAtom(Runner);
     865            *out << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;
     866            Filling->AddAtom(CopyAtoms[Walker->nr]);
    801867          }
    802868
    803869          // go through all bonds and add as well
    804870          Binder = filler->first;
    805           while(Binder != filler->last) {
     871          while(Binder->next != filler->last) {
    806872            Binder = Binder->next;
     873            *out << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;
     874            Filling->AddBond(CopyAtoms[Binder->leftatom->nr], CopyAtoms[Binder->rightatom->nr], Binder->BondDegree);
    807875          }
    808876        } else {
     
    811879        }
    812880      }
     881  *out << Verbose(0) << "End of FillBoxWithMolecule" << endl;
     882
    813883  return Filling;
    814884};
     
    823893 * \para RADIUS radius of the virtual sphere
    824894 */
    825 void Find_non_convex_border(ofstream *out, molecule* mol, class Tesselation *Tess, class LinkedCell *LCList, const char *filename, const double RADIUS)
     895void Find_non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS)
    826896{
    827897  int N = 0;
    828   bool freeTess = false;
    829898  bool freeLC = false;
    830899  ofstream *tempstream = NULL;
     
    833902
    834903  *out << Verbose(1) << "Entering search for non convex hull. " << endl;
    835   if (Tess == NULL) {
     904  if (mol->TesselStruct == NULL) {
    836905    *out << Verbose(1) << "Allocating Tesselation struct ..." << endl;
    837     Tess = new Tesselation;
    838     freeTess = true;
     906    mol->TesselStruct = new Tesselation;
     907  } else {
     908    delete(mol->TesselStruct);
     909    *out << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl;
     910    mol->TesselStruct = new Tesselation;
    839911  }
    840912  LineMap::iterator baseline;
     
    849921  }
    850922
    851   Tess->Find_starting_triangle(out, RADIUS, LCList);
    852 
    853   baseline = Tess->LinesOnBoundary.begin();
    854   while ((baseline != Tess->LinesOnBoundary.end()) || (flag)) {
     923  mol->TesselStruct->Find_starting_triangle(out, RADIUS, LCList);
     924
     925  baseline = mol->TesselStruct->LinesOnBoundary.begin();
     926  while ((baseline != mol->TesselStruct->LinesOnBoundary.end()) || (flag)) {
    855927    if (baseline->second->TrianglesCount == 1) {
    856       failflag = Tess->Find_next_suitable_triangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, N, LCList); //the line is there, so there is a triangle, but only one.
     928      failflag = mol->TesselStruct->Find_next_suitable_triangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, N, LCList); //the line is there, so there is a triangle, but only one.
    857929      flag = flag || failflag;
    858930      if (!failflag)
     
    861933      //cout << Verbose(1) << "Line " << *baseline->second << " has " << baseline->second->TrianglesCount << " triangles adjacent" << endl;
    862934      if (baseline->second->TrianglesCount != 2)
    863         cout << Verbose(1) << "ERROR: TESSELATION FINISHED WITH INVALID TRIANGLE COUNT!" << endl;
     935        *out << Verbose(1) << "ERROR: TESSELATION FINISHED WITH INVALID TRIANGLE COUNT!" << endl;
    864936    }
    865937
    866938    N++;
    867939    baseline++;
    868     if ((baseline == Tess->LinesOnBoundary.end()) && (flag)) {
    869       baseline = Tess->LinesOnBoundary.begin();   // restart if we reach end due to newly inserted lines
     940    if ((baseline == mol->TesselStruct->LinesOnBoundary.end()) && (flag)) {
     941      baseline = mol->TesselStruct->LinesOnBoundary.begin();   // restart if we reach end due to newly inserted lines
    870942      flag = false;
    871943    }
    872944
    873945    // write temporary envelope
    874     if ((DoSingleStepOutput && (Tess->TrianglesOnBoundaryCount % 1 == 0))) { // if we have a new triangle and want to output each new triangle configuration
    875       class BoundaryTriangleSet *triangle = (Tess->TrianglesOnBoundary.end()--)->second;
     946    if ((DoSingleStepOutput && (mol->TesselStruct->TrianglesOnBoundaryCount % 1 == 0))) { // if we have a new triangle and want to output each new triangle configuration
     947      class BoundaryTriangleSet *triangle = (mol->TesselStruct->TrianglesOnBoundary.end()--)->second;
    876948      sprintf(NumberName, "-%04d-%s_%s_%s", TriangleFilesWritten, triangle->endpoints[0]->node->Name, triangle->endpoints[1]->node->Name, triangle->endpoints[2]->node->Name);
    877949      if (DoTecplotOutput) {
     
    881953        NameofTempFile.erase(npos, 1);
    882954        NameofTempFile.append(TecplotSuffix);
    883         cout << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
     955        *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    884956        tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    885         write_tecplot_file(out, tempstream, Tess, mol, TriangleFilesWritten);
     957        write_tecplot_file(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
    886958        tempstream->close();
    887959        tempstream->flush();
     
    895967        NameofTempFile.erase(npos, 1);
    896968        NameofTempFile.append(Raster3DSuffix);
    897         cout << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
     969        *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    898970        tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    899         write_raster3d_file(out, tempstream, Tess, mol);
     971        write_raster3d_file(out, tempstream, mol->TesselStruct, mol);
    900972//        // include the current position of the virtual sphere in the temporary raster3d file
    901973//        // make the circumsphere's center absolute again
     
    9301002      OutputName.append(TecplotSuffix);
    9311003      ofstream *tecplot = new ofstream(OutputName.c_str());
    932       write_tecplot_file(out, tecplot, Tess, mol, -1);
     1004      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, -1);
    9331005      tecplot->close();
    9341006      delete(tecplot);
     
    9381010      OutputName.append(Raster3DSuffix);
    9391011      ofstream *raster = new ofstream(OutputName.c_str());
    940       write_raster3d_file(out, raster, Tess, mol);
     1012      write_raster3d_file(out, raster, mol->TesselStruct, mol);
    9411013      raster->close();
    9421014      delete(raster);
     
    9481020  cout << Verbose(2) << "Check: List of Baselines with not two connected triangles:" << endl;
    9491021  int counter = 0;
    950   for (testline = Tess->LinesOnBoundary.begin(); testline != Tess->LinesOnBoundary.end(); testline++) {
     1022  for (testline = mol->TesselStruct->LinesOnBoundary.begin(); testline != mol->TesselStruct->LinesOnBoundary.end(); testline++) {
    9511023    if (testline->second->TrianglesCount != 2) {
    9521024      cout << Verbose(2) << *testline->second << "\t" << testline->second->TrianglesCount << endl;
     
    9551027  }
    9561028  if (counter == 0)
    957     cout << Verbose(2) << "None." << endl;
    958 
    959   // Tests the IsInnerAtom() function.
    960   Vector x (0, 0, 0);
    961   cout << Verbose(0) << "Point to check: " << x << endl;
    962   cout << Verbose(0) << "Check: IsInnerPoint() returns " << IsInnerPoint(x, Tess, LCList)
    963     << "for vector " << x << "." << endl;
    964   TesselPoint* a = Tess->PointsOnBoundary.begin()->second->node;
    965   cout << Verbose(0) << "Point to check: " << *a << " (on boundary)." << endl;
    966   cout << Verbose(0) << "Check: IsInnerAtom() returns " << IsInnerPoint(a, Tess, LCList)
    967     << "for atom " << a << " (on boundary)." << endl;
    968   LinkedNodes *List = NULL;
    969   for (int i=0;i<NDIM;i++) { // each axis
    970     LCList->n[i] = LCList->N[i]-1; // current axis is topmost cell
    971     for (LCList->n[(i+1)%NDIM]=0;LCList->n[(i+1)%NDIM]<LCList->N[(i+1)%NDIM];LCList->n[(i+1)%NDIM]++)
    972       for (LCList->n[(i+2)%NDIM]=0;LCList->n[(i+2)%NDIM]<LCList->N[(i+2)%NDIM];LCList->n[(i+2)%NDIM]++) {
    973         List = LCList->GetCurrentCell();
    974         //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    975         if (List != NULL) {
    976           for (LinkedNodes::iterator Runner = List->begin();Runner != List->end();Runner++) {
    977             if (Tess->PointsOnBoundary.find((*Runner)->nr) == Tess->PointsOnBoundary.end()) {
    978               a = *Runner;
    979               i=3;
    980               for (int j=0;j<NDIM;j++)
    981                 LCList->n[j] = LCList->N[j];
    982               break;
    983             }
    984           }
    985         }
    986       }
    987   }
    988   cout << Verbose(0) << "Check: IsInnerPoint() returns " << IsInnerPoint(a, Tess, LCList)
    989     << "for atom " << a << " (inside)." << endl;
    990 
    991 
    992   if (freeTess)
    993     delete(Tess);
     1029    *out << Verbose(2) << "None." << endl;
     1030
     1031//  // Tests the IsInnerAtom() function.
     1032//  Vector x (0, 0, 0);
     1033//  *out << Verbose(0) << "Point to check: " << x << endl;
     1034//  *out << Verbose(0) << "Check: IsInnerPoint() returns " << mol->TesselStruct->IsInnerPoint(out, x, LCList)
     1035//    << "for vector " << x << "." << endl;
     1036//  TesselPoint* a = mol->TesselStruct->PointsOnBoundary.begin()->second->node;
     1037//  *out << Verbose(0) << "Point to check: " << *a << " (on boundary)." << endl;
     1038//  *out << Verbose(0) << "Check: IsInnerAtom() returns " << mol->TesselStruct->IsInnerPoint(out, a, LCList)
     1039//    << "for atom " << a << " (on boundary)." << endl;
     1040//  LinkedNodes *List = NULL;
     1041//  for (int i=0;i<NDIM;i++) { // each axis
     1042//    LCList->n[i] = LCList->N[i]-1; // current axis is topmost cell
     1043//    for (LCList->n[(i+1)%NDIM]=0;LCList->n[(i+1)%NDIM]<LCList->N[(i+1)%NDIM];LCList->n[(i+1)%NDIM]++)
     1044//      for (LCList->n[(i+2)%NDIM]=0;LCList->n[(i+2)%NDIM]<LCList->N[(i+2)%NDIM];LCList->n[(i+2)%NDIM]++) {
     1045//        List = LCList->GetCurrentCell();
     1046//        //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
     1047//        if (List != NULL) {
     1048//          for (LinkedNodes::iterator Runner = List->begin();Runner != List->end();Runner++) {
     1049//            if (mol->TesselStruct->PointsOnBoundary.find((*Runner)->nr) == mol->TesselStruct->PointsOnBoundary.end()) {
     1050//              a = *Runner;
     1051//              i=3;
     1052//              for (int j=0;j<NDIM;j++)
     1053//                LCList->n[j] = LCList->N[j];
     1054//              break;
     1055//            }
     1056//          }
     1057//        }
     1058//      }
     1059//  }
     1060//  *out << Verbose(0) << "Check: IsInnerPoint() returns " << mol->TesselStruct->IsInnerPoint(out, a, LCList)
     1061//    << "for atom " << a << " (inside)." << endl;
     1062
     1063
    9941064  if (freeLC)
    9951065    delete(LCList);
  • src/boundary.hpp

    r62bb91 ref0e6d  
    3636void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity);
    3737molecule * FillBoxWithMolecule(ofstream *out, MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandAtomDisplacement, double RandMolDisplacement, bool DoRandomRotation);
    38 void Find_convex_border(ofstream *out, molecule* mol, class Tesselation *&TesselStruct, class LinkedCell *LCList, const char *filename);
    39 void Find_non_convex_border(ofstream *out, molecule* mol, class Tesselation *T, class LinkedCell *LC, const char *tempbasename, const double RADIUS);
     38void Find_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename);
     39void Find_non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LC, const char *tempbasename, const double RADIUS);
    4040void Find_next_suitable_point(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);
    4141Boundaries *GetBoundaryPoints(ofstream *out, molecule *mol);
Note: See TracChangeset for help on using the changeset viewer.