Changeset 0a4f7f for src/tesselationhelpers.cpp
- Timestamp:
- Apr 7, 2010, 3:45:38 PM (16 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, 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:
- 72e7fa
- Parents:
- f9352d
- File:
-
- 1 edited
-
src/tesselationhelpers.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tesselationhelpers.cpp
rf9352d r0a4f7f 14 14 #include "tesselationhelpers.hpp" 15 15 #include "vector.hpp" 16 #include "vector_ops.hpp" 16 17 #include "verbose.hpp" 17 18 … … 53 54 54 55 for(int i=0;i<3;i++) { 55 gsl_matrix_set(A, i, 0, a .x[i]);56 gsl_matrix_set(A, i, 1, b .x[i]);57 gsl_matrix_set(A, i, 2, c .x[i]);56 gsl_matrix_set(A, i, 0, a[i]); 57 gsl_matrix_set(A, i, 1, b[i]); 58 gsl_matrix_set(A, i, 2, c[i]); 58 59 } 59 60 m11 = DetGet(A, 1); 60 61 61 62 for(int i=0;i<3;i++) { 62 gsl_matrix_set(A, i, 0, a .x[i]*a.x[i] + b.x[i]*b.x[i] + c.x[i]*c.x[i]);63 gsl_matrix_set(A, i, 1, b .x[i]);64 gsl_matrix_set(A, i, 2, c .x[i]);63 gsl_matrix_set(A, i, 0, a[i]*a[i] + b[i]*b[i] + c[i]*c[i]); 64 gsl_matrix_set(A, i, 1, b[i]); 65 gsl_matrix_set(A, i, 2, c[i]); 65 66 } 66 67 m12 = DetGet(A, 1); 67 68 68 69 for(int i=0;i<3;i++) { 69 gsl_matrix_set(A, i, 0, a .x[i]*a.x[i] + b.x[i]*b.x[i] + c.x[i]*c.x[i]);70 gsl_matrix_set(A, i, 1, a .x[i]);71 gsl_matrix_set(A, i, 2, c .x[i]);70 gsl_matrix_set(A, i, 0, a[i]*a[i] + b[i]*b[i] + c[i]*c[i]); 71 gsl_matrix_set(A, i, 1, a[i]); 72 gsl_matrix_set(A, i, 2, c[i]); 72 73 } 73 74 m13 = DetGet(A, 1); 74 75 75 76 for(int i=0;i<3;i++) { 76 gsl_matrix_set(A, i, 0, a .x[i]*a.x[i] + b.x[i]*b.x[i] + c.x[i]*c.x[i]);77 gsl_matrix_set(A, i, 1, a .x[i]);78 gsl_matrix_set(A, i, 2, b .x[i]);77 gsl_matrix_set(A, i, 0, a[i]*a[i] + b[i]*b[i] + c[i]*c[i]); 78 gsl_matrix_set(A, i, 1, a[i]); 79 gsl_matrix_set(A, i, 2, b[i]); 79 80 } 80 81 m14 = DetGet(A, 1); … … 83 84 eLog() << Verbose(1) << "three points are colinear." << endl; 84 85 85 center-> x[0]= 0.5 * m12/ m11;86 center-> x[1]= -0.5 * m13/ m11;87 center-> x[2]= 0.5 * m14/ m11;86 center->at(0) = 0.5 * m12/ m11; 87 center->at(1) = -0.5 * m13/ m11; 88 center->at(2) = 0.5 * m14/ m11; 88 89 89 90 if (fabs(a.Distance(center) - RADIUS) > MYEPSILON) … … 281 282 Vector SideA,SideB,HeightA, HeightB; 282 283 for (int i=0;i<NDIM;i++) 283 intersection .x[i] = gsl_vector_get(x, i);284 intersection[i] = gsl_vector_get(x, i); 284 285 285 286 SideA.CopyVector(&(I->x1)); … … 336 337 /* Starting point */ 337 338 x = gsl_vector_alloc(NDIM); 338 gsl_vector_set(x, 0, point1 .x[0]);339 gsl_vector_set(x, 1, point1 .x[1]);340 gsl_vector_set(x, 2, point1 .x[2]);339 gsl_vector_set(x, 0, point1[0]); 340 gsl_vector_set(x, 1, point1[1]); 341 gsl_vector_set(x, 2, point1[2]); 341 342 342 343 /* Set initial step sizes to 1 */ … … 372 373 double t1, t2; 373 374 for (int i = 0; i < NDIM; i++) { 374 intersection .x[i] = gsl_vector_get(s->x, i);375 intersection[i] = gsl_vector_get(s->x, i); 375 376 } 376 377 … … 700 701 // calculate the intersection between this projected baseline and Base 701 702 Vector *Intersection = new Vector; 702 Intersection->GetIntersectionOfTwoLinesOnPlane(Base->endpoints[0]->node->node, Base->endpoints[1]->node->node, &NewOffset, &NewDirection, &Normal); 703 *Intersection = GetIntersectionOfTwoLinesOnPlane(*(Base->endpoints[0]->node->node), 704 *(Base->endpoints[1]->node->node), 705 NewOffset, NewDirection); 703 706 Normal.CopyVector(Intersection); 704 707 Normal.SubtractVector(Base->endpoints[0]->node->node); … … 747 750 *vrmlfile << "Sphere {" << endl << " "; // 2 is sphere type 748 751 for (i=0;i<NDIM;i++) 749 *vrmlfile << Walker->node-> x[i]-center->x[i]<< " ";752 *vrmlfile << Walker->node->at(i)-center->at(i) << " "; 750 753 *vrmlfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour 751 754 cloud->GoToNext(); … … 757 760 for (i=0;i<3;i++) { // print each node 758 761 for (int j=0;j<NDIM;j++) // and for each node all NDIM coordinates 759 *vrmlfile << TriangleRunner->second->endpoints[i]->node->node-> x[j]-center->x[j]<< " ";762 *vrmlfile << TriangleRunner->second->endpoints[i]->node->node->at(j)-center->at(j) << " "; 760 763 *vrmlfile << "\t"; 761 764 } … … 792 795 *rasterfile << "# current virtual sphere\n"; 793 796 *rasterfile << "8\n 25.0 0.6 -1.0 -1.0 -1.0 0.2 0 0 0 0\n"; 794 *rasterfile << "2\n " << helper .x[0] << " " << helper.x[1] << " " << helper.x[2] << "\t" << 5. << "\t1 0 0\n";797 *rasterfile << "2\n " << helper[0] << " " << helper[1] << " " << helper[2] << "\t" << 5. << "\t1 0 0\n"; 795 798 *rasterfile << "9\n terminating special property\n"; 796 799 delete(center); … … 820 823 *rasterfile << "2" << endl << " "; // 2 is sphere type 821 824 for (i=0;i<NDIM;i++) 822 *rasterfile << Walker->node-> x[i]-center->x[i]<< " ";825 *rasterfile << Walker->node->at(i)-center->at(i) << " "; 823 826 *rasterfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour 824 827 cloud->GoToNext(); … … 831 834 for (i=0;i<3;i++) { // print each node 832 835 for (int j=0;j<NDIM;j++) // and for each node all NDIM coordinates 833 *rasterfile << TriangleRunner->second->endpoints[i]->node->node-> x[j]-center->x[j]<< " ";836 *rasterfile << TriangleRunner->second->endpoints[i]->node->node->at(j)-center->at(j) << " "; 834 837 *rasterfile << "\t"; 835 838 } … … 877 880 Walker = target->second->node; 878 881 LookupList[Walker->nr] = Counter++; 879 *tecplot << Walker->node-> x[0] << " " << Walker->node->x[1] << " " << Walker->node->x[2]<< " " << target->second->value << endl;882 *tecplot << Walker->node->at(0) << " " << Walker->node->at(1) << " " << Walker->node->at(2) << " " << target->second->value << endl; 880 883 } 881 884 *tecplot << endl;
Note:
See TracChangeset
for help on using the changeset viewer.
