[Gmsh] generate unstructured mesh between indentic structured surface mesh of a non extrudable geometry

gdemesy at physics.utoronto.ca gdemesy at physics.utoronto.ca
Thu Mar 11 19:54:33 CET 2010


Dear Christophe & Gmsh users,

A quick follow up: Actually a double extrusion does the trick.
My nanometers (nm in the attached .geo, which becomes a scaling factor  
more than actual nanometers!) just need to be set to a value >=10.

I guess this was just an issue of floating precision for the  
coordinates of the mesh nodes generated on the edges of the geometry  
when you perform the second extrusion.

Like you said, one can still "apply a global scaling factor (using  
Mesh.ScalingFactor=1.e-9) when saving the mesh".

Best,

Guillaume


demesy <guillaume.demesy at fresnel.fr> a écrit :

> Hi Christophe,
>
> thanks for your kind reply.
> Scaling the whole system by *1e9 is not bothering, I only had to scale 2
> physical constants in getdp...
>
> I also think that two surface extrusions would be more appropriate here.
> Unfortunately I couldn't mesh the attached minimal (not-)working example:
> - I'm using one of your tricks
> (http://www.geuz.org/pipermail/gmsh/2009/004416.html) to generate 2 faces
> of a parallelepiped with identical mesh and I delete the generated entries
> (volume and surfaces). so far, so good.
> - Then I try to extrude in the other direction, but gmsh seem to mesh the
> faces // to the extrusion direction before the desired one, which seem to
> be the source of the problem (please see attached image).
>
> There might be a workaround here. If you can think of someting, I'm still
> very interested.
>
> Thanks again,
>
> Guillaume
>
>
> On Wed, 24 Feb 2010 13:21:33 +0100, Christophe Geuzaine
> <cgeuzaine at ulg.ac.be> wrote:
>> On 18/02/10 01:05, gdemesy at physics.utoronto.ca wrote:
>>> Dear Gmsh Users and Developers,
>>>
>>> I would need to impose pseudo-periodic boundary conditions on two sets
>>> of parallel surfaces in the attached geometry (respectively parallel to
>>> zOx and zOy).
>>>
>>> Originally, I was planning to use identical unstructured mesh on these
>>> surfaces, but as far as I understood, my only options consist in using
>>> (i) an extrusion of surfaces or (ii) the Transfinite Algo which both
>>> lead to structured surface mesh.
>>>
>>> I have considered these two last options:
>>> (i) I did not manage to extrude the mesh in both directions. Thus, after
>>> extruding one surface in one direction (say Ox) and deleting all the
>>> middle entries (as mentioned in
>>> http://www.geuz.org/pipermail/gmsh/2009/004416.html), I still have to
>>> extrude it in the Oy direction, which leads me to define some points two
>>> times (?).
>>>
>>> (ii) I tried to use Transfinite Surfaces, like in the attached geo file.
>>> I used MeshAdapt for the 2D part which generates proper 2D meshes.
>>> Everything seems OK until the 3D meshing part:
>>> - Delaunay overwrites my identical surface mesh as mentioned in some
>>> past mail.
>>> - Frontal leads to unexpected multiple "Error : Edge a - b multiple
>>> times in surface mesh"
>>>
>>> Is there any workaround?
>>
>> Hello Guillaume,
>>
>> Unfortunately we cannot correct the error in the Frontal algorithm: it
>> fails due to some internal floating point precision issue. A workaround
>> is to define nm=1 in your geometry, and apply a global scaling factor
>> (using Mesh.ScalingFactor=1.e-9) when saving the mesh...
>>
>> I also think until we have actual "mesh copying" operations (work in
>> progress... almost done but not quite!), Extrusion would be a better way
>> forward. Why didn't extrusion work in your case?
>>
>> Best,
>>
>> Christophe
>>
>>
>>
>>
>>
>>
>>> Wouldn't you use Extrude instead?
>>>
>>> Eventually, I would like to end up with a fine mesh in the so-called
>>> groove physical volume (n°6000), and ideally a mesh that goes
>>> progressively coarser when reaching the top (resp. bottom) of the
>>> physical region 5000=PML_top (resp. 1000=PML_bot). However, it seems
>>> that Transfinite doesn't enjoy this kind of setting, e.g.
>>> "paramaille_hol>paramaille". Would you have any solution in mind,
>>> compatible with my early issue ?
>>>
>>> Thank you very much for your time.
>>>
>>> Best,
>>>
>>> Guillaume Demésy,
>>> Postdoc at University of Toronto.
>>>
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>>
>>> _______________________________________________
>>> gmsh mailing list
>>> gmsh at geuz.org
>>> http://www.geuz.org/mailman/listinfo/gmsh
>>
>>
>>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

-------------- next part --------------
nm = 10.;
lambda0    = 700*nm;
n_hol  = 1;
n_sup  = 1;
n_sub  = 1;
paramaille     = 10;
paramaille_pml = 10;
paramaille_hol = 10;
lc_sup     = lambda0/(paramaille*n_sup);
lc_sup_pml = lambda0/(paramaille_pml*n_sup);
lc_sub     = lambda0/(paramaille*n_sub);
lc_sub_pml = lambda0/(paramaille_pml*n_sub);
lc_hol     = lambda0/(paramaille_hol*n_hol);

period_x = 300*nm;
period_y = 300*nm;
h_sup    = 400*nm;
h_hol    = 150*nm;
h_sub    = 200*nm;
PML_bot  = 500*nm;
PML_top  = 500*nm;
d_hol    = 100*nm;

Point(1) = {-period_x/2,-period_y/2, -h_sub, lc_sub};
Point(2) = {-period_x/2, period_y/2, -h_sub, lc_sub};
Point(3) = {-period_x/2, period_y/2, h_hol+h_sup, lc_sup};
Point(4) = {-period_x/2,-period_y/2, h_hol+h_sup, lc_sup};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};


Line Loop(29) = {4, 1, 2, 3};
Plane Surface(30) = {29};


Extrude {period_x, 0, 0} {
                            Surface{30}; Layers{1};
                         }
                         
Delete {
  Volume{1};
  Surface{47,51,43,39};
  Line{37,38,42,46};
}
Line(40) = {1, 6};
Line(41) = {4, 5};

Line Loop(53) = {40, -32, -41, 4};
Ruled Surface(54) = {53};

Extrude {0, period_y, 0} {
                             Surface{54}; Layers{1};
                          }
Delete {
  Volume{1};
  Surface{63,71};
}