continuity#

This is a submodule which contains functions used to deal with continuity. This concerns connecting element boundaries together and generating continuity equations.

Functions used to connect elements together on edges or corners are connect_corner_based() and connect_edge_center() for 0-forms, and connect_edge_based() for both 0- and 1-forms.

mfv2d.continuity.connect_corner_based(elements: ElementCollection, *pairs: tuple[int, ElementSide]) list[Constraint][source]#

Create constraints for 0-forms on the corner.

Parameters:
  • elements (ElementCollection) – Element collection to which the two elements belong to.

  • *pairs (tuple of (int, ElementSide)) – Elements that should be connected as pairs of element and side that the corner is the beginning for.

Returns:

Constraints which enforce continuity between the elements for 0-forms.

Return type:

list of Constraints

mfv2d.continuity.connect_edge_center(elements: ElementCollection, e1: int, e2: int, side: ElementSide) list[Constraint][source]#

Connect center of edges for two elements with 0-forms.

Parameters:
  • elements (ElementCollection) – Element collection to which the elements belong to.

  • e1 (int) – Index of the first element.

  • e2 (int) – Index of the second element.

  • side (ElementSide) – Side of the elements that is to be connected.

Returns:

Constraints which enforce continuity between the two elements for 0-forms in the middle of the side.

Return type:

list of Constraints

mfv2d.continuity.connect_edge_based(elements: ElementCollection, e1: int, s1: ElementSide, e2: int, s2: ElementSide, form_order: UnknownFormOrder) list[Constraint][source]#

Create constraints for 0-forms or 1-forms on edges.

Parameters:
  • elements (ElementCollection) – Element collection to which the two elements belong to.

  • e1 (int) – Index of the first element.

  • s1 (ElementSide) – Side of the first element that is connected to the second.

  • e2 (int) – Index of the second element.

  • s2 (ElementSide) – Side of the second element that is connected to the second.

  • form_order (UnknownFormOrder) – Order of the unknown form to handle. Note that only 0-forms and 1-forms are valid, since 2-forms have no boundary DoFs.

Returns:

Constraints which enforce continuity between the two elements for 0-forms or 1-forms.

Return type:

list of Constraints

These are all used for innner element connectivity function connect_element_inner().

mfv2d.continuity.connect_element_inner(elements: ElementCollection, element: int, form_order: UnknownFormOrder) list[Constraint][source]#

Generate constraints for continuity within the element.

Parameters:
  • elements (ElementCollection) – Element collection the element belongs to.

  • element (int) – Index of element to deal with.

  • form_order (UnknownFormOrder) – Order of the form to use.

Returns:

Constraints which enforce the continuity within the element.

Return type:

list of Constraint

This all culminates in connect_elements(), which generates all constraints for mesh continuity.

mfv2d.continuity.connect_elements(elements: ElementCollection, unknowns: UnknownOrderings, mesh: Mesh2D, dof_offsets: FixedElementArray[uint32]) list[Constraint][source]#

Generate constraints for all elements and unknowns.

Parameters:
  • elements (ElementCollection) – Element collection that contains all the elements.

  • unknowns (UnknownOrderings) – Orders of unknown forms defined for all elements.

  • mesh (Mesh2D) – Mesh with primal and dual topology of root elements.

  • dof_offsets (FixedElementArray[np.uint32]) – Array of offsets for degrees of freedom in the elements.

Returns:

List with constraints which enforce continuity between degrees of freedom for unknown forms defined between all elements.

Return type:

list of Constraint

There is also an internal function used in this module.

mfv2d.continuity._find_surface_boundary_id_node(mesh: Mesh2D, surf_idx: int, node_idx: int) ElementSide[source]#

Find what boundary begins with the node with a given index is in the surface.

Parameters:
  • mesh (Mesh2D) – Mesh the surface is a part of.

  • surf_idx (int) – Index of the surface.

  • node_idx (int) – Index of the node.

Returns:

Side of the element which begins with the given node. If the node is not in the surface an exception is raised.

Return type:

ElementSide