mtnlion.cell module

Cell domain descriptions

class mtnlion.cell.DomainData[source]

Bases: tuple

Data required to minimally describe the problem domain.

boundary_measure

Alias for field number 2

domain_measure

Alias for field number 1

mesh

Alias for field number 0

class mtnlion.cell.DomainInterface(mesh_grid: numpy.ndarray)[source]

Bases: abc.ABC

Minimal interface for describing problem domains.

class BoundaryMap(primary_domain, marker)

Bases: tuple

marker

Alias for field number 1

primary_domain

Alias for field number 0

add_domain_measure(domain: str, measure: ufl.measure.Measure, multiple: int = 1) → None[source]

Set the domain measure and its multiplicity for a given domain.

Parameters
  • domain – The domain to assign

  • measure – The measure to apply to the domain

  • multiple – The multiplicity to apply to the domain measure

Returns

None

boundary_of(boundary_domain: str, primary_domains: Iterable[str], measures: Iterable[ufl.measure.Measure], multiples: Iterable[int]) → None[source]

Create a boundary domain that is the boundary of one or more primary domains and assign a boundary measure with its corresponding multiplicity.

Parameters
  • boundary_domain – name of the boundary domain

  • primary_domains – names of the domains this domain is a boundary of

  • measures – assign a boundary measure to the boundary domain

  • multiples – assign a multiplicity to the boundary measure

Returns

None

create_element(element_type: str, degree: int) → dolfin.FiniteElement[source]

Create a FEniCS finite element. See documentation for fem.FiniteElement.

Parameters
  • element_type – Type of the finite element.

  • degree – Degree of the element

Returns

fem.FiniteElement

create_function_space(element: dolfin.FiniteElement)[source]

Create a FEniCS function space given an element. See documentation for fem.FunctionSpace.

Parameters

element – Element to use to create a function space

Returns

fem.FunctionSpace

is_boundary(domain: str) → bool[source]

Deduce if a given domain is a boundary domain by whether or not is has parent domains defined.

Parameters

domain – name of the domain to check

Returns

true if domain is a boundary

class mtnlion.cell.MeasureMap[source]

Bases: tuple

A mapping between measures, multiplicities, and primary (parent) domains

measure

Alias for field number 0

multiple

Alias for field number 1

primary_domain

Alias for field number 2

class mtnlion.cell.P2D(mesh_grid: numpy.ndarray)[source]

Bases: mtnlion.cell.DomainInterface

Definition for a pseudo two-dimensional domain.