Skip to content
Snippets Groups Projects
Commit f2f5d64a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better heuristic for va alloc with cutplane

parent 355ce8b8
No related branches found
No related tags found
No related merge requests found
// $Id: Mesh.cpp,v 1.217 2008-02-27 12:39:28 geuzaine Exp $ // $Id: Mesh.cpp,v 1.218 2008-03-07 19:02:59 geuzaine Exp $
// //
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// //
...@@ -710,6 +710,8 @@ class initMeshGRegion { ...@@ -710,6 +710,8 @@ class initMeshGRegion {
// suppose edge shared by 4 elements on averge (pessmistic) // suppose edge shared by 4 elements on averge (pessmistic)
num += (12 * r->tetrahedra.size() + 24 * r->hexahedra.size() + num += (12 * r->tetrahedra.size() + 24 * r->hexahedra.size() +
18 * r->prisms.size() + 16 * r->pyramids.size()) / 4; 18 * r->prisms.size() + 16 * r->pyramids.size()) / 4;
if(CTX.mesh.use_cut_plane && CTX.mesh.cut_plane_draw_intersect)
num = (int)sqrt(num);
if(CTX.mesh.explode != 1.) num *= 4; if(CTX.mesh.explode != 1.) num *= 4;
if(_curved) num *= 2; if(_curved) num *= 2;
} }
...@@ -721,6 +723,8 @@ class initMeshGRegion { ...@@ -721,6 +723,8 @@ class initMeshGRegion {
if(CTX.mesh.volumes_faces){ if(CTX.mesh.volumes_faces){
num += (4 * r->tetrahedra.size() + 12 * r->hexahedra.size() + num += (4 * r->tetrahedra.size() + 12 * r->hexahedra.size() +
8 * r->prisms.size() + 6 * r->pyramids.size()) / 2; 8 * r->prisms.size() + 6 * r->pyramids.size()) / 2;
if(CTX.mesh.use_cut_plane && CTX.mesh.cut_plane_draw_intersect)
num = (int)sqrt(num);
if(CTX.mesh.explode != 1.) num *= 2; if(CTX.mesh.explode != 1.) num *= 2;
if(_curved) num *= 4; if(_curved) num *= 4;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment