[Gmsh] Create mesh for 1D geometry

Deepa deepamahm.iisc at gmail.com
Sun Feb 9 12:57:03 CET 2020


Hi Max,
I could export the CAD drawing in IGES format. Could you please suggest how
to create NASTRAN bulk data file from IGES? I am also attaching the iges
file for your kind reference.
I'd like to set the mesh size equal to the distance between two adjacent
vertices.I hope the coordinates of the vertices can be obtained from iges
file.

Regarding what was mentioned in the previous email, " extract point and
line data etc." could you please elaborate a bit on this? I think by points
you mean coordinates of the vertices.
Does line data mean the length of the line, which is the distance between
two vertices?
Thanks a lot,
Deepa

On Fri, Feb 7, 2020 at 11:15 PM Max Orok <morok at mevex.com> wrote:

> You're welcome Deepa! There may be some semi-automatic sweetspot if you
> can extract point and line data etc.
>
> On Fri, Feb 7, 2020 at 9:53 AM Deepa <deepamahm.iisc at gmail.com> wrote:
>
>> Hi Max,
>>
>> I have to create multiple geometries Iike this. I'll try and find out how
>> to create the drawing in the formats that you mentioned.
>>
>> Thanks a lot,
>> Deepa
>>
>> On Fri 7 Feb, 2020, 7:27 PM Max Orok, <morok at mevex.com> wrote:
>>
>>> I'm not sure dwg or dwf is supported, but I know you can import STEP,
>>> IGES or BREP.
>>>
>>> If it's just the one geometry I think you could manually specify it like
>>> we did for a single line, but make sure that
>>> the lines are connected at those points.
>>>
>>>
>>> On Fri, Feb 7, 2020 at 8:04 AM Deepa <deepamahm.iisc at gmail.com> wrote:
>>>
>>>> Hi Max,
>>>>
>>>> Thanks a lot. It works like a charm!
>>>>
>>>> I'd like to know if it is possible to create NASTRAN bulk data file for
>>>> geometries like the following
>>>>
>>>> [image: Untitled.png]
>>>>
>>>> I have the geometry in  dwg and dxf file format created from AutoCAD.
>>>> Basically, I have specified coordinate positions to create points at every
>>>> delx= say,0.5 in CAD.
>>>>
>>>> Many thanks,
>>>> Deepa
>>>>
>>>> On Fri, Feb 7, 2020 at 1:52 AM Max Orok <morok at mevex.com> wrote:
>>>>
>>>>> Using the python api, building on Jeremy's nice example, but omitting
>>>>> physical groups:
>>>>>
>>>>> -----
>>>>> import gmsh
>>>>>
>>>>> delx = 0.5
>>>>> xend = 20
>>>>>
>>>>> gmsh.initialize()
>>>>>
>>>>> point_a = gmsh.model.geo.addPoint(0.0, 0.0, 0.0, meshSize=delx)
>>>>> point_b = gmsh.model.geo.addPoint(20.0, 0.0, 0.0, meshSize=delx)
>>>>>
>>>>> line = gmsh.model.geo.addLine(point_a, point_b)
>>>>>
>>>>> gmsh.model.geo.synchronize()
>>>>>
>>>>> # make a 1d mesh
>>>>> gmsh.model.mesh.generate(1)
>>>>>
>>>>> # save the mesh as a NASTRAN bulk data file
>>>>> gmsh.write("line.bdf")
>>>>>
>>>>> gmsh.finalize()
>>>>> -----
>>>>>
>>>>> Sincerely,
>>>>> Max
>>>>>
>>>>> On Thu, Feb 6, 2020 at 1:25 PM Jeremy Theler <jeremy at seamplex.com>
>>>>> wrote:
>>>>>
>>>>>> delx = 0.5;
>>>>>> xend = 20;
>>>>>> Point(1) = {0, 0, 0, delx};
>>>>>> Point(2) = {xend, 0, 0, delx};
>>>>>>
>>>>>> Line(1) = {1, 2};
>>>>>>
>>>>>> Physical Point("left") = {1};
>>>>>> Physical Point("right") = {2};
>>>>>> Physical Line("bulk") = {1};
>>>>>>
>>>>>> On Thu, 2020-02-06 at 23:11 +0530, Deepa wrote:
>>>>>> > >
>>>>>> > > I am a beginner here.
>>>>>> > >
>>>>>> > > I'm looking for ways of creating a mesh for a 2D geometry. It's a
>>>>>> > > straight line, the nodes have to be positioned along the x
>>>>>> > > directions and all y-coordinates have to be zero.
>>>>>> > >
>>>>>> > > Example: 0 : delx : xend, where delx =0.5, xend = 20.
>>>>>> > >
>>>>>> > > I have to create the input file in a format that will be
>>>>>> compatible
>>>>>> > > for importing in COMSOL.
>>>>>> > >
>>>>>> > > Any suggestions on how to proceed will be really helpful
>>>>>> > >
>>>>>> > > Thanks,
>>>>>> > > Deepa
>>>>>> > >
>>>>>> > >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > gmsh mailing list
>>>>>> > gmsh at onelab.info
>>>>>> >
>>>>>> > http://onelab.info/mailman/listinfo/gmsh
>>>>>> >
>>>>>> >
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> gmsh mailing list
>>>>>> gmsh at onelab.info
>>>>>> http://onelab.info/mailman/listinfo/gmsh
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Max Orok
>>>>> Contractor
>>>>> www.mevex.com
>>>>>
>>>>>
>>>>>
>>>
>>> --
>>> Max Orok
>>> Contractor
>>> www.mevex.com
>>>
>>>
>>>
>
> --
> Max Orok
> Contractor
> www.mevex.com
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20200209/ab59336a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Untitled.png
Type: image/png
Size: 60375 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200209/ab59336a/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2_gmsh.iges
Type: application/octet-stream
Size: 2132 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200209/ab59336a/attachment-0001.iges>


More information about the gmsh mailing list