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 <[email protected]> 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
> > [email protected]
> >
> > http://onelab.info/mailman/listinfo/gmsh
> >
> >
>
>
> _______________________________________________
> gmsh mailing list
> [email protected]
> http://onelab.info/mailman/listinfo/gmsh
>
--
Max Orok
Contractor
www.mevex.com
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()
line.bdf
Description: Binary data
_______________________________________________ gmsh mailing list [email protected] http://onelab.info/mailman/listinfo/gmsh
