Geometry
Sets
Bramble.CartesianProduct — Typestruct CartesianProduct{D, T}A type representing the cartesian product of D closed intervals in a space with element type T.
Fields
box: a tuple ofDpairs, where each pair represents the bounds(min, max)of an intervalcollapsed: a tuple ofDboolean values indicating whether each dimension is collapsed (i.e., min = max)
Bramble.CartesianProduct — Method(X::CartesianProduct)(i)Returns the i-th interval (or point) in the CartesianProduct.
Example
julia> Y = cartesian_product(((0.0, 1.0), (4.0, 5.0)));
Y(2)
(4.0, 5.0)Base.eltype — Methodeltype(X::CartesianProduct)Returns the element type of a CartesianProduct. Can be applied directly to the type of the CartesianProduct.
Example
julia> X = cartesian_product(0, 1);
eltype(X)
Float64Base.first — Methodfirst(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.
Bramble.cartesian_product — Methodcartesian_product(x, y)
cartesian_product(box)Returns a CartesianProduct.
- If
Dtuples are provided inbox, it returns aD-dimensional CartesianProduct. - If two values
xandyare provided, it returns a1-dimensional CartesianProduct to represent the interval [x,y].
Bramble.is_collapsed — Methodis_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
aandb, it returnstrueif they are approximately equal usingisapprox. - For a 1-dimensional CartesianProduct, it returns the pre-computed collapse status stored in
X.collapsed[1].
Bramble.point — Methodpoint(x)
Creates a collapsed 1D CartesianProduct representing the point $[x, x]$.
Bramble.point_type — Methodpoint_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.
Bramble.projection — Methodprojection(X::CartesianProduct, i)Returns the i-th component interval of X` as a new 1D CartesianProduct.
Bramble.set — Methodset(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.
Bramble.tails — Methodtails(X::CartesianProduct, i)Returns the i-th component interval of the CartesianProduct X as a Tuple. This is an alias for X(i).
Bramble.tails — Methodtails(X::CartesianProduct)Returns the component sets of a CartesianProduct:
- for a one-dimensional CartesianProduct (
D=1), returns the single component set. - for a
D-dimensional CartesianProduct, returns a tuple containing all component sets.
Markers
Bramble.DomainMarkers — Typestruct 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 predefinedSymbol(e.g.,:left).tuples: markers identified by a collection of predefinedSymbols (e.g.,(:top, :right)).conditions: markers identified by a boolean functionf(x)orf(x, t).
Bramble.DomainMarkers — Method(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.
Bramble.EvaluatedDomainMarkers — Typestruct 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_markersevaluation_time
Bramble.Marker — Typestruct 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
Symbolfor 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, returningtruefor points inside the marked region.
Fields
label: ASymbolused to name the marked region (e.g.,:inlet,:wall).identifier: The object that identifies the region (Symbol,Set{Symbol}, orBrambleFunction).
Bramble.MarkerPair — TypeMarkerPair{F}A type alias for Pair{Symbol, F}, representing a convenient way to define a marker. For example: :boundary => :left.
Bramble.conditions — Methodconditions(domain_markers::DomainMarkers)Gets the set of function-based markers from a DomainMarkers object.
Bramble.conditions — Methodconditions(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.
Bramble.identifier — Methodidentifier(m::Marker)
identifier(m::MarkerPair)Returns the identifier (Symbol, Set, or function) of a Marker or MarkerPair.
Bramble.label — Methodlabel(m::Marker)
label(m::MarkerPair)Returns the Symbol label of a Marker or MarkerPair.
Bramble.label_conditions — Methodlabel_conditions(domain_markers::DomainMarkers)Returns a generator that yields the labels from the function-based markers.
Bramble.label_identifiers — Methodlabel_identifiers(domain_markers::DomainMarkers)Returns a generator that yields the label of every marker in the DomainMarkers collection.
Bramble.label_symbols — Methodlabel_symbols(domain_markers::DomainMarkers)Returns a generator that yields the labels from the single-symbol markers.
Bramble.label_tuples — Methodlabel_tuples(domain_markers::DomainMarkers)Returns a generator that yields the labels from the symbol-tuple markers.
Bramble.symbols — Methodsymbols(domain_markers::DomainMarkers)Gets the set of single-symbol markers from a DomainMarkers object.
Bramble.tuples — Methodtuples(domain_markers::DomainMarkers)Gets the set of symbol-tuple markers from a DomainMarkers object.
Domains
Bramble.Domain — Typestruct Domain{SetType, MarkersType} <: Bramble.DomainBaseTypeRepresents 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.
Base.eltype — Methodeltype(Ω::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))
Float64Bramble.get_boundary_symbols — Methodget_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₁)
Bramble.label_conditions — Methodlabel_conditions(Ω::Domain)Returns a generator with the labels of the conditions on DomainMarkers.
Bramble.label_identifiers — Methodlabel_identifiers(Ω::Domain)Returns a generator with all labels on DomainMarkers.
Bramble.label_symbols — Methodlabel_symbols(Ω::Domain)Returns a generator with the labels of the symbols on DomainMarkers.
Bramble.label_tuples — Methodlabel_tuples(Ω::Domain)Returns a generator with the labels of the tuples on DomainMarkers.
Bramble.marker_conditions — Methodmarker_conditions(Ω::Domain)Returns a generator yielding the identifiers (functions) of condition-based markers.
Bramble.marker_identifiers — Methodmarker_identifiers(Ω::Domain)Returns a generator that yields the identifiers (Symbol, Set{Symbol}, or BrambleFunction) of all markers associated with the Domain Ω.
Bramble.marker_symbols — Methodmarker_symbols(Ω::Domain)Returns a generator yielding the identifiers of single-symbol markers.
Bramble.marker_tuples — Methodmarker_tuples(Ω::Domain)Returns a generator yielding the identifiers of symbol-tuple markers.
Bramble.projection — Methodprojection(Ω::Domain, i)Returns the i-th CartesianProduct of the set associated with Domain Ω.
For example, projection(domain(I × I), 1) will return I.
Bramble.set — Methodset(Ω::Domain)Returns the CartesianProduct associated with the Domain Ω.