<s> """<STR_LIT>""" <EOL> import scipy as _sp <EOL> from OpenPNM . Geometry import models as gm <EOL> from OpenPNM . Geometry import GenericGeometry <EOL> class Cube_and_Cuboid ( GenericGeometry ) : <EOL> r"""<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> super ( ) . __init__ ( ** kwargs ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . pore_misc . random ) <EOL> Ps = self . _net . pores ( self . name ) <EOL> Ts = self . _net . find_neighbor_throats ( pores = Ps , mode = '<STR_LIT>' ) <EOL> P1 = self . _net [ '<STR_LIT>' ] [ : , <NUM_LIT:0> ] [ Ts ] <EOL> P2 = self . _net [ '<STR_LIT>' ] [ : , <NUM_LIT:1> ] [ Ts ] <EOL> C1 = self . _net [ '<STR_LIT>' ] [ P1 ] <EOL> C2 = self . _net [ '<STR_LIT>' ] [ P2 ] <EOL> E = _sp . sqrt ( _sp . sum ( ( C1 - C2 ) ** <NUM_LIT:2> , axis = <NUM_LIT:1> ) ) <EOL> if _sp . allclose ( E , E [ <NUM_LIT:0> ] ) : <EOL> spacing = E [ <NUM_LIT:0> ] <EOL> else : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . pore_diameter . normal , <EOL> loc = spacing / <NUM_LIT:2> , <EOL> scale = spacing / <NUM_LIT:10> ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . pore_area . cubic ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . pore_volume . cube ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . throat_diameter . minpore , <EOL> factor = <NUM_LIT:0.5> ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . throat_length . straight ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . throat_volume . cuboid ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . throat_area . cuboid ) <EOL> self . models . add ( propname = '<STR_LIT>' , <EOL> model = gm . throat_surface_area . cuboid ) </s>
