carputils.mesh.block_region(block, entity, index, low, up, bath=False, verbose=False)

Generate a boundary condition definition for a Block.

Given a Block, generate a set of openCARP options defining a block-shaped region on a given domain low and up specify lower and upper coordinates of the block region.

For example, for the default origin-centred box of size (1,1,1) and resolution 0.1:

>>> geom = Block()

calling block_region() with low =’[-0.5, -0.5 -0.5]’ and up=’[0.0, 0.0, 0.0]’:

>>> block_region(geom, 'stimulus', 0, low, up, False)

will generate a stimulus block definition for -0.5<=x<=0., -0.5<=y<=0. and -0.5<=z<=0.0.

block : Block
The geometry to generate boundary conditions for
entity : str
The openCARP boundary condition type to use (e.g. ‘stimulus’)
index : int
The boundary condition index
low : array
x, y and z coordinate of lower left corner of block region
up : array
x, y and z coordinate of upper right corner of block region
bath : bool, optional
Generate BC at bounds of tissue+bath if True, tissue only otherwise (default)
verbose : bool, optional
True to print summary of generated parameters to stdout
openCARP command line options to set up boundary condition.