Refining interior hexes in a block

I have a code with 2 blocks defined, and would like to refine all hexes in one block, but not have the refinements carry over to the other block. Is there a way to refine all hexes that are interior to a block, such that after refinement, only one block is modified?

Thanks!

It’s kind of tricky to get at all the interior hexes, but it can be done. Try the following:

reset
create cylinder radius 1 z 1
create cylinder radius 0.5 z 1
subtract 2 from 1
create cylinder radius 0.5 z 1
merge all
mesh volume all
group ‘hexes_in_volume_3’ add hex in volume 3
group ‘outer_hexes’ add hex in face in volume 3
group ‘hexes_to_refine’ subtract outer_hexes from hexes_in_volume_3 #creates the target group of hexes to refine
highlight hexes_to_refine
refine hex in hexes_to_refine

This approach only refines the interior hexes to volume 3, not perturbing the interface between the two volumes.

Great, thanks!