discretization_modules/generic_discretization.py
def __create_cell_vol_mapping(self):
    """
    Generate cell -> volume mapping for all cells of current partition. Note that keys are ordered by the
    associated DG(0) dof, not by the cell index in the mesh.

    This map is required for calculating various densities from total region integrals (like cell power densities from
    cell-integrated powers).
    """

    if self.verb > 2: print0("Constructing cell -> volume mapping")
    timer = Timer("DD: Cell->vol construction")

    code = \
    '''
      #include <dolfin/mesh/Cell.h>

      namespace dolfin
      {
        void fill_in(Array<double>& cell_vols, const Mesh& mesh, const Array<int>& cell_dofs)
        {
          for (CellIterator c(mesh); !c.end(); ++c)
            cell_vols[cell_dofs[c->index()]] = c->volume();
        }
      }
    '''

    cell_mapping_module = compile_extension_module(code)
    cell_vol_array = DoubleArray(self.local_ndof0)
    cell_mapping_module.fill_in(cell_vol_array, self.mesh, self.local_cell_dof_map)
    self._local_cell_volumes = cell_vol_array.array()

    timer.stop()

    Generate cell -> volume mapping for all cells of current partition. Note that keys are ordered by the
    associated DG(0) dof, not by the cell index in the mesh.

    This map is required for calculating various densities from total region integrals (like cell power densities from
    cell-integrated powers).
    
Generate cell -> volume mapping for all cells of current partition. Note that keys are ordered by the
associated DG(0) dof, not by the cell index in the mesh.

This map is required for calculating various densities from total region integrals (like cell power densities from
cell-integrated powers).
Generate cell - > volume mapping for all cells of current partition . Note that keys are ordered by the associated DG ( 0 ) dof not by the cell index in the mesh . This map is required for calculating various densities from total region integrals ( like cell power densities from cell - integrated powers ) .
def __create_cell_vol_mapping(self):
    if self.verb > 2: print0("Constructing cell -> volume mapping")
    timer = Timer("DD: Cell->vol construction")
    code = \
    '''
      #include <dolfin/mesh/Cell.h>
      namespace dolfin
      {
        void fill_in(Array<double>& cell_vols, const Mesh& mesh, const Array<int>& cell_dofs)
        {
          for (CellIterator c(mesh); !c.end(); ++c)
            cell_vols[cell_dofs[c->index()]] = c->volume();
        }
      }
    '''
    cell_mapping_module = compile_extension_module(code)
    cell_vol_array = DoubleArray(self.local_ndof0)
    cell_mapping_module.fill_in(cell_vol_array, self.mesh, self.local_cell_dof_map)
    self._local_cell_volumes = cell_vol_array.array()
    timer.stop()
def __create_cell_vol_mapping ( self ) : if self . verb > 2 : print0 ( "Constructing cell -> volume mapping" ) timer = Timer ( "DD: Cell->vol construction" ) code = '''
      #include <dolfin/mesh/Cell.h>

      namespace dolfin
      {
        void fill_in(Array<double>& cell_vols, const Mesh& mesh, const Array<int>& cell_dofs)
        {
          for (CellIterator c(mesh); !c.end(); ++c)
            cell_vols[cell_dofs[c->index()]] = c->volume();
        }
      }
    ''' cell_mapping_module = compile_extension_module ( code ) cell_vol_array = DoubleArray ( self . local_ndof0 ) cell_mapping_module . fill_in ( cell_vol_array , self . mesh , self . local_cell_dof_map ) self . _local_cell_volumes = cell_vol_array . array ( ) timer . stop ( )
Generate cell -> volume mapping for all cells of current partition.
Generate cell - > volume mapping for all cells of current partition .
"""
    Generate cell -> volume mapping for all cells of current partition. Note that keys are ordered by the
    associated DG(0) dof, not by the cell index in the mesh.

    This map is required for calculating various densities from total region integrals (like cell power densities from
    cell-integrated powers).
    """
self