Ignore:
Timestamp:
Aug 10, 2009, 4:11:47 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
ada6d2
Parents:
0cf171
Message:

New function ConvexizeNonconvexEnvelope() to calculate the volume of a non-convex envelope.

The central idea is that the volume of a convex envelope is easy to determine as a sum of pyramids with respect to a center inside the envelope. Hence, if we can "reduce" the non-convex envelope to a convex one in such a way that we know the added volume, we may determine the volume of a non-convex envelope.
The nice side effect is that we may use our Find_non_convex_border() algorithm to calculate also the convex envelope.

  • We go through all BoundaryPoints and check whether one of its Baselines does not fulfill the ConvexCriterion. If so, we remove it, as it can not be a boundary point on the convex envelope, and re-construct the attached triangles. The added volume is a general tetraeder, whose formula is known.
  • FIX: Find_convex_border() - We check whether AddPoint is successful or not.
  • builder.cpp: case 'o' - changed to use ConvexizeNonconvexEnvelope() instead of Find_convex_border()
  • Tesselation:AddPoint() - now takes second argument which is the index for BPS and always set BPS to either the newly created or the already present point. Return argument discerns between new and already present point.
  • Tesselation::BPS, BLS, BTS are now public not private. We have to access them from ConvexizeNonconvexEnvelope()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r0cf171 r70c4567  
    18711871                cout << Verbose(1) << "Storing tecplot data in " << argv[argptr] << "." << endl;
    18721872                LinkedCell LCList(mol, 10.);
    1873                 class Tesselation *TesselStruct = NULL;
    1874                 Find_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr]);
    1875                 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, &configuration);
    1876                 cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;
    1877                 delete(TesselStruct);
     1873                //Find_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr]);
     1874                Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);
     1875
     1876                double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct);
     1877                double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, mol->TesselStruct, &configuration);
     1878                cout << Verbose(0) << "The tesselated surface area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
     1879                cout << Verbose(0) << "The non-convex tesselated surface area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
    18781880                argptr+=1;
    18791881              }
Note: See TracChangeset for help on using the changeset viewer.