Geometry

Sets

Bramble.CartesianProductType
struct CartesianProduct{D, T}

A type representing the cartesian product of D closed intervals in a space with element type T.

Fields

  • box: a tuple of D pairs, where each pair represents the bounds (min, max) of an interval

  • collapsed: a tuple of D boolean values indicating whether each dimension is collapsed (i.e., min = max)

source
Base.firstMethod
first(X::CartesianProduct{1})
last(X::CartesianProduct{1})

Return the first and last elements of a one-dimensional CartesianProduct, respectively. These methods extend Base.first and Base.last for CartesianProduct{1}` types.

source
Bramble.is_collapsedMethod
is_collapsed(a::T, b::T)
is_collapsed(X::CartesianProduct{1})

Checks if a 1D CartesianProduct or two numbers are "collapsed" (i.e., degenerate).

  • For two numbers a and b, it returns true if they are approximately equal using isapprox.
  • For a 1-dimensional CartesianProduct, it returns the pre-computed collapse status stored in X.collapsed[1].
source
Bramble.point_typeMethod
point_type(X::CartesianProduct)

Determines the type of a coordinate point within a CartesianProduct space. Returns T for 1D spaces and NTuple{D,T} for D-dimensional spaces.

source
Bramble.setMethod
set(X::CartesianProduct)

Returns the CartesianProduct itself. This can be useful for functions that expect a domain object and might receive either the object or a wrapper.

source

Markers

Bramble.DomainMarkersType
struct DomainMarkers{BFType}

A container that categorizes and stores all markers for a given domain.

See markers for construction and get_boundary_symbols for available predefined boundary symbols.

Fields

  • symbols: markers identified by a single predefined Symbol (e.g., :left).

  • tuples: markers identified by a collection of predefined Symbols (e.g., (:top, :right)).

  • conditions: markers identified by a boolean function f(x) or f(x, t).

source
Bramble.DomainMarkersMethod
(dm::DomainMarkers)(t::Number)

Evaluates a time-dependent DomainMarkers object at a specific time t. This function returns a new, time-independent DomainMarkers object.

Example

julia> time_dep_markers = markers(space_domain, time_domain, :moving_front => (x, t) -> x[1] > t);
	   markers_at_0_5 = time_dep_markers(0.5)# Symbol and Tuple markers are time-agnostic, so they are preserved.
source
Bramble.EvaluatedDomainMarkersType
struct EvaluatedDomainMarkers{M<:Bramble.DomainMarkers, T<:Number}

A lazy, view-like wrapper that represents a DomainMarkers object evaluated at a specific time t.

This struct avoids allocating a new collection for time-evaluated functions. Instead, it generates the time-independent functions on-the-fly when the conditions are iterated over. It shares the symbols and tuples directly from the original object.

Fields

  • original_markers

  • evaluation_time

source
Bramble.MarkerType
struct Marker{F}

Represents a labeled region or boundary of a domain.

Each Marker consists of a label (a Symbol) and an identifier. The identifier specifies how to locate the marked region. It can be:

  • A Symbol for predefined boundaries (e.g., :left, :top).
  • A Set{Symbol} for collections of predefined boundaries.
  • A function (wrapped in a BrambleFunction) that acts as a level-set, returning true for points inside the marked region.

Fields

  • label: A Symbol used to name the marked region (e.g., :inlet, :wall).

  • identifier: The object that identifies the region (Symbol, Set{Symbol}, or BrambleFunction).

source
Bramble.MarkerPairType
MarkerPair{F}

A type alias for Pair{Symbol, F}, representing a convenient way to define a marker. For example: :boundary => :left.

source
Bramble.conditionsMethod
conditions(edm::EvaluatedDomainMarkers)

Returns a lazy generator that yields time-evaluated markers.

This is the core of the lazy evaluation. It iterates over the original conditions and yields new Marker objects with their functions evaluated at edm.evaluation_time, but only when requested.

source
Bramble.identifierMethod
identifier(m::Marker)
identifier(m::MarkerPair)

Returns the identifier (Symbol, Set, or function) of a Marker or MarkerPair.

source
Bramble.labelMethod
label(m::Marker)
label(m::MarkerPair)

Returns the Symbol label of a Marker or MarkerPair.

source
Bramble.label_conditionsMethod
label_conditions(domain_markers::DomainMarkers)

Returns a generator that yields the labels from the function-based markers.

source
Bramble.label_symbolsMethod
label_symbols(domain_markers::DomainMarkers)

Returns a generator that yields the labels from the single-symbol markers.

source
Bramble.label_tuplesMethod
label_tuples(domain_markers::DomainMarkers)

Returns a generator that yields the labels from the symbol-tuple markers.

source

Domains

Bramble.DomainType
struct Domain{SetType, MarkersType} <: Bramble.DomainBaseType

Represents a computational domain, which combines a geometric set with a collection of labeled markers.

This struct is a fundamental building block, bundling a geometric entity (a CartesianProduct) with a DomainMarkers object that defines named regions (like boundaries or subdomains).

Fields

  • set: the geometric set defining the domain's extent (e.g., a CartesianProduct).

  • markers: a DomainMarkers object containing all labeled regions for this domain.

source
Base.eltypeMethod
eltype(Ω::Domain)

Returns the type of the bounds defining Domain Ω. It can also be applied to the type of the domain. It can be applied also to the type of the domain.

Example

julia> I = interval(0.0, 1.0);
	   eltype(domain(I × I))
Float64
source
Bramble.get_boundary_symbolsMethod
get_boundary_symbols(X::CartesianProduct)

Returns a tuple of default boundary symbols for a CartesianProduct.

  • in 1D [x₁,x₂], :left (x=x₁), :right (x=x₂)
  • in 2D [x₁,x₂] × [y₁,y₂], :left (x=x₁), :right (x=x₂), :top (y=y₂), :bottom (y=y₁)
  • in 3D [x₁,x₂] × [y₁,y₂] × [z₁,z₂], :front (x=x₂), :back (x=x₁), :left (y=y₁), :right (y=y₂), :top (z=z₃), :bottom (z=z₁)
source
Bramble.marker_conditionsMethod
marker_conditions(Ω::Domain)

Returns a generator yielding the identifiers (functions) of condition-based markers.

source
Bramble.marker_identifiersMethod
marker_identifiers(Ω::Domain)

Returns a generator that yields the identifiers (Symbol, Set{Symbol}, or BrambleFunction) of all markers associated with the Domain Ω.

source