# [Gmsh] Atypical, newbie question

Ruth Vazquez Sabariego ruth.sabariego at esat.kuleuven.be
Fri Apr 1 10:59:40 CEST 2016

```Dear Julius,
What you would need is to embed the points in the volume. Unfortunately, that is not yet implemented.

From the manual:
Point | Line { expression-list } In Surface { expression };
Embed the point(s) or line(s) in the given surface. The surface mesh will conform to the mesh of the point(s) or lines(s).
Surface { expression-list } In Volume { expression };
Embed the surface in the given volume. The volume mesh will conform to the mesh of the surface.

I’ve modified your code creating two surfaces for the points that where on the same plane. One point is still not embedded, thus.
See hereafter.

Note that newp, newl, newll, news give you automatically the new number available, that avoids taking point values generated by the Extrude command. Also aux[] is a list containing the generated surfaces and volume. aux[0] is the surface opposite to Surface{6}, aux[1] is the volume, the rest of aux[] contains the surrounding surfaces.

Plane Surface(6) = {5};
aux[]= Extrude {0, 0, box_size} {
Surface{6};
};
volBox = aux[1];

lc=10;
pnts[] += newp; Point(newp) = {7.150548, 1.000000,  -6.990684, lc};
pnts[] += newp; Point(newp) = {-4.438894, 1.000000,  -8.960816, lc};
pnts[] += newp; Point(newp) = {-9.893936, 1.000000,  1.452595, lc};
pnts[] += newp; Point(newp) = {-1.675894, 1.000000,  9.858569, lc};
pnts[] += newp; Point(newp) = {8.858176, 1.000000,  4.640336, lc};

For k In {0:#pnts[]-1}
k2 = k<(#pnts[]-1)?k+1:0;
ln1[]+=newl; Line(newl) = {pnts[k],pnts[k2]};
EndFor
Line Loop(newll) = ln1[];
surf1=news; Plane Surface(news) = newll-1;

pnts2[] += newp; Point(newp) = {1.675894, 4.750000,  -9.858569, lc};
pnts2[] += newp; Point(newp) = {-8.858176, 4.750000,  -4.640336, lc};
pnts2[] += newp; Point(newp) = {-7.150548, 4.750000,  6.990684, lc};
pnts2[] += newp; Point(newp) = {4.438894, 4.750000,  8.960816, lc};
pnts2[] += newp; Point(newp) = {9.893936, 4.750000,  -1.452595, lc};

For k In {0:#pnts2[]-1}
k2 = k<(#pnts2[]-1)?k+1:0;
ln2[]+=newl; Line(newl) = {pnts2[k],pnts2[k2]};
EndFor
Line Loop(newll) = ln2[];
surf2=news; Plane Surface(news) = newll-1;

Surface{surf1} In Volume{volBox};
Surface{surf2} In Volume{volBox};

// This one is not yet embedded.
Point(newp) = {7.150548, 8.500000,  -6.990684, lc};

HTH,
Ruth

—
Prof. Ruth V. Sabariego
KU Leuven
Dept. Electrical Engineering ESAT/Electa, EnergyVille
http://www.esat.kuleuven.be/electa
http://www.energyville.be

Free software: http://gmsh.info | http://getdp.info | http://onelab.info

On 31 Mar 2016, at 21:33, Vincent Huber <vincent.huber at cemosis.fr<mailto:vincent.huber at cemosis.fr>> wrote:

Hi Julius,

I guess you have to define theses points as Physical Points, isn’t it ?

All the best,

VH

​

2016-03-31 17:54 GMT+02:00 Julius Bier Kirkegaard <juliusbierk at gmail.com<mailto:juliusbierk at gmail.com>>:
Dear all,

I have (I think) a fairly simple question, but it's also quite atypical, so I have had no luck Googling. I hope that you one of you might have time to point me in the right direction...

I have a box:

box_size = 50;
lb = 10.;
Point(1) = {-box_size/2, -box_size/2, -box_size/2, lb};
Point(2) = {box_size/2, -box_size/2, -box_size/2, lb};
Point(3) = {box_size/2, box_size/2, -box_size/2, lb};
Point(4) = {-box_size/2, box_size/2, -box_size/2, lb};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line Loop(5) = {1, 2, 3, 4};
Plane Surface(6) = {5};
Extrude {0, 0, box_size} {
Surface{6};
}

This works quite well and gmsh is happy to (3D) mesh it.

The problem is that I would to ensure that certain points inside the box are node points. So my question is, how do I ensure that points, like these

lc = 10;
Point(5) = {7.150548, 1.000000,  -6.990684, lc};
Point(6) = {-4.438894, 1.000000,  -8.960816, lc};
Point(7) = {-9.893936, 1.000000,  1.452595, lc};
Point(8) = {-1.675894, 1.000000,  9.858569, lc};
Point(9) = {8.858176, 1.000000,  4.640336, lc};
Point(10) = {1.675894, 4.750000,  -9.858569, lc};
Point(11) = {-8.858176, 4.750000,  -4.640336, lc};
Point(12) = {-7.150548, 4.750000,  6.990684, lc};
Point(13) = {4.438894, 4.750000,  8.960816, lc};
Point(14) = {9.893936, 4.750000,  -1.452595, lc};
Point(15) = {7.150548, 8.500000,  -6.990684, lc};

are part of the mesh nodes?

The reason I need this is that I need to impose boundary conditions at these specific points.

Best wishes,
Julius

_______________________________________________
gmsh mailing list
gmsh at onelab.info<mailto:gmsh at onelab.info>
http://onelab.info/mailman/listinfo/gmsh

--
Docteur Ingénieur de recherche
CeMoSiS<http://www.cemosis.fr/> - vincent.huber at cemosis.fr<mailto:vincent.huber at cemosis.fr>
Tel: +33 (0)3 68 85 02 06
IRMA - 7, rue René Descartes
67 000 Strasbourg