diff --git a/Fltk/Makefile b/Fltk/Makefile index 9d319bbf79622803477e5293c31eea1253ab701b..a1d010d6052049ebb9e5ece4ed737ad29ce36005 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.119 2006-12-05 18:34:58 geuzaine Exp $ +# $Id: Makefile,v 1.120 2006-12-16 14:37:19 geuzaine Exp $ # # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle # @@ -133,7 +133,8 @@ GUI_Projection.o: GUI_Projection.cpp ../Common/Gmsh.h ../Common/Message.h \ ../Common/SmoothNormals.h ../Geo/projectionFace.h ../Geo/GFace.h \ ../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h \ ../Common/VertexArray.h ../Common/SmoothNormals.h \ - ../Common/AdaptiveViews.h ../Common/GmshMatrix.h Shortcut_Window.h + ../Common/AdaptiveViews.h ../Common/GmshMatrix.h ../Common/Options.h \ + Shortcut_Window.h Callbacks.o: Callbacks.cpp ../Common/Gmsh.h ../Common/Message.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ diff --git a/Geo/GEdge.cpp b/Geo/GEdge.cpp index b87d30de42f5ba91486769e04ea76e197bec6d50..074c811e4db9b00ad5e7ef791709ffde42ba6d46 100644 --- a/Geo/GEdge.cpp +++ b/Geo/GEdge.cpp @@ -1,4 +1,4 @@ -// $Id: GEdge.cpp,v 1.21 2006-12-16 01:25:58 geuzaine Exp $ +// $Id: GEdge.cpp,v 1.22 2006-12-16 14:37:19 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -40,11 +40,9 @@ GEdge::~GEdge() for(unsigned int i = 0; i < mesh_vertices.size(); i++) delete mesh_vertices[i]; - mesh_vertices.clear(); for(unsigned int i = 0; i < lines.size(); i++) delete lines[i]; - lines.clear(); } void GEdge::resetMeshAttributes() @@ -144,16 +142,15 @@ double GEdge::curvature(double par) const if (r.low() == par) eps2 = 0; if (r.high() == par) eps1 = 0; + SVector3 n1 = firstDer(par - eps1); + SVector3 n2 = firstDer(par + eps2); - SVector3 n1 = firstDer(par-eps1); - SVector3 n2 = firstDer(par+eps2); + GPoint P1 = point(par - eps1); + GPoint P2 = point(par + eps2); - GPoint P1 = point(par-eps1); - GPoint P2 = point(par+eps2); - - double D = sqrt ( (P1.x()-P2.x())*(P1.x()-P2.x())+ - (P1.y()-P2.y())*(P1.y()-P2.y())+ - (P1.z()-P2.z())*(P1.z()-P2.z())); + double D = sqrt ((P1.x() - P2.x()) * (P1.x() - P2.x()) + + (P1.y() - P2.y()) * (P1.y() - P2.y()) + + (P1.z() - P2.z()) * (P1.z() - P2.z())); n1.normalize(); n2.normalize(); diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp index fbd663f958521e64df6a045eabdf586239774cbe..3909261eab51f9cfb6e4350cb07d217f0c487079 100644 --- a/Geo/GFace.cpp +++ b/Geo/GFace.cpp @@ -1,4 +1,4 @@ -// $Id: GFace.cpp,v 1.29 2006-12-16 01:25:58 geuzaine Exp $ +// $Id: GFace.cpp,v 1.30 2006-12-16 14:37:19 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -53,15 +53,12 @@ GFace::~GFace() for(unsigned int i = 0; i < mesh_vertices.size(); i++) delete mesh_vertices[i]; - mesh_vertices.clear(); for(unsigned int i = 0; i < triangles.size(); i++) delete triangles[i]; - triangles.clear(); for(unsigned int i = 0; i < quadrangles.size(); i++) delete quadrangles[i]; - quadrangles.clear(); } void GFace::resetMeshAttributes() diff --git a/Geo/GRegion.cpp b/Geo/GRegion.cpp index 1a82331ef3cb1a68a77fe66556e30760bb41279a..b79f885ac0d1eee60859815856079064ca5c7830 100644 --- a/Geo/GRegion.cpp +++ b/Geo/GRegion.cpp @@ -1,4 +1,4 @@ -// $Id: GRegion.cpp,v 1.14 2006-12-16 01:25:58 geuzaine Exp $ +// $Id: GRegion.cpp,v 1.15 2006-12-16 14:37:20 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -38,23 +38,18 @@ GRegion::~GRegion() for(unsigned int i = 0; i < mesh_vertices.size(); i++) delete mesh_vertices[i]; - mesh_vertices.clear(); for(unsigned int i = 0; i < tetrahedra.size(); i++) delete tetrahedra[i]; - tetrahedra.clear(); for(unsigned int i = 0; i < hexahedra.size(); i++) delete hexahedra[i]; - hexahedra.clear(); for(unsigned int i = 0; i < prisms.size(); i++) delete prisms[i]; - prisms.clear(); for(unsigned int i = 0; i < pyramids.size(); i++) delete pyramids[i]; - pyramids.clear(); } void GRegion::resetMeshAttributes() diff --git a/Geo/GVertex.cpp b/Geo/GVertex.cpp index c75e7ce3d3e8cb7912d6835a9801682c71187279..bb617f40beb64690f834d50c9f3cea1a43802fb6 100644 --- a/Geo/GVertex.cpp +++ b/Geo/GVertex.cpp @@ -1,4 +1,4 @@ -// $Id: GVertex.cpp,v 1.10 2006-11-29 16:57:00 remacle Exp $ +// $Id: GVertex.cpp,v 1.11 2006-12-16 14:37:20 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -31,7 +31,6 @@ GVertex::~GVertex() { for(unsigned int i = 0; i < mesh_vertices.size(); i++) delete mesh_vertices[i]; - mesh_vertices.clear(); } void GVertex::addEdge(GEdge *e) @@ -44,13 +43,11 @@ void GVertex::delEdge(GEdge *e) l_edges.erase(std::find(l_edges.begin(), l_edges.end(), e)); } - SPoint2 GVertex::reparamOnFace ( GFace *gf , int) const { return gf->parFromPoint ( SPoint3(x(),y(),z() )); } - std::string GVertex::getAdditionalInfoString() { char str[256]; diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp index f2cb5e7b213e9949e5b85379c014d9f4a72ca49c..925e1212b8f13e77b21edc9efc1a781e29f5283e 100644 --- a/Mesh/Generator.cpp +++ b/Mesh/Generator.cpp @@ -1,4 +1,4 @@ -// $Id: Generator.cpp,v 1.109 2006-12-16 13:58:24 geuzaine Exp $ +// $Id: Generator.cpp,v 1.110 2006-12-16 14:37:20 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -24,10 +24,10 @@ #include "Context.h" #include "Views.h" #include "OS.h" +#include "GModel.h" #include "meshGEdge.h" #include "meshGFace.h" #include "meshGRegion.h" -#include "GModel.h" #include "BackgroundMesh.h" #include "SecondOrder.h" @@ -200,28 +200,37 @@ bool TooManyElements(int dim){ void Mesh1D() { if(TooManyElements(1)) return; + Msg(STATUS1, "Meshing 1D..."); double t1 = Cpu(); std::for_each(GMODEL->firstEdge(), GMODEL->lastEdge(), meshGEdge()); double t2 = Cpu(); CTX.mesh_timer[0] = t2 - t1; + Msg(INFO, "Mesh 1D complete (%g s)", CTX.mesh_timer[0]); + Msg(STATUS1, "Mesh"); } void Mesh2D() { if(TooManyElements(2)) return; + Msg(STATUS1, "Meshing 2D..."); double t1 = Cpu(); std::for_each(GMODEL->firstFace(), GMODEL->lastFace(), meshGFace()); double t2 = Cpu(); CTX.mesh_timer[1] = t2 - t1; + Msg(INFO, "Mesh 2D complete (%g s)", CTX.mesh_timer[1]); + Msg(STATUS1, "Mesh"); } void Mesh3D() { if(TooManyElements(3)) return; + Msg(STATUS1, "Meshing 3D..."); double t1 = Cpu(); std::for_each(GMODEL->firstRegion(), GMODEL->lastRegion(), meshGRegion()); double t2 = Cpu(); CTX.mesh_timer[2] = t2 - t1; + Msg(INFO, "Mesh 3D complete (%g s)", CTX.mesh_timer[2]); + Msg(STATUS1, "Mesh"); } void OptimizeMesh() @@ -230,8 +239,8 @@ void OptimizeMesh() double t1 = Cpu(); std::for_each(GMODEL->firstRegion(), GMODEL->lastRegion(), optimizeMeshGRegion()); double t2 = Cpu(); - Msg(STATUS1, "Mesh"); Msg(INFO, "Mesh 3D optimization complete (%g s)", t2 - t1); + Msg(STATUS1, "Mesh"); } void GenerateMesh(int ask) @@ -249,26 +258,20 @@ void GenerateMesh(int ask) // 1D mesh if(ask == 1 || (ask > 1 && old < 1)) { - Msg(STATUS1, "Meshing 1D..."); std::for_each(GMODEL->firstFace(), GMODEL->lastFace(), deMeshGFace()); std::for_each(GMODEL->firstRegion(), GMODEL->lastRegion(), deMeshGRegion()); Mesh1D(); - Msg(INFO, "Mesh 1D complete (%g s)", CTX.mesh_timer[0]); } // 2D mesh if(ask == 2 || (ask > 2 && old < 2)) { - Msg(STATUS1, "Meshing 2D..."); std::for_each(GMODEL->firstRegion(), GMODEL->lastRegion(), deMeshGRegion()); Mesh2D(); - Msg(INFO, "Mesh 2D complete (%g s)", CTX.mesh_timer[1]); } // 3D mesh if(ask == 3) { - Msg(STATUS1, "Meshing 3D..."); Mesh3D(); - Msg(INFO, "Mesh 3D complete (%g s)", CTX.mesh_timer[2]); } // Orient the surface mesh so that it matches the geometry @@ -283,7 +286,6 @@ void GenerateMesh(int ask) if(GMODEL->getMeshStatus() && CTX.mesh.order == 2) Degre2(CTX.mesh.second_order_linear, CTX.mesh.second_order_incomplete); - Msg(STATUS1, "Mesh"); CTX.threads_lock = 0; CTX.mesh.changed = ENT_ALL; } diff --git a/Mesh/Makefile b/Mesh/Makefile index 8e9ec7abe2be284604c3f16c18a4e30518839771..5e8e9bcfb9ffdf3ce7cc6eea23cf3f64e310975f 100644 --- a/Mesh/Makefile +++ b/Mesh/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.154 2006-12-03 01:09:34 geuzaine Exp $ +# $Id: Makefile,v 1.155 2006-12-16 14:37:20 geuzaine Exp $ # # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle # @@ -71,23 +71,23 @@ depend: Generator.o: Generator.cpp ../Common/Gmsh.h ../Common/Message.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \ - ../Numeric/Numeric.h ../Common/Context.h ../Parser/OpenFile.h \ - ../Common/Views.h ../Common/ColorTable.h ../Common/VertexArray.h \ + ../Numeric/Numeric.h ../Common/Context.h ../Common/Views.h \ + ../Common/ColorTable.h ../Common/VertexArray.h \ ../Common/SmoothNormals.h ../Common/AdaptiveViews.h \ - ../Common/GmshMatrix.h ../Common/OS.h meshGEdge.h meshGFace.h \ - meshGRegion.h ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h \ - ../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h \ - ../Geo/SPoint3.h ../Common/GmshDefines.h ../Geo/MVertex.h \ - ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/GEdge.h \ - ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h ../Geo/SPoint3.h \ - ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/MElement.h ../Geo/MVertex.h \ - ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h ../Common/Hash.h \ - ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \ + ../Common/GmshMatrix.h ../Common/OS.h ../Geo/GModel.h ../Geo/GVertex.h \ + ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \ + ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Common/GmshDefines.h \ + ../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h \ + ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/SVector3.h \ + ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/MElement.h \ + ../Geo/MVertex.h ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h \ + ../Common/Hash.h ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \ ../Geo/ExtrudeParams.h ../Geo/GFace.h ../Geo/GPoint.h ../Geo/GEntity.h \ ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/MElement.h ../Geo/SPoint2.h \ ../Geo/SVector3.h ../Geo/Pair.h ../Geo/ExtrudeParams.h ../Geo/GRegion.h \ ../Geo/GEntity.h ../Geo/MElement.h ../Geo/ExtrudeParams.h \ - ../Geo/SBoundingBox3d.h BackgroundMesh.h SecondOrder.h + ../Geo/SBoundingBox3d.h meshGEdge.h meshGFace.h meshGRegion.h \ + BackgroundMesh.h SecondOrder.h meshGEdge.o: meshGEdge.cpp ../Common/Gmsh.h ../Common/Message.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \