| 44 | 
  | 
 * | 
| 45 | 
  | 
 *  Created by Charles F. Vardeman II on 11 Dec 2006. | 
| 46 | 
  | 
 *  @author  Charles F. Vardeman II | 
| 47 | 
< | 
 *  @version $Id: ConvexHull.cpp,v 1.9 2008-10-07 17:12:48 chuckv Exp $ | 
| 47 | 
> | 
 *  @version $Id: ConvexHull.cpp,v 1.10 2008-10-15 18:26:01 chuckv Exp $ | 
| 48 | 
  | 
 * | 
| 49 | 
  | 
 */ | 
| 50 | 
  | 
 | 
| 369 | 
  | 
#else | 
| 370 | 
  | 
#ifdef HAVE_QHULL | 
| 371 | 
  | 
/* Old options Qt Qu Qg QG0 FA */ | 
| 372 | 
< | 
ConvexHull::ConvexHull() : Hull(), dim_(3), options_("qhull Qt  Qci Tcv Pp"), Ns_(200) { | 
| 372 | 
> | 
/* More old opts Qc Qi Pp*/ | 
| 373 | 
> | 
ConvexHull::ConvexHull() : Hull(), dim_(3), options_("qhull Qt Pp"), Ns_(200) { | 
| 374 | 
  | 
  //If we are doing the mpi version, set up some vectors for data communication | 
| 375 | 
  | 
#ifdef IS_MPI | 
| 376 | 
  | 
 | 
| 603 | 
  | 
      Triangle* face = new Triangle(); | 
| 604 | 
  | 
      Vector3d  V3dNormal(facet->normal[0],facet->normal[1],facet->normal[2]); | 
| 605 | 
  | 
      face->setNormal(V3dNormal); | 
| 606 | 
< | 
      //face->setCentroid(V3dCentroid); | 
| 606 | 
> | 
  | 
| 607 | 
> | 
       | 
| 608 | 
> | 
 | 
| 609 | 
  | 
      RealType faceArea = 0.5*V3dNormal.length(); | 
| 610 | 
< | 
      //face->setArea(faceArea); | 
| 610 | 
> | 
      face->setArea(faceArea); | 
| 611 | 
  | 
 | 
| 612 | 
  | 
 | 
| 613 | 
  | 
      vertices = qh_facet3vertex(facet); | 
| 614 | 
+ | 
       | 
| 615 | 
+ | 
      coordT *center = qh_getcenter(vertices); | 
| 616 | 
+ | 
      Vector3d V3dCentroid(center[0], center[1], center[2]); | 
| 617 | 
+ | 
      face->setCentroid(V3dCentroid); | 
| 618 | 
+ | 
 | 
| 619 | 
  | 
      FOREACHvertex_(vertices){ | 
| 620 | 
  | 
        id = qh_pointid(vertex->point); | 
| 621 | 
  | 
        int localindex = id; | 
| 642 | 
  | 
          } | 
| 643 | 
  | 
#endif | 
| 644 | 
  | 
      } //Foreachvertex | 
| 645 | 
+ | 
      /* | 
| 646 | 
+ | 
      if (!SETempty_(facet->coplanarset)){ | 
| 647 | 
+ | 
        FOREACHpoint_(facet->coplanarset){ | 
| 648 | 
+ | 
          id = qh_pointid(point); | 
| 649 | 
+ | 
          surfaceSDs_.push_back(bodydoubles[id]); | 
| 650 | 
+ | 
        } | 
| 651 | 
+ | 
      } | 
| 652 | 
  | 
 | 
| 653 | 
  | 
      Triangles_.push_back(face); | 
| 654 | 
  | 
      qh_settempfree(&vertices);       | 
| 655 | 
< | 
       | 
| 655 | 
> | 
      */ | 
| 656 | 
  | 
    } //FORALLfacets | 
| 657 | 
  | 
 | 
| 658 | 
< | 
                         | 
| 658 | 
> | 
    /* | 
| 659 | 
> | 
    std::cout << surfaceSDs_.size() << std::endl; | 
| 660 | 
> | 
    for (SD = surfaceSDs_.begin(); SD != surfaceSDs_.end(); ++SD){ | 
| 661 | 
> | 
      Vector3d thisatom = (*SD)->getPos(); | 
| 662 | 
> | 
      std::cout << "Au " << thisatom.x() << "  " << thisatom.y() << " " << thisatom.z() << std::endl; | 
| 663 | 
> | 
    } | 
| 664 | 
> | 
    */ | 
| 665 | 
  | 
 | 
| 645 | 
– | 
  Ns_ = surfaceSDs_.size(); | 
| 666 | 
  | 
 | 
| 667 | 
  | 
 | 
| 668 | 
< | 
  qh_getarea(qh facet_list); | 
| 669 | 
< | 
  volume_ = qh totvol; | 
| 670 | 
< | 
  area_ = qh totarea; | 
| 671 | 
< | 
 | 
| 672 | 
< | 
   | 
| 673 | 
< | 
 | 
| 674 | 
< | 
  qh_freeqhull(!qh_ALL); | 
| 675 | 
< | 
  qh_memfreeshort(&curlong, &totlong); | 
| 676 | 
< | 
  if (curlong || totlong) | 
| 677 | 
< | 
    std::cerr << "qhull internal warning (main): did not free %d bytes of long memory (%d pieces) " | 
| 678 | 
< | 
              << totlong << curlong << std::endl; | 
| 679 | 
< | 
   | 
| 680 | 
< | 
 | 
| 681 | 
< | 
   | 
| 668 | 
> | 
    Ns_ = surfaceSDs_.size(); | 
| 669 | 
> | 
     | 
| 670 | 
> | 
     | 
| 671 | 
> | 
    qh_getarea(qh facet_list); | 
| 672 | 
> | 
    volume_ = qh totvol; | 
| 673 | 
> | 
    area_ = qh totarea; | 
| 674 | 
> | 
     | 
| 675 | 
> | 
     | 
| 676 | 
> | 
     | 
| 677 | 
> | 
    qh_freeqhull(!qh_ALL); | 
| 678 | 
> | 
    qh_memfreeshort(&curlong, &totlong); | 
| 679 | 
> | 
    if (curlong || totlong) | 
| 680 | 
> | 
      std::cerr << "qhull internal warning (main): did not free %d bytes of long memory (%d pieces) " | 
| 681 | 
> | 
                << totlong << curlong << std::endl; | 
| 682 | 
> | 
     | 
| 683 | 
> | 
     | 
| 684 | 
> | 
     | 
| 685 | 
  | 
} | 
| 686 | 
  | 
 | 
| 687 | 
  | 
 |