diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 2bade4e..b842b0f 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-02-11T03:21:51","documenter_version":"1.8.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-02-11T15:14:35","documenter_version":"1.8.1"}} \ No newline at end of file diff --git a/dev/combinatorial_maps/index.html b/dev/combinatorial_maps/index.html index f293610..535a01b 100644 --- a/dev/combinatorial_maps/index.html +++ b/dev/combinatorial_maps/index.html @@ -1,2 +1,2 @@ -Combinatorial maps · CombinatorialSpaces.jl

Combinatorial maps

CombinatorialSpaces has incomplete, experimental support for several combinatorial structures used in topological graph theory, such as combinatorial maps and rotation systems. For an introduction to rotation systems and their implementation, see this blog post at the AlgebraicJulia blog.

API docs

CombinatorialSpaces.CombinatorialMapsModule

Combinatorial maps and related structures, as C-sets.

In topological graph theory and graph drawing, an embedded graph is a combinatorial structure representing a graph embedded in an (oriented) surface, up to equivalence under (orientation-preserving) homeomorphism. This module defines data structures for rotation systems, combinatorial maps, and other combinatorial objects describing embedded graphs.

source
CombinatorialSpaces.CombinatorialMaps.add_corolla!Method

Add corolla to rotation graph, rotation system, or similar structure.

A corolla is a vertex together with its incident half-edges, the number of which is its valence. The rotation on the half-edges is the consecutive one induced by the half-edge part numbers.

source
+Combinatorial maps · CombinatorialSpaces.jl

Combinatorial maps

CombinatorialSpaces has incomplete, experimental support for several combinatorial structures used in topological graph theory, such as combinatorial maps and rotation systems. For an introduction to rotation systems and their implementation, see this blog post at the AlgebraicJulia blog.

API docs

CombinatorialSpaces.CombinatorialMapsModule

Combinatorial maps and related structures, as C-sets.

In topological graph theory and graph drawing, an embedded graph is a combinatorial structure representing a graph embedded in an (oriented) surface, up to equivalence under (orientation-preserving) homeomorphism. This module defines data structures for rotation systems, combinatorial maps, and other combinatorial objects describing embedded graphs.

source
CombinatorialSpaces.CombinatorialMaps.add_corolla!Method

Add corolla to rotation graph, rotation system, or similar structure.

A corolla is a vertex together with its incident half-edges, the number of which is its valence. The rotation on the half-edges is the consecutive one induced by the half-edge part numbers.

source
diff --git a/dev/discrete_exterior_calculus/index.html b/dev/discrete_exterior_calculus/index.html index 40148a4..3cec1b1 100644 --- a/dev/discrete_exterior_calculus/index.html +++ b/dev/discrete_exterior_calculus/index.html @@ -1,2 +1,2 @@ -Discrete exterior calculus · CombinatorialSpaces.jl

Discrete exterior calculus

CombinatorialSpaces.jl provides discrete differential operators defined on simplicial sets via the Discrete Exterior Calculus (DEC).

There are two modules for these DEC operators. The first, CombinatorialSpaces.DiscreteExteriorCalculus, serves as our reference implementation. It is suitable for any manifold-like delta dual complex. The second, CombinatorialSpaces.FastDEC, offers more efficient operators, both in construction, and in execution time. The operators offered by both modules agree up to differences introduced by re-ordering floating-point operations.

Certain operators in FastDEC are made more efficient by assuming that the delta dual complex has not been altered in any way after it is created and volumes have been assigned with subdivide_duals!. So, such operators should not be called on such a complex if it has been manually edited.

API docs

CombinatorialSpaces.DiscreteExteriorCalculusModule

The discrete exterior calculus (DEC) for simplicial sets.

This module provides the dual complex associated with a delta set (the primal complex), which is a discrete incarnation of Hodge duality, as well as the many operators of the DEC that depend on it, such as the Hodge star, codifferential, wedge product, interior product, and Lie derivative. The main reference for this module is Hirani's 2003 PhD thesis.

source
CombinatorialSpaces.DiscreteExteriorCalculus.DualChainType

Wrapper for chain of dual cells of dimension n.

In an $N$-dimensional complex, the elementary dual simplices of each $n$-simplex together comprise the dual $(N-n)$-cell of the simplex. Using this correspondence, a basis for primal $n$-chains defines the basis for dual $(N-n)$-chains.

Note

In (Hirani 2003, Definition 3.4.1), the duality operator assigns a certain sign to each elementary dual simplex. For us, all of these signs should be regarded as positive because we have already incorporated them into the orientation of the dual simplices.

source
Catlab.Theories.:∧Method

Wedge product of discrete forms.

The wedge product of a $k$-form and an $l$-form is a $(k+l)$-form.

The DEC and related systems have several flavors of wedge product. This one is the discrete primal-primal wedge product introduced in (Hirani, 2003, Chapter 7) and (Desbrun et al 2005, Section 8). It depends on the geometric embedding and requires the dual complex. Note that we diverge from Hirani in that his formulation explicitly divides by (k+1)!. We do not do so in this computation.

source
Catlab.Theories.ΔMethod

Laplace-de Rham operator on discrete forms.

This linear operator on primal $n$-forms is defined by $Δ := δ d + d δ$. Restricted to 0-forms, it reduces to the negative of the Laplace-Beltrami operator ∇²: $Δ f = -∇² f$.

source
CombinatorialSpaces.DiscreteExteriorCalculus.:⋆Method

Hodge star operator from primal 1-forms to dual 1-forms.

This specific hodge star implementation is based on the hodge star presented in (Ayoub et al 2020), which generalizes the operator presented in (Hirani 2003). This reproduces the diagonal hodge for a dual mesh generated under circumcentric subdivision and provides off-diagonal correction factors for meshes generated under other subdivision schemes (e.g. barycentric).

source
CombinatorialSpaces.DiscreteExteriorCalculus.:⋆Method

Hodge star operator from primal $n$-forms to dual $N-n$-forms.

Note

Some authors, such as (Hirani 2003) and (Desbrun 2005), use the symbol $⋆$ for the duality operator on chains and the symbol $*$ for the Hodge star operator on cochains. We do not explicitly define the duality operator and we use the symbol $⋆$ for the Hodge star.

source
CombinatorialSpaces.DiscreteExteriorCalculus.dualizeMethod

Calls the constructor for d's dual type on d, including parameters. Does not call subdivide_duals! on the result. Should work out of the box on new DeltaSet types if (1) their dual type has the same name as their primal type with "Set" substituted by "DualComplex" and (2) their dual type has the same parameter set as their primal type. At the time of writing (PR 117) only "Embedded" types fail criterion (2) and get special treatment.

Examples

s = EmbeddedDeltaSet2D{Bool,SVector{2,Float64}}() dualize(s)::EmbeddedDeltaDualComplex2D{Bool,Float64,SVector{2,Float64}}

source
CombinatorialSpaces.DiscreteExteriorCalculus.elementary_dualsMethod

List of elementary dual simplices corresponding to primal simplex.

In general, in an $n$-dimensional complex, the elementary duals of primal $k$-simplices are dual $(n-k)$-simplices. Thus, in 1D dual complexes, the elementary duals of...

  • primal vertices are dual edges
  • primal edges are (single) dual vertices

In 2D dual complexes, the elementary duals of...

  • primal vertices are dual triangles
  • primal edges are dual edges
  • primal triangles are (single) dual vertices

In 3D dual complexes, the elementary duals of...

  • primal vertices are dual tetrahedra
  • primal edges are dual triangles
  • primal triangles are dual edges
  • primal tetrahedra are (single) dual vertices
source
CombinatorialSpaces.DiscreteExteriorCalculus.interior_productMethod

Interior product of a vector field (or 1-form) and a $n$-form.

Specifically, this operation is the primal-dual interior product defined in (Hirani 2003, Section 8.2) and (Desbrun et al 2005, Section 10). Thus it takes a primal vector field (or primal 1-form) and a dual $n$-forms and then returns a dual $(n-1)$-form.

source
CombinatorialSpaces.DiscreteExteriorCalculus.subsimplicesMethod

List of dual simplices comprising the subdivision of a primal simplex.

A primal $n$-simplex is always subdivided into $(n+1)!$ dual $n$-simplices, not be confused with the elementary_duals which have complementary dimension.

The returned list is ordered such that subsimplices with the same primal vertex appear consecutively.

source
CombinatorialSpaces.DiscreteExteriorCalculus.∇²Method

Laplace-Beltrami operator on discrete forms.

This linear operator on primal $n$-forms defined by $∇² α := -δ d α$, where δ is the codifferential and d is the exterior derivative.

Note

For following texts such as Abraham-Marsden-Ratiu, we take the sign convention that makes the Laplace-Beltrami operator consistent with the Euclidean Laplace operator (the divergence of the gradient). Other authors, such as (Hirani 2003), take the opposite convention, which has the advantage of being consistent with the Laplace-de Rham operator Δ.

source
CombinatorialSpaces.DiscreteExteriorCalculus.♭Method

Flat operator converting vector fields to 1-forms.

A generic function for discrete flat operators. Currently the DPP-flat from (Hirani 2003, Definition 5.5.2) and (Desbrun et al 2005, Definition 7.3) is implemented, as well as a primal-to-primal flat, which assumes linear-interpolation of the vector field across an edge, determined solely by the values at the endpoints.

See also: the sharp operator .

source
CombinatorialSpaces.DiscreteExteriorCalculus.♯Method

Sharp operator for converting primal 1-forms to primal vector fields.

This the primal-primal sharp from Hirani 2003, Definition 5.8.1 and Remark 2.7.2.

Note

A PP-flat is also defined in (Desbrun et al 2005, Definition 7.4) but differs in two ways: Desbrun et al's notation suggests a unit normal vector, whereas the gradient of Hirani's primal-primal interpolation function is not necessarily a unit vector. More importantly, Hirani's vector is a normal to a different face than Desbrun et al's, with further confusion created by the fact that Hirani's Figure 5.7 agrees with Desbrun et al's description rather than his own. That being said, to the best of our knowledge, our implementation is the correct one and agrees with Hirani's description, if not his figure.

See also: and ♯_mat, which returns a matrix that encodes this operator.

source
CombinatorialSpaces.DiscreteExteriorCalculus.♯_matMethod
function ♯_mat(s::AbstractDeltaDualComplex2D, DS::DiscreteSharp)

Sharpen a 1-form into a vector field.

3 primal-primal methods are supported. See ♯_denominator for the distinction between Hirani's method and and an "Alternative" method. Desbrun's definition is selected with DesbrunSharp, and is like Hirani's, save for dividing by the norm twice.

A dual-dual method which uses linear least squares to estimate a vector field is selected with LLSDDSharp.

source
CombinatorialSpaces.DiscreteExteriorCalculus.♯_matMethod
function ♯_mat(s::AbstractDeltaDualComplex2D, ::LLSDDSharp)

Sharpen a dual 1-form into a DualVectorField, using linear least squares.

Up to floating point error, this method perfectly produces fields which are constant over any triangle in the domain. Assume that the contribution of each half-edge to the value stored on the entire dual edge is proportional to their lengths. Since this least squares method does not perform pre-normalization, the contribution of each half-edge value is proportional to its length on the given triangle. Satisfying the continuous exterior calculus, sharpened vectors are constrained to lie on their triangle (i.e. they are indeed tangent).

It is not known whether this method has been exploited previously in the DEC literature, or defined in code elsewhere.

source
CombinatorialSpaces.FastDECModule

The discrete exterior calculus (DEC) with high performance in mind.

This module provides similar functionality to the DiscreteExteriorCalculus module but uses assumptions about the ACSet mesh structure to greatly improve performance. Some operators, like the exterior derivative are returned as sparse matrices while others, like the wedge product, are instead returned as functions that will compute the product.

source
Catlab.Theories.:∧Method
∧(s::HasDeltaSet, α::DualForm{1}, β::SimplexForm{1})

Wedge product of a dual 1-form and a primal 1-form.

Chain the musical isomorphisms to interpolate the dual 1-form to a primal 1-form. Then use the CombinatorialSpaces version of the Hirani primal-primal weddge (without explicitly dividing by 2.)

source
Catlab.Theories.:∧Method
∧(s::HasDeltaSet, α::SimplexForm{1}, β::DualForm{1})

Wedge product of a primal 1-form and a dual 1-form.

Chain the musical isomorphisms to interpolate the dual 1-form to a primal 1-form, using the linear least squares ♯. Then use the CombinatorialSpaces version of the Hirani primal-primal weddge.

source
CombinatorialSpaces.FastDEC.avg₀₁_matMethod
Averaging matrix from 0-forms to 1-forms.

Given a 0-form, this matrix computes a 1-form by taking the mean of value stored on the faces of each edge.

This matrix can be used to implement a wedge product: (avg₀₁(s)*X) .* Y where X is a 0-form and Y a 1-form, assuming the center of an edge is halfway between its endpoints.

See also avg₀₁.

source
CombinatorialSpaces.FastDEC.dec_wedge_productMethod
dec_wedge_product(::Type{Tuple{m,n}}, sd::HasDeltaSet, backend=Val{:CPU}, arr_cons=identity, cast_float=nothing) where {m,n}

Return a function that computes the wedge product between a primal m-form and a primal n-form, assuming special properties of the mesh.

It is assumed... ... for the 0-1 wedge product, that the dual vertex on an edge is at the midpoint. ... for the 1-1 wedge product, that the dual mesh simplices are in the default order as returned by the dual complex constructor.

Arguments:

Tuple{m,n}: the degrees of the differential forms. sd: the simplicial complex. backend=Val{:CPU}: a value-type to select special backend logic, if implemented. arr_cons=identity: a constructor of the desired array type on the appropriate backend e.g. MtlArray. cast_float=nothing: a specific Float type to use e.g. Float32. Otherwise, the type of the first differential form will be used.

source
CombinatorialSpaces.FastDEC.dec_wedge_product_ddMethod
dec_wedge_product_dd(::Type{Tuple{m,n}}, sd::HasDeltaSet) where {m,n}

Return a function that computes the wedge product between a dual m-form and a dual n-form.

The currently supported dual-dual wedges are 0-1 and 1-0.

source
CombinatorialSpaces.FastDEC.dec_wedge_product_dpMethod
dec_wedge_product_dp(::Type{Tuple{m,n}}, sd::HasDeltaSet) where {m,n}

Return a function that computes the wedge product between a dual m-form and a primal n-form.

It is assumed... ... for the 1-0 and 0-1 wedge product, that means are barycentric, and performs bilinear interpolation. It is not known if this definition has appeared in the literature or any code.

The currently supported dual-primal wedges are 0-1, 1-0, and 1-1.

source
CombinatorialSpaces.FastDEC.ℒ_ddMethod
function ℒ_dd(::Type{Tuple{1,1}}, s::SimplicialSets.HasDeltaSet)

Given a dual 1-form and a dual 1-form, return their lie derivative as a dual 1-form.

source
+Discrete exterior calculus · CombinatorialSpaces.jl

Discrete exterior calculus

CombinatorialSpaces.jl provides discrete differential operators defined on simplicial sets via the Discrete Exterior Calculus (DEC).

There are two modules for these DEC operators. The first, CombinatorialSpaces.DiscreteExteriorCalculus, serves as our reference implementation. It is suitable for any manifold-like delta dual complex. The second, CombinatorialSpaces.FastDEC, offers more efficient operators, both in construction, and in execution time. The operators offered by both modules agree up to differences introduced by re-ordering floating-point operations.

Certain operators in FastDEC are made more efficient by assuming that the delta dual complex has not been altered in any way after it is created and volumes have been assigned with subdivide_duals!. So, such operators should not be called on such a complex if it has been manually edited.

API docs

CombinatorialSpaces.DiscreteExteriorCalculusModule

The discrete exterior calculus (DEC) for simplicial sets.

This module provides the dual complex associated with a delta set (the primal complex), which is a discrete incarnation of Hodge duality, as well as the many operators of the DEC that depend on it, such as the Hodge star, codifferential, wedge product, interior product, and Lie derivative. The main reference for this module is Hirani's 2003 PhD thesis.

source
CombinatorialSpaces.DiscreteExteriorCalculus.DualChainType

Wrapper for chain of dual cells of dimension n.

In an $N$-dimensional complex, the elementary dual simplices of each $n$-simplex together comprise the dual $(N-n)$-cell of the simplex. Using this correspondence, a basis for primal $n$-chains defines the basis for dual $(N-n)$-chains.

Note

In (Hirani 2003, Definition 3.4.1), the duality operator assigns a certain sign to each elementary dual simplex. For us, all of these signs should be regarded as positive because we have already incorporated them into the orientation of the dual simplices.

source
Catlab.Theories.:∧Method

Wedge product of discrete forms.

The wedge product of a $k$-form and an $l$-form is a $(k+l)$-form.

The DEC and related systems have several flavors of wedge product. This one is the discrete primal-primal wedge product introduced in (Hirani, 2003, Chapter 7) and (Desbrun et al 2005, Section 8). It depends on the geometric embedding and requires the dual complex. Note that we diverge from Hirani in that his formulation explicitly divides by (k+1)!. We do not do so in this computation.

source
Catlab.Theories.ΔMethod

Laplace-de Rham operator on discrete forms.

This linear operator on primal $n$-forms is defined by $Δ := δ d + d δ$. Restricted to 0-forms, it reduces to the negative of the Laplace-Beltrami operator ∇²: $Δ f = -∇² f$.

source
CombinatorialSpaces.DiscreteExteriorCalculus.:⋆Method

Hodge star operator from primal 1-forms to dual 1-forms.

This specific hodge star implementation is based on the hodge star presented in (Ayoub et al 2020), which generalizes the operator presented in (Hirani 2003). This reproduces the diagonal hodge for a dual mesh generated under circumcentric subdivision and provides off-diagonal correction factors for meshes generated under other subdivision schemes (e.g. barycentric).

source
CombinatorialSpaces.DiscreteExteriorCalculus.:⋆Method

Hodge star operator from primal $n$-forms to dual $N-n$-forms.

Note

Some authors, such as (Hirani 2003) and (Desbrun 2005), use the symbol $⋆$ for the duality operator on chains and the symbol $*$ for the Hodge star operator on cochains. We do not explicitly define the duality operator and we use the symbol $⋆$ for the Hodge star.

source
CombinatorialSpaces.DiscreteExteriorCalculus.dualizeMethod

Calls the constructor for d's dual type on d, including parameters. Does not call subdivide_duals! on the result. Should work out of the box on new DeltaSet types if (1) their dual type has the same name as their primal type with "Set" substituted by "DualComplex" and (2) their dual type has the same parameter set as their primal type. At the time of writing (PR 117) only "Embedded" types fail criterion (2) and get special treatment.

Examples

s = EmbeddedDeltaSet2D{Bool,SVector{2,Float64}}() dualize(s)::EmbeddedDeltaDualComplex2D{Bool,Float64,SVector{2,Float64}}

source
CombinatorialSpaces.DiscreteExteriorCalculus.elementary_dualsMethod

List of elementary dual simplices corresponding to primal simplex.

In general, in an $n$-dimensional complex, the elementary duals of primal $k$-simplices are dual $(n-k)$-simplices. Thus, in 1D dual complexes, the elementary duals of...

  • primal vertices are dual edges
  • primal edges are (single) dual vertices

In 2D dual complexes, the elementary duals of...

  • primal vertices are dual triangles
  • primal edges are dual edges
  • primal triangles are (single) dual vertices

In 3D dual complexes, the elementary duals of...

  • primal vertices are dual tetrahedra
  • primal edges are dual triangles
  • primal triangles are dual edges
  • primal tetrahedra are (single) dual vertices
source
CombinatorialSpaces.DiscreteExteriorCalculus.interior_productMethod

Interior product of a vector field (or 1-form) and a $n$-form.

Specifically, this operation is the primal-dual interior product defined in (Hirani 2003, Section 8.2) and (Desbrun et al 2005, Section 10). Thus it takes a primal vector field (or primal 1-form) and a dual $n$-forms and then returns a dual $(n-1)$-form.

source
CombinatorialSpaces.DiscreteExteriorCalculus.subsimplicesMethod

List of dual simplices comprising the subdivision of a primal simplex.

A primal $n$-simplex is always subdivided into $(n+1)!$ dual $n$-simplices, not be confused with the elementary_duals which have complementary dimension.

The returned list is ordered such that subsimplices with the same primal vertex appear consecutively.

source
CombinatorialSpaces.DiscreteExteriorCalculus.∇²Method

Laplace-Beltrami operator on discrete forms.

This linear operator on primal $n$-forms defined by $∇² α := -δ d α$, where δ is the codifferential and d is the exterior derivative.

Note

For following texts such as Abraham-Marsden-Ratiu, we take the sign convention that makes the Laplace-Beltrami operator consistent with the Euclidean Laplace operator (the divergence of the gradient). Other authors, such as (Hirani 2003), take the opposite convention, which has the advantage of being consistent with the Laplace-de Rham operator Δ.

source
CombinatorialSpaces.DiscreteExteriorCalculus.♭Method

Flat operator converting vector fields to 1-forms.

A generic function for discrete flat operators. Currently the DPP-flat from (Hirani 2003, Definition 5.5.2) and (Desbrun et al 2005, Definition 7.3) is implemented, as well as a primal-to-primal flat, which assumes linear-interpolation of the vector field across an edge, determined solely by the values at the endpoints.

See also: the sharp operator .

source
CombinatorialSpaces.DiscreteExteriorCalculus.♯Method

Sharp operator for converting primal 1-forms to primal vector fields.

This the primal-primal sharp from Hirani 2003, Definition 5.8.1 and Remark 2.7.2.

Note

A PP-flat is also defined in (Desbrun et al 2005, Definition 7.4) but differs in two ways: Desbrun et al's notation suggests a unit normal vector, whereas the gradient of Hirani's primal-primal interpolation function is not necessarily a unit vector. More importantly, Hirani's vector is a normal to a different face than Desbrun et al's, with further confusion created by the fact that Hirani's Figure 5.7 agrees with Desbrun et al's description rather than his own. That being said, to the best of our knowledge, our implementation is the correct one and agrees with Hirani's description, if not his figure.

See also: and ♯_mat, which returns a matrix that encodes this operator.

source
CombinatorialSpaces.DiscreteExteriorCalculus.♯_matMethod
function ♯_mat(s::AbstractDeltaDualComplex2D, DS::DiscreteSharp)

Sharpen a 1-form into a vector field.

3 primal-primal methods are supported. See ♯_denominator for the distinction between Hirani's method and and an "Alternative" method. Desbrun's definition is selected with DesbrunSharp, and is like Hirani's, save for dividing by the norm twice.

A dual-dual method which uses linear least squares to estimate a vector field is selected with LLSDDSharp.

source
CombinatorialSpaces.DiscreteExteriorCalculus.♯_matMethod
function ♯_mat(s::AbstractDeltaDualComplex2D, ::LLSDDSharp)

Sharpen a dual 1-form into a DualVectorField, using linear least squares.

Up to floating point error, this method perfectly produces fields which are constant over any triangle in the domain. Assume that the contribution of each half-edge to the value stored on the entire dual edge is proportional to their lengths. Since this least squares method does not perform pre-normalization, the contribution of each half-edge value is proportional to its length on the given triangle. Satisfying the continuous exterior calculus, sharpened vectors are constrained to lie on their triangle (i.e. they are indeed tangent).

It is not known whether this method has been exploited previously in the DEC literature, or defined in code elsewhere.

source
CombinatorialSpaces.FastDECModule

The discrete exterior calculus (DEC) with high performance in mind.

This module provides similar functionality to the DiscreteExteriorCalculus module but uses assumptions about the ACSet mesh structure to greatly improve performance. Some operators, like the exterior derivative are returned as sparse matrices while others, like the wedge product, are instead returned as functions that will compute the product.

source
Catlab.Theories.:∧Method
∧(s::HasDeltaSet, α::DualForm{1}, β::SimplexForm{1})

Wedge product of a dual 1-form and a primal 1-form.

Chain the musical isomorphisms to interpolate the dual 1-form to a primal 1-form. Then use the CombinatorialSpaces version of the Hirani primal-primal weddge (without explicitly dividing by 2.)

source
Catlab.Theories.:∧Method
∧(s::HasDeltaSet, α::SimplexForm{1}, β::DualForm{1})

Wedge product of a primal 1-form and a dual 1-form.

Chain the musical isomorphisms to interpolate the dual 1-form to a primal 1-form, using the linear least squares ♯. Then use the CombinatorialSpaces version of the Hirani primal-primal weddge.

source
CombinatorialSpaces.FastDEC.avg₀₁_matMethod
Averaging matrix from 0-forms to 1-forms.

Given a 0-form, this matrix computes a 1-form by taking the mean of value stored on the faces of each edge.

This matrix can be used to implement a wedge product: (avg₀₁(s)*X) .* Y where X is a 0-form and Y a 1-form, assuming the center of an edge is halfway between its endpoints.

See also avg₀₁.

source
CombinatorialSpaces.FastDEC.dec_wedge_productMethod
dec_wedge_product(::Type{Tuple{m,n}}, sd::HasDeltaSet, backend=Val{:CPU}, arr_cons=identity, cast_float=nothing) where {m,n}

Return a function that computes the wedge product between a primal m-form and a primal n-form, assuming special properties of the mesh.

It is assumed... ... for the 0-1 wedge product, that the dual vertex on an edge is at the midpoint. ... for the 1-1 wedge product, that the dual mesh simplices are in the default order as returned by the dual complex constructor.

Arguments:

Tuple{m,n}: the degrees of the differential forms. sd: the simplicial complex. backend=Val{:CPU}: a value-type to select special backend logic, if implemented. arr_cons=identity: a constructor of the desired array type on the appropriate backend e.g. MtlArray. cast_float=nothing: a specific Float type to use e.g. Float32. Otherwise, the type of the first differential form will be used.

source
CombinatorialSpaces.FastDEC.dec_wedge_product_ddMethod
dec_wedge_product_dd(::Type{Tuple{m,n}}, sd::HasDeltaSet) where {m,n}

Return a function that computes the wedge product between a dual m-form and a dual n-form.

The currently supported dual-dual wedges are 0-1 and 1-0.

source
CombinatorialSpaces.FastDEC.dec_wedge_product_dpMethod
dec_wedge_product_dp(::Type{Tuple{m,n}}, sd::HasDeltaSet) where {m,n}

Return a function that computes the wedge product between a dual m-form and a primal n-form.

It is assumed... ... for the 1-0 and 0-1 wedge product, that means are barycentric, and performs bilinear interpolation. It is not known if this definition has appeared in the literature or any code.

The currently supported dual-primal wedges are 0-1, 1-0, and 1-1.

source
CombinatorialSpaces.FastDEC.ℒ_ddMethod
function ℒ_dd(::Type{Tuple{1,1}}, s::SimplicialSets.HasDeltaSet)

Given a dual 1-form and a dual 1-form, return their lie derivative as a dual 1-form.

source
diff --git a/dev/euler/index.html b/dev/euler/index.html index bca5700..5ed7839 100644 --- a/dev/euler/index.html +++ b/dev/euler/index.html @@ -85,4 +85,4 @@ eulers_method() -plot_dvf(sd, u, title="Flow, with Projection Method")Example block output +plot_dvf(sd, u, title="Flow, with Projection Method")Example block output diff --git a/dev/grid_laplace/index.html b/dev/grid_laplace/index.html index f90a812..29124c8 100644 --- a/dev/grid_laplace/index.html +++ b/dev/grid_laplace/index.html @@ -409,4 +409,4 @@ u0 = zeros(nv(sds[1])) b = Ls[1]*rand(nv(sds[1])) #put into range of the Laplacian for solvability u = multigrid_vcycles(u0,b,Ls,rs,ps,3,10) #3,10 chosen empirically, presumably there's deep lore and chaos here -norm(Ls[1]*u-b)/norm(b) +norm(Ls[1]*u-b)/norm(b) diff --git a/dev/index.html b/dev/index.html index 510ba38..78d254b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -CombinatorialSpaces.jl · CombinatorialSpaces.jl

CombinatorialSpaces.jl

This package provides combinatorial models of geometric spaces, such as simplicial sets and combinatorial maps. These "combinatorial spaces" are useful in computational physics, computer graphics, and other applications where geometry plays a large role. They are also potentially useful in non-geometric applications, since structures like simplicial sets generalize graphs from binary relations to higher-arity relations.

Combinatorial spaces, like graphs, are typically C-sets (copresheaves) on some category C. They are implemented here using the general data structures for C-sets offered by Catlab.jl. Thus, this package complements and extends the family of graph data structures shipped with Catlab in the module Catlab.Graphs.

Current features include:

  • delta sets (semi-simplicial sets) in dimensions one and two, optionally oriented and/or embedded in Euclidean space
  • construction of the dual complex associated with a delta set, via combinatorial and geometric subdivision
  • core operators of the discrete exterior calculus, including the boundary, exterior deriviative, Hodge star, codifferential, and Laplace-Beltrami operators
  • experimental support for rotation systems and combinatorial maps

Installation

To install this package, open the Julia shell, press ] to enter Pkg mode, and run the command

(@v1.5) pkg> add CombinatorialSpaces
+CombinatorialSpaces.jl · CombinatorialSpaces.jl

CombinatorialSpaces.jl

This package provides combinatorial models of geometric spaces, such as simplicial sets and combinatorial maps. These "combinatorial spaces" are useful in computational physics, computer graphics, and other applications where geometry plays a large role. They are also potentially useful in non-geometric applications, since structures like simplicial sets generalize graphs from binary relations to higher-arity relations.

Combinatorial spaces, like graphs, are typically C-sets (copresheaves) on some category C. They are implemented here using the general data structures for C-sets offered by Catlab.jl. Thus, this package complements and extends the family of graph data structures shipped with Catlab in the module Catlab.Graphs.

Current features include:

  • delta sets (semi-simplicial sets) in dimensions one and two, optionally oriented and/or embedded in Euclidean space
  • construction of the dual complex associated with a delta set, via combinatorial and geometric subdivision
  • core operators of the discrete exterior calculus, including the boundary, exterior deriviative, Hodge star, codifferential, and Laplace-Beltrami operators
  • experimental support for rotation systems and combinatorial maps

Installation

To install this package, open the Julia shell, press ] to enter Pkg mode, and run the command

(@v1.5) pkg> add CombinatorialSpaces
diff --git a/dev/meshes/index.html b/dev/meshes/index.html index 2ed7f25..4542274 100644 --- a/dev/meshes/index.html +++ b/dev/meshes/index.html @@ -8,11 +8,11 @@ catmesh_dset = EmbeddedDeltaSet2D(catmesh) mesh(catmesh_dset, shading=false)

Alterntively, the embedded delta set can be visualized as a wireframe:

wireframe(catmesh_dset)

We can also construct and plot the dual complex for this mesh:

dual = EmbeddedDeltaDualComplex2D{Bool, Float32, Point{3,Float32}}(catmesh_dset)
 subdivide_duals!(dual, Barycenter())
-wireframe(dual)

API docs

CombinatorialSpaces.Meshes.loadmeshMethod
loadmesh(s::Icosphere)

Load in a icosphere mesh.

source
CombinatorialSpaces.Meshes.loadmeshMethod
loadmesh(s::Point_Map)

Load in a point map describing the connectivity of the toroidal mesh.

source
CombinatorialSpaces.Meshes.loadmeshMethod
loadmesh(s::Rectangle_30x10)

Load in a rectangular mesh.

source
CombinatorialSpaces.Meshes.loadmeshMethod
loadmesh(s::Torus_30x10)

Load in a toroidal mesh.

source
CombinatorialSpaces.Meshes.makeSphereMethod
makeSphere(minLat, maxLat, dLat, minLong, maxLong, dLong, radius)

Construct a spherical mesh (inclusively) bounded by the given latitudes and longitudes, discretized at dLat and dLong intervals, at the given radius from Earth's center.

Note that this construction returns a UV-sphere. DEC simulations are more accurate on meshes with (near) equilateral triangles, such as the icospheres available through loadmesh.

We say that:

  • 90°N is 0
  • 90°S is 180
  • Prime Meridian is 0
  • 10°W is 355

We say that:

  • (x=0,y=0,z=0) is at the center of the sphere
  • the x-axis points toward 0°,0°
  • the y-axis points toward 90°E,0°
  • the z-axis points toward the North Pole

References:

List of common coordinate transformations

Examples

# Regular octahedron.
+wireframe(dual)

API docs

CombinatorialSpaces.Meshes.makeSphereMethod
makeSphere(minLat, maxLat, dLat, minLong, maxLong, dLong, radius)

Construct a spherical mesh (inclusively) bounded by the given latitudes and longitudes, discretized at dLat and dLong intervals, at the given radius from Earth's center.

Note that this construction returns a UV-sphere. DEC simulations are more accurate on meshes with (near) equilateral triangles, such as the icospheres available through loadmesh.

We say that:

  • 90°N is 0
  • 90°S is 180
  • Prime Meridian is 0
  • 10°W is 355

We say that:

  • (x=0,y=0,z=0) is at the center of the sphere
  • the x-axis points toward 0°,0°
  • the y-axis points toward 90°E,0°
  • the z-axis points toward the North Pole

References:

List of common coordinate transformations

Examples

# Regular octahedron.
 julia> s, npi, spi = makeSphere(0, 180, 90, 0, 360, 90, 1)
# 72 points along the unit circle on the x-y plane.
 julia> s, npi, spi = makeSphere(90, 90, 0, 0, 360, 5, 1)
# 72 points along the equator at 0km from Earth's surface.
 julia> s, npi, spi = makeSphere(90, 90, 1, 0, 360, 5, 6371)
# TIE-GCM grid at 90km altitude (with no poles,   i.e. a bulbous cylinder).
 julia> s, npi, spi = makeSphere(5, 175, 5, 0, 360, 5, 6371+90)
# TIE-GCM grid at 90km altitude (with South pole, i.e. a bowl).
 julia> s, npi, spi = makeSphere(5, 180, 5, 0, 360, 5, 6371+90)
# TIE-GCM grid at 90km altitude (with poles,      i.e. a sphere).
 julia> s, npi, spi = makeSphere(0, 180, 5, 0, 360, 5, 6371+90)
# The Northern hemisphere of the TIE-GCM grid at 90km altitude.
-julia> s, npi, spi = makeSphere(0, 180, 5, 0, 360, 5, 6371+90)
source
CombinatorialSpaces.Meshes.triangulated_gridFunction
function triangulated_grid(max_x, max_y, dx, dy, point_type, compress=true)

Triangulate the rectangle [0,maxx] x [0,maxy] by approximately equilateral triangles of width dx and height dy.

If compress is true (default), then enforce that all rows of points are less than max_x, otherwise, keep dx as is.

source
CombinatorialSpaces.MeshInteropModule

Interoperation with mesh files.

This module enables delta sets to be imported from mesh files supported by MeshIO.jl and for delta sets to be converted to meshes, mainly for the purposes of plotting. Meshes are represented by the GeometryBasics.Mesh type.

source
+julia> s, npi, spi = makeSphere(0, 180, 5, 0, 360, 5, 6371+90)source
CombinatorialSpaces.Meshes.triangulated_gridFunction
function triangulated_grid(max_x, max_y, dx, dy, point_type, compress=true)

Triangulate the rectangle [0,maxx] x [0,maxy] by approximately equilateral triangles of width dx and height dy.

If compress is true (default), then enforce that all rows of points are less than max_x, otherwise, keep dx as is.

source
CombinatorialSpaces.MeshInteropModule

Interoperation with mesh files.

This module enables delta sets to be imported from mesh files supported by MeshIO.jl and for delta sets to be converted to meshes, mainly for the purposes of plotting. Meshes are represented by the GeometryBasics.Mesh type.

source
diff --git a/dev/objects.inv b/dev/objects.inv index 5703c60..b045d3b 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/simplicial_sets/index.html b/dev/simplicial_sets/index.html index 1ff578e..b511465 100644 --- a/dev/simplicial_sets/index.html +++ b/dev/simplicial_sets/index.html @@ -15,4 +15,4 @@ glue_triangle!(dset, 1, 4, 3) dset

As the table above illustrates, only the edges of each triangle are explicitly stored. The vertices of a triangle can be accessed using the function triangle_vertices. The correctness of this function depends on the semi-simplicial identities.

map(triangles(dset)) do t
   triangle_vertices(dset, t)
-end

API docs

CombinatorialSpaces.SimplicialSetsModule

Simplicial sets in one, two, and three dimensions.

For the time being, this module provides data structures only for delta sets, also known as semi-simplicial sets. These include the face maps but not the degeneracy maps of a simplicial set. In the future we may add support for simplicial sets. The analogy to keep in mind is that graphs are to semi-simpicial sets as reflexive graphs are to simplicial sets.

Also provided are the fundamental operators on simplicial sets used in nearly all geometric applications, namely the boundary and coboundary (discrete exterior derivative) operators. For additional operators, see the DiscreteExteriorCalculus module.

source
CombinatorialSpaces.SimplicialSets.AbstractDeltaSet1DType

Abstract type for one-dimensional delta sets, aka semi-simplicial sets.

source
CombinatorialSpaces.SimplicialSets.AbstractDeltaSet2DType

Abstract type for 2D delta sets.

source
CombinatorialSpaces.SimplicialSets.AbstractDeltaSet3DType

Abstract type for 3D delta sets.

source
CombinatorialSpaces.SimplicialSets.DeltaSet0DType

A 0-dimensional delta set, aka a set of vertices.

source
CombinatorialSpaces.SimplicialSets.DeltaSet1DType

A one-dimensional delta set, aka semi-simplicial set.

Delta sets in 1D are isomorphic to graphs (in the category theorist's sense). The source and target of an edge can be accessed using the face maps (simplicial terminology) or src and tgt maps (graph-theoretic terminology). More generally, this type implements the graphs interface in Catlab.Graphs.

source
CombinatorialSpaces.SimplicialSets.DeltaSet2DType

A 2D delta set, aka semi-simplicial set.

The triangles in a semi-simpicial set can be interpreted in several ways. Geometrically, they are triangles (2-simplices) whose three edges are directed according to a specific pattern, determined by the ordering of the vertices or equivalently by the simplicial identities. This geometric perspective is present through the subpart names ∂e0, ∂e1, and ∂e2 and through the boundary map . Alternatively, the triangle can be interpreted as a higher-dimensional link or morphism, going from two edges in sequence (which might be called src2_first and src2_last) to a transitive edge (say tgt2). This is the shape of the binary composition operation in a category.

source
CombinatorialSpaces.SimplicialSets.DeltaSet3DType

A 3D delta set, aka semi-simplicial set.

source
CombinatorialSpaces.SimplicialSets.EType

Edge in simplicial set: alias for Simplex{1}.

source
CombinatorialSpaces.SimplicialSets.EmbeddedDeltaSet1DType

A one-dimensional, embedded, oriented delta set.

source
CombinatorialSpaces.SimplicialSets.EmbeddedDeltaSet2DType

A two-dimensional, embedded, oriented delta set.

source
CombinatorialSpaces.SimplicialSets.EmbeddedDeltaSet3DType

A three-dimensional, embedded, oriented delta set.

source
CombinatorialSpaces.SimplicialSets.HasDeltaSetType

Abstract type for C-sets that contain a delta set of some dimension.

This dimension could be zero, in which case the delta set consists only of vertices (0-simplices).

source
CombinatorialSpaces.SimplicialSets.HasDeltaSet1DType

Abstract type for C-sets that contain a one-dimensional delta set.

source
CombinatorialSpaces.SimplicialSets.HasDeltaSet2DType

Abstract type for C-sets containing a 2D delta set.

source
CombinatorialSpaces.SimplicialSets.HasDeltaSet3DType

Abstract type for C-sets containing a 3D delta set.

source
CombinatorialSpaces.SimplicialSets.OrientedDeltaSet1DType

A one-dimensional oriented delta set.

Edges are oriented from source to target when edge_orientation is true/positive and from target to source when it is false/negative.

source
CombinatorialSpaces.SimplicialSets.OrientedDeltaSet2DType

A two-dimensional oriented delta set.

Triangles are ordered in the cyclic order $(0,1,2)$ when tri_orientation is true/positive and in the reverse order when it is false/negative.

source
CombinatorialSpaces.SimplicialSets.OrientedDeltaSet3DType

A three-dimensional oriented delta set.

source
CombinatorialSpaces.SimplicialSets.SimplexType

Wrapper for simplex or simplices of dimension n.

See also: V, E, Tri.

source
CombinatorialSpaces.SimplicialSets.SimplexChainType

Wrapper for simplex chain of dimension n.

Example: EChain([2,-1,1]) represents the chain 2a-b+c in the simplicial set with edges a,b,c.

source
CombinatorialSpaces.SimplicialSets.SimplexFormType

Wrapper for discrete form, aka cochain, in simplicial set.

source
CombinatorialSpaces.SimplicialSets.TetType

Tetrahedron in simplicial set: alias for Simplex{3}.

source
CombinatorialSpaces.SimplicialSets.TriType

Triangle in simplicial set: alias for Simplex{2}.

source
CombinatorialSpaces.SimplicialSets.VType

Vertex in simplicial set: alias for Simplex{0}.

source
CombinatorialSpaces.SimplicialSets.LkFunction

Alias for the link operator link.

source
CombinatorialSpaces.SimplicialSets.StFunction

Alias for the star operator star, not the Hodge star.

source
CombinatorialSpaces.SimplicialSets.St̄Function

Alias for the closed star operator closed_star, not the Hodge star.

source
CombinatorialSpaces.SimplicialSets.add_sorted_edge!Method

Add edge to simplicial set, respecting the order of the vertex IDs.

source
CombinatorialSpaces.SimplicialSets.add_sorted_edges!Method

Add edges to simplicial set, respecting the order of the vertex IDs.

source
CombinatorialSpaces.SimplicialSets.add_tetrahedron!Method

Add a tetrahedron (3-simplex) to a simplicial set, given its boundary triangles.

Warning

This low-level function does not check the simplicial identities. It is your responsibility to ensure they are satisfied. By contrast, tetrahedra added using the function glue_tetrahedron! always satisfy the simplicial identities, by construction. Thus it is often easier to use this function.

source
CombinatorialSpaces.SimplicialSets.add_triangle!Method

Add a triangle (2-simplex) to a simplicial set, given its boundary edges.

In the arguments to this function, the boundary edges have the order $0 → 1$, $1 → 2$, $0 → 2$. i.e. (∂e₂, ∂e₀, ∂e₁).

Warning

This low-level function does not check the simplicial identities. It is your responsibility to ensure they are satisfied. By contrast, triangles added using the function glue_triangle! always satisfy the simplicial identities, by construction. Thus it is often easier to use this function.

source
CombinatorialSpaces.SimplicialSets.boundaryFunction

Alias for the face map and boundary operator .

source
CombinatorialSpaces.SimplicialSets.closed_starMethod

Closed star of a vertex in a delta set.

Munkres §2 ≈ "The union of all simplices of s having v as a vertex."

Return a vector of simplex chains of dimensions 0 to n.

Note that we do not return polytopes, but rather the simplices which together form such polytopes, in no particular order.

This is not the Hodge star .

See also star, link.

source
CombinatorialSpaces.SimplicialSets.coboundaryFunction

Alias for the coboundary operator d.

source
CombinatorialSpaces.SimplicialSets.dMethod

The discrete exterior derivative, aka the coboundary operator.

source
CombinatorialSpaces.SimplicialSets.dimensionMethod

Calculate the dimension of a delta set from its acset schema. Assumes that vertices, edges, triangles, and tetrahedra are named :V, :E, :Tri, and :Tet respectively.

source
CombinatorialSpaces.SimplicialSets.edge_verticesMethod

Boundary vertices of an edge.

source
CombinatorialSpaces.SimplicialSets.exterior_derivativeFunction

Alias for the discrete exterior derivative d.

source
CombinatorialSpaces.SimplicialSets.glue_sorted_tet_cube!Method

Glue a tetrahedralized cube onto a simplicial set, respecting the order of the vertices.

After sorting, the faces of the cube are: 1 5-4 0, 1 2-6 5, 1 2-3 0, 7 4-0 3, 7 3-2 6, 7 6-5 4, For each face, the diagonal edge is between those vertices connected by a dash. The internal diagonal is between vertices 1 and 7.

source
CombinatorialSpaces.SimplicialSets.glue_sorted_tetrahedron!Method

Glue a tetrahedron onto a simplicial set, respecting the order of the vertices.

source
CombinatorialSpaces.SimplicialSets.glue_sorted_triangle!Method

Glue a triangle onto a simplicial set, respecting the order of the vertices.

source
CombinatorialSpaces.SimplicialSets.glue_tetrahedron!Method

Glue a tetrahedron onto a simplicial set, given its boundary vertices.

If a needed triangle between two vertices exists, it is reused (hence the "gluing"); otherwise, it is created. Necessary 1-simplices are likewise glued.

source
CombinatorialSpaces.SimplicialSets.glue_triangle!Method

Glue a triangle onto a simplicial set, given its boundary vertices.

If a needed edge between two vertices exists, it is reused (hence the "gluing"); otherwise, it is created.

Note this function does not check whether a triangle [v₀,v₁,v₂] already exists.

Note that this function does not rearrange v₀, v₁, v₂ in the way that minimizes the number of edges added. For example, if s is the DeltaSet with a single triangle [1,2,3] and edges [1,2], [2,3], [1,3], then gluing triangle [3,1,4] will add edges [3,1], [1,4], [3,4] so as to respect the simplicial identities. Note that the edges [1,3] and [3,1] are distinct! However, if the DeltaSet that one is creating is meant to be manifold-like, then adding triangles using only the command glue_sorted_triangle! guarantees that the minimal number of new edges are created.

TODO: Reference a proof of the above claim.

source
CombinatorialSpaces.SimplicialSets.is_manifold_likeMethod

Test whether a given simplicial complex is manifold-like.

According to Hirani, "all simplices of dimension $k$ with $0 ≤ k ≤ n - 1$ must be the face of some simplex of dimension $n$ in the complex." This function does not test that simplices do not overlap. Nor does it test that e.g. two triangles that share 2 vertices share an edge. Nor does it test that e.g. there is at most one triangle that connects 3 vertices. Nor does it test that the delta set consists of a single component.

source
CombinatorialSpaces.SimplicialSets.linkMethod

Link of a vertex in a delta set.

Munkres §2 ≈ "The set St̄(v) - St(v)."

Return a vector of simplex chains of dimensions 0 to n.

These are the simplices which are in the closed star of v, but not in the star of v.

See also star, closed_star.

source
CombinatorialSpaces.SimplicialSets.nonboundariesMethod

Find the simplices which are not a face of another.

For an n-D oriented delta set, return a vector of 0 through n-1 chains consisting of the simplices that are not the face of another. Note that since n-simplices in an n-D oriented delta set are never the face of an (n+1)-simplex, these are excluded.

We choose the term "nonboundaries" so as not to be confused with the term "nonface", defined as those faces that are not in a simplical complex, whose corresponding monomials are the basis of the Stanley-Reisner ideal.

source
CombinatorialSpaces.SimplicialSets.nsimplicesMethod

Number of simplices of given dimension in a simplicial set.

source
CombinatorialSpaces.SimplicialSets.orient!Method

Consistently orient simplices in a simplicial set, if possible.

Two simplices with a common face are consistently oriented if they induce opposite orientations on the shared face. This function attempts to consistently orient all simplices of a given dimension and returns whether this has been achieved. Each connected component is oriently independently using the helper function orient_component!.

source
CombinatorialSpaces.SimplicialSets.orient_component!Method

Consistently orient simplices in the same connected component, if possible.

Given an $n$-simplex and a choice of orientation for it, this function attempts to consistently orient all $n$-simplices that may be reached from it by traversing $(n-1)$-faces. The traversal is depth-first. If a consistent orientation is possible, the function returns true and the orientations are assigned; otherwise, it returns false and no orientations are changed.

If the simplicial set is not connected, the function orient! may be more convenient.

source
CombinatorialSpaces.SimplicialSets.orientationMethod

Orientation of simplex.

source
CombinatorialSpaces.SimplicialSets.pointMethod

Point associated with vertex of complex.

source
CombinatorialSpaces.SimplicialSets.set_orientation!Method

Set orientation of simplex.

source
CombinatorialSpaces.SimplicialSets.simplicesMethod

Simplices of given dimension in a simplicial set.

source
CombinatorialSpaces.SimplicialSets.starMethod

Star of a vertex in a delta set.

Munkres §2 ≈ "The union of the interiors of those simplices of s that have v as a vertex."

Return a vector of simplex chains of dimensions 0 to n.

Recall that interior(σ) = σ - boundary(σ), Munkres §1.

Note that we are returning interiors alone. This means, e.g. a triangle may be returned without one or more of its edges. Consequentially, the output of this function may not be storable in an ACSet.

This is not the Hodge star .

See also closed_star, link.

source
CombinatorialSpaces.SimplicialSets.tetrahedron_edgesMethod

Boundary edges of a tetrahedron.

This accessor assumes that the simplicial identities hold.

source
CombinatorialSpaces.SimplicialSets.tetrahedron_trianglesMethod

Boundary triangles of a tetrahedron.

source
CombinatorialSpaces.SimplicialSets.tetrahedron_verticesMethod

Boundary vertices of a tetrahedron.

This accessor assumes that the simplicial identities hold.

source
CombinatorialSpaces.SimplicialSets.triangle_edgesMethod

Boundary edges of a triangle.

source
CombinatorialSpaces.SimplicialSets.triangle_verticesMethod

Boundary vertices of a triangle.

This accessor assumes that the simplicial identities hold.

source
CombinatorialSpaces.SimplicialSets.volumeMethod

$n$-dimensional volume of $n$-simplex spanned by given $n+1$ points.

source
CombinatorialSpaces.SimplicialSets.volumeMethod

$n$-dimensional volume of $n$-simplex in an embedded simplicial set.

source
CombinatorialSpaces.SimplicialSets.∂Method

Face map and boundary operator on simplicial sets.

Given numbers n and 0 <= i <= n and a simplicial set of dimension at least n, the ith face map is implemented by the call

∂(n, i, s, ...)

The boundary operator on n-faces and n-chains is implemented by the call

∂(n, s, ...)

Note that the face map returns simplices, while the boundary operator returns chains (vectors in the free vector space spanned by oriented simplices).

source
+end

API docs

CombinatorialSpaces.SimplicialSetsModule

Simplicial sets in one, two, and three dimensions.

For the time being, this module provides data structures only for delta sets, also known as semi-simplicial sets. These include the face maps but not the degeneracy maps of a simplicial set. In the future we may add support for simplicial sets. The analogy to keep in mind is that graphs are to semi-simpicial sets as reflexive graphs are to simplicial sets.

Also provided are the fundamental operators on simplicial sets used in nearly all geometric applications, namely the boundary and coboundary (discrete exterior derivative) operators. For additional operators, see the DiscreteExteriorCalculus module.

source
CombinatorialSpaces.SimplicialSets.AbstractDeltaSet1DType

Abstract type for one-dimensional delta sets, aka semi-simplicial sets.

source
CombinatorialSpaces.SimplicialSets.AbstractDeltaSet2DType

Abstract type for 2D delta sets.

source
CombinatorialSpaces.SimplicialSets.AbstractDeltaSet3DType

Abstract type for 3D delta sets.

source
CombinatorialSpaces.SimplicialSets.DeltaSet0DType

A 0-dimensional delta set, aka a set of vertices.

source
CombinatorialSpaces.SimplicialSets.DeltaSet1DType

A one-dimensional delta set, aka semi-simplicial set.

Delta sets in 1D are isomorphic to graphs (in the category theorist's sense). The source and target of an edge can be accessed using the face maps (simplicial terminology) or src and tgt maps (graph-theoretic terminology). More generally, this type implements the graphs interface in Catlab.Graphs.

source
CombinatorialSpaces.SimplicialSets.DeltaSet2DType

A 2D delta set, aka semi-simplicial set.

The triangles in a semi-simpicial set can be interpreted in several ways. Geometrically, they are triangles (2-simplices) whose three edges are directed according to a specific pattern, determined by the ordering of the vertices or equivalently by the simplicial identities. This geometric perspective is present through the subpart names ∂e0, ∂e1, and ∂e2 and through the boundary map . Alternatively, the triangle can be interpreted as a higher-dimensional link or morphism, going from two edges in sequence (which might be called src2_first and src2_last) to a transitive edge (say tgt2). This is the shape of the binary composition operation in a category.

source
CombinatorialSpaces.SimplicialSets.DeltaSet3DType

A 3D delta set, aka semi-simplicial set.

source
CombinatorialSpaces.SimplicialSets.EType

Edge in simplicial set: alias for Simplex{1}.

source
CombinatorialSpaces.SimplicialSets.EmbeddedDeltaSet1DType

A one-dimensional, embedded, oriented delta set.

source
CombinatorialSpaces.SimplicialSets.EmbeddedDeltaSet2DType

A two-dimensional, embedded, oriented delta set.

source
CombinatorialSpaces.SimplicialSets.EmbeddedDeltaSet3DType

A three-dimensional, embedded, oriented delta set.

source
CombinatorialSpaces.SimplicialSets.HasDeltaSetType

Abstract type for C-sets that contain a delta set of some dimension.

This dimension could be zero, in which case the delta set consists only of vertices (0-simplices).

source
CombinatorialSpaces.SimplicialSets.HasDeltaSet1DType

Abstract type for C-sets that contain a one-dimensional delta set.

source
CombinatorialSpaces.SimplicialSets.HasDeltaSet2DType

Abstract type for C-sets containing a 2D delta set.

source
CombinatorialSpaces.SimplicialSets.HasDeltaSet3DType

Abstract type for C-sets containing a 3D delta set.

source
CombinatorialSpaces.SimplicialSets.OrientedDeltaSet1DType

A one-dimensional oriented delta set.

Edges are oriented from source to target when edge_orientation is true/positive and from target to source when it is false/negative.

source
CombinatorialSpaces.SimplicialSets.OrientedDeltaSet2DType

A two-dimensional oriented delta set.

Triangles are ordered in the cyclic order $(0,1,2)$ when tri_orientation is true/positive and in the reverse order when it is false/negative.

source
CombinatorialSpaces.SimplicialSets.OrientedDeltaSet3DType

A three-dimensional oriented delta set.

source
CombinatorialSpaces.SimplicialSets.SimplexType

Wrapper for simplex or simplices of dimension n.

See also: V, E, Tri.

source
CombinatorialSpaces.SimplicialSets.SimplexChainType

Wrapper for simplex chain of dimension n.

Example: EChain([2,-1,1]) represents the chain 2a-b+c in the simplicial set with edges a,b,c.

source
CombinatorialSpaces.SimplicialSets.SimplexFormType

Wrapper for discrete form, aka cochain, in simplicial set.

source
CombinatorialSpaces.SimplicialSets.TetType

Tetrahedron in simplicial set: alias for Simplex{3}.

source
CombinatorialSpaces.SimplicialSets.TriType

Triangle in simplicial set: alias for Simplex{2}.

source
CombinatorialSpaces.SimplicialSets.VType

Vertex in simplicial set: alias for Simplex{0}.

source
CombinatorialSpaces.SimplicialSets.LkFunction

Alias for the link operator link.

source
CombinatorialSpaces.SimplicialSets.StFunction

Alias for the star operator star, not the Hodge star.

source
CombinatorialSpaces.SimplicialSets.St̄Function

Alias for the closed star operator closed_star, not the Hodge star.

source
CombinatorialSpaces.SimplicialSets.add_sorted_edge!Method

Add edge to simplicial set, respecting the order of the vertex IDs.

source
CombinatorialSpaces.SimplicialSets.add_sorted_edges!Method

Add edges to simplicial set, respecting the order of the vertex IDs.

source
CombinatorialSpaces.SimplicialSets.add_tetrahedron!Method

Add a tetrahedron (3-simplex) to a simplicial set, given its boundary triangles.

Warning

This low-level function does not check the simplicial identities. It is your responsibility to ensure they are satisfied. By contrast, tetrahedra added using the function glue_tetrahedron! always satisfy the simplicial identities, by construction. Thus it is often easier to use this function.

source
CombinatorialSpaces.SimplicialSets.add_triangle!Method

Add a triangle (2-simplex) to a simplicial set, given its boundary edges.

In the arguments to this function, the boundary edges have the order $0 → 1$, $1 → 2$, $0 → 2$. i.e. (∂e₂, ∂e₀, ∂e₁).

Warning

This low-level function does not check the simplicial identities. It is your responsibility to ensure they are satisfied. By contrast, triangles added using the function glue_triangle! always satisfy the simplicial identities, by construction. Thus it is often easier to use this function.

source
CombinatorialSpaces.SimplicialSets.boundaryFunction

Alias for the face map and boundary operator .

source
CombinatorialSpaces.SimplicialSets.closed_starMethod

Closed star of a vertex in a delta set.

Munkres §2 ≈ "The union of all simplices of s having v as a vertex."

Return a vector of simplex chains of dimensions 0 to n.

Note that we do not return polytopes, but rather the simplices which together form such polytopes, in no particular order.

This is not the Hodge star .

See also star, link.

source
CombinatorialSpaces.SimplicialSets.coboundaryFunction

Alias for the coboundary operator d.

source
CombinatorialSpaces.SimplicialSets.dMethod

The discrete exterior derivative, aka the coboundary operator.

source
CombinatorialSpaces.SimplicialSets.dimensionMethod

Calculate the dimension of a delta set from its acset schema. Assumes that vertices, edges, triangles, and tetrahedra are named :V, :E, :Tri, and :Tet respectively.

source
CombinatorialSpaces.SimplicialSets.edge_verticesMethod

Boundary vertices of an edge.

source
CombinatorialSpaces.SimplicialSets.exterior_derivativeFunction

Alias for the discrete exterior derivative d.

source
CombinatorialSpaces.SimplicialSets.glue_sorted_tet_cube!Method

Glue a tetrahedralized cube onto a simplicial set, respecting the order of the vertices.

After sorting, the faces of the cube are: 1 5-4 0, 1 2-6 5, 1 2-3 0, 7 4-0 3, 7 3-2 6, 7 6-5 4, For each face, the diagonal edge is between those vertices connected by a dash. The internal diagonal is between vertices 1 and 7.

source
CombinatorialSpaces.SimplicialSets.glue_sorted_tetrahedron!Method

Glue a tetrahedron onto a simplicial set, respecting the order of the vertices.

source
CombinatorialSpaces.SimplicialSets.glue_sorted_triangle!Method

Glue a triangle onto a simplicial set, respecting the order of the vertices.

source
CombinatorialSpaces.SimplicialSets.glue_tetrahedron!Method

Glue a tetrahedron onto a simplicial set, given its boundary vertices.

If a needed triangle between two vertices exists, it is reused (hence the "gluing"); otherwise, it is created. Necessary 1-simplices are likewise glued.

source
CombinatorialSpaces.SimplicialSets.glue_triangle!Method

Glue a triangle onto a simplicial set, given its boundary vertices.

If a needed edge between two vertices exists, it is reused (hence the "gluing"); otherwise, it is created.

Note this function does not check whether a triangle [v₀,v₁,v₂] already exists.

Note that this function does not rearrange v₀, v₁, v₂ in the way that minimizes the number of edges added. For example, if s is the DeltaSet with a single triangle [1,2,3] and edges [1,2], [2,3], [1,3], then gluing triangle [3,1,4] will add edges [3,1], [1,4], [3,4] so as to respect the simplicial identities. Note that the edges [1,3] and [3,1] are distinct! However, if the DeltaSet that one is creating is meant to be manifold-like, then adding triangles using only the command glue_sorted_triangle! guarantees that the minimal number of new edges are created.

TODO: Reference a proof of the above claim.

source
CombinatorialSpaces.SimplicialSets.is_manifold_likeMethod

Test whether a given simplicial complex is manifold-like.

According to Hirani, "all simplices of dimension $k$ with $0 ≤ k ≤ n - 1$ must be the face of some simplex of dimension $n$ in the complex." This function does not test that simplices do not overlap. Nor does it test that e.g. two triangles that share 2 vertices share an edge. Nor does it test that e.g. there is at most one triangle that connects 3 vertices. Nor does it test that the delta set consists of a single component.

source
CombinatorialSpaces.SimplicialSets.linkMethod

Link of a vertex in a delta set.

Munkres §2 ≈ "The set St̄(v) - St(v)."

Return a vector of simplex chains of dimensions 0 to n.

These are the simplices which are in the closed star of v, but not in the star of v.

See also star, closed_star.

source
CombinatorialSpaces.SimplicialSets.nonboundariesMethod

Find the simplices which are not a face of another.

For an n-D oriented delta set, return a vector of 0 through n-1 chains consisting of the simplices that are not the face of another. Note that since n-simplices in an n-D oriented delta set are never the face of an (n+1)-simplex, these are excluded.

We choose the term "nonboundaries" so as not to be confused with the term "nonface", defined as those faces that are not in a simplical complex, whose corresponding monomials are the basis of the Stanley-Reisner ideal.

source
CombinatorialSpaces.SimplicialSets.nsimplicesMethod

Number of simplices of given dimension in a simplicial set.

source
CombinatorialSpaces.SimplicialSets.orient!Method

Consistently orient simplices in a simplicial set, if possible.

Two simplices with a common face are consistently oriented if they induce opposite orientations on the shared face. This function attempts to consistently orient all simplices of a given dimension and returns whether this has been achieved. Each connected component is oriently independently using the helper function orient_component!.

source
CombinatorialSpaces.SimplicialSets.orient_component!Method

Consistently orient simplices in the same connected component, if possible.

Given an $n$-simplex and a choice of orientation for it, this function attempts to consistently orient all $n$-simplices that may be reached from it by traversing $(n-1)$-faces. The traversal is depth-first. If a consistent orientation is possible, the function returns true and the orientations are assigned; otherwise, it returns false and no orientations are changed.

If the simplicial set is not connected, the function orient! may be more convenient.

source
CombinatorialSpaces.SimplicialSets.orientationMethod

Orientation of simplex.

source
CombinatorialSpaces.SimplicialSets.pointMethod

Point associated with vertex of complex.

source
CombinatorialSpaces.SimplicialSets.set_orientation!Method

Set orientation of simplex.

source
CombinatorialSpaces.SimplicialSets.simplicesMethod

Simplices of given dimension in a simplicial set.

source
CombinatorialSpaces.SimplicialSets.starMethod

Star of a vertex in a delta set.

Munkres §2 ≈ "The union of the interiors of those simplices of s that have v as a vertex."

Return a vector of simplex chains of dimensions 0 to n.

Recall that interior(σ) = σ - boundary(σ), Munkres §1.

Note that we are returning interiors alone. This means, e.g. a triangle may be returned without one or more of its edges. Consequentially, the output of this function may not be storable in an ACSet.

This is not the Hodge star .

See also closed_star, link.

source
CombinatorialSpaces.SimplicialSets.tetrahedron_edgesMethod

Boundary edges of a tetrahedron.

This accessor assumes that the simplicial identities hold.

source
CombinatorialSpaces.SimplicialSets.tetrahedron_trianglesMethod

Boundary triangles of a tetrahedron.

source
CombinatorialSpaces.SimplicialSets.tetrahedron_verticesMethod

Boundary vertices of a tetrahedron.

This accessor assumes that the simplicial identities hold.

source
CombinatorialSpaces.SimplicialSets.triangle_edgesMethod

Boundary edges of a triangle.

source
CombinatorialSpaces.SimplicialSets.triangle_verticesMethod

Boundary vertices of a triangle.

This accessor assumes that the simplicial identities hold.

source
CombinatorialSpaces.SimplicialSets.volumeMethod

$n$-dimensional volume of $n$-simplex spanned by given $n+1$ points.

source
CombinatorialSpaces.SimplicialSets.volumeMethod

$n$-dimensional volume of $n$-simplex in an embedded simplicial set.

source
CombinatorialSpaces.SimplicialSets.∂Method

Face map and boundary operator on simplicial sets.

Given numbers n and 0 <= i <= n and a simplicial set of dimension at least n, the ith face map is implemented by the call

∂(n, i, s, ...)

The boundary operator on n-faces and n-chains is implemented by the call

∂(n, s, ...)

Note that the face map returns simplices, while the boundary operator returns chains (vectors in the free vector space spanned by oriented simplices).

source