Mercurial > repos > public > sbplib
diff +grid/evalOnStaggered.m @ 1331:60c875c18de3 feature/D2_boundary_opt
Merge with feature/poroelastic for Elastic schemes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 10 Mar 2022 16:54:26 +0100 |
parents | 8aa0909125a4 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+grid/evalOnStaggered.m Thu Mar 10 16:54:26 2022 +0100 @@ -0,0 +1,29 @@ +function gf = evalOnStaggered(g, f, gridGroup, subGrids) + + default_arg('gridGroup', 1); + + gf = []; + + if isa(g, 'multiblock.Grid') + + nSubGrids = numel(g.grids{1}.gridGroups{gridGroup}); + default_arg('subGrids', 1:nSubGrids ); + + for i = 1:g.nBlocks() + for j = subGrids + gf = [gf; grid.evalOn(g.grids{i}.gridGroups{gridGroup}{j}, f)]; + end + end + + else + + nSubGrids = numel(g.gridGroups{gridGroup}); + default_arg('subGrids', 1:nSubGrids ); + + for j = subGrids + gf = [gf; grid.evalOn(g.grids{i}.gridGroups{gridGroup}{j}, f)]; + end + + end + +end \ No newline at end of file