3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

15
3d metrics tools: mshmet and 3d meshing tools: mmg3d and freeyams J. Morice 1 , C. Drobrzynski 2 and P. Frey 1 1 Universit ´ e Pierre et Marie Curie and 2 University of Bordeaux I. supported by ANR FF2A3 freefem++ day 1& 2 sept 2010 – p.1/15

Transcript of 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

Page 1: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

3d metrics tools: mshmetand

3d meshing tools: mmg3d and freeyams

J. Morice 1, C. Drobrzynski 2 and P. Frey1

1 Universite Pierre et Marie Curie and 2 University of Bordeaux I.

supported by ANR FF2A3

freefem++ day 1& 2 sept 2010

– p.1/15

Page 2: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

Outline

RemarkImportant input parameter of mmg3d and freeyams is a metric

Definition of a metric

Function to compute a metric :mshmet (P. Frey)

3d Meshing tools :mmg3d (C. Drobrzynski and P. Frey)freeyams (P. Frey)

freefem++ day 1& 2 sept 2010

– p.2/15

Page 3: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mshmet

developped by P. Frey

Computation of metric based on function variations (Hessian)

function = solution, error of a solution

isotropic or anisotropic metric

load "mshmet" // need to load library mshmetfespace Vh(Th,P1);Vh u;real[int] M = mshmet(Th,u);

freefem++ day 1& 2 sept 2010

– p.3/15

Page 4: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mshmet:parameter

loptions= integer parameters : int[7]loptions(0): normalization level (default 0).loptions(1): 1 : isotropics mode (default)

0 : anistropics modeloptions(2): level set metric mode (default 0).loptions(3): debug mode(default 0).loptions(4): verbosity (default 10).loptions(5): number of regularization’s iteration of solutions given (default 0).loptions(6): use previous metric mode (default: 0.)

doptions= real parameters : real[4]doptions(0): hmin (default 0.01).doptions(1): hmax (default 1.0).doptions(2): tolerance parameters (default 0.01).doptions(2): relative width for Level Set (0 < w < 1) ( default 0.05).

metric= initial metric

freefem++ day 1& 2 sept 2010

– p.4/15

Page 5: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mmg3d

Execute mmg.pdf

freefem++ day 1& 2 sept 2010

– p.5/15

Page 6: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mmg3d : first examplemmg3d: precompiled library in freefem++ website (not yet licenced)Future: mmg3d downloaded automatically by freefem++

keywords: mmg3d

first example

load "msh3"load "mmg3d" //need to load the library mmg3d...mesh3 Th= . . .

// definition of an isotropic metric ≃ mesh size near verticesreal[int] isometric(Th.nv); {for( int ii=0; ii<Th.nv; ii++)isometric[ii]=0.17;}mesh3 Th3=mmg3d( Th, memory=100, metric=isometric);// memory : maximum memory size for the new mesh in Mbytes// metric : the metric given at mmg3d (real[int] )

freefem++ day 1& 2 sept 2010

– p.6/15

Page 7: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mmg3d: parameter

options= option parameters of mmg3d ( int[6] )options(0) optimization parameters : (default 1)

0 : mesh optimization.1 : adaptation with metric (deletion and insertion vertices) and optimization.-1: adaptation with metric (deletion and insertion vertices) without optimization.4 : split tetrahedrons (be careful modify the surface).9 : moving mesh with optimization.-9: moving mesh without optimization.

options(1) debug modeoptions(2) specify the size of bucket per dimension (default 64)options(3) swapping mode (no edge or face flipping.)options(4) no insert points modeoptions(5) verbosity level (default 3)

memory= set the maximum memory size of new mesh in Mbytes (default 100 Mo).

metric= this vector contains the metric given at mmg3d.

displacement= set the vector displacement at each vertices.

displVect= set the vector displacement at each vertices in a vector.

freefem++ day 1& 2 sept 2010

– p.7/15

Page 8: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mmg3d: moving example

load "msh3"load "medit"load "mmg3d"

mesh3 Th=readmesh3("fallingspheres.mesh");

real[int] vit(3); // displacement of the sphere = velocity*dtvit[0] = 0., vit[1] = 0., vit[2] = -0.3;func zero = 0.;func dep = vit[2];

fespace Vh(Th,P1);macro Grad(u) [dx(u),dy(u),dz(u)] //Vh uh,vh;

// PDE of displacemet in the z directionproblem Lap(uh,vh) = int3d(Th)(Grad(uh)’*Grad(vh))+ on(310,300,uh=dep) + on(311,uh=0.);

freefem++ day 1& 2 sept 2010

– p.8/15

Page 9: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

mmg3d: moving exampleint[int] opt=[9,0,64,0,0,3]; // moving with optimizationfor(int it=0; it<29; it++){

cout«" ITERATION "«it«endl;Lap;Th=mmg3d(Th,options=opt,displacement=[zero,zero,uh]);savemesh(Th,"out-"+it+".mesh");

}

initial mesh final mesh

freefem++ day 1& 2 sept 2010

– p.9/15

Page 10: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

overview freeyamsfreeyams developed by P. Frey

technical report http://www.ann.jussieu.fr/~frey/software.html

smoothing surface

freefem++ day 1& 2 sept 2010

– p.10/15

Page 11: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

overview freeyamsdecimation of mesh : obtain hierarchical meshes

freefem++ day 1& 2 sept 2010

– p.11/15

Page 12: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

overview freeyams

complex meshes

freefem++ day 1& 2 sept 2010

– p.12/15

Page 13: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

freeyams : simple example

keyword: freeyams

simple example

load "msh3"load "medit"load "freeyams" // need to load freeyams library

mesh3 Th3 = . . . ; // Th3 volumic/surface mesh

mesh3 ThSurf = freeyams(Th); // ThSurf is a surface mesh

freefem++ day 1& 2 sept 2010

– p.13/15

Page 14: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

freeyams : parameter

loptions= integer parameters (int[13])loptions(0): anisotropic mode.loptions(1): FE correction parameter ≃ mesh suitable for FE.loptions(3): maximum memory in Mbytes.loptions(6): create point on straight edge (no mapping) mode (default 0).loptions(7): validity check during smoothing mode (only with loptions(12)=9)loptions(10): ridge detection mode (default 0) (ridge definition doptions(10)).loptions(11): vertex smoothing mode (default 0).loptions(12): Optimization level parameter (default 0).

0 : mesh optimization (smoothing+swapping)1 : decimation+enrichment adaptated to a metric map.-1: decimation adaptated to a metric map.2 : decimation+enrichment with a Hausdorff-like method-2: decimation with a Hausdorff-like method4 : split triangles recursively.9 : No-Shrinkage Vertex Smoothing (avoid important decrease of the volume)

freefem++ day 1& 2 sept 2010

– p.14/15

Page 15: 3d metrics tools: mshmet and 3d meshing tools: mmg3d and ...

freeyams : parameter

doptions= real parameter : real[11].doptions(0): Tangent plane deviation (default 0.01).doptions(3): Set the gradation value (Mesh density control) (default 1.3).doptions(4): hmin (default size is automatically computed).doptions(5): hmax (default size is automatically computed).doptions(6): tolerance of the control of Chordal deviation (default -2.0).doptions(10): angular ridge detection (default 45 degree).

metric= metric at the different vertices on the initial mesh.

freefem++ day 1& 2 sept 2010

– p.15/15