Model.solverdeckcleanup#

Model.solverdeckcleanup(solver, collection_set)#

Deletes or retains certain solver specific entities, based on their validity in the current model. This is useful after a box trim operation.

Parameters:
  • solver (hwString) – The source solver name. Currently only LS-DYNA is supported.

  • collection_set (CollectionSet) –

    The set of collections containing possibly multiple type of entities to consider for cleanup. Supported entity types include groups, controlvols, and loads.

    The following operations are performed:

    • AIRBAG_ADVANCED_ALE (control volume): Delete if at least one bag ID is not defined.

    • AIRBAG_INTERACTION (control volume): Delete if the card image does not contain both AB1 and AB2 values. Both have to be present for the entity to be retained.

    • AIRBAG_PARTICLE (control volume): Delete if the card image does not reference either a part set ID or part ID corresponding to variables SID1 and SID2. Only one has to be present for the entity to be retained.

    • AIRBAG_<option> (control volume): Delete if the secondary definition is empty.

    • ALE_options (ALE group)

    • CONSTRAINED_EULER_IN_EULER (group)

    • CONSTRAINED_LAGRANGE_IN_SOLID (ALE group)

    • CONSTRAINED_RIGID_BODIES (group)

    • CONSTRAINED_TIE-BREAK (group)

    • CONTACT (group): Delete if either the main or secondary definition is missing or empty.

    • CONSTRAINED_EXTRA_NODE (group): Delete if no nodes or node set are associated. In its card image, remove the keyword if PSID is assigned as blank.

    The following keywords, if defined, do not need explicit entity definitions as they consider the entire model, and will be retained:

    • CONTACT (group): If main or secondary type is assigned a value of 5.

    • LOAD_BLAST

    • LOAD_BODY

    • LOAD_BRODE

    • INITIAL_VELOCITY_<option>

    • RIGIDWALL: If variable NSID is assigned a value of 0.

Example#

Clean up the element enities with IDs 1,2,3 and the node entities with IDs 1,2,3#
import hm
import hm.entities as ent

model = hm.Model()

nodes_collection = hm.Collection(model, ent.Node, [1, 2, 3])
element_collection = hm.Collection(model, ent.Element, [1, 2, 3])
entity_collection_set = hm.CollectionSet(model)
entity_collection_set.set(nodes_collection)
entity_collection_set.set(element_collection)

model.solverdeckcleanup(solver="LsDyna", collection_set=entity_collection_set)