2.4.1. Introduction to Logical Volumes
A logical volume is a geometric selector. Its
Inside() method determines whether a point lies inside
the selected region. OpenSn can use logical volumes to assign mesh block or boundary IDs and to
identify subregions for sources and post-processing.
The pyopensn.logvol module provides the following concrete logical volumes:
RPPLogicalVolumeselects an axis-aligned rectangular parallelepiped. Individual axes can be made infinite, which also makes this class useful for slabs and extruded rectangles.RCCLogicalVolumeselects a finite right circular cylinder defined by a base point, an axis vector, and a radius.SphereLogicalVolumeselects a sphere defined by its center and radius.BooleanLogicalVolumecombines other logical volumes with inclusion and exclusion operations.SurfaceMeshLogicalVolumeselects the region enclosed by aSurfaceMesh.
All of these derive from LogicalVolume. See the
Python API reference for their constructor parameters and methods.
When a logical volume is passed to
SetBlockIDFromLogicalVolume(), OpenSn selects a cell by
testing its centroid. Boundary IDs can similarly be assigned with
SetBoundaryIDFromLogicalVolume(). A logical volume that
only intersects a cell, without containing its centroid, therefore does not select that cell.