Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    r26b4d62 r5f7b95  
    6868    LOG(1, "Storing tecplot non-convex data in " << params.filenameNonConvex.get() << ".");
    6969    PointCloudAdaptor<molecule> cloud(mol, mol->name);
    70     LCList = new LinkedCell_deprecated(cloud, 100.);
     70    LCList = new LinkedCell_deprecated(cloud, 2.*params.SphereRadius.get());
    7171    //Boundaries *BoundaryPoints = NULL;
    7272    //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]);
    7373    // TODO: Beide Funktionen sollten streams anstelle des Filenamen benutzen, besser fuer unit tests
    74     Success &= FindNonConvexBorder(mol, TesselStruct, LCList, 50., params.filenameNonConvex.get().string().c_str());
     74    Success &= FindNonConvexBorder(mol, TesselStruct, LCList, params.SphereRadius.get(), params.filenameNonConvex.get().string().c_str());
    7575    //RemoveAllBoundaryPoints(TesselStruct, mol, argv[argptr]);
    76     const double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, params.filenameConvex.get().string().c_str());
     76    const double volumedifference =
     77        ConvexizeNonconvexEnvelope(TesselStruct, mol, params.filenameConvex.get().string().c_str(),
     78            params.DoOutputEveryStep.get());
     79    // check whether tesselated structure is truly convex
     80    if (!TesselStruct->isConvex()) {
     81      ELOG(1, "Tesselated surface has not been properly convexized.");
     82        Success = false;
     83    } else {
     84      LOG(2, "DEBUG: We do have a convex surface tesselation now.");
     85    }
     86    // we check whether all molecule's atoms are still inside
     87    std::vector<std::string> outside_atoms;
     88    for(molecule::const_iterator iter = mol->begin(); iter != mol->end(); ++iter)
     89      if (!TesselStruct->IsInnerPoint((*iter)->getPosition(), LCList))
     90        outside_atoms.push_back((*iter)->getName());
     91    if (outside_atoms.empty())
     92      LOG(2, "DEBUG: All molecule's atoms are inside the tesselated, convex surface.");
     93    else {
     94      ELOG(1, "The following atoms are not inside the tesselated, convex surface:"
     95          << outside_atoms);
     96      Success = false;
     97    }
     98
    7799    const double clustervolume = TesselStruct->getVolumeOfConvexEnvelope(configuration->GetIsAngstroem());
    78100    LOG(0, "The tesselated volume area is " << clustervolume << " " << (configuration->GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3.");
     
    84106    return Action::success;
    85107  else {
    86     STATUS("Failed to find the non convex border.");
     108    STATUS(std::string("Failed to find the non convex border")
     109        +std::string("containing all atoms")
     110        +std::string("."));
    87111    return Action::failure;
    88112  }
Note: See TracChangeset for help on using the changeset viewer.