Ignore:
Timestamp:
Jan 8, 2010, 2:04:22 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:
9fb860
Parents:
c15ca2
Message:

Attempt to fix the tesselation::IsInnerPoint().

We try the IsInnerPoint() as follows:

  1. Find nearest BoundaryPoints - working
  2. Find Closest BoundaryLine's - working
  3. Find closest Triangle that is well aligned (wrt to NormalVector and Distance) - unsure whether correctly working
  4. Check whether alignment is on boundary or inside/outside - working
  5. If on boundary, we check whether it's inside of triangle by intersecting with boundary lines - not working

Hence, we code a wrapper for GSL routines, to - finally - allow for solution of linear system of equations.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/tesselation_insideoutsideunittest.cpp

    rc15ca2 r97498a  
    2626void TesselationInOutsideTest::setUp()
    2727{
    28   setVerbosity(3);
     28  setVerbosity(5);
    2929
    3030  // create corners
     
    3232  Walker = new TesselPoint;
    3333  Walker->node = new Vector(0., 0., 0.);
    34   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     34  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    3535  strcpy(Walker->Name, "1");
    3636  Walker->nr = 1;
     
    3838  Walker = new TesselPoint;
    3939  Walker->node = new Vector(0., 1., 0.);
    40   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     40  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    4141  strcpy(Walker->Name, "2");
    4242  Walker->nr = 2;
     
    4444  Walker = new TesselPoint;
    4545  Walker->node = new Vector(1., 0., 0.);
    46   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     46  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    4747  strcpy(Walker->Name, "3");
    4848  Walker->nr = 3;
     
    5050  Walker = new TesselPoint;
    5151  Walker->node = new Vector(1., 1., 0.);
    52   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     52  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    5353  strcpy(Walker->Name, "4");
    5454  Walker->nr = 4;
     
    5656  Walker = new TesselPoint;
    5757  Walker->node = new Vector(0., 0., 1.);
    58   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     58  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    5959  strcpy(Walker->Name, "5");
    6060  Walker->nr = 5;
     
    6262  Walker = new TesselPoint;
    6363  Walker->node = new Vector(0., 1., 1.);
    64   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     64  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    6565  strcpy(Walker->Name, "6");
    6666  Walker->nr = 6;
     
    6868  Walker = new TesselPoint;
    6969  Walker->node = new Vector(1., 0., 1.);
    70   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     70  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    7171  strcpy(Walker->Name, "7");
    7272  Walker->nr = 7;
     
    7474  Walker = new TesselPoint;
    7575  Walker->node = new Vector(1., 1., 1.);
    76   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     76  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    7777  strcpy(Walker->Name, "8");
    7878  Walker->nr = 8;
     
    146146{
    147147  double n[3];
    148   const double boundary = 5.;
     148  const double boundary = 2.;
    149149  const double step = 1.;
    150150
     
    153153    for (n[1] = -boundary; n[1] <= boundary; n[1]+=step)
    154154      for (n[2] = -boundary; n[2] <= boundary; n[2]+=step) {
    155         if ( ((n[0] > 0) && (n[0] > 0) && (n[0] > 0)) && (n[0]+n[1]+n[2] <= 1.))
     155        if ( ((n[0] >= 0.) && (n[1] >= 0.) && (n[2] >= 0.)) && (fabs(n[0])+fabs(n[1])+fabs(n[2]) <= 1.))
    156156          CPPUNIT_ASSERT_EQUAL( true , TesselStruct->IsInnerPoint(Vector(n[0], n[1], n[2]), LinkedList) );
    157157        else
Note: See TracChangeset for help on using the changeset viewer.