def _add_geometry(self):
        try:
            boundary_pores = sp.where(self['pore.type'] != 0)[0]
            boundary_throats = sp.where(self['throat.type'] != 0)[0]
            self['throat.top'] = sp.ravel(self['throat.type'] == 1)
            self['throat.bottom'] = sp.ravel(self['throat.type'] == 6)
            self['throat.left'] = sp.ravel(self['throat.type'] == 2)
            self['throat.right'] = sp.ravel(self['throat.type'] == 5)
            self['throat.front'] = sp.ravel(self['throat.type'] == 3)
            self['throat.back'] = sp.ravel(self['throat.type'] == 4)
            self['pore.top'] = self.tomask(pores=sp.ravel(
                self.find_connected_pores(self.throats('top'))))
            self['pore.bottom'] = self.tomask(sp.ravel(
                self.find_connected_pores(self.throats('bottom'))))
            self['pore.left'] = self.tomask(sp.ravel(
                self.find_connected_pores(self.throats('left'))))
            self['pore.right'] = self.tomask(sp.ravel(
                self.find_connected_pores(self.throats('right'))))
            self['pore.front'] = self.tomask(sp.ravel(
                self.find_connected_pores(self.throats('front'))))
            self['pore.back'] = self.tomask(sp.ravel(
                self.find_connected_pores(self.throats('back'))))
            add_boundaries = True
        except:
            boundary_pores = sp.array([])
            boundary_throats = sp.array([])
            logger.info('No boundary pores added.')
            add_boundaries = False
        Ps = sp.where([pore not in boundary_pores for pore in self.pores()])[0]
        Ts = sp.where(
            [throat not in boundary_throats for throat in self.throats()])[0]
        geom = OpenPNM.Geometry.GenericGeometry(network=self, pores=Ps, throats=Ts)
        geom['pore.volume'] = sp.ravel(sp.array(
            self._dictionary['pvolume'][self._pore_map[Ps]], float))
        geom['pore.diameter'] = sp.ravel(sp.array(
            self._dictionary['pdiameter'][self._pore_map[Ps]], float))
        geom['throat.diameter'] = sp.ravel(sp.array(
            self._dictionary['tdiameter'][self._throat_map[Ts]], float))
        geom.add_model(propname='pore.area',
                       model=OpenPNM.Geometry.models.pore_area.spherical)
        geom.add_model(propname='throat.area',
                       model=OpenPNM.Geometry.models.throat_area.cylinder)

        if add_boundaries:
            boun = OpenPNM.Geometry.Boundary(network=self,
                                             pores=boundary_pores,
                                             throats=boundary_throats,
                                             name='boundary')
            self['pore.top_boundary'] = \
                self.tomask(pores=self.pores(['top', 'boundary'],
                            mode='intersection'))
            self['pore.bottom_boundary'] = \
                self.tomask(pores=self.pores(['bottom', 'boundary'],
                            mode='intersection'))
            self['pore.left_boundary'] = \
                self.tomask(pores=self.pores(['left', 'boundary'],
                            mode='intersection'))
            self['pore.right_boundary'] = \
                self.tomask(pores=self.pores(['right', 'boundary'],
                            mode='intersection'))
            self['pore.front_boundary'] = \
                self.tomask(pores=self.pores(['front', 'boundary'],
                            mode='intersection'))
            self['pore.back_boundary'] = \
                self.tomask(pores=self.pores(['back', 'boundary'],
                            mode='intersection'))

            self['throat.top_boundary'] = \
                self.tomask(throats=self.throats(['top', 'boundary'],
                            mode='intersection'))
            self['throat.bottom_boundary'] = \
                self.tomask(throats=self.throats(['bottom', 'boundary'],
                            mode='intersection'))
            self['throat.left_boundary'] = \
                self.tomask(throats=self.throats(['left', 'boundary'],
                            mode='intersection'))
            self['throat.right_boundary'] = \
                self.tomask(throats=self.throats(['right', 'boundary'],
                            mode='intersection'))
            self['throat.front_boundary'] = \
                self.tomask(throats=self.throats(['front', 'boundary'],
                            mode='intersection'))
            self['throat.back_boundary'] = \
                self.tomask(throats=self.throats(['back', 'boundary'],
                            mode='intersection'))
dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Network/__MatFile__.py/MatFile._add_geometry/original