Changeset 34c43a for src/tesselationhelpers.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, Candidate_v1.7.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:
- 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/tesselationhelpers.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tesselationhelpers.cpp
rba5215 r34c43a 28 28 #include "CandidateForTesselation.hpp" 29 29 #include "CodePatterns/Info.hpp" 30 #include "CodePatterns/Log.hpp" 31 #include "CodePatterns/Verbose.hpp" 32 #include "IPointCloud.hpp" 33 #include "LinearAlgebra/Line.hpp" 34 #include "LinearAlgebra/LinearSystemOfEquations.hpp" 35 #include "LinearAlgebra/Plane.hpp" 36 #include "LinearAlgebra/RealSpaceMatrix.hpp" 37 #include "LinearAlgebra/Vector.hpp" 38 #include "LinearAlgebra/vector_ops.hpp" 30 39 #include "linkedcell.hpp" 31 #include "LinearAlgebra/LinearSystemOfEquations.hpp"32 #include "CodePatterns/Log.hpp"33 40 #include "tesselation.hpp" 34 41 #include "tesselationhelpers.hpp" 35 #include "LinearAlgebra/Vector.hpp"36 #include "LinearAlgebra/Line.hpp"37 #include "LinearAlgebra/vector_ops.hpp"38 #include "CodePatterns/Verbose.hpp"39 #include "LinearAlgebra/Plane.hpp"40 #include "LinearAlgebra/RealSpaceMatrix.hpp"41 42 42 43 void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS) … … 427 428 for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++) 428 429 for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) { 429 const LinkedCell::LinkedNodes*List = LC->GetCurrentCell();430 const TesselPointSTLList *List = LC->GetCurrentCell(); 430 431 //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl; 431 432 if (List != NULL) { 432 for ( LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {433 for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 433 434 helper = (Point) - ((*Runner)->getPosition()); 434 435 double currentNorm = helper. Norm(); … … 480 481 for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++) 481 482 for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) { 482 const LinkedCell::LinkedNodes*List = LC->GetCurrentCell();483 const TesselPointSTLList *List = LC->GetCurrentCell(); 483 484 //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl; 484 485 if (List != NULL) { 485 for ( LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {486 for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 486 487 helper = (Point) - ((*Runner)->getPosition()); 487 488 double currentNorm = helper.NormSquared(); … … 569 570 * \param *mol molecule structure with atom positions 570 571 */ 571 void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * constcloud)572 void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, IPointCloud & cloud) 572 573 { 573 574 Info FunctionInfo(__func__); 574 575 TesselPoint *Walker = NULL; 575 576 int i; 576 Vector *center = cloud ->GetCenter();577 Vector *center = cloud.GetCenter(); 577 578 if (vrmlfile != NULL) { 578 579 //Log() << Verbose(1) << "Writing Raster3D file ... "; … … 580 581 *vrmlfile << "#Created by molecuilder" << endl; 581 582 *vrmlfile << "#All atoms as spheres" << endl; 582 cloud ->GoToFirst();583 while (!cloud ->IsEnd()) {584 Walker = cloud ->GetPoint();583 cloud.GoToFirst(); 584 while (!cloud.IsEnd()) { 585 Walker = cloud.GetPoint(); 585 586 *vrmlfile << "Sphere {" << endl << " "; // 2 is sphere type 586 587 for (i=0;i<NDIM;i++) 587 588 *vrmlfile << Walker->at(i)-center->at(i) << " "; 588 589 *vrmlfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour 589 cloud ->GoToNext();590 cloud.GoToNext(); 590 591 } 591 592 … … 613 614 * \param *mol molecule structure with atom positions 614 615 */ 615 void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * constcloud)616 void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation * const Tess, IPointCloud & cloud) 616 617 { 617 618 Info FunctionInfo(__func__); … … 620 621 if (Tess->LastTriangle != NULL) { 621 622 // include the current position of the virtual sphere in the temporary raster3d file 622 Vector *center = cloud ->GetCenter();623 Vector *center = cloud.GetCenter(); 623 624 // make the circumsphere's center absolute again 624 625 Vector helper = (1./3.) * ((Tess->LastTriangle->endpoints[0]->node->getPosition()) + … … 641 642 * \param *mol molecule structure with atom positions 642 643 */ 643 void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * constcloud)644 void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, IPointCloud & cloud) 644 645 { 645 646 Info FunctionInfo(__func__); 646 647 TesselPoint *Walker = NULL; 647 648 int i; 648 Vector *center = cloud ->GetCenter();649 Vector *center = cloud.GetCenter(); 649 650 if (rasterfile != NULL) { 650 651 //Log() << Verbose(1) << "Writing Raster3D file ... "; … … 652 653 *rasterfile << "@header.r3d" << endl; 653 654 *rasterfile << "# All atoms as spheres" << endl; 654 cloud ->GoToFirst();655 while (!cloud ->IsEnd()) {656 Walker = cloud ->GetPoint();655 cloud.GoToFirst(); 656 while (!cloud.IsEnd()) { 657 Walker = cloud.GetPoint(); 657 658 *rasterfile << "2" << endl << " "; // 2 is sphere type 658 659 for (int j=0;j<NDIM;j++) { // and for each node all NDIM coordinates … … 661 662 } 662 663 *rasterfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour 663 cloud ->GoToNext();664 cloud.GoToNext(); 664 665 } 665 666 … … 691 692 * \param N arbitrary number to differentiate various zones in the tecplot format 692 693 */ 693 void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * constcloud, const int N)694 void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, IPointCloud & cloud, const int N) 694 695 { 695 696 Info FunctionInfo(__func__); … … 700 701 *tecplot << "ZONE T=\""; 701 702 if (N < 0) { 702 *tecplot << cloud ->GetName();703 *tecplot << cloud.GetName(); 703 704 } else { 704 705 *tecplot << N << "-"; … … 711 712 } 712 713 *tecplot << "\", N=" << TesselStruct->PointsOnBoundary.size() << ", E=" << TesselStruct->TrianglesOnBoundary.size() << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl; 713 const int MaxId=cloud->GetMaxId(); 714 int *LookupList = new int[MaxId]; 715 for (int i=0; i< MaxId ; i++){ 714 const int MaxId=cloud.GetMaxId(); 715 ASSERT(MaxId >= 0, "WriteTecplotFile() - negative MaxId? No atoms present?"); 716 int *LookupList = new int[MaxId+1]; 717 for (int i=0; i<= MaxId ; i++){ 716 718 LookupList[i] = -1; 717 719 } … … 722 724 for (PointMap::const_iterator target = TesselStruct->PointsOnBoundary.begin(); target != TesselStruct->PointsOnBoundary.end(); ++target) { 723 725 Walker = target->second->node; 726 ASSERT(Walker->nr <= MaxId, "WriteTecplotFile() - Id of particle greater than MaxId."); 724 727 LookupList[Walker->nr] = Counter++; 725 728 for (int i=0;i<NDIM;i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
