sfepy.fem.facets module

class sfepy.fem.facets.Facets(name, kind, domain, single_facets, n_obj, indices, facets)[source]
find_group_interfaces(return_surface=True)[source]

Find facets that create boundary between different element groups, i.e. facets that each belongs to two elements in different groups.

Parameters:

return_surface : bool

If True, the surface facets are also returned.

Returns:

inter_facets : array

The array with indices to self.facets of shape (n_i, 2), where n_i is the number of the interface facets. Each row corresponds to a single unique facet, each column to the corresponding two facets from each side of the interface.

surface_facets : array, optional

The array with indices to self.facets of shape (n_s,), where n_s is the number of the surface facets.

static from_domain(domain, kind)[source]
get_complete_facets(vertices, ig=0, mask=None)[source]

Get complete facets in group ig that are defined by the given vertices, or mask, if given.

Parameters:

vertices : array

The list of vertices.

ig : int

The group index.

mask : array, optional

Alternatively to vertices, a mask can be given with 1 at indices equal to the vertices and 0 elsewhere.

Returns:

ifacets : array

The indices into self.facets.

get_coors(ig=None)[source]

Get the coordinates of vertices of unique facets in group ig.

Parameters:

ig : int, optional

The element group. If None, the coordinates for all groups are returned, filled with zeros at places of missing vertices, i.e. where facets having less then the full number of vertices (n_v) are.

Returns:

coors : array

The coordinates in an array of shape (n_f, n_v, dim).

uid : array

The unique ids of facets in the order of coors.

get_dof_orientation_maps(nodes)[source]

Given description of facet DOF nodes, return the corresponding integer coordinates and orientation maps.

Notes

Assumes single facet type in all groups.

get_facet_dof_permutations(nodes)[source]

Given description of facet DOF nodes, return the DOF permutations for all possible facet orientations.

get_orientation(ig, tp_edge_ori=None)[source]

Get the orientation flag in group ig.

Parameters:

ig : int

The group index.

tp_edge_ori : array, optional

If given, use the tensor edge orientation to fix the flag - the flag is flipped for edges, where tp_edge_ori is False.

Returns:

ori : array

The orientation flag.

get_uid_per_elements(ig=0)[source]

Get unique ids of facets for all elements in group ig.

mark_surface_facets()[source]

flag: 0 .. inner, 2 .. edge, 3 .. triangle, 4 .. quadrangle

setup_group_interfaces()[source]

Setup facets that create boundary between different element groups.

setup_neighbours()[source]
For each unique facet:
  • indices of facets - sparse matrix (n_unique x n_all_obj) mtx[i, j] == 1 if facet[j] has uid[i]
  • number of elements it is in
setup_unique()[source]

sorted_facets == permuted_facets[perm] permuted_facets == sorted_facets[perm_i] uid : unique id in order of sorted_facets uid_i : unique id in order of permuted_facets or facets

sort_and_orient()[source]
sfepy.fem.facets.get_facet_dof_permutations(int_coors, ori_maps)[source]

Prepare DOF permutation vector for each possible facet orientation.