# sfepy.discrete.common.mappings module

Reference-physical domain mappings.

class sfepy.discrete.common.mappings.Mapping(**kwargs)

  Base class for mappings.

  static from_args(region, kind='v')

    Create mapping from reference to physical entities in a given region, given the integration kind (‘v’ or ‘s’).

    This mapping can be used to compute the physical quadrature points.

    Parameters:
      region Region instance

        The region defining the entities.

      kind‘v’ or ‘s’

        The kind of the entities: ‘v’ - cells, ‘s’ - facets.

    Returns:
      mapping FEMapping or IGMapping instance

        The requested mapping.

class sfepy.discrete.common.mappings.PhysicalQPs(num=0)

  Physical quadrature points in a region.

  get_shape(rshape)

    Get shape from raveled shape.

class sfepy.discrete.common.mappings.PyCMapping(bf, det, volume, bfg, normal, dim)

  Class for storing mapping data. Primary data in numpy arrays. Data for C functions translated to FMFields and embedded in CMapping.

  integrate(out, field, mode=0)

sfepy.discrete.common.mappings.get_jacobian(field, integral, region=None, integration='volume')

  Get the jacobian of reference mapping corresponding to field.

  Parameters:
    field Field instance

      The field defining the reference mapping.

    integral Integral instance

      The integral defining quadrature points.

    region Region instance, optional

      If given, use the given region instead of field region.

    integration one of (‘volume’, ‘surface’, ‘surface_extra’)

      The integration type.

  Returns:
    jac array

      The jacobian merged for all element groups.

  See also

  `get_mapping_data`

  Notes

  Assumes the same element geometry in all element groups of the field!

sfepy.discrete.common.mappings.get_mapping_data(name, field, integral, region=None, integration='volume')

  General helper function for accessing reference mapping data.

  Get data attribute name from reference mapping corresponding to field in region in quadrature points of the given integral and integration type.

  Parameters:
    name str

      The reference mapping attribute name.

    field Field instance

      The field defining the reference mapping.

    integral Integral instance

      The integral defining quadrature points.

    region Region instance, optional

      If given, use the given region instead of field region.

    integration one of (‘volume’, ‘surface’, ‘surface_extra’)

      The integration type.

  Returns:
    data array

      The required data merged for all element groups.

  Notes

  Assumes the same element geometry in all element groups of the field!

sfepy.discrete.common.mappings.get_normals(field, integral, region)

  Get the normals of element faces in region.

  Parameters:
    field Field instance

      The field defining the reference mapping.

    integral Integral instance

      The integral defining quadrature points.

    region Region instance

      The given of the element faces.

  Returns:
    normals array

      The normals merged for all element groups.

  See also

  `get_mapping_data`

  Notes

  Assumes the same element geometry in all element groups of the field!

sfepy.discrete.common.mappings.get_physical_qps(region, integral, map_kind=None)

  Get physical quadrature points corresponding to the given region and integral.