ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/math/ConvexHull.cpp
(Generate patch)

Comparing trunk/src/math/ConvexHull.cpp (file contents):
Revision 1307 by chuckv, Mon Oct 20 19:36:32 2008 UTC vs.
Revision 1308 by chuckv, Tue Oct 21 16:44:00 2008 UTC

# Line 44 | Line 44
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.11 2008-10-20 19:36:32 chuckv Exp $
47 > *  @version $Id: ConvexHull.cpp,v 1.12 2008-10-21 16:44:00 chuckv Exp $
48   *
49   */
50  
# Line 438 | Line 438 | void ConvexHull::computeHull(std::vector<StuntDouble*>
438    
439    boolT ismalloc = False;
440    /* Clean up memory from previous convex hull calculations*/
441 +  
442    Triangles_.clear();
443    surfaceSDs_.clear();
444    surfaceSDs_.reserve(Ns_);
# Line 608 | Line 609 | void ConvexHull::computeHull(std::vector<StuntDouble*>
609          simError();
610        } //simplicical
611        
612 <      Triangle* face = new Triangle();
612 >      Triangle face;
613        Vector3d  V3dNormal(facet->normal[0],facet->normal[1],facet->normal[2]);
614 <      face->setNormal(V3dNormal);
614 >      face.setNormal(V3dNormal);
615  
616        
617  
618        RealType faceArea = 0.5*V3dNormal.length();
619 <      face->setArea(faceArea);
619 >      face.setArea(faceArea);
620  
621  
622        vertices = qh_facet3vertex(facet);
623        
624        coordT *center = qh_getcenter(vertices);
625        Vector3d V3dCentroid(center[0], center[1], center[2]);
626 <      face->setCentroid(V3dCentroid);
626 >      face.setCentroid(V3dCentroid);
627        Vector3d faceVel = V3Zero;
628        FOREACHvertex_(vertices){
629          id = qh_pointid(vertex->point);
# Line 635 | Line 636 | void ConvexHull::computeHull(std::vector<StuntDouble*>
636   #else
637            faceVel = faceVel + bodydoubles[localindex]->getVel();
638   #endif
639 <          face->addVertex(bodydoubles[localindex]);
639 >          face.addVertex(bodydoubles[localindex]);
640            if( !isSurfaceID[id] ){
641              isSurfaceID[id] = true;
642   #ifdef IS_MPI      
# Line 649 | Line 650 | void ConvexHull::computeHull(std::vector<StuntDouble*>
650   #ifdef IS_MPI
651          
652          }else{
653 <          face->addVertex(NULL);
653 >          face.addVertex(NULL);
654            }
655   #endif
656        } //Foreachvertex
# Line 661 | Line 662 | void ConvexHull::computeHull(std::vector<StuntDouble*>
662          }
663        }
664        */
665 <      face->setFacetVelocity(faceVel/3.0);
665 >      face.setFacetVelocity(faceVel/3.0);
666        Triangles_.push_back(face);
667        qh_settempfree(&vertices);      
668  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines