Acoular 25.04 documentation

MergeGrid

«  LineGrid   ::   grids   ::   Sector  »

MergeGrid

class acoular.grids.MergeGrid

Bases: Grid

Base class for merging multiple grid geometries.

The MergeGrid class allows the combination of multiple grid geometries into a single unified grid. Each input grid is assigned a subdomain in the resulting grid, and all properties, such as positions and identifiers, are appropriately merged.

Notes

  • The merged grid eliminates duplicate points based on their positions.

  • Each subgrid retains its original grid properties, such as digest and size.

Examples

Merging two simple grids:

>>> import acoular as ac
>>> grid1 = ac.LineGrid(loc=(0, 0, 0), direction=(1, 0, 0), length=1, num_points=3)
>>> grid2 = ac.LineGrid(loc=(0, 0, 0), direction=(0, 1, 0), length=1, num_points=3)
>>> merged_grid = ac.MergeGrid()
>>> merged_grid.grids = [grid1, grid2]
>>> merged_grid.size
5
>>> merged_grid.pos
array([[0. , 0. , 0. , 0.5, 1. ],
       [0. , 0.5, 1. , 0. , 0. ],
       [0. , 0. , 0. , 0. , 0. ]])
grids = List(desc='list of grids')

A list of Grid objects to be merged. Each grid is treated as a subdomain in the resulting merged grid.

grid_digest = Str(desc='digest of the merged grids')

A list of unique digests for each grid being merged. (read-only)

subgrids = Property(desc='names of subgrids for each point')

Names of subgrids corresponding to each point in the merged grid. (read-only)

digest = Property(depends_on=['grids', 'grid_digest'])

A unique identifier for the grid, based on its properties. (read-only)

«  LineGrid   ::   grids   ::   Sector  »