Model.storemeshtodatabase#

Model.storemeshtodatabase(elemstosurfcomp)#

Converts a generated mesh (if any) into elements in the specified component.

Parameters:

elemstosurfcomp (int) – If non-zero, new elements are created in the surface component to which they belong. Otherwise, they are created in the current component.

Example#

Create the new elements in the current component. For a complete example, please see functions Model.ameshclearsurface() or Model.interactivemeshsurf().#
# Before we have set the edge and face parameters for automeshing module for a surface
# Discarding mesh of face 2
model.rejectmesh(faceindex=2)

# Setting again new parameters for face 2 and after setting new parameters...
#...new elements are generated  for the current surface.
model.set_meshedgeparams(
    edge_index=8,
    elem_density=6,
    alg_type=0,
    bias_style=0,
    bias=-2.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)

model.set_meshedgeparams(
    edge_index=5,
    elem_density=3,
    alg_type=0,
    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=6,
    elem_density=5,
    alg_type=0,
    bias_style=0,
    bias=2.0,
    min_size=0.0,
    max_size=0.0,
    chordal_dev=0.0,
    max_angle=0.0,
)

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

model.set_meshfaceparams(
    face_index=2,
    shape_type=1,
    elem_type=1,
    alg_type=0,
    elem_size=0,
    smooth_method=0,
    smooth_tol=0.1,
    size_control=0,
    skew_control=0,
)

model.automesh(face_index=2, algorithm=1, elem_type=1)

model.storemeshtodatabase(elemstosurfcomp=0)