ndiffusion.region_powers¶
- ndiffusion.region_powers(density, volumes, regions, n_regions=None)[source]¶
Integrate a per-cell density over regions.
- Parameters:
density (array-like) –
(n_cells,)- typicallypower_density(), but any density works (a reaction rate gives a region reaction rate).volumes (array-like) –
(n_cells,)fromcell_volumes().regions (array-like of int) – Region id per cell: the material map for powers by material, or any other labeling (assembly, ring, …).
n_regions (int, optional) – Length of the result; defaults to
max(regions) + 1.
- Returns:
(n_regions,); entryris the integral over cells labeledr.- Return type: