cashocs.geometry.interval_mesh#
- cashocs.geometry.interval_mesh(n: int = 10, start: float = 0.0, end: float = 1.0, partitions: list[float] | None = None, comm: MPI.Comm | None = None) _typing.MeshTuple [source]#
Creates an 1D interval mesh starting at x=0 to x=length.
This function creates a uniform mesh of a 1D interval, starting at the
start
and ending atend
. The resulting mesh usesn
sub-intervals to discretize the geometry. The boundary markers are as follows:1 corresponds to \(x=start\)
2 corresponds to \(x=end\)
- Parameters:
n (int) – Number of elements for discretizing the interval, default is 10
start (float) – The start of the interval, default is 0.0
end (float) – The end of the interval, default is 1.0
partitions (list[float] | None) – Points in the interval at which a partition in subdomains should be made. The resulting volume measure is sorted ascendingly according to the sub-intervals defined in partitions (starting at 1). Defaults to
None
.comm (MPI.Comm | None) – MPI communicator that is to be used for creating the mesh.
- Returns:
A tuple (mesh, subdomains, boundaries, dx, ds, dS), where mesh is the imported FEM mesh, subdomains is a mesh function for the subdomains, boundaries is a mesh function for the boundaries, dx is a volume measure, ds is a surface measure, and dS is a measure for the interior facets.
- Return type:
_typing.MeshTuple