symfem.references¶
Reference elements.
Attributes¶
Exceptions¶
Exception to be thrown when an element can only be created on the default reference. |
Classes¶
A reference cell on which a finite element can be defined. |
|
A point. |
|
An interval. |
|
A triangle. |
|
A tetrahedron. |
|
A quadrilateral. |
|
A hexahedron. |
|
A (triangular) prism. |
|
A (square-based) pyramid. |
|
A polygon on a barycentric dual grid. |
Module Contents¶
- symfem.references.LatticeWithLines¶
- symfem.references.IntLimits¶
- exception symfem.references.NonDefaultReferenceError¶
Bases:
NotImplementedErrorException to be thrown when an element can only be created on the default reference.
- class symfem.references.Reference(vertices: symfem.geometry.SetOfPointsInput = ())¶
Bases:
abc.ABCA reference cell on which a finite element can be defined.
- __build__(tdim: int, name: str, origin: symfem.geometry.PointTypeInput, axes: symfem.geometry.SetOfPointsInput, reference_vertices: symfem.geometry.SetOfPointsInput, vertices: symfem.geometry.SetOfPointsInput, edges: tuple[tuple[int, int], Ellipsis], faces: tuple[tuple[int, Ellipsis], Ellipsis], volumes: tuple[tuple[int, Ellipsis], Ellipsis], sub_entity_types: list[list[str] | str | None], simplex: bool = False, tp: bool = False)¶
Create a reference cell.
- Parameters:
tdim – The topological dimension of the cell
name – The name of the cell
origin – The coordinates of the origin
axes – Vectors representing the axes of the cell
reference_vertices – The vertices of the default version of this cell
vertices – The vertices of this cell
edges – Pairs of vertex numbers that form the edges of the cell
faces – Tuples of vertex numbers that form the faces of the cell
volumes – Tuples of vertex numbers that form the volumes of the cell
sub_entity_types – The cell types of each sub-entity of the cell
simplex – Is the cell a simplex (interval/triangle/tetrahedron)?
tp – Is the cell a tensor product (interval/quadrilateral/hexahedron)?
- property clockwise_vertices: symfem.geometry.SetOfPoints¶
Get list of vertices in clockwise order.
- Returns:
A list of vertices
- __eq__(other: object) bool¶
Check if two references are equal.
- __hash__() int¶
Check if two references are equal.
- intersection(other: Reference) Reference | None¶
Get the intersection of two references.
- Returns:
A reference element that is the intersection
- abstractmethod default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- abstractmethod make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- make_lattice_float(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- make_lattice_with_lines_float(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- z_ordered_entities() list[list[tuple[int, int]]]¶
Get the subentities of the cell in back-to-front plotting order.
- Returns:
List of lists of subentity dimensions and numbers
- z_ordered_entities_extra_dim() list[list[tuple[int, int]]]¶
Get the subentities in back-to-front plotting order when using an extra dimension.
- Returns:
List of lists of subentity dimensions and numbers
- get_point(reference_coords: symfem.geometry.PointType) tuple[sympy.core.expr.Expr, Ellipsis]¶
Get a point in the reference from reference coordinates.
- Parameters:
reference_coords – The reference coordinates
- Returns:
A point in the cell
- abstractmethod integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- abstractmethod get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- abstractmethod get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- get_map_to_self() symfem.geometry.PointType¶
Get the map from the canonical reference to this reference.
- Returns:
The map
- abstractmethod _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- get_inverse_map_to_self() symfem.geometry.PointType¶
Get the inverse map from the canonical reference to this reference.
- Returns:
The map
- abstractmethod _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- abstractmethod volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- midpoint() symfem.geometry.PointType¶
Calculate the midpoint.
- Returns:
The midpoint of the cell
- jacobian() sympy.core.expr.Expr¶
Calculate the Jacobian.
- Returns:
The Jacobian
- scaled_axes() symfem.geometry.SetOfPoints¶
Return the unit axes of the reference.
- Returns:
The axes
- tangent() symfem.geometry.PointType¶
Calculate the tangent to the element.
- Returns:
The tangent
- normal() symfem.geometry.PointType¶
Calculate the normal to the element.
- Returns:
The normal
- sub_entities(dim: int | None = None, codim: int | None = None) tuple[tuple[int, Ellipsis], Ellipsis]¶
Get the sub-entities of a given dimension.
- Parameters:
dim – The dimension of the sub-entity
codim – The co-dimension of the sub-entity
- Returns:
A tuple of tuples of vertex numbers
- sub_entity_count(dim: int | None = None, codim: int | None = None) int¶
Get the number of sub-entities of a given dimension.
- Parameters:
dim – the dimension of the sub-entity
codim – the codimension of the sub-entity
- Returns:
The number of sub-entities
- sub_entity(dim: int, n: int, reference_vertices: bool = False) Any¶
Get the sub-entity of a given dimension and number.
- Parameters:
dim – the dimension of the sub-entity
n – The sub-entity number
reference_vertices – Should the reference vertices be used?
- Returns:
The sub-entity
- at_vertex(point: symfem.geometry.PointType) bool¶
Check if a point is a vertex of the reference.
- Parameters:
point – The point
- Returns:
Is the point a vertex?
- on_edge(point_in: symfem.geometry.PointType) bool¶
Check if a point is on an edge of the reference.
- Parameters:
point_in – The point
- Returns:
Is the point on an edge?
- on_face(point_in: symfem.geometry.PointType) bool¶
Check if a point is on a face of the reference.
- Parameters:
point_in – The point
- Returns:
Is the point on a face?
- abstractmethod contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- map_polyset_from_default(poly: list[symfem.functions.FunctionInput]) list[symfem.functions.FunctionInput]¶
Map the polynomials from the default reference element to this reference.
- derivative_count(order: int) int¶
Number of derivatives up to given order.
- Parameters:
order – Max derivative order
- Returns:
Number of derivatives
- plot_entity_diagrams(filename: str | list[str], plot_options: dict[str, Any] = {}, **kwargs: Any)¶
Plot diagrams showing the entity numbering of the reference.
- class symfem.references.Point(vertices: symfem.geometry.SetOfPointsInput = ((),))¶
Bases:
ReferenceA point.
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- abstractmethod make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Interval(vertices: symfem.geometry.SetOfPointsInput = ((0,), (1,)))¶
Bases:
ReferenceAn interval.
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Triangle(vertices: symfem.geometry.SetOfPointsInput = ((0, 0), (1, 0), (0, 1)))¶
Bases:
ReferenceA triangle.
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- z_ordered_entities_extra_dim() list[list[tuple[int, int]]]¶
Get the subentities in back-to-front plotting order when using an extra dimension.
- Returns:
List of lists of subentity dimensions and numbers
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Tetrahedron(vertices: symfem.geometry.SetOfPointsInput = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)))¶
Bases:
ReferenceA tetrahedron.
- property clockwise_vertices: symfem.geometry.SetOfPoints¶
Get list of vertices in clockwise order.
- Returns:
A list of vertices
- z_ordered_entities() list[list[tuple[int, int]]]¶
Get the subentities of the cell in back-to-front plotting order.
- Returns:
List of lists of subentity dimensions and numbers
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Quadrilateral(vertices: symfem.geometry.SetOfPointsInput = ((0, 0), (1, 0), (0, 1), (1, 1)))¶
Bases:
ReferenceA quadrilateral.
- property clockwise_vertices: symfem.geometry.SetOfPoints¶
Get list of vertices in clockwise order.
- Returns:
A list of vertices
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- z_ordered_entities_extra_dim() list[list[tuple[int, int]]]¶
Get the subentities in back-to-front plotting order when using an extra dimension.
- Returns:
List of lists of subentity dimensions and numbers
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Hexahedron(vertices: symfem.geometry.SetOfPointsInput = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (1, 1, 0), (0, 0, 1), (1, 0, 1), (0, 1, 1), (1, 1, 1)))¶
Bases:
ReferenceA hexahedron.
- property clockwise_vertices: symfem.geometry.SetOfPoints¶
Get list of vertices in clockwise order.
- Returns:
A list of vertices
- z_ordered_entities() list[list[tuple[int, int]]]¶
Get the subentities of the cell in back-to-front plotting order.
- Returns:
List of lists of subentity dimensions and numbers
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Prism(vertices: symfem.geometry.SetOfPointsInput = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 0, 1), (0, 1, 1)))¶
Bases:
ReferenceA (triangular) prism.
- property clockwise_vertices: symfem.geometry.SetOfPoints¶
Get list of vertices in clockwise order.
- Returns:
A list of vertices
- z_ordered_entities() list[list[tuple[int, int]]]¶
Get the subentities of the cell in back-to-front plotting order.
- Returns:
List of lists of subentity dimensions and numbers
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.Pyramid(vertices: symfem.geometry.SetOfPointsInput = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (1, 1, 0), (0, 0, 1)))¶
Bases:
ReferenceA (square-based) pyramid.
- property clockwise_vertices: symfem.geometry.SetOfPoints¶
Get list of vertices in clockwise order.
- Returns:
A list of vertices
- z_ordered_entities() list[list[tuple[int, int]]]¶
Get the subentities of the cell in back-to-front plotting order.
- Returns:
List of lists of subentity dimensions and numbers
- default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- abstractmethod make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- class symfem.references.DualPolygon(number_of_triangles: int, vertices: symfem.geometry.SetOfPointsInput | None = None)¶
Bases:
ReferenceA polygon on a barycentric dual grid.
- reference_origin: symfem.geometry.PointType¶
- number_of_triangles¶
- abstractmethod contains(point: symfem.geometry.PointType) bool¶
Check if a point is contained in the reference.
- Parameters:
point – The point
- Returns:
Is the point contained in the reference?
- abstractmethod integration_limits(vars: symfem.symbols.AxisVariablesNotSingle = t) IntLimits¶
Get the limits for an integral over this reference.
- Parameters:
vars – The variables to use for each direction
- Returns:
Integration limits that can be passed into sympy.integrate
- abstractmethod get_map_to(vertices: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the map from the reference to a cell.
- Parameters:
vertices – The vertices of a call
- Returns:
The map
- abstractmethod get_inverse_map_to(vertices_in: symfem.geometry.SetOfPointsInput) symfem.geometry.PointType¶
Get the inverse map from a cell to the reference.
- Parameters:
vertices_in – The vertices of a cell
- Returns:
The inverse map
- abstractmethod _compute_map_to_self() symfem.geometry.PointType¶
Compute the map from the canonical reference to this reference.
- Returns:
The map
- abstractmethod _compute_inverse_map_to_self() symfem.geometry.PointType¶
Compute the inverse map from the canonical reference to this reference.
- Returns:
The map
- abstractmethod volume() sympy.core.expr.Expr¶
Calculate the volume.
- Returns:
The volume of the cell
- abstractmethod default_reference() Reference¶
Get the default reference for this cell type.
- Returns:
The default reference
- make_lattice(n: int) symfem.geometry.SetOfPoints¶
Make a lattice of points.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points offset from the edge of the cell
- abstractmethod make_lattice_with_lines(n: int) LatticeWithLines¶
Make a lattice of points, and a list of lines connecting them.
- Parameters:
n – The number of points along each edge
- Returns:
A lattice of points including the edges of the cell Pairs of point numbers that make a mesh of lines across the cell
- z_ordered_entities_extra_dim() list[list[tuple[int, int]]]¶
Get the subentities in back-to-front plotting order when using an extra dimension.
- Returns:
List of lists of subentity dimensions and numbers