fish2eod.helpers package

Submodules

fish2eod.helpers.dolfin_tools module

Common analysis tools for working with dolfin objects with inconsistent methods.

class fish2eod.helpers.dolfin_tools.Equation(A: Form, u: TrialFunction, b: Form)

Bases: NamedTuple

Helper named tuple for the compiled equation.

a is the bilinear form u is the trial function b is the right hand side of the equation

A: Form

Alias for field number 0

b: Form

Alias for field number 2

u: TrialFunction

Alias for field number 1

fish2eod.helpers.dolfin_tools.convert_fenics_data(data)

Convert fenics data into a manipulatable format after loading.

Fenics data can be saved as unsigned integers for integer meshfunctions which can cause problems. Additionally data will be saved as [[x0], [x1], [x2], … [xn]] so flatten the array.

Parameters:

data (ndarray) – Fenics data in numpy after loading from h5 file

Returns:

Data in a usable format

fish2eod.helpers.dolfin_tools.get_data(f)

Get data from a dolfin MeshFunction/function.

Parameters:

f – dolfin object to extract the data from

Return type:

ndarray

Returns:

Data in a matrix - must be combined with topology for plotting

fish2eod.helpers.dolfin_tools.get_dimension(f)

Get dimension from a dolfin MeshFunction/function.

Parameters:

f – dolfin object to extract the dimension from

Return type:

int

Returns:

Dimension

fish2eod.helpers.type_helpers module

class fish2eod.helpers.type_helpers.ComputatableSideInformation(skin_type, side, coordinates, arc_length)

Bases: NamedTuple

arc_length: ndarray

Alias for field number 3

coordinates: ndarray

Alias for field number 2

side: str

Alias for field number 1

skin_type: str

Alias for field number 0

class fish2eod.helpers.type_helpers.DataSet(topology: Optional[ndarray], geometry: Optional[ndarray], data: Union[str, List], time_step: str, name: str, parameter_state: Dict[str, str], domain_map: Dict[str, int])

Bases: NamedTuple

Helper for organizing a solution.

data: Union[str, List]

Alias for field number 2

domain_map: Dict[str, int]

Alias for field number 6

geometry: Optional[ndarray]

Alias for field number 1

name: str

Alias for field number 4

parameter_state: Dict[str, str]

Alias for field number 5

time_step: str

Alias for field number 3

topology: Optional[ndarray]

Alias for field number 0

class fish2eod.helpers.type_helpers.ElectricImageParameters(domains: Sequence[str], value: Union[float, Sequence[float]])

Bases: NamedTuple

Helper named tuple for computing electric images.

Specify the domain names and the conductivity value for the “null” condition for electric images

domains is the set of domains to modify value is either a single conductance value for all domains or a sequence of numbers (1 per domain) for different null conditions

domains: Sequence[str]

Alias for field number 0

value: Union[float, Sequence[float]]

Alias for field number 1

class fish2eod.helpers.type_helpers.SkinStructure(left_inner, left_outer, right_inner, right_outer, left_arc_length, right_arc_length)

Bases: object

Store the skin in a helpful structure.

_inner/_outer refer to the inner and outer skin layers in (x,y) pairs _arc_length saves the arc length of the boundary (inner boundary is used).

left_arc_length: ndarray
left_inner: ndarray
left_outer: ndarray
right_arc_length: ndarray
right_inner: ndarray
right_outer: ndarray
class fish2eod.helpers.type_helpers.TDP(left_tdp, right_tdp)

Bases: object

Store the transdermal potential (tdp) or image.

left_tdp: ndarray
right_tdp: ndarray