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

- Triangle now supports our background meshes

- fixed memory leak in Optimize_Netgen (forgot to free the volume
  vertices) + added missing 2nd order reset

- fixed a couple of typos in the docs
parent 8cece18d
No related branches found
No related tags found
No related merge requests found
# $Id: Makefile,v 1.363 2004-07-05 15:31:59 geuzaine Exp $
# $Id: Makefile,v 1.364 2004-07-14 22:42:26 geuzaine Exp $
#
# Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
#
......@@ -23,7 +23,7 @@ include variables
GMSH_MAJOR_VERSION = 1
GMSH_MINOR_VERSION = 54
GMSH_PATCH_VERSION = 1
GMSH_PATCH_VERSION = 2
GMSH_EXTRA_VERSION = "-cvs"
GMSH_VERSION = ${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}
......
// $Id: 2D_Cylindrical.cpp,v 1.17 2004-06-20 23:25:32 geuzaine Exp $
// $Id: 2D_Cylindrical.cpp,v 1.18 2004-07-14 22:42:26 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -295,7 +295,7 @@ int MeshCylindricalSurface(Surface * s)
else if(CTX.mesh.algo2d == DELAUNAY_ANISO)
AlgorithmeMaillage2DAnisotropeModeJF(s);
else
Mesh_Shewchuk(s);
Mesh_Triangle(s);
for(i = 0; i < CTX.mesh.nb_smoothing; i++) {
tnxe = Tree_Create(sizeof(NXE), compareNXE);
......
// $Id: 2D_Mesh.cpp,v 1.67 2004-06-30 00:57:50 geuzaine Exp $
// $Id: 2D_Mesh.cpp,v 1.68 2004-07-14 22:42:26 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -899,7 +899,7 @@ void Maillage_Surface(void *data, void *dum)
else if(CTX.mesh.algo2d == DELAUNAY_ANISO)
AlgorithmeMaillage2DAnisotropeModeJF(s);
else
Mesh_Shewchuk(s);
Mesh_Triangle(s);
if(CTX.mesh.nb_smoothing) {
Msg(STATUS3, "Smoothing surface %d", s->Num);
......
// $Id: 2D_Mesh_Triangle.cpp,v 1.9 2004-05-22 01:29:46 geuzaine Exp $
// $Id: 2D_Mesh_Triangle.cpp,v 1.10 2004-07-14 22:42:26 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -26,7 +26,7 @@
#if !defined(HAVE_TRIANGLE)
int Mesh_Shewchuk(Surface * s)
int Mesh_Triangle(Surface * s)
{
Msg(GERROR, "Triangle is not compiled in this version of Gmsh");
return 1;
......@@ -72,11 +72,10 @@ void AddInMesh(Surface * sur, int nbbound, Vertex ** vertexbound,
Free(out->pointattributelist);
for(i = 0; i < out->numberoftriangles; i++) {
s =
Create_Simplex(vtable[out->trianglelist[i * out->numberofcorners + 0]],
vtable[out->trianglelist[i * out->numberofcorners + 1]],
vtable[out->trianglelist[i * out->numberofcorners + 2]],
NULL);
s = Create_Simplex(vtable[out->trianglelist[i * out->numberofcorners + 0]],
vtable[out->trianglelist[i * out->numberofcorners + 1]],
vtable[out->trianglelist[i * out->numberofcorners + 2]],
NULL);
s->iEnt = sur->Num;
Tree_Add(sur->Simplexes, &s);
}
......@@ -108,7 +107,7 @@ void FindPointInHole(List_T * verts, REAL * x, REAL * y)
*y = 0.5 * (v1->Pos.Y + v2->Pos.Y) + 1.e-12 * CTX.lc * c[1];
}
int Mesh_Shewchuk(Surface * s)
int Mesh_Triangle(Surface * s)
{
char opts[128];
int i, j, k, l, NbPts = 0, first;
......@@ -138,6 +137,7 @@ int Mesh_Shewchuk(Surface * s)
k = 0;
l = 0;
double lc_max = -1.0;
for(i = 0; i < List_Nbr(s->Contours); i++) {
List_Read(s->Contours, i, &list);
first = l;
......@@ -146,6 +146,7 @@ int Mesh_Shewchuk(Surface * s)
in.pointlist[k] = v->Pos.X;
in.pointlist[k + 1] = v->Pos.Y;
in.pointattributelist[l] = v->lc;
if(v->lc > lc_max) lc_max = v->lc;
vtable[l] = v;
in.segmentlist[k] = l;
in.segmentlist[k + 1] = (j == List_Nbr(list) - 1) ? (first) : (l + 1);
......@@ -180,8 +181,16 @@ int Mesh_Shewchuk(Surface * s)
mid.edgelist = NULL;
mid.edgemarkerlist = NULL;
// triangulate the points with minimum angle > 20 deg, with no boundary breaking
// triangulate the points with minimum angle > 20 deg, with no
// boundary breaking,
// TODO:
// and with an area constraint related to the
// maximum char. length allowed (this last constraint is to avoid an
// extremely coarse initial grid, on which the interpolation of the
// final char. lengths would be awful).
//sprintf(opts, "pqzYa%e", lc_max*lc_max/2.);
strcpy(opts, "pqzY");
if(CTX.verbosity < 4)
strcat(opts, "Q");
......@@ -203,8 +212,7 @@ int Mesh_Shewchuk(Surface * s)
mid.trianglearealist =
(REAL *) Malloc(mid.numberoftriangles * sizeof(REAL));
for(i = 0; i < mid.numberoftriangles; i++) {
//if(THEM->BGM.Typ == ONFILE) {
if(0) {
if(THEM->BGM.Typ == ONFILE) {
double xx = 0.0, yy = 0.0;
for(j = 0; j < mid.numberofcorners; j++) {
k = mid.trianglelist[i * mid.numberofcorners + j];
......@@ -213,10 +221,13 @@ int Mesh_Shewchuk(Surface * s)
}
xx /= mid.numberofcorners;
yy /= mid.numberofcorners;
// project the point in real space; this is a mess, since we
// actually change the parameters of the surface in 2d_Mesh.cpp
// x =, y = , z = ;
//val = Lc_XYZ(x, y, z, THEM);
Vertex *v, *dum;
v = Create_Vertex(-1, xx, yy, 0.0, 0.0, 0.0);
Calcule_Z_Plan(&v, &dum);
Projette_Inverse(&v, &dum);
val = Lc_XYZ(v->Pos.X, v->Pos.Y, v->Pos.Z, THEM);
val = val * val / 1.2;
Free_Vertex(&v, 0);
}
else {
val = 0;
......@@ -225,7 +236,7 @@ int Mesh_Shewchuk(Surface * s)
val += mid.pointattributelist[k];
}
val /= mid.numberofcorners;
val = val * val / 1.5; // approx (we want isotropic meshes)
val = val * val / 1.5;
}
mid.trianglearealist[i] = val;
}
......@@ -235,7 +246,8 @@ int Mesh_Shewchuk(Surface * s)
out.trianglelist = NULL;
out.triangleattributelist = NULL;
// refine the triangulation according to the triangle area constraints
// refine the triangulation according to the triangle area
// constraints
//strcpy(opts, "praqzBPY");
strcpy(opts, CTX.mesh.triangle_options);
......
// $Id: 3D_Mesh_Netgen.cpp,v 1.10 2004-06-30 19:51:44 geuzaine Exp $
// $Id: 3D_Mesh_Netgen.cpp,v 1.11 2004-07-14 22:42:26 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -256,6 +256,7 @@ void Netgen::OptimizeVolume()
List_Read(_volverts, i, &v);
Tree_Suppress(_vol->Vertices, &v);
Tree_Suppress(THEM->Vertices, &v);
Free_Vertex(&v, NULL);
}
// remove the tets
Tree_Action(_vol->Simplexes, suppressSimplex);
......@@ -303,6 +304,8 @@ void Optimize_Netgen(Mesh *m)
Msg(STATUS2, "Optimize volume mesh...");
double t1 = Cpu();
Degre1(); // cleanup 2nd order vertices, if any
List_T *list = Tree2List(m->Volumes);
for(int i = 0; i < List_Nbr(list); i++){
Volume *v;
......
......@@ -467,7 +467,7 @@ int MeshEllipticSurface(Surface * sur);
int AlgorithmeMaillage2DAnisotropeModeJF(Surface * s);
void Maillage_Automatique_VieuxCode(Surface * pS, Mesh * m, int ori);
int Mesh_Shewchuk(Surface *s);
int Mesh_Triangle(Surface *s);
int Mesh_Netgen(Volume * v);
void Optimize_Netgen(Volume * v);
void Optimize_Netgen(Mesh * m);
......
// small addition(s) to the netgen interface library for Gmsh
// small additions to the netgen interface library for Gmsh
#include "meshing.hpp"
#include "mystdlib.h"
......
// $Id: DecomposeInSimplex.cpp,v 1.12 2004-06-16 18:03:27 geuzaine Exp $
// $Id: DecomposeInSimplex.cpp,v 1.13 2004-07-14 22:42:27 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -58,8 +58,8 @@ void GMSH_DecomposeInSimplexPlugin::getInfos(char *author, char *copyright,
strcpy(copyright, "DGR (www.multiphysics.com)");
strcpy(help_text,
"Plugin(DecomposeInSimplex) decomposes all\n"
"non-simplectic elements (quadrangles, prisms\n"
"pyramids, hexahedra) in the view `iView' into\n"
"non-simplectic elements (quadrangles, prisms,\n"
"hexahedra, pyramids) in the view `iView' into\n"
"simplices (triangles, tetrahedra). If `iView' < 0,\n"
"the plugin is run on the current view.\n"
"\n"
......
$Id: VERSIONS,v 1.234 2004-07-05 15:31:59 geuzaine Exp $
$Id: VERSIONS,v 1.235 2004-07-14 22:42:27 geuzaine Exp $
New since 1.54: small bug fixes.
New since 1.54: added background mesh support for Triangle; small bug
fixes.
New in 1.54: integrated Netgen (3D mesh quality optimization +
alternative 3D algorithm); Extrude Surface now always automatically
......
\input texinfo.tex @c -*-texinfo-*-
@c $Id: gmsh.texi,v 1.126 2004-07-03 17:50:50 geuzaine Exp $
@c $Id: gmsh.texi,v 1.127 2004-07-14 22:42:27 geuzaine Exp $
@c
@c Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
@c
......@@ -1886,13 +1886,13 @@ way to compute the target sizes on this mesh (usually through an error
estimation procedure, in an iterative process of mesh adaptation). Note that
the target element sizes can be constrained by the characteristic lengths
defined in the geometrical model if the
@code{Mesh.ConstrainedBackgroundMesh} option is set.
This method only works with the isotropic 1D, 2D and 3D algorithm, and is
not currently available with the Triangle algorithm. To load a background
@code{Mesh.ConstrainedBackgroundMesh} option is set. To load a background
mesh, use the @code{-bgm} command-line option (@pxref{Command-line options})
or select `Apply as background mesh' in the post-processing view option
menu.
Background meshes are not supported by the 2D anisotropic algorithm and the
3D Netgen algorithm.
@end enumerate
Here are the mesh commands that are related to the specification of
......@@ -2249,9 +2249,9 @@ Duplicates the @var{expression}-th post-processing view.
Executes the plugin @var{string}. The list of default plugins is given in
@ref{Post-processing plugins}.
@item Plugin (@var{string}) . @var{string} = @var{expression};
Sets a floating point option for a given plugin. See @ref{t9.geo}, for some
examples.
@item Plugin (@var{string}) . @var{string} = @var{expression} | @var{char-expression};
Sets an option for a given plugin. See @ref{Post-processing plugins}, for a
list of default plugins and @ref{t9.geo}, for some examples.
@item Save View[@var{expression}] @var{char-expression};
Saves the the @var{expression}-th post-processing view in a file named
......
......@@ -138,8 +138,8 @@ Default value: @code{-1}
@item Plugin(DecomposeInSimplex)
Plugin(DecomposeInSimplex) decomposes all
non-simplectic elements (quadrangles, prisms
pyramids, hexahedra) in the view `iView' into
non-simplectic elements (quadrangles, prisms,
hexahedra, pyramids) in the view `iView' into
simplices (triangles, tetrahedra). If `iView' < 0,
the plugin is run on the current view.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment