Changeset 34e0592 for src/boundary.cpp


Ignore:
Timestamp:
Aug 20, 2009, 7:48:07 AM (16 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:
78b73c, 9ba9ee
Parents:
1d9b7aa (diff), 7c14ec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Frederik Heber <heber@…> (08/19/09 14:40:33)
git-committer:
Frederik Heber <heber@…> (08/20/09 07:48:07)
Message:

Merge branch 'ConcaveHull' of ssh://stud64d-02/home/metzler/workspace/espack into Ticket14

Conflicts:

molecuilder/src/boundary.cpp
molecuilder/src/tesselation.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r1d9b7aa r34e0592  
    118118 * \param *mol molecule structure with atom positions
    119119 */
    120 void write_vrml_file(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, class molecule *mol)
     120void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, class molecule *mol)
    121121{
    122122  atom *Walker = mol->start;
     
    172172 * \param *mol molecule structure with atom positions
    173173 */
    174 void write_raster3d_file(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, class molecule *mol)
     174void WriteRaster3dFile(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, class molecule *mol)
    175175{
    176176  atom *Walker = mol->start;
     
    227227 * \param N arbitrary number to differentiate various zones in the tecplot format
    228228 */
    229 void write_tecplot_file(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, class molecule *mol, int N)
     229void WriteTecplotFile(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, class molecule *mol, int N)
    230230{
    231231  if ((tecplot != NULL) && (TesselStruct != NULL)) {
     
    440440 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename.
    441441 */
    442 void Find_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename)
     442void FindConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename)
    443443{
    444444  bool BoundaryFreeFlag = false;
    445445  Boundaries *BoundaryPoints = NULL;
    446446
    447   cout << Verbose(1) << "Begin of find_convex_border" << endl;
     447  cout << Verbose(1) << "Begin of FindConvexBorder" << endl;
    448448
    449449  if (mol->TesselStruct != NULL) // free if allocated
     
    509509      OutputName.append(TecplotSuffix);
    510510      ofstream *tecplot = new ofstream(OutputName.c_str());
    511       write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
     511      WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
    512512      tecplot->close();
    513513      delete(tecplot);
     
    518518      OutputName.append(Raster3DSuffix);
    519519      ofstream *rasterplot = new ofstream(OutputName.c_str());
    520       write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
     520      WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
    521521      rasterplot->close();
    522522      delete(rasterplot);
     
    556556      OutputName.append(TecplotSuffix);
    557557      ofstream *tecplot = new ofstream(OutputName.c_str());
    558       write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
     558      WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
    559559      tecplot->close();
    560560      delete(tecplot);
     
    564564      OutputName.append(Raster3DSuffix);
    565565      ofstream *rasterplot = new ofstream(OutputName.c_str());
    566       write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
     566      WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
    567567      rasterplot->close();
    568568      delete(rasterplot);
     
    575575    delete[] (BoundaryPoints);
    576576
    577   cout << Verbose(1) << "End of find_convex_border" << endl;
     577  cout << Verbose(1) << "End of FindConvexBorder" << endl;
    578578};
    579579
     
    732732      OutputName.append(TecplotSuffix);
    733733      ofstream *tecplot = new ofstream(OutputName.c_str());
    734       write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
     734      WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
    735735      tecplot->close();
    736736      delete(tecplot);
     
    741741      OutputName.append(Raster3DSuffix);
    742742      ofstream *rasterplot = new ofstream(OutputName.c_str());
    743       write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
     743      WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
    744744      rasterplot->close();
    745745      delete(rasterplot);
     
    816816  class Tesselation *TesselStruct = NULL;
    817817  LinkedCell LCList(mol, 10.);
    818   Find_convex_border(out, mol, &LCList, NULL);
     818  FindConvexBorder(out, mol, &LCList, NULL);
    819819  double clustervolume;
    820820  if (ClusterVolume == 0)
     
    957957    if ((*ListRunner)->TesselStruct == NULL) {
    958958      *out << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
    959       Find_non_convex_border((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.);
     959      FindNonConvexBorder((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.);
    960960    }
    961961    i++;
     
    10821082 * \para RADIUS radius of the virtual sphere
    10831083 */
    1084 void Find_non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS)
     1084void FindNonConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS)
    10851085{
    10861086  int N = 0;
     
    11011101  LineMap::iterator baseline;
    11021102  LineMap::iterator testline;
    1103   *out << Verbose(0) << "Begin of Find_non_convex_border\n";
     1103  *out << Verbose(0) << "Begin of FindNonConvexBorder\n";
    11041104  bool flag = false;  // marks whether we went once through all baselines without finding any without two triangles
    11051105  bool failflag = false;
     
    11101110  }
    11111111
    1112   mol->TesselStruct->Find_starting_triangle(out, RADIUS, LCList);
     1112  mol->TesselStruct->FindStartingTriangle(out, RADIUS, LCList);
    11131113
    11141114  baseline = mol->TesselStruct->LinesOnBoundary.begin();
     
    11191119  while ((baseline != mol->TesselStruct->LinesOnBoundary.end()) || (flag)) {
    11201120    if (baseline->second->triangles.size() == 1) {
    1121       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.
     1121      failflag = mol->TesselStruct->FindNextSuitableTriangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, N, LCList); //the line is there, so there is a triangle, but only one.
    11221122      flag = flag || failflag;
    11231123      if (!failflag)
    1124         cerr << "WARNING: Find_next_suitable_triangle failed." << endl;
     1124        cerr << "WARNING: FindNextSuitableTriangle failed." << endl;
    11251125      // write temporary envelope
    11261126      if ((DoSingleStepOutput && (mol->TesselStruct->TrianglesOnBoundaryCount % SingleStepWidth == 0))) { // if we have a new triangle and want to output each new triangle configuration
     
    11381138            *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    11391139            tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    1140             write_tecplot_file(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
     1140            WriteTecplotFile(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
    11411141            tempstream->close();
    11421142            tempstream->flush();
     
    11521152            *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    11531153            tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    1154             write_raster3d_file(out, tempstream, mol->TesselStruct, mol);
     1154            WriteRaster3dFile(out, tempstream, mol->TesselStruct, mol);
    11551155    //        // include the current position of the virtual sphere in the temporary raster3d file
    11561156    //        // make the circumsphere's center absolute again
     
    11911191  }
    11921192
     1193  // Purges surplus triangles.
     1194  mol->TesselStruct->RemoveDegeneratedTriangles();
     1195
    11931196  // write final envelope
    11941197  if (filename != 0) {
     
    11981201      OutputName.append(TecplotSuffix);
    11991202      ofstream *tecplot = new ofstream(OutputName.c_str());
    1200       write_tecplot_file(out, tecplot, mol->TesselStruct, mol, -1);
     1203      WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, -1);
    12011204      tecplot->close();
    12021205      delete(tecplot);
     
    12061209      OutputName.append(Raster3DSuffix);
    12071210      ofstream *raster = new ofstream(OutputName.c_str());
    1208       write_raster3d_file(out, raster, mol->TesselStruct, mol);
     1211      WriteRaster3dFile(out, raster, mol->TesselStruct, mol);
    12091212      raster->close();
    12101213      delete(raster);
     
    12571260//    << "for atom " << a << " (inside)." << endl;
    12581261
    1259 
    12601262  if (freeLC)
    12611263    delete(LCList);
    1262   *out << Verbose(0) << "End of Find_non_convex_border\n";
     1264  *out << Verbose(0) << "End of FindNonConvexBorder\n";
    12631265};
    12641266
Note: See TracChangeset for help on using the changeset viewer.