Re: [Gmsh] Create mesh for 1D geometry

2020-02-07 Thread Max Orok
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  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  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  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@onelab.info
>>> >
>>> > http://onelab.info/mailman/listinfo/gmsh
>>> >
>>> >
>>>
>>>
>>> ___
>>> gmsh mailing list
>>> gmsh@onelab.info
>>> http://onelab.info/mailman/listinfo/gmsh
>>>
>>
>>
>> --
>> Max Orok
>> Contractor
>> www.mevex.com
>>
>>
>>

-- 
Max Orok
Contractor
www.mevex.com
___
gmsh mailing list
gmsh@onelab.info
http://onelab.info/mailman/listinfo/gmsh


Re: [Gmsh] Create mesh for 1D geometry

2020-02-07 Thread Deepa
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  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  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@onelab.info
>> >
>> > http://onelab.info/mailman/listinfo/gmsh
>> >
>> >
>>
>>
>> ___
>> gmsh mailing list
>> gmsh@onelab.info
>> http://onelab.info/mailman/listinfo/gmsh
>>
>
>
> --
> Max Orok
> Contractor
> www.mevex.com
>
>
>
___
gmsh mailing list
gmsh@onelab.info
http://onelab.info/mailman/listinfo/gmsh