sfepy.fem.mappings module

Finite element reference mappings.

class sfepy.fem.mappings.Mapping(coors, conn, poly_space=None, gel=None, order=1)[source]

Base class for mappings.

get_base(coors, diff=False)[source]

Get base functions or their gradient evaluated in given coordinates.

get_geometry()[source]

Return reference element geometry as a GeometryElement instance.

get_physical_qps(qp_coors)[source]

Get physical quadrature points corresponding to given reference element quadrature points.

Returns:

qps : array

The physical quadrature points ordered element by element, i.e. with shape (n_el, n_qp, dim).

class sfepy.fem.mappings.PhysicalQPs(**kwargs)[source]

Physical quadrature points in a region.

get_merged_values()[source]
get_shape(rshape, ig=None)[source]

Get shape from raveled shape.

class sfepy.fem.mappings.SurfaceMapping(coors, conn, poly_space=None, gel=None, order=1)[source]

Mapping from reference domain to physical domain of the space dimension higher by one.

get_mapping(qp_coors, weights, poly_space=None, mode='surface')[source]

Get the mapping for given quadrature points, weights, and polynomial space.

Returns:

cmap : CMapping instance

The surface mapping.

class sfepy.fem.mappings.VolumeMapping(coors, conn, poly_space=None, gel=None, order=1)[source]

Mapping from reference domain to physical domain of the same space dimension.

get_mapping(qp_coors, weights, poly_space=None, ori=None)[source]

Get the mapping for given quadrature points, weights, and polynomial space.

Returns:

cmap : CMapping instance

The volume mapping.

sfepy.fem.mappings.get_jacobian(field, integral, region=None, integration='volume')[source]

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.fem.mappings.get_mapping_data(name, field, integral, region=None, integration='volume')[source]

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.fem.mappings.get_normals(field, integral, region)[source]

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.fem.mappings.get_physical_qps(region, integral)[source]

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