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: object

A simple dataclass coupling a BoundaryCurve with the indices of the cells within the Mesh.centroids data structure that are part of that boundary cells_idx, the side of the boundary (class:BoundarySide), and the corresponding indices of the ghost cells within the Mesh._centroids

side

The BoundarySide which the Boundary is member of

Type

josie.boundary.boundary.BoundarySide

boundary_curve

The BoundaryCurve

cells_idx

The cell indices. It’s a tuple containing MAX_DIMENSIONALITY MeshIndex elements. Each element indexes the structured Mesh on one axis to provide the cells that are part of the BoundaryCurve.

Type

Union[Tuple[Union[int, slice, numpy.ndarray], …], numpy.ndarray]

ghost_cells_idx

The ghost cell indices. It’s a tuple containing MAX_DIMENSIONALITY MeshIndex elements. Each element indexes the structured Mesh on one axis to provide the cells that are part of the BoundaryCurve.

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]
curve: josie.boundary.boundary.BoundaryCurve
ghost_cells_idx: Union[Tuple[Union[int, slice, numpy.ndarray], ...], numpy.ndarray]
init_bc(cells)

Proxy method to BoundaryCurve.init()

side: josie.boundary.boundary.BoundarySide
class josie.boundary.boundary.BoundaryCurve

Bases: object

A class representing a BoundaryCurve. A BoundaryCurve is parametrized with a single parameter. It implements a __call__() method that returns the (x,y) values of the curve for a given \xi 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.NoAliasIntEnum

An enumeration.

BOTTOM = 0
LEFT = 0
RIGHT = -1
TOP = -1
class josie.boundary.boundary.CircleArc(p1, p2, p3)

Bases: josie.boundary.boundary.BoundaryCurve

A 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.BoundaryCurve

A line between two points

Parameters
  • p1 (Union[ndarray, Sequence[float]]) – Starting point of the line

  • p2 (Union[ndarray, Sequence[float]]) – Ending point of the line

josie.boundary.set module

class josie.boundary.set.BoundarySet(left, bottom, right, top)

Bases: object

bottom: josie.boundary.boundary.BoundaryCurve
left: josie.boundary.boundary.BoundaryCurve
right: josie.boundary.boundary.BoundaryCurve
top: josie.boundary.boundary.BoundaryCurve
class josie.boundary.set.BoxMesh(length, height)

Bases: josie.boundary.set.BoundarySet

A convenience class to create a rectangular mesh provided its dimensions

Parameters
  • length (float) – The length of the box

  • height (float) – The height of the box

bottom: josie.boundary.boundary.BoundaryCurve
left: josie.boundary.boundary.BoundaryCurve
right: josie.boundary.boundary.BoundaryCurve
top: josie.boundary.boundary.BoundaryCurve
class josie.boundary.set.Cube(side_length)

Bases: josie.boundary.set.BoxMesh

A BoxMesh with equal lenght and height

bottom: josie.boundary.boundary.BoundaryCurve
left: josie.boundary.boundary.BoundaryCurve
right: josie.boundary.boundary.BoundaryCurve
top: josie.boundary.boundary.BoundaryCurve
class josie.boundary.set.UnitCube

Bases: josie.boundary.set.Cube

Cube with length equal to 1

bottom: josie.boundary.boundary.BoundaryCurve
left: josie.boundary.boundary.BoundaryCurve
right: josie.boundary.boundary.BoundaryCurve
top: josie.boundary.boundary.BoundaryCurve

Module contents