Model.linearmesh#

Model.linearmesh(quads)#

Within the automeshing module, generates quad or tria elements using a flexible surfaceless algorithm that approximates a ruled surface. Can only be used together with Model.surfacemode() where mode=3 and one of the Model.linearsurfacebetweenlines() or Model.linearsurfacebetweennodes() or Model.linearsurfacebetweennodesandline(). functions.

Parameters:

quads (int) – If nonzero, specifies that the created elements should be quads.

Example#

Identify a region in the shape of a ruled surface and sends it into the automesher to create quad elements and store the elements to the HyperMesh database#
import hm
import hm.entities as ent

model = hm.Model()

'''

Indentifying a region in the shape of a ruled surface using
the model.surfacemode(mode=3), the model.linearsurfacebetweennodes()
and sends it into the automesher via the model.set_meshedgeparams()
to create quad elements via model.linearmesh(quads=1). The
model.storemeshtodatabase() stores the elements in Hypermesh database.

'''

model.surfacemode(mode=3)

nodelist1 = [
    ent.Node(model, 1581),
    ent.Node(model, 77),
    ent.Node(model, 83),
    ent.Node(model, 88),
    ent.Node(model, 95),
]
nodelist2 = [
    ent.Node(model, 225),
    ent.Node(model, 228),
    ent.Node(model, 232),
    ent.Node(model, 235),
    ent.Node(model, 262),
]

model.linearsurfacebetweennodes(list1=nodelist1, list2=nodelist2, reverse=1)

model.set_meshedgeparams(
    edge_index=0,
    elem_density=8.0,
    alg_type=1,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)

model.set_meshedgeparams(
    edge_index=1,
    elem_density=4.0,
    alg_type=1,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)

model.set_meshedgeparams(
    edge_index=2,
    elem_density=8.0,
    alg_type=1,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)

model.set_meshedgeparams(
    edge_index=3,
    elem_density=4.0,
    alg_type=1,
    bias_style=0,
    bias=0.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)

model.linearmesh(quads=1)

model.storemeshtodatabase(elemstosurfcomp=0)

model.ameshclearsurface()