zoomy_core.symbolic.domains module#
Symbolic Domain / Boundary / Normal layer.
Sympy-side atoms for representing continuous integration regions and
their boundaries. These are not the numerical mesh in
zoomy_core.mesh — they are symbolic descriptors used to drive
weak-form derivations (DivergenceTheorem, MapToReferenceElement)
without committing to a specific discretisation.
Pattern:
Domainand its subclasses (Interval,Simplex,Box) are Python descriptors carrying coordinate symbols plus geometry data.BoundaryIntegral(integrand, domain)is an opaque sympy atom — the surface integral∫_∂D f ds. It is manufactured perDomainvia the establishedphi_fnpattern (onesympy.Functionsubclass per domain instance, with_domainback-reference).NormalVector(domain)returns thesympy.Functionsubclass for the outward unit normal. Callsn(0),n(1), … give opaque component atoms.
Volume integrals stay as native sympy.Integral — the existing 1D
pipeline keeps consuming them unchanged.
- class zoomy_core.symbolic.domains.Domain(coords, name)#
Bases:
objectContinuous integration region in symbolic form.
Subclasses fill in geometry (vertices, intervals) and override
boundary,reference,affine_map,normalas appropriate for their shape.- Parameters:
coords (tuple[sympy.core.symbol.Symbol, ...]) –
name (str) –
- coords: tuple[sympy.core.symbol.Symbol, ...]#
- name: str#
- property dim: int#
- affine_map()#
Return
(B, V0)such thatx = V0 + B · ξmaps the reference element toself. Defined only on volume domains.- Return type:
tuple[sympy.matrices.dense.MutableDenseMatrix, sympy.matrices.dense.MutableDenseMatrix]
- normal()#
Return the
sympy.Functionclass for the outward unit normal onself. Defined only on boundary domains.- Return type:
type
- property boundary_integral_fn: type#
sympy.Functionsubclass for∫_∂(self) f dsatoms.One class per
Domaininstance. The back-referencecls._domainlets operations recover the surrounding domain. Renders in LaTeX as∮_{<name>} f \, dSvia the_latexmethod.
- property normal_fn: type#
sympy.Functionsubclass for outward unit normal components.Calls
n(i)carry the back-referencecls._domainso downstream operations can verify “this normal belongs to that boundary”. Renders in LaTeX asn_<name>^{(i)}.
- class zoomy_core.symbolic.domains.Interval(var, a, b, name=None)#
Bases:
Domain1D interval
[a, b]parametrised by a singlevar.- Parameters:
var (sp.Symbol) –
name (str) –
- affine_map()#
Return
(B, V0)such thatx = V0 + B · ξmaps the reference element toself. Defined only on volume domains.- Return type:
tuple[sympy.matrices.dense.MutableDenseMatrix, sympy.matrices.dense.MutableDenseMatrix]
- class zoomy_core.symbolic.domains.Simplex(vertices, coords, name=None)#
Bases:
Domainn-dim simplex from a vertex tuple.verticesis a sequence ofn+1points, each a tuple/Matrix of lengthn(matchingcoords).B = [V₁−V₀ | V₂−V₀ | …],V₀is the offset, and the affine map isx = V₀ + B · ξ.- Parameters:
vertices (Sequence) –
coords (tuple[sympy.core.symbol.Symbol, ...]) –
name (str) –
- boundary()#
- Return type:
- affine_map()#
Return
(B, V0)such thatx = V0 + B · ξmaps the reference element toself. Defined only on volume domains.- Return type:
tuple[sympy.matrices.dense.MutableDenseMatrix, sympy.matrices.dense.MutableDenseMatrix]
- class zoomy_core.symbolic.domains.Box(intervals, name=None)#
Bases:
DomainTensor product of
Intervalfactors.- Parameters:
intervals (Sequence[Interval]) –
name (str) –
- boundary()#
- Return type:
- affine_map()#
Return
(B, V0)such thatx = V0 + B · ξmaps the reference element toself. Defined only on volume domains.- Return type:
tuple[sympy.matrices.dense.MutableDenseMatrix, sympy.matrices.dense.MutableDenseMatrix]
- class zoomy_core.symbolic.domains.PointSet(var, points, name=None)#
Bases:
_BoundaryDomainDegenerate 0-dim boundary — the boundary of an
Interval.Bridge to the existing
Subs(f, var, bound)plumbing inins_generator: aBoundaryIntegralover aPointSetis semanticallyf|_{var=b} − f|_{var=a}and resolves through that convention rather than producing a new symbolic kind.- Parameters:
var (sp.Symbol) –
points (Sequence) –
name (str) –
- property dim: int#
- class zoomy_core.symbolic.domains.SimplexBoundary(parent, name=None)#
Bases:
_BoundaryDomainOpaque boundary of a
Simplex— one symbolic atom covers∂K(no per-face decomposition in this layer).- Parameters:
parent (Domain) –
name (str) –
- class zoomy_core.symbolic.domains.BoxBoundary(parent, name=None)#
Bases:
_BoundaryDomainOpaque boundary of a
Box— same convention asSimplexBoundary.- Parameters:
parent (Domain) –
name (str) –
- zoomy_core.symbolic.domains.BoundaryIntegral(integrand, domain)#
Construct a symbolic
∫_∂D f dsatom.domainshould be a boundary domain (e.g.K.boundary()). The result is an opaquesympy.Functioncall whose class carries_domainback todomain— operations likeDivergenceTheoremandMapToReferenceElementwalk for instances of this class to find boundary integrals.- Parameters:
integrand (Expr) –
domain (Domain) –
- Return type:
Expr