Model.ossmooth_geometry#

Model.ossmooth_geometry(modelsel, fem_filename, filepath_grid, filepath_sh, load_op, outputcode, tetrameshingcode, units, autobead, autobeadthreshold, autobeadlayer, isosurface, surfacecode, densitythreshold, detectbridge, lowthreshold, distancecoefficient, optismoothboundary, lapiteration, lapfeatureangle, lapsmoothboundary, remesh, surfacereduction, reductionfeatureangle, createplotel)#

Extract the final design geometry from OptiStruct topology, topography and shape optimization results.

Parameters:
  • modelsel (int) –

    Model selection option.

    0 - Specify model file path to read.

    1 - Use current model in HyperMesh.

  • fem_filename (hwString) – The full name and path to the OptiStruct .fem results file generated from the optimization. Used only when modelsel = 1.

  • filepath_grid (hwString) – The full name and path to the OptiStruct .grid results file generated from the optimization.

  • filepath_sh (hwString) – The full name and path to the OptiStruct .sh results file generated from the optimization.

  • load_op (int) –

    Execution/load option. Valid values are:

    0 - Create .oss file only to be used in standalone version (do not execute ossmooth)

    1 - Do not load geometry into HyperMesh.

    2 - Load geometry into HyperMesh.

  • outputcode (int) –

    Output file format. Valid values are:

    1 - Natran

    2 - IGES

    3 - STL

    4 - H3D

  • tetrameshingcode (int) –

    Flag indicating whether to create tetramesh after creating isosurface.

    0 - No

    1 - Yes

  • units (int) –

    Units to use for IGES output. Valid values are:

    1 - inch

    2 - mm

    4 - foot

    6 - meter

    10 - cm

  • autobead (int) –

    Flag indicating whether to create an autobead design.

    0 - No

    1 - Yes

  • autobeadthreshold (double) – Threshold value for autobead (autobeadthreshold ≥ 0 and ≤ 1).

  • autobeadlayer (int) – Layer value for autobead (autobeadlayer=1 or 2).

  • isosurface (int) –

    Flag indicating whether to create an isosurface.

    0 - No

    1 - Yes

  • surfacecode (int) –

    The method to use. Valid values are:

    0 - No smoothing, isosurface only

    1 - Optimization based smoothing

    2 - No smoothing, element threshold

    3 - Laplacian smoothing

  • densitythreshold (double) – The density threshold for topology optimization (densitythreshold ≥ 0 and ≤ 1).

  • detectbridge (int) –

    Flag indicating whether to detect connectivity in isosurface.

    0 - No

    1 - Yes

  • lowthreshold (double) – The lower density threshold for connectivity detection (lowthreshold ≥ 0 and ≤ 1). Low threshold must be smaller than density threshold value.

  • distancecoefficient (double) – The distance coefficient to use in optimization based smoothing (distancecoefficient ≥ -50 and ≤ 50).

  • optismoothboundary (int) –

    Flag indicating whether to include the boundary or not in optimization based smoothing.

    0 - No

    1 - Yes

  • lapiteration (int) – The number of iterations to use in Laplacian smoothing (lapiteration ≥ 0).

  • lapfeatureangle (double) – The feature angle to use in Laplacian smoothing (lapfeatureangle ≥ 1 and ≤ 80).

  • lapsmoothboundary (int) –

    Flag indicating whether to include the boundary or not in Laplacian smoothing.

    0 - No

    1 - Yes

  • remesh (int) –

    Flag indicating whether to remesh when creating an autobead design or/and isosurface.

    0 - No

    1 - Yes

  • surfacereduction (int) –

    Flag indicating whether to use surface reduction.

    0 - No

    1 - Yes

  • reductionfeatureangle (double) – The feature angle to use when requesting surface reduction (reductionfeatureangle ≥ 1 and ≤ 80).

  • createplotel (int) –

    Flag indicating whether to create PLOTEL elements.

    0 - No

    1 - Yes

Example#

Execute OSSmooth on the “ C:/test / os1.fem “ , “ C:/test / os1.grid “ and “ C:/test / os1.sh files “ , load geometry back to HyperMesh , request Nastran output , create 1 layer autobead with remesh design with 0.3 bead threshold , no surface reduction , 0.3 topology optimization threshold , detect connectivity in isosurface with 0.2 low threshold , Laplacian smoothing , 10 iterations , 30.0 degrees feature angle and include the boundary , create PLOTEL elements#
import hm
import hm.entities as ent

model = hm.Model()

model.ossmooth_geometry(
    modelsel=0,
    fem_filename="C:/test/os1.fem",
    filepath_grid="C:/test/os1.grid",
    filepath_sh="C:/test/os1.sh",
    load_op=2,
    outputcode=1,
    tetrameshingcode=0,
    units=1,
    autobead=1,
    autobeadthreshold=0.3,
    autobeadlayer=1,
    isosurface=1,
    surfacecode=3,
    densitythreshold=0.4,
    detectbridge=1,
    lowthreshold=0.2,
    distancecoefficient=0.0,
    optismoothboundary=0,
    lapiteration=10,
    lapfeatureangle=30.0,
    lapsmoothboundary=1,
    remesh=1,
    surfacereduction=0,
    reductionfeatureangle=10.0,
    createplotel=1,
)