Model.hm_getaxisymmetricvolumereduced#

Model.hm_getaxisymmetricvolumereduced(solids, elems, rotal_axis, reference_point, num_samples=1, result_per_elem=1)#

Calculates the reduced volume of the axisymmetric solids. The enclosed volume when the selected elements are fully rotated is considered to produce the full axisymmetric volume, with axis of symmetry passing through the reference_point with a direction defined by the rotal_axis option.

The function outputs the volume formed by rotation of each element in the specified collection and the reduced volume for that element and the total result for all selected elements.

If an input element is outwards to the cross section of the selected axisymmetric solids along the direction perpendicular to the axis of rotation, it will also be considered as inside the solid unless it intersects with one of the selected solids.

Parameters:
  • solids (Collection) – The collection containing the axisymmetric solids for which the reduced volume is calculated.

  • elems (Collection) – The collection containing the elements for which the reduced volume is calculated.

  • rotal_axis (hwTriple) – The components of the vector defining the axis of symmetry for selected solids.

  • reference_point (hwTriple) – The coordinates of a point the axis of symmetry passes through.

  • num_samples (int) – The number of samples used for analysis per each edge of quad and the maximum number of samples per each edge of tria element. This is an optional argument. By default, one sample is used per each element. Each sample point is chosen inside the element. The figure below shows the sample points for num_samples set to 3.

  • result_per_elem (unsigned int) – The optional flag controlling the returned results. Valid values are 0 and 1 (default). By default, results for all elements are returned separately along with the total result. If set to 0, only the total axisymmetric unreduced volume and the total volume reduced are returned.

Returns:

If result_per_elem=0:

  • HmQueryResult - Result object containing the output values:

    • totalUnreducedVolume (double) - The total unreduced volume of the axisymmetric solids formed by rotation of the selected elements.

    • totalReducedVolume (double) - The total reduced volume of the axisymmetric solids formed by rotation of the selected elements.

If result_per_elem=1:

  • HmQueryResult - Result object containing the output values:

    • resultList (HmQueryResultList) - Result list object containing HmQueryResult objects with the following output data:

      • element (Entity) - The element entity object for which the volume is calculated.

      • unreducedVolume (double) - The unreduced volume of the axisymmetric solids formed by rotation of the selected element.

      • reducedVolume (double) - The reduced volume of the axisymmetric solids formed by rotation of the selected element.

    • Summary (HmQueryResultList) - Result list object containing HmQueryResult objects with the following output data:

      • totalUnreducedVolume (double) - The total unreduced volume of the axisymmetric solids formed by rotation of the selected elements.

      • totalReducedVolume (double) - The total reduced volume of the axisymmetric solids formed by rotation of the selected elements.

Examples#

Find the reduced volume of axisymmetric solid ID 1 formed by rotation of elements in component ID 10 around the axis passing through point (0,0,0) with direction (0,0,1).#
import hm
import hm.entities as ent

model = hm.Model()

solids = hm.Collection(model,ent.Solid,[1])

elems = hm.Collection(model,ent.Element, hm.Collection(model,ent.Component,[10]))

_, resultlist = model.hm_getaxisymmetricvolumereduced(
    solids=solids,
    elems=elems,
    rot_axis=(0.0, 0.0, 1.0),
    reference_point=(0.0, 0.0, 0.0),
    num_samples=3,
    result_per_elem=1
)

for result in resultlist:
    print(f"Element: {result.element.id}, Unreduced Volume: {result.unreducedVolume}, Reduced Volume: {result.reducedVolume}")

print(f"Total Unreduced Volume: {resultlist.summary[0].totalUnreducedVolume}, Total Reduced Volume: {resultlist.summary[0].totalReducedVolume}")