- Timestamp:
- Oct 27, 2009, 5:41:12 PM (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, 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:
- d96277
- Parents:
- fb73b8
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.cpp
rfb73b8 rc0f6c6 1746 1746 1747 1747 // construct old center 1748 GetCenterofCircumcircle(&OldSphereCenter, T.endpoints[0]->node->node, T.endpoints[1]->node->node,T.endpoints[2]->node->node);1748 GetCenterofCircumcircle(&OldSphereCenter, *T.endpoints[0]->node->node, *T.endpoints[1]->node->node, *T.endpoints[2]->node->node); 1749 1749 helper.CopyVector(&T.NormalVector); // normal vector ensures that this is correct center of the two possible ones 1750 1750 radius = Line.endpoints[0]->node->node->DistanceSquared(&OldSphereCenter); … … 1805 1805 AddTesselationPoint(BaseRay->endpoints[1]->node, 2); 1806 1806 1807 if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet ** )TPS)) {1807 if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet ** const )TPS)) { 1808 1808 AddTesselationLine(TPS[0], TPS[1], 0); 1809 1809 AddTesselationLine(TPS[0], TPS[2], 1); … … 1834 1834 // We demand that at most one new degenerate line is created and that this line also already exists (which has to be the case due to existentTrianglesCount == 1) 1835 1835 // i.e. at least one of the three lines must be present with TriangleCount <= 1 1836 if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet ** )TPS)) {1836 if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet ** const)TPS)) { 1837 1837 AddTesselationLine(TPS[0], TPS[1], 0); 1838 1838 AddTesselationLine(TPS[0], TPS[2], 1); … … 1996 1996 1997 1997 // calculate volume 1998 volume = CalculateVolumeofGeneralTetraeder( Base->endpoints[1]->node->node, OtherBase->endpoints[0]->node->node, OtherBase->endpoints[1]->node->node,Base->endpoints[0]->node->node);1998 volume = CalculateVolumeofGeneralTetraeder(*Base->endpoints[1]->node->node, *OtherBase->endpoints[0]->node->node, *OtherBase->endpoints[1]->node->node, *Base->endpoints[0]->node->node); 1999 1999 2000 2000 // delete the temporary other base line and the closest points … … 2361 2361 2362 2362 // construct both new centers 2363 GetCenterofCircumcircle(&NewSphereCenter, BaseLine->endpoints[0]->node->node, BaseLine->endpoints[1]->node->node,Candidate->node);2363 GetCenterofCircumcircle(&NewSphereCenter, *BaseLine->endpoints[0]->node->node, *BaseLine->endpoints[1]->node->node, *Candidate->node); 2364 2364 OtherNewSphereCenter.CopyVector(&NewSphereCenter); 2365 2365 … … 3138 3138 AddTesselationTriangle(); 3139 3139 // calculate volume summand as a general tetraeder 3140 volume += CalculateVolumeofGeneralTetraeder( TPS[0]->node->node, TPS[1]->node->node, TPS[2]->node->node, &OldPoint);3140 volume += CalculateVolumeofGeneralTetraeder(*TPS[0]->node->node, *TPS[1]->node->node, *TPS[2]->node->node, OldPoint); 3141 3141 // advance number 3142 3142 count++; -
src/tesselationhelpers.cpp
rfb73b8 rc0f6c6 14 14 #include "verbose.hpp" 15 15 16 double DetGet(gsl_matrix * A,int inPlace) {16 double DetGet(gsl_matrix * const A, const int inPlace) { 17 17 /* 18 18 inPlace = 1 => A is replaced with the LU decomposed copy. … … 42 42 }; 43 43 44 void GetSphere(Vector * center, Vector &a, Vector &b, Vector &c,double RADIUS)44 void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS) 45 45 { 46 46 gsl_matrix *A = gsl_matrix_calloc(3,3); … … 96 96 * @param b vector second point of triangle 97 97 * @param c vector third point of triangle 98 * @param *Umkreismittelpunkt new c neter point of circumference98 * @param *Umkreismittelpunkt new center point of circumference 99 99 * @param Direction vector indicates up/down 100 * @param AlternativeDirection vecotr, needed in case the triangles have 90 deg angle100 * @param AlternativeDirection Vector, needed in case the triangles have 90 deg angle 101 101 * @param Halfplaneindicator double indicates whether Direction is up or down 102 * @param AlternativeIndicator doub e indicates in case of orthogonal triangles which direction of AlternativeDirection is suitable102 * @param AlternativeIndicator double indicates in case of orthogonal triangles which direction of AlternativeDirection is suitable 103 103 * @param alpha double angle at a 104 104 * @param beta double, angle at b … … 107 107 * @param Umkreisradius double radius of circumscribing circle 108 108 */ 109 void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector*AlternativeDirection,110 double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS,double Umkreisradius)109 void GetCenterOfSphere(Vector* const & Center, const Vector &a, const Vector &b, const Vector &c, Vector * const NewUmkreismittelpunkt, const Vector* const Direction, const Vector* const AlternativeDirection, 110 const double HalfplaneIndicator, const double AlternativeIndicator, const double alpha, const double beta, const double gamma, const double RADIUS, const double Umkreisradius) 111 111 { 112 112 Vector TempNormal, helper; … … 171 171 * \param *c third point 172 172 */ 173 void GetCenterofCircumcircle(Vector * Center, Vector *a, Vector *b, Vector *c)173 void GetCenterofCircumcircle(Vector * const Center, const Vector &a, const Vector &b, const Vector &c) 174 174 { 175 175 Vector helper; … … 177 177 Vector SideA, SideB, SideC; 178 178 SideA.CopyVector(b); 179 SideA.SubtractVector( c);179 SideA.SubtractVector(&c); 180 180 SideB.CopyVector(c); 181 SideB.SubtractVector( a);181 SideB.SubtractVector(&a); 182 182 SideC.CopyVector(a); 183 SideC.SubtractVector( b);183 SideC.SubtractVector(&b); 184 184 alpha = M_PI - SideB.Angle(&SideC); 185 185 beta = M_PI - SideC.Angle(&SideA); … … 215 215 * \return Angle between \a NewSphereCenter and \a OldSphereCenter relative to \a CircleCenter, 2.*M_PI if one test fails 216 216 */ 217 double GetPathLengthonCircumCircle( Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector,Vector &SearchDirection)217 double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection) 218 218 { 219 219 Vector helper; … … 300 300 * @return true if there is an intersection between the given lines, false otherwise 301 301 */ 302 bool existsIntersection( Vector point1, Vector point2, Vector point3, Vectorpoint4)302 bool existsIntersection(const Vector &point1, const Vector &point2, const Vector &point3, const Vector &point4) 303 303 { 304 304 bool result; … … 403 403 * @return angle between point and reference 404 404 */ 405 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector)405 double GetAngle(const Vector &point, const Vector &reference, const Vector &OrthogonalVector) 406 406 { 407 407 if (reference.IsZero()) … … 429 429 * \return \f$ \frac{1}{6} \cdot ((a-d) \times (a-c) \cdot (a-b)) \f$ 430 430 */ 431 double CalculateVolumeofGeneralTetraeder( Vector *a, Vector *b, Vector *c, Vector *d)431 double CalculateVolumeofGeneralTetraeder(const Vector &a, const Vector &b, const Vector &c, const Vector &d) 432 432 { 433 433 Vector Point, TetraederVector[3]; … … 438 438 TetraederVector[2].CopyVector(c); 439 439 for (int j=0;j<3;j++) 440 TetraederVector[j].SubtractVector( d);440 TetraederVector[j].SubtractVector(&d); 441 441 Point.CopyVector(&TetraederVector[0]); 442 442 Point.VectorProduct(&TetraederVector[1]); … … 452 452 * \return true - there is such a line (i.e. creation of degenerated triangle is valid), false - no such line (don't create) 453 453 */ 454 bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * nodes[3])454 bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]) 455 455 { 456 456 bool result = false; … … 536 536 * @return point which is second closest to the provided one 537 537 */ 538 TesselPoint* FindSecondClosestPoint(const Vector* Point, LinkedCell*LC)538 TesselPoint* FindSecondClosestPoint(const Vector* Point, const LinkedCell* const LC) 539 539 { 540 540 TesselPoint* closestPoint = NULL; … … 649 649 * \return Vector on reference line that has closest distance 650 650 */ 651 Vector * GetClosestPointBetweenLine(ofstream *out, const BoundaryLineSet * Base, const BoundaryLineSet *OtherBase)651 Vector * GetClosestPointBetweenLine(ofstream *out, const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase) 652 652 { 653 653 // construct the plane of the two baselines (i.e. take both their directional vectors) … … 689 689 * \return distance between \a *x and plane defined by \a *triangle, -1 - if something went wrong 690 690 */ 691 double DistanceToTrianglePlane(ofstream * out, const Vector *x, const BoundaryTriangleSet *triangle)691 double DistanceToTrianglePlane(ofstream * const out, const Vector *x, const BoundaryTriangleSet * const triangle) 692 692 { 693 693 double distance = 0.; … … 705 705 * \param *mol molecule structure with atom positions 706 706 */ 707 void WriteVrmlFile(ofstream * out, ofstream *vrmlfile, const Tesselation *Tess, const PointCloud *cloud)707 void WriteVrmlFile(ofstream * const out, ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud) 708 708 { 709 709 TesselPoint *Walker = NULL; … … 748 748 * \param *mol molecule structure with atom positions 749 749 */ 750 void IncludeSphereinRaster3D(ofstream * out, ofstream *rasterfile, const Tesselation *Tess, const PointCloud *cloud)750 void IncludeSphereinRaster3D(ofstream * const out, ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud) 751 751 { 752 752 Vector helper; … … 773 773 * \param *mol molecule structure with atom positions 774 774 */ 775 void WriteRaster3dFile(ofstream * out, ofstream *rasterfile, const Tesselation *Tess, const PointCloud *cloud)775 void WriteRaster3dFile(ofstream * const out, ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud) 776 776 { 777 777 TesselPoint *Walker = NULL; … … 818 818 * \param N arbitrary number to differentiate various zones in the tecplot format 819 819 */ 820 void WriteTecplotFile(ofstream * out, ofstream *tecplot, const Tesselation *TesselStruct, const PointCloud *cloud, const int N)820 void WriteTecplotFile(ofstream * const out, ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N) 821 821 { 822 822 if ((tecplot != NULL) && (TesselStruct != NULL)) { … … 859 859 * \param *TesselStruct pointer to Tesselation structure 860 860 */ 861 void CalculateConcavityPerBoundaryPoint(ofstream * out, const Tesselation *TesselStruct)861 void CalculateConcavityPerBoundaryPoint(ofstream * const out, const Tesselation * const TesselStruct) 862 862 { 863 863 class BoundaryPointSet *point = NULL; … … 886 886 * \return true - all have exactly two triangles, false - some not, list is printed to screen 887 887 */ 888 bool CheckListOfBaselines(ofstream * out, const Tesselation *TesselStruct)888 bool CheckListOfBaselines(ofstream * const out, const Tesselation * const TesselStruct) 889 889 { 890 890 LineMap::const_iterator testline; -
src/tesselationhelpers.hpp
rfb73b8 rc0f6c6 47 47 /********************************************** declarations *******************************/ 48 48 49 double DetGet(gsl_matrix * A,int inPlace);50 void GetSphere(Vector * center, Vector &a, Vector &b, Vector &c,double RADIUS);51 void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection, double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS,double Umkreisradius);52 void GetCenterofCircumcircle(Vector * Center, Vector *a, Vector *b, Vector *c);53 double GetPathLengthonCircumCircle( Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector,Vector &SearchDirection);49 double DetGet(gsl_matrix * const A, const int inPlace); 50 void GetSphere(Vector * const Center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS); 51 void GetCenterOfSphere(Vector* const Center, const Vector &a, const Vector &b, const Vector &c, Vector * const NewUmkreismittelpunkt, const Vector* const Direction, const Vector* const AlternativeDirection, const double HalfplaneIndicator, const double AlternativeIndicator, const double alpha, const double beta, const double gamma, const double RADIUS, const double Umkreisradius); 52 void GetCenterofCircumcircle(Vector * const Center, const Vector &a, const Vector &b, const Vector &c); 53 double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection); 54 54 double MinIntersectDistance(const gsl_vector * x, void *params); 55 bool existsIntersection( Vector point1, Vector point2, Vector point3, Vectorpoint4);56 double CalculateVolumeofGeneralTetraeder( Vector *a, Vector *b, Vector *c, Vector *d);57 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);55 bool existsIntersection(const Vector &point1, const Vector &point2, const Vector &point3, const Vector &point4); 56 double CalculateVolumeofGeneralTetraeder(const Vector &a, const Vector &b, const Vector &c, const Vector &d); 57 double GetAngle(const Vector &point, const Vector &reference, const Vector &OrthogonalVector); 58 58 59 bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * nodes[3]);60 bool SortCandidates(const CandidateForTesselation* candidate1, const CandidateForTesselation *candidate2);59 bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]); 60 bool SortCandidates(const CandidateForTesselation* candidate1, const CandidateForTesselation *candidate2); 61 61 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC); 62 TesselPoint* FindSecondClosestPoint(const Vector*, const LinkedCell* );63 Vector * GetClosestPointBetweenLine(ofstream *out, const BoundaryLineSet * Base, const BoundaryLineSet *OtherBase);62 TesselPoint* FindSecondClosestPoint(const Vector*, const LinkedCell* const LC); 63 Vector * GetClosestPointBetweenLine(ofstream *out, const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase); 64 64 65 void WriteTecplotFile(ofstream * out, ofstream *tecplot, const Tesselation *TesselStruct, const PointCloud *cloud, const int N);66 void WriteRaster3dFile(ofstream * out, ofstream *rasterfile, const Tesselation *Tess, const PointCloud *cloud);67 void IncludeSphereinRaster3D(ofstream * out, ofstream *rasterfile, const Tesselation *Tess, const PointCloud *cloud);68 void WriteVrmlFile(ofstream * out, ofstream *vrmlfile, const Tesselation *Tess, const PointCloud *cloud);69 void CalculateConcavityPerBoundaryPoint(ofstream * out, const Tesselation *TesselStruct);70 double DistanceToTrianglePlane(ofstream * out, const Vector *x, const BoundaryTriangleSet *triangle);65 void WriteTecplotFile(ofstream * const out, ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N); 66 void WriteRaster3dFile(ofstream * const out, ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud); 67 void IncludeSphereinRaster3D(ofstream * const out, ofstream * const rasterfile, const Tesselation *Tess, const PointCloud *cloud); 68 void WriteVrmlFile(ofstream * const out, ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud); 69 void CalculateConcavityPerBoundaryPoint(ofstream * const out, const Tesselation * const TesselStruct); 70 double DistanceToTrianglePlane(ofstream * const out, const Vector *x, const BoundaryTriangleSet * const triangle); 71 71 72 bool CheckListOfBaselines(ofstream * out, const Tesselation *TesselStruct);72 bool CheckListOfBaselines(ofstream * const out, const Tesselation * const TesselStruct); 73 73 74 74
Note:
See TracChangeset
for help on using the changeset viewer.