Model.createandadjustmass#

Model.createandadjustmass(sourcecollection, targetmass, targetcogx, targetcogy, targetcogz, targetcollection=s_defaultCollection, tolerance=0.0, usestructuralmass=False, addnumericalmass=False, nodalmass=1, iterations=1, optimizetargetflag=False)#

Adjusts mass for a selection of source components by creating solvermasses on the target components.

Parameters:
  • sourcecollection (Collection) – The collection containing the source component entities.

  • targetmass (double) – The target mass value.

  • targetcogx (double) – The target x-COG.

  • targetcogy (double) – The target y-COG.

  • targetcogz (double) – The target z-COG.

  • targetcollection (Collection) – The collection containing the target entities.

  • tolerance (double) – The percentage tolerance on mass to be adjusted.

  • usestructuralmass (bool) –

    0 - Use engineering mass

    1 - Use structural mass

  • addnumericalmass (bool) –

    0 - Do not add numerical mass

    1 - Add numerical mass coming from time step on the source entities

  • nodalmass (int) –

    0 - Mass type as property mass

    1 - Mass type as nodal mass

  • iterations (int) – Number of iterations.

  • optimizetargetflag (bool) –

    0 - Do not use optimize target

    1 - Use optimize target

Examples#

Adjust mass on all the components with specific target mass and COG values#
import hm
import hm.entities as ent

model = hm.Model()

model.createandadjustmass(
    sourcecollection=hm.Collection(model, ent.Component),
    targetmass=0.0245,
    targetcogx=-277.65,
    targetcogy=-0.49188,
    targetcogy=-0.49188,
    tolerance=10.0,
    usestructuralmass=True,
    addnumericalmass=True,
)
Another example of adjusting mass on all the components with specific target mass and COG values#
import hm
import hm.entities as ent

model = hm.Model

collection_input = hm.Collection(model,ent.Component)
collection_output = hm.Collection(model,ent.Component)

model.createandadjustmass(
    sourcecollection=collection_input,
    targetcollection=collection_output,
    targetmass=16000.000000,
    targetcogx=24.550000,
    targetcogy=-16.420000,
    targetcogy=25.000000,
    tolerance=10.0,
    addnumericalmass=False,
    nodalmass=0,
    iterations=20,
    optimizetargetflag=0,
)