Model.batchmesh2#

Model.batchmesh2(collection, criteria_file, param_file, elemSize=-1.000000, elemType=2, elemOrder=-1, minElemSize=DBL_MAX, maxElemSize=DBL_MAX, elemFeatureAngle=25.000000, noGeomCleanup=0, noNodeMoveAcrossEdges=0, noRemoveHoles=0, noSeedHoles=0, noWasher=0, noAdvKeepFeatures=0, paramsGenerateMode='', batchTempFilesMode=-1, saveModel=-1, breakConnectivity=0, keepPlotElems=1, keepPreservedEdges=0)#

Performs interactive BatchMeshing.

Parameters:
  • collection (Collection) – The collection containing the entities to mesh by performing BatchMeshing. Valid entities are surfaces and components.

  • criteria_file (hwString) – The full path and file name of the criteria file. If the criteria are set by a preceding function, dummy can be used. This is ignored if paramsGenerateMode is set in the strings input, except the case in which paramsGenerateMode="scale".

  • param_file (hwString) – The full path and file name of the parameter file. If the params are set by a preceding function, dummy can be used. This is ignored if paramsGenerateMode is set in the strings input, except the case in which paramsGenerateMode="scale".

  • elemSize (double) –

    The target element size.

    If set as a positive value, then the criteria_file and param_file arguments are either scaled if paramsGenerateMode="scale", or ignored and the criteria and parameter values are auto-generated using some default values adjusted to the given size.

  • elemType (int) –

    Element type. Valid values are:

    0 - Trias

    1 - Quads

    2 - Mixed (default)

  • elemOrder (int) –

    Element order. Valid values are:

    1 - First (default)

    2 - Second

  • minElemSize (double) – The minimum element size, used for quality criteria auto-generation. Default is 0.3*elemSize.

  • maxElemSize (double) – The maximum element size, used for quality criteria auto-generation. Default is 1.75*elemSize.

  • elemFeatureAngle (double) – The minimum angle, in degrees, between elements for feature element edges. Default is 25.0.

  • noGeomCleanup (int) –

    Flag for geometry cleanup. Valid values are:

    0 - Geometry cleanup is applied (default).

    1 - Geometry cleanup is not applied.

  • noNodeMoveAcrossEdges (int) –

    Flag for node translation off geometry edges. Valid only when noGeomCleanup=0. Valid values are:

    0 - Nodes are allowed to be moved across non-feature geometry edges (default).

    1 - Nodes are not allowed to move off geometry edges.

  • noRemoveHoles (int) –

    Flag for small hole removal. Valid only when noGeomCleanup=0. Valid values are:

    0 - Small hole removal during geometry cleanup is enabled (default). The default diameter for removal is max(0.4*elemSize, 0.8*min_elemSize).

    1 - Small hole removal during geometry cleanup is disabled.

  • noSeedHoles (int) –

    Flag for hole seeding. Valid only when noGeomCleanup=0. Valid values are:

    0 - Holes seeding with fixed points during geometry cleanup is enabled (default).

    1 - Holes seeding with fixed points during geometry cleanup is disabled.

  • noWasher (int) –

    Flag for washer creation. Valid only when noGeomCleanup=0. Valid values are:

    0 - Washer creation is enabled (default).

    1 - Washer creation is disabled.

  • noAdvKeepFeatures (int) –

    Flag for advanced feature capturing. Valid only when noGeomCleanup=0. Valid values are:

    0 - Advanced feature capturing is enabled (default).

    1 - Advanced feature capturing is disabled.

  • paramsGenerateMode (hwString) –

    Defines the auto-generate mode. Valid values are:

    generic - Generic, universal parameters are created (default)

    scale - The given criteria_file and param_file files are scaled to elemSize.

    midmesh - Parameters specialized for shell models obtained by mid-surface extraction are created.

    shell - Parameters specialized for shell models are created.

    solid - Parameters specialized for solid models are created.

  • batchTempFilesMode (int) – This argument is deprecated as now all values do not create temp files. It should not be set.

  • saveModel (int) – This argument is deprecated as now do not save a backup model, but will allow undo/redo. It should not be set.

  • breakConnectivity (int) –

    Flag for mesh connectivity. Valid only when noGeomCleanup=0. Valid values are:

    0 - Mesh connectivity is maintained with parts of the model not selected (default).

    1 - Mesh connectivity is broken with parts of the model not selected.

  • keepPlotElems (int) –

    Flag for keeping plot elements. Valid only when noGeomCleanup=0. Valid values are:

    0 - Plot elements are deleted. This is how standalone BatchMesher behaves.

    1 - Plot elements are not deleted (default).

  • keepPreservedEdges (int) –

    Flag for preserving edges. Valid only when noGeomCleanup=0. Valid values are:

    0 - Do not preserve edges.

    1 - Preserve edges.

Note

Except the collection, criteria_file and param_file all the other mesh and geometry clean-up arguments are valid when elemSize > 0.

Examples#

BatchMesh surfaces with IDs 36 and 79 using the criteria file “C:/crit/10mm.criteria” and parameters file “C:/crit/10mm.param”, with all other default parameters#
import hm
import hm.entities as ent

model = hm.Model()

surface_collection = hm.Collection(model, ent.Surface, [36, 79])

model.batchmesh2(
    collection=surface_collection,
    criteria_file="C:/crit/10mm.criteria",
    param_file="C:/crit/10mm.param",
)
BatchMesh surfaces with IDs 36 and 79 using the criteria file “C:/crit/10mm.criteria” and parameters file “C:/crit/10mm.param”, breaking mesh connectivity, with all other default parameters#
import hm
import hm.entities as ent

model = hm.Model()

surface_collection = hm.Collection(model, ent.Surface, [36, 79])

model.batchmesh2(
    collection=surface_collection,
    criteria_file="C:/crit/10mm.criteria",
    param_file="C:/crit/10mm.param",
    breakConnectivity=1,
)
BatchMesh surfaces with IDs 36 and 79 with element size 8.0 and minimum size 3.75. Use auto-generated shell criteria and parameters.#
import hm
import hm.entities as ent

model = hm.Model()

surface_collection = hm.Collection(model, ent.Surface, [36, 79])

model.batchmesh2(
    collection=surface_collection,
    criteria_file="dummy",
    param_file="dummy",
    elemSize=8.0,
    minElemSize=3.75,
    paramsGenerateMode="shell",
)
BatchMesh surfaces with IDs 36 and 79 with element size 7.0, using scaling of the criteria “C:/crit/10mm.criteria” and parameters file “C:/crit/10mm.param”#
import hm
import hm.entities as ent

model = hm.Model()

surface_collection = hm.Collection(model, ent.Surface, [36, 79])

model.batchmesh2(
    collection=surface_collection,
    criteria_file="C:/crit/10mm.criteria",
    param_file="C:/crit/10mm.param",
    elemSize=7.0,
    paramsGenerateMode="scale",
)