josie.boundary package¶
Submodules¶
josie.boundary.boundary module¶
This module implements the different curve parametrization to describe the boundaries of a domain
- class josie.boundary.boundary.Boundary(side, curve, cells_idx, ghost_cells_idx)¶
Bases:
objectA simple
dataclasscoupling aBoundaryCurvewith the indices of the cells within theMesh.centroidsdata structure that are part of that boundarycells_idx, the side of the boundary (class:BoundarySide), and the corresponding indices of the ghost cells within theMesh._centroids- side¶
The
BoundarySidewhich theBoundaryis member of
- boundary_curve¶
The
BoundaryCurve
- cells_idx¶
The cell indices. It’s a tuple containing
MAX_DIMENSIONALITYMeshIndexelements. Each element indexes the structuredMeshon one axis to provide the cells that are part of theBoundaryCurve.- Type
Union[Tuple[Union[int, slice, numpy.ndarray], …], numpy.ndarray]
- ghost_cells_idx¶
The ghost cell indices. It’s a tuple containing
MAX_DIMENSIONALITYMeshIndexelements. Each element indexes the structuredMeshon one axis to provide the cells that are part of theBoundaryCurve.- Type
Union[Tuple[Union[int, slice, numpy.ndarray], …], numpy.ndarray]
Example
For example the left boundary of a 2D structured mesh will be given by a tuple (0, None). That means that if we consider the
Solver, we can access the values of the fields associated to the boundary cells by:solver.values[0, :]
- apply_bc(cells, t)¶
Proxy method to
BoundaryCurve.bc()
- cells_idx: Union[Tuple[Union[int, slice, numpy.ndarray], ...], numpy.ndarray]¶
- ghost_cells_idx: Union[Tuple[Union[int, slice, numpy.ndarray], ...], numpy.ndarray]¶
- init_bc(cells)¶
Proxy method to
BoundaryCurve.init()
- class josie.boundary.boundary.BoundaryCurve¶
Bases:
objectA class representing a
BoundaryCurve. ABoundaryCurveis parametrized with a single parameter. It implements a__call__()method that returns thevalues of the curve for a given
parameter value.
- property bc¶
- plot(resolution=50)¶
This method actually plots the BoundaryCurve
This method currently plots stuff using matplotlib. It generates the list of points to plot with a default resolution.
- Parameters
resolution – The number of points to plot the curve with [default: 50].
- class josie.boundary.boundary.BoundarySide(value=<no_arg>, names=None, module=None, type=None, start=1, boundary=None)¶
Bases:
josie.data.NoAliasIntEnumAn enumeration.
- BOTTOM = 0¶
- LEFT = 0¶
- RIGHT = -1¶
- TOP = -1¶
- class josie.boundary.boundary.CircleArc(p1, p2, p3)¶
Bases:
josie.boundary.boundary.BoundaryCurveA class representing a circular arc from three given points on the arc
- Parameters
p1 – Starting point of the arc
p2 – Ending point of the arc
p3 – Another point on the arc
- class josie.boundary.boundary.Line(p1, p2)¶
Bases:
josie.boundary.boundary.BoundaryCurveA line between two points
- Parameters
p1 (
Union[ndarray,Sequence[float]]) – Starting point of the linep2 (
Union[ndarray,Sequence[float]]) – Ending point of the line
josie.boundary.set module¶
- class josie.boundary.set.BoundarySet(left, bottom, right, top)¶
Bases:
object
- class josie.boundary.set.BoxMesh(length, height)¶
Bases:
josie.boundary.set.BoundarySetA convenience class to create a rectangular mesh provided its dimensions
- Parameters
length (
float) – The length of the boxheight (
float) – The height of the box
- class josie.boundary.set.Cube(side_length)¶
Bases:
josie.boundary.set.BoxMeshA
BoxMeshwith equal lenght and height
- class josie.boundary.set.UnitCube¶
Bases:
josie.boundary.set.CubeCubewith length equal to 1