[Gmsh] internal node structure
Trevor Irons
trevorirons at gmail.com
Thu Aug 7 21:29:20 CEST 2014
Jean:
With your suggestion I was able to figure out what I was trying to do. I
did not realize that you could not extrude a line loop directly. Thank you
for your help. I have posted below in case this is helpful to someone else.
Cheers,
Trevor
lc = 10; // Target element size
R = .25; // Magnet Radius
D0 = 10; // Top of magnet
D1 = 11; // Bottom of magnet
// Total Solution Space
X0 = -2.;
X1 = 2.;
Y0 = -2.;
Y1 = 2.;
Z0 = 9.;
Z1 = 12.;
////////////////////////////////////
// North Pole
p = newp;
Point(p) = { 0, 0, D0, lc/100};
Point(p+1) = { R, 0, D0, lc/100};
Point(p+2) = { 0, R, D0, lc/100};
Point(p+3) = {-R, 0, D0, lc/100};
Point(p+4) = { 0, -R, D0, lc/100};
// Connect up the points
c = newc;
Circle(c) = {p+1, p, p+3};
l = newl;
Line(l) = {p+3,p+1};
ll = newll;
Line Loop(ll) = {c, l};
ss = news;
ss = Extrude {0, 0, D1-D0} { Line{c,l}; };
/////////////////////////////////////
// Large Bounding box
Point(116) = {X0, Y0, Z0};
Point(117) = {X1, Y0, Z0};
Point(118) = {X1, Y1, Z0};
Point(119) = {X0, Y1, Z0};
Line(120) = {116,117};
Line(121) = {117,118};
Line(122) = {118,119};
Line(123) = {119,116};
Line Loop(124) = {120, 121, 122, 123};
Plane Surface(125) = {124};
//v = newv;
v[] = Extrude {0, 0, Z1-Z0} { Surface{125}; };
Surface{ss[1]} In Volume{v[1]};
Physical Volume(1) = {v[1]};
-- Trevor
On 7 August 2014 10:16, Trevor Irons <trevorirons at gmail.com> wrote:
> Thank you again. I tried extruding lines and was able to do so with
> straight ones but not Line Loops. I have included as small of an example as
> I can think of. This does what I want for the top of the 1/2 cylinder. But
> I would like to extend this behaviour to the commented out extrusion step.
> Again thanks for any ideas. All I can think of is throw what is written
> here into a loop. But I am not sure how well that would work.
>
> lc = 10; // Target element size
> R = .25; // Radius
> D0 = 10; // Top
> D1 = 11; // Bottom
>
> // Total Solution Space
> X0 = -2.;
> X1 = 2.;
> Y0 = -2.;
> Y1 = 2.;
> Z0 = 9.;
> Z1 = 12.;
>
> ////////////////////////////////////
> // North Pole
>
> Point(0) = { 0, 0, D0, lc/10};
> Point(1) = { R, 0, D0, lc/10};
> Point(2) = { 0, R, D0, lc/10};
> Point(3) = {-R, 0, D0, lc/10};
>
> // Connect up the points
> Circle(4) = {1, 0, 3};
> Line(5) = {3,1};
>
> Line Loop(6) = {4,5};
> Plane Surface(7) = {6};
>
> //////////////////////////////////////
> // Extrude 1/2 cylinder
> //Extrude {0, 0, D1-D0} { Surface{7}; } // I want this *outer surface*
> within my final volume
>
> /////////////////////////////////////
> // Large Bounding box
> Point(116) = {X0, Y0, Z0};
> Point(117) = {X1, Y0, Z0};
> Point(118) = {X1, Y1, Z0};
> Point(119) = {X0, Y1, Z0};
> Line(120) = {116,117};
> Line(121) = {117,118};
> Line(122) = {118,119};
> Line(123) = {119,116};
> Line Loop(124) = {120, 121, 122, 123};
> Plane Surface(125) = {124};
> Extrude {0, 0, Z1-Z0} { Surface{125}; }
>
> // We want the surface in the volume
>
> Surface{7} In Volume{1};
> //Surface{8} In Volume{1};
>
> // Don't export internal structure
> Physical Volume(1) = {1};
>
> -- Trevor
>
>
> On 7 August 2014 07:53, jean pierre aubry <jeanpierre at lamachine.fr> wrote:
>
>> without a complete example it is difficult to understand what you want
>>
>> however extruding the lines that make the borders of Surface{7} you
>> should get a Surface which would be bordering the volume along the
>> extrusion vector
>>
>>
>> Le Thu, 7 Aug 2014 09:34:36 -0600,
>> Trevor Irons <trevorirons at gmail.com> a écrit :
>>
>> > Thank you. That worked perfectly for a 2D 'plane surface'! Thanks for
>> > the tip.
>> >
>> > I had one follow up question though, Instead of just a 2D surface I
>> > would like to do this with a 3D surface, i.e. internal 3D object. But
>> > once I extrude it, it becomes a volume and I cannot call Surface In
>> > Volume anymore.
>> >
>> >
>> > Line Loop(6) = {4,5};
>> > Plane Surface(7) = {6}; // Define a plane
>> > surface Surface{7} In Volume{1}; // This works
>> > for the unextruded surface
>> > Extrude {0, 0, D1-D0} { Surface{7}; } // I want to include the
>> > surface of this extrusion in the mesh
>> >
>> >
>> > Surface(8) = CastToSurface{Volume{2}}; // Made up desired
>> > functionality Surface{8} In Volume{1}; // I
>> > want to call something like this
>> >
>> > Is there a way to cast an extrusion back into just a surface, but now
>> > just the outer 3D surface?
>> >
>> > Thanks.
>> >
>> >
>> > -- Trevor
>> >
>> >
>> > On 5 August 2014 05:01, jean pierre aubry <jeanpierre at lamachine.fr>
>> > wrote:
>> >
>> > > hello
>> > >
>> > > >Is there a way to scrub the internal `surface' but retain the mesh
>> > > >structure?
>> > >
>> > > what about putting the surfaces you want to export into Physical
>> > > and to NOT put into Physical the ones you do not want
>> > >
>> > > i do not know about VTK
>> > > but by proceeding this way only the defined Physical are exported
>> > > in .msh or .med mesh
>> > >
>> > > --
>> > > jean pierre aubry
>> > > 33 688 670 795
>> > > jeanpierre [at] lamachine.fr
>> > >
>>
>>
>>
>> --
>> jean pierre aubry
>> 33 688 670 795
>> jeanpierre [at] lamachine.fr
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20140807/12174e21/attachment.html>