Fluid Modeling and Boolean Algebra for Arbitrarily Complex Topology in Two Dimensions
Qinghai Zhang, Zhixuan Li

TL;DR
This paper introduces a mathematical model for multiphase fluid flows in two dimensions that captures complex topologies and deformations efficiently using Boolean algebra and topological invariants, enabling robust analysis of fluid behavior.
Contribution
It presents a novel framework combining regular open semianalytic sets with Boolean operations to handle complex fluid topologies and changes efficiently and accurately.
Findings
Topological features like Betti numbers can be extracted in constant time.
The model accurately captures topological changes via non-manifold boundary points.
Boolean operations handle all degenerate cases and complex topologies efficiently.
Abstract
We propose a mathematical model for fluids in multiphase flows in order to establish a solid theoretical foundation for the study of their complex topology, large geometric deformations, and topological changes such as merging. Our modeling space consists of regular open semianalytic sets with bounded boundaries, and is further equipped with constructive and algebraic definitions of Boolean operations. Major distinguishing features of our model include (a) topological information of fluids such as Betti numbers can be easily extracted in constant time, (b) topological changes of fluids are captured by non-manifold points on fluid boundaries, (c) Boolean operations on fluids correctly handle all degenerate cases and apply to arbitrarily complex topologies, yet they are simple and efficient in that they only involve determining the relative position of a point to a Jordan curve and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSlime Mold and Myxomycetes Research · Computer Graphics and Visualization Techniques · Topological and Geometric Data Analysis
Fluid Modeling and Boolean Algebra
for Arbitrarily Complex Topology in Two Dimensions
Qinghai Zhang School of Mathematical Sciences, Zhejiang University, 38 Zheda Road, Hangzhou, Zhejiang Province, 310027 China ([email protected]).
Zhixuan Li
School of Mathematical Sciences, Zhejiang University, 38 Zheda Road, Hangzhou, Zhejiang Province, 310027 China ([email protected]).
Abstract
We propose a mathematical model for fluids in multiphase flows in order to establish a solid theoretical foundation for the study of their complex topology, large geometric deformations, and topological changes such as merging. Our modeling space consists of regular open semianalytic sets with bounded boundaries, and is further equipped with constructive and algebraic definitions of Boolean operations. Major distinguishing features of our model include (a) topological information of fluids such as Betti numbers can be easily extracted in constant time, (b) topological changes of fluids are captured by non-manifold points on fluid boundaries, (c) Boolean operations on fluids correctly handle all degenerate cases and apply to arbitrarily complex topologies, yet they are simple and efficient in that they only involve determining the relative position of a point to a Jordan curve and intersecting a number of curve segments. Although the main targeting field is multiphase flows, our theory and algorithms may also be useful for related fields such as solid modeling, computational geometry, computer graphics, and geographic information system.
keywords:
Multiphase flows, fluid modeling, topological changes, Boolean algebra, Betti numbers, oriented Jordan curves, polygon clipping.
AMS:
76T99, 65D18, 06E99
1 Introduction
Physically meaningful regions in the sense of homogeneous continua are ubiquitous, and their modeling is of fundamental significance in innumerable applications of science and engineering. Traditionally, the modeling of two- and three-dimensional physical regions is the main subject of a mature research field called solid modeling [29, 35]. In comparison, modeling of fluids have always been avoided in the field of multiphase flows. However, rapid advancements in the science of multiphase flows have been calling for such a model so that complex phenomena such as those involving topological changes of fluids can be studied rigorously.
In this paper, we aim to answer this need by introducing the notion of fluid modeling in multiphase flows, analogous to solid modeling in computer-aided design (CAD). We propose a topological space for fluid modeling and further equip this space with natural algebraic structures in order to extract essential topological information and to perform simple and efficient Boolean operations.
In Sections 1.1, 1.2, and 1.3, we motivate different aspects of fluid modeling and review previous efforts and relevant results. We then list in Section 1.4 a number of questions as the more detailed targets of this work.
1.1 Solid modeling
What distinguishes solid modeling from similar disciplines such as computer graphics is its emphasis on physical fidelity, as evident in its underlying mathematical and computational principles. This emphasis is natural: driven by the design, analysis, and manufacture of engineering systems, solid modeling must support the representation, visualization, exchange, interrogation, and creation of physical objects in CAD.
One common approach of solid modeling relies on point-set topology. The classical modeling space proposed by Requicha and colleagues [28, 31, 30] consists of r-sets, which are bounded, closed, regular semianalytic sets in Euclidean spaces. The regularity condition captures in solid continua the absence of low-dimensional features such as isolated gaps and points, and the semianalytic condition postulates that the boundary of a solid be locally well behaved; see Section 3.1 for more details.
The other common approach in solid modeling is combinatorial, in the sense of cell complexes in algebraic topology [22] [34]. Complex objects are viewed in terms of primitive building blocks called cells, thus it is not the constituting cells but their combinational informations that describe the physical object. Take simplicial complexes for example, a -cell is a -simplex in the Euclidean space , and many cells of different dimensions are glued together to form an -dimensional simplicial complex by requiring that any adjacent pair of -cells be attached to each other along a -cell for each . The adjacency of -cells is encoded in the th boundary operator , which maps each -cell to an element in the -chain , a group of formal sums of -cells. If we concatenate the chain groups with the boundary operators, we obtain a chain complex,
[TABLE]
where each boundary operator is a group homomorphism. This chain complex is all we need for mathematical modeling and computer representation of any -dimensional solid! As a prominent advantage, key topological quantities, such as the number of connected components and the number of holes, can be systematically computed from the chain complex. The cost of this computation, however, can be substantial [15].
Thanks to the fact that any r-set can be represented by a simplicial complex as accurately as one wishes, the point-set approach and the combinatorial approach are seamlessly consistent [30]. Thus we can use these two models interchangeably, at least theoretically. This consistency also forces an -dimensional r-set to be closed; otherwise a boundary operator in (1) may have a range outside of the chain complex.
1.2 Fluid modeling and interface tracking (IT) in multiphase flows
In dramatic comparison to the aforementioned research on solid modeling, efforts on geometric modeling of fluids are rare: mathematical models and computer algorithms have been deliberately designed such that geometric modeling of fluids is avoided in numerically simulating multiphase flows. In the volume-of-fluid (VOF) method [12], a deforming fluid phase is represented by a color function , of which the value is 1 if there is at and 0 otherwise; then the fluid phase at time is represented as a moving point set . Either the scalar conservation law
[TABLE]
or the advection equation
[TABLE]
is solved to recover the boundary of at subsequent time instants. In the level-set method [25], the boundary of a fluid phase is represented as the zero isocontour of a signed distance function , and once again the region of the fluid phase is recovered by numerically solving either (2) or (3) on . In the front tracking method [40], the boundary of a fluid phase is represented by connected Lagrangian markers; tracking the fluid phase is then reduced to tracking these markers via numerically solving ordinary differential equations. In all of these IT methods, geometric problems in deforming fluids with sharp interfaces are converted to numerically solving differential equations. With topological information discarded, this conversion largely reduces the complexity of IT both theoretically and computationally; this is a main reason for successes of the aforementioned IT methods. During the past forty years, these IT methods have been extremely valuable in studying multiphase flows.
As the science of multiphase flows moves towards more and more complex phenomena, higher and higher expectations are imposed on IT. First, the wider and wider spectrum of relevant time scales and length scales in mainstream problems demands that IT methods be more and more accurate and efficient. Second, the tight coupling of interface to ambient fluids necessitates accurate estimation of derived geometric quantities such as curvature and unit normal vectors. Third, topological changes of a fluid phase such as merging exhibit distinct behaviors for different regimes of the Weber number and other impact parameters [27], hence it is not enough to handle topological changes solely from the interface locus and the velocity field. For these problems, an IT method should also take as its input a policy that describes how the interface shall evolve at the branching time and place of topological changes.
Despite their tremendous successes, current IT methods have a number of limitations in answering the aforementioned challenges of multiphase flows. First, most methods are at best second-order accurate [43]. Second, the IT errors put an upper limit on the accuracy of estimating curvature and unit vectors. It is shown in [47] that, for a second-order method, its error of curvature estimation is proportional to where denotes a norm of IT errors. In other words, the number of accurate digits one gets in curvature estimation is at best half of that in the IT results. Third, the avoidance of geometric modeling of fluids renders it highly difficult to treat topological changes rigorously. When merging and separation happen, front-tracking methods have to resort to “surgical” operations that are short of theoretical justification. VOF methods and level-set methods have no special procedures for topological changes; this is often advertised as an advantage. However, by using this “automatic” treatment, an application scientist has no control over the evolution of an interface that undergoes topological changes: the evolution is determined not by the physics, but by particularities of numerical algorithms [43, 48]. Clearly, this disadvantage is a consequence of avoiding the geometric and topological modeling of fluids.
In this work, we aim to establish a theoretical foundation for fluid modeling. To prevent reinventing the wheel, we have tried to utilize the wealth of solid modeling, but found that none of the two main approaches in Section 1.1 is adequate for fluid modeling. Topology computing based on cell complexes involves much machinery, yet its efficiency may not be acceptable; nor are the r-sets suitable for fluid modeling. First, the requirement of r-sets being closed is not amenable to numerical analysis of IT methods [43]. Second, topological changes create on the fluid boundary a special type of non-manifold points, such as the points in Figure 1, which cause non-uniqueness of boundary representations, c.f. Figure 5. This non-uniqueness degrades isomorphisms to homomorphisms in the association of algebraic structures with elements in the topological modeling space. Third, r-sets can be modified to yield a new Boolean algebra whose implementation is much simpler and more efficient.
1.3 Boolean operations
The operations to be performed on the modeling space are an indispensable part of the modeling process; after all, a major purpose of modeling is to answer questions on the objects being modeled. Hence theoretically a modeling space is shaped by primary cases of queries. Computationally, these operations should be defined algebraically and constructively so that they furnish realizable algorithms that finish in reasonable time.
We are interested in Boolean operations on physically meaningful regions with arbitrarily complex topologies. This interest follows naturally from the motivations in Section 1.2. First, we have shown that algorithms for clipping splinegons with a linear polygon can improve the IT accuracy by many orders of magnitudes [48]. Second, for coupling an IT method to an Eulerian main flow solver, regions occupied by the fluid inside fixed control volumes are needed to define averaged values and to construct stencils for approximating spatial operators with linear combinations of these averaged values. Third, in handling topological changes, the emerging time and sites of non-manifold points need to be detected on the fluid boundary before we are able to decide how to evolve it. This detecting problem requires calculating intersections of multiple regions inside a single control volume.
Boolean operations on polygons are an active and intense research topic in many related fields such as computational geometry, computer graphics, CAD, and geographic information system (GIS). In particular, physically meaningful regions in GIS such as parks, roads, and lakes are represented by polygons and their Boolean operations are essential for extracting information and answering queries. Consequently, there exist numerous papers on this topic; see, e.g., [38, 18, 41, 10, 24, 19, 7, 36, 21] and references therein. However, many current algorithms are subject to strong restrictions on operand polygons such as convexity, simple-connectedness, and no self-intersections. In addition, most algorithms fail for degenerate cases such as a vertex of a polygon being on the edge of the other polygon; these degenerate scenarios, nonetheless, are at the core of characterizing and treating topological changes. Therefore, current Boolean algorithms are not suitable for fluid modeling.
As another main reason for their lack of applicability in multiphase flows, very few of current Boolean algorithms have a solid mathematical foundation, and those that do have other notable drawbacks. For example, Boolean algorithms based on cell complexes [26, 32] seem to be inefficient for complex topologies. Those based on Nef polyhedra [23, 3, 11] have an elegant theoretical foundation and is applicable to arbitrarily complex topologies, but they appear as an overkill for fluid modeling in that many elements in the modeling space of Nef polyhedra do not have counterparts in multiphase flows. In addition, the corresponding algorithms and data structures are complicated and difficult to implement. For both types of algorithms, computing the topological information such as Betti numbers would be very time-consuming.
1.4 Motivations and contributions of this work
Methods that couple elementary concepts or tools from multiple disciplines often perform surprisingly well. For fluid-structure interactions, a recent approach called isogeometric analysis [6, 1] has been increasingly popular, and much of its success is due to the integration of finite element methods with highly accurate (and sometimes exact) solid modeling in CAD. In our previous work, we have adopted a similar guiding principle to integrate IT with a topological space for fluid modeling [49]. The resulting generic framework, called MARS, furnishes new tools for analyzing current IT methods [43] and leads to a new IT method and a new curvature-estimation algorithm that are more accurate than current methods by many orders of magnitudes [47, 48].
In recognition of the potentially large benefits of integrating fluid modeling with multiphase flows and in view of the discussions in previous subsections, we list a number of questions as the driving forces behind this work.
- (Q-1)
Can we propose a generic topological space that appropriately models physically meaningful regions across multiple research fields such as solid modeling, GIS, and multiphase flows? 2. (Q-2)
Can we find a simple representation scheme for elements in the modeling space to facilitate geometric and topological queries? 3. (Q-3)
Can we design simple and efficient Boolean operations that correctly handle all degenerate cases? 4. (Q-4)
In particular, can we provide theoretical underpinning and algorithmic support for handling topological changes of moving regions? 5. (Q-5)
Meanwhile, can we extract topological information such as Betti numbers with optimal complexity?
In this paper, we provide positive answers to all of the above questions. (Q-1) is answered in Section 3, where physically meaningful regions are modeled by a topological space, called the Yin space, which consists of regular open semianalytic sets with bounded boundaries. These conditions capture fluid features that are commonly relevant in multiphase flows, solid modeling, and GIS. Furthermore, Yin sets are defined in terms of computable mathematical properties and are thus independent of any particular representation or individual application. As such, this modeling space serves as a bridge between multiphase flows and the other fields that emphasize geometry and topology. As our answer to (Q-2), each Yin set can be uniquely expressed as the result of finite Boolean operations on interiors of oriented Jordan curves. This uniqueness leads to an isomorphism from the Yin space into the Jordan space, a collection of certain posets of oriented Jordan curves, and this isomorphism reduces Boolean algebra on the two-dimensional Yin space to one-dimensional routines in the Jordan space, namely locating a point relative to a simple polygon and finding intersections of curve segments. This is our answer to (Q-3); see Section 4.
In addressing (Q-4), we pay special attentions to issues related to non-manifold points on the fluid boundary, such as characterizing topological changes with improper intersections of curves and dividing closed curves at these improper intersections to ensure correctness of Boolean operations. However, we emphasize that, in both our theory and our algorithms, non-manifold points of topological changes are treated not as an anomaly, but as a natural consequence of capturing the physical meaningfulness of fluids with the mathematical conditions that constitute the notion of Yin sets. This is a major advantage of the Yin sets over the r-sets.
As another prominent feature of our theory, the number of connected components in any bounded Yin set is simply the number of positively oriented Jordan curves in its boundary representation, and the number of holes in a component is the number of negatively oriented Jordan curves in the boundary representation of that component. Since these numbers are returned in time, our answer to (Q-5) is of optimal complexity.
The rest of this paper is organized as follows. In Section 2, we introduce prerequisites and notation. In Section 3, we propose Yin sets as our fluid modeling space and study its topological properties. In Section 4, we design Boolean operations on the Yin space in a way so that corresponding algorithms can be implemented by straightforward orchestration of the definitions. Utilizing the Bentley-Ottmann paradigm of plane sweeping [2] in calculating intersections of curve segments, our current implementation of the Boolean operations is close to optimal complexity. A number of fun tests are given in Figure 13 to illustrate the Boolean algebra. Finally, we draw the conclusion and discuss several research prospects in Section 5.
2 Preliminaries
In this section we collect relevant definitions and theorems that form the algebraic foundation of this work. Some notations introduced here will be repeatedly used in subsequent sections.
2.1 Partially ordered sets
The Cartesian product of a nonempty set with itself times is denoted by ; in particular, . An -ary relation on is a subset of ; if it is called a binary relation. A given binary relation “” on a set is said to be an equivalence relation if and only if it is reflexive (), symmetric (), and transitive () for all . A binary relation “” defined on a set is a partial order on if and only if it is reflexive (), antisymmetric (), and transitive () for all .
A nonempty set with a partial order on it is called a partially ordered set, or more briefly a poset. Two elements are comparable if either or ; otherwise and are incomparable. If all are comparable by , then “” is a total order on and is a chain or linearly-ordered set. For examples, with the usual order of real numbers is a chain; the power set of , i.e. the set of all subsets of , with the subset relation “” is a poset but not a chain. The notation means , and means both and .
Definition 1** (Covering relation).**
Let denote a poset and . We say covers and write or if and only if and no element satisfy .
Most concepts on the ordering of make sense for posets. Let be a subset of a poset . An element is an upper bound of if for all . is the least upper bound of , or supremum of () if is an upper bound of , and for any upper bound of . Similarly we can define the concepts of a lower bound and the greatest lower bound of or the infimum of ().
Definition 2** (Lattice as a poset).**
A lattice is a poset satisfying that, for all , both sup and inf exist in .
2.2 Distributive Lattices
An -ary operation on is a function where is the arity of . A finitary operation is an -ary operation for some nonnegative integer . is nullary (or a constant) if its arity is zero, i.e. it is completely determined by the only element , hence a nullary operation on can be identified with the element ; for convenience it is regarded as an element of . An operation on is unary or binary if its arity is 1 or 2, respectively.
Definition 3** (Universal algebra).**
A algebra is an ordered pair where is a nonempty set and a family of finitary operations on . The set is the universe or the underlying set of and the fundamental operations of .
An algebra is finite if the cardinality of its universe is bounded. When is finite, say , we also write with the operations sorted by their arities in descending order. As a common example, a group is an algebra of the form where are a binary, a unary, and a nullary operations on , respectively.
Definition 4** (Lattice as an algebra).**
A lattice is an algebra where contains two binary operations and (read “join” and “meet” respectively) on that satisfy the following axiomatic identities for all ,
- (LA-1)
commutative laws: , ; 2. (LA-2)
associative laws: , ; 3. (LA-3)
absorption laws: , .
Sometimes the following idempotent laws are also included in the definition of a lattice although they can be derived from the above three axioms,
[TABLE]
A lattice defined as a poset can be converted to an algebra by constructing the binary operations as and ; the converse case can also be achieved by defining the partial order as . Hence Definition 2 and Definition 4 are equivalent.
Definition 5**.**
A bounded lattice is an algebra where contains binary operations and nullary operations so that is a lattice and, ,
[TABLE]
The boundedness in the above definition is best understood from the poset viewpoint: and for all .
Definition 6**.**
A distributive lattice is a lattice which satisfies either of the distributive laws
[TABLE]
Either identity in (6) can be deduced from the other and Definition 4 [5, p. 10].
A notion central to every branch of mathematics is isomorphism. In particular, two lattices are isomorphic if they have the same structure.
Definition 7** (Lattice isomorphism).**
A homomorphism of the lattice into the lattice is a map satisfying
[TABLE]
An isomorphism is a bijective homomorphism.
More details on distributive lattices can be found in [5] from the perspective of universal algebra and in [37, ch. 3] from the viewpoint of posets. See [9] for a more accessible one.
2.3 Boolean algebra
The simplest definition may be due to Huntington [13].
Definition 8**.**
A Boolean algebra is an algebra of the form
[TABLE]
where the binary operations , the unary operation called complementation, and the nullary operations satisfy
- (BA-1)
the identity laws: , , 2. (BA-2)
the complement laws: , , 3. (BA-3)
the commutative laws (LA-1), 4. (BA-4)
the distributive laws (6).
Other definitions contain redundant axiomatic laws that can be deduced from the above four conditions. For example, Givant and Halmos [8, p. 10] defined a Boolean algebra as an algebra with its fundamental operations satisfying (LA-1), (LA-2), (4), (5), (6), (BA-1), (BA-2), , , , and the DeMorgan’s laws,
[TABLE]
In this work we adopt the viewpoint of Burris and Sankappanavar [5, p. 116].
Definition 9**.**
A Boolean algebra is a bounded distributive lattice with an additional complementation operation that satisfies the complement laws (BA-2).
2.4 Veblen’s theorem
A graph is an ordered pair where is the set of vertices and the set of edges, each edge being an unordered pair of distinct vertices. is a subgraph of , written as , if and . If , then and are adjacent in , and the edge is said to be incident to and . The degree of a vertex is the number of edges incident to .
Definition 10**.**
A path is a graph of the form and . A cycle is a graph of the form where is a path and .
A graph is connected if for every pair of distinct vertices in there is a subgraph of as the path from one vertex to the other. A component of the graph is a maximal connected subgraph.
Theorem 11** **(Veblen
[42]).
The edge set of a graph can be partitioned into edge-disjoint cycles if and only if the degree of every vertex is even.
Proof.
If a graph is the union of a number of edge-disjoint cycles, then clearly a vertex contained in cycles has degree . Hence the necessity holds.
Suppose that the degree of every vertex is a positive even integer. How do we find a single cycle in ? Let be a path of maximal length in . Since , must have another neighbor in addition to . Furthermore, we must have for some ; otherwise it would contradict the starting condition that is of maximal length. Therefore we have found a cycle .
Having found one cycle, we remove it from . If the remaining subgraph of is not empty, then the degree of every vertex in remains positive and even. Repeating the cycle-finding procedures completes the proof; see [4, p. 5]. ∎
A multigraph is an augmented graph that allows loops and multiple edges; the former is defined as a special edge joining a vertex to itself and the latter several edges joining the same vertices. A loop contributes 2 to the degree of a vertex while each edge in a multiple edge contribute 1. As for cycles, the condition of in Definition 10 is changed to for a multigraph: indicates a loop and two edges joining the same vertices. It is straightforward to extend Theorem 11 to multigraphs.
Theorem 12**.**
The edge set of a multigraph can be partitioned into edge-disjoint cycles if and only if the degree of each vertex is positive and even.
A directed graph/multigraph is a graph/multigraph where the edges are ordered pairs of vertices. An edge is then said to start at and end at . Furthermore, the degree of a vertex is split into the outdegree and the indegree , with the former as the number of edges starting at and the latter that of edges ending at . Veblen’s Theorem generalizes to directed multigraphs in a straightforward manner.
Theorem 13**.**
The edge set of a directed multigraph can be partitioned into directed cycles if and only if each vertex has the same outdegree and indegree.
3 Yin sets
Based on regular semianalytic sets introduced in Section 3.1, we propose in Section 3.2 the Yin space for fluid modeling in two dimensions. From the viewpoint of Jordan curves in Section 3.3, we study in Section 3.4 the local and global topology of Yin sets, the results of which yield the notion of realizable spadjors in Section 3.5 as a unique boundary representation of Yin sets.
3.1 Regular semianalytic sets
In a topological space , the complement of a subset , written , is the set . The closure of a set , written , is the intersection of all closed supersets of . The interior of , written , is the union of all open subsets of . The exterior of , written , is the interior of its complement. By the identity [8, p. 58], we have . A point is a boundary point of if and . The boundary of , written , is the set of all boundary points of . It can be shown that and . An open set is regular if it coincides with the interior of its own closure, i.e. if . A closed set is regular if it coincides with the closure of its own interior, i.e. if . The duality of the interior and closure operators implies , hence is a regular open set if and only if . For any subset , it can be shown that is a regular open set and is a regular closed set.
Regular sets, open or closed, capture the salient feature that physically meaningful regions are free of lower-dimensional elements such as isolated points and curves in 2D and dangling faces in 3D.
Theorem 14** **(MacNeille [20]
and Tarski [39]).
Let denote the class of all regular open sets of a topological space and define for all . Then is a Boolean algebra.
Proof.
See [8, §10]. ∎
Similarly, it can be shown that, with appropriately defined operations, regular closed sets of a topological space also form a Boolean algebra [17, p. 39].
Regular sets are not perfect for representing physically meaningful regions yet: some of them cannot be described by a finite number of symbol structures. For example, some sets have nowhere differentiable boundaries, which, in their parametric forms, are usually infinite series of continuous functions [33]. Another pathological case is more subtle: intersecting two regular sets with piecewise smooth boundaries may yield an infinite number of disjoint regular sets. Consider
[TABLE]
Although both and are described by two inequalities, their intersection is a disjoint union of an infinite number of regular sets; see [28, Fig. 4-1, Fig. 4-2]. This poses a fundamental problem that results of Boolean operations of two regular sets may not be well represented on a computer by a finite number of entitites.
Therefore, we need to find a proper subspace of regular sets, each element of which is finitely describable. This search eventually arrives at semianalytic sets.
Definition 15**.**
A set is semianalytic if there exist a finite number of analytic functions such that is in the universe of a finite Boolean algebra formed from the sets
[TABLE]
The ’s are called the generating functions of . In particular, a semianalytic set is semialgebraic if all of its generating functions are polynomials.
Recall that a function is analytic if and only if its Taylor series at converges to the function in some neighborhood for every in its domain. In the example of (10), is semianalytic while is not, because the Taylor series of at the origin does not converge. Roughly speaking, the boundary curves of regular semianalytic sets are piecewise smooth.
3.2 :
the Yin space for fluid modeling
Regular closed semianalytic sets have been an essential mathematical tool for solid modeling since the dawning time of this field [31]. However, as shown in Figure 5, requiring regular semianalytic sets to be closed would make their boundary representation not unique, degrading the isomorphism in Definition 33 and Theorem 34 to a homomorphism. As another work closely related to this one, the analysis on a family of interface tracking methods [43, 49] via the theory of donating regions [44, 45] also requires that the regular sets be open. Therefore, only regular open semianalytic sets are employed in this work.
Definition 16**.**
A Yin set111 Yin sets are named after the first author’s mentor, Madam Ping Yin. As a coincidence, the most important dichotomy in Taoism consists of Yin and Yang, where Yang represents the active, the straight, the ascending, and so on, while Yin represents the passive, the circular, the descending, and so on. From this viewpoint, straight lines and Jordan curves can be considered as Yang 1-manifolds and Yin 1-manifolds, respectively. is a regular open semianalytic set whose boundary is bounded. The class of all such Yin sets form the Yin space .
In Figure 1, the Yin set in subplot (a) is unbounded and connected while that in subplot (b) is bounded and consists of four disjoint components.
By Definition 15, semianalytic sets are closed under set complementation, finite union, and finite intersection. Then by Theorem 14, regular open semianalytic sets form a Boolean algebra since they are the intersection of the universes of two Boolean algebras. Furthermore, Boolean operations on Yin sets preserve the attribute of a bounded boundary being bounded, hence we have
Theorem 17**.**
The algebra is a Boolean algebra.
3.3 Jordan curves and orientations
A path in from to is a continuous map satisfying and . A subset of is path-connected if every pair of points of can be joined by a path in . Given , define an equivalence relation on by setting if there is a path-connected subset of that contains both and . The equivalence classes are called the path-connected components of .
A planar curve is a continuous map . It is smooth if the map is smooth. It is simple if the map is injective; otherwise it is self-intersecting. Although strictly speaking a curve is a map, we also use to refer to its image. Two distinct piecewise smooth curves and intersect at if there exist such that . Then is the intersection of and . For an open ball with sufficiently small radius , consists of two disjoint connected regular open sets. If is entirely contained in one of these two sets, is an improper intersection; otherwise it is a proper intersection. Two curves are disjoint if they have neither proper intersections nor improper ones. Suppose upon its extension to a path, a simple curve further satisfies , then is a simple closed curve or Jordan curve.
Theorem 18** (Jordan Curve Theorem [14]).**
The complement of a Jordan curve in the plane consists of two components, each of which has as its boundary. One component is bounded and the other is unbounded; both of them are open and path-connected.
The above theorem states that a Jordan curve divides the plane into three parts: itself, its interior, and exterior.
Definition 19**.**
The interior of an oriented Jordan curve , denoted by , is the component of the complement of that always lies to the left when an observer traverses the curve in the increasing direction of the parameterization .
A Jordan curve is said to be positively oriented if its interior is the bounded component of its complement; otherwise it is negatively oriented. The orientation of a Jordan curve can be flipped by reversing the increasing direction of the parameterization. The following notion will be used throughout this work.
Definition 20**.**
Two Jordan curves are almost disjoint if they have no proper intersections and at most a finite number of improper intersections.
3.4 The local and global topology of a Yin set
The following lemma characterizes the local topology of a Yin set at its boundary.
Lemma 21**.**
Let be a boundary point of a Yin set and denote by the open ball centered at with its radius . For any sufficiently small ,
- (a)
* consists of simple curves, where is a finite positive integer,* 2. (b)
if , all simple curves in (a) intersect and is their sole intersection, 3. (c)
* consists of an even number of disjoint regular open sets; for two such sets sharing a common boundary, one is a subset of while the other that of . *
Proof.
Since is semianalytic, Definition 15 implies that is defined by a finite number of analytic functions . By the implicit function theorem, each defines a planar curve. Then (a) and (b) follows from the condition of being regular open and the condition that can be as small as one wishes. Hence the local topology at a boundary point can be characterized by the number of the aforementioned curves that intersect at , as is shown in Figure 2.
By (a), (b), and the fact of being regular open, consists of an even number of disjoint regular open sets. Consider two such sets that share a common boundary. Suppose both of them are subsets of , then it contradicts the fact of being regular. Suppose both of them are subsets of , then it contradicts the fact of their common boundary being a subset of . Hence (c) follows. ∎
The above lemma on the local topology naturally yields a result on the global topology of a connected Yin set.
Theorem 22**.**
For a connected Yin set , its boundary can be uniquely partitioned into a finite set of pairwise almost disjoint Jordan curves.
Proof.
Without loss of generality, we focus on a single connected component of . By Lemma 21, a boundary point can be classified into two types according to , the number of curves that intersect at .
If all boundary points satisfy , the condition of being bounded implies that this connected component of must be a single Jordan curve. Hence the statement holds trivially.
Otherwise a finite number of boundary points satisfy . Then we construct a multigraph by setting its vertex set as and by obtaining its edges from dividing with . By Lemma 21 (a), (b), and being connected, the degree of each vertex in is even. Then it follows from Theorem 12 that we can decompose into edge-disjoint cycles. As shown in Figure 3, the decomposition is performed by requiring that, at each vertex , two edges incident to are assigned to the same cycle if and only if they belong to the boundary of the same connected component of . Consequently, no edges in different cycles intersect properly at each self-intersection, hence the resulting Jordan curves are pairwise almost disjoint.
Finally, we show that the decomposition in Figure 3 is the only valide choice. Consider the other possibilities shown in Figure 4. If the two edges in the same cycle are not adjacent as in Figure 4 (a), then two cycles would have a proper intersection at , which contradicts the condition of the Jordan curves having no proper intersections. As for the last possibility shown in Figure 4 (b), two edges in the same cycle are adjacent but they both belong to the boundary of some connected component of . Then we can draw Jordan curves that contain them. The simpleness of a Jordan curve implies . Then there exist two points that belong to the bounded complements of and , respectively. Because is connected, there exists a path within that connects and . By Theorem 18, this path has to intersect at some point, say . The construction of this path implies ; the construction of implies . This is a contradiction because is open. ∎
The above proof hinges on the fact of a Yin set being open, so Theorem 22 may not hold for the closure of a Yin set. As shown in Figure 5, the decomposition of the boundary of a regular closed set is not unique. This is a main reason that we do not model physically meaningful regions with regular closed sets.
To relate to its boundary Jordan curves, we first define a partial order on Jordan curves.
Definition 23** (Inclusion of Jordan curves).**
A Jordan curve is said to include , written as or , if and only if the bounded complement of is a subset of that of . If includes and , we write or .
Definitions 1 and 23 yield a covering relation for Jordan curves.
Definition 24** (Covering of Jordan curves).**
Let denote a poset of Jordan curves with inclusion as the partial order. We say covers in and write ‘’ or ‘’ if and no elements satisfies .
Now we state the most important result of this subsection.
Theorem 25**.**
*Suppose a Yin set is connected. Then the Jordan curves as the unique decomposition of , given by the method shown in Figure 3, can further be uniquely oriented such that *
[TABLE]
, the set of oriented boundary Jordan curves of , must be one of the two types,
[TABLE]
where all ’s are negatively oriented, mutally incomparable with respect to inclusion. For , we also have
[TABLE]
Proof.
As in the proof of Theorem 22, we construct a multigraph from . is further made a directed multigraph via orienting so that always lies at the left side of any oriented Jordan curve. As shown in Figure 6, the indegree and outdegree of any vertex in equals. By Theorem 13, there exists at least one directed cycle decomposition of . Then the uniqueness of the directed cycle decomposition follows from the uniqueness of orienting the Jordan curves in Figure 6.
Consider the case . For , suppose that and is comparable, as shown in Figure 7(b). According to the orientation, must lie at the left side of both and , but this is impossible because both and are part of the boundary of . Consequently, (12) follows from Definition 19; see Figure 7(a).
Consider the case . If , then (14) holds vacuously and (12) holds trivially from Definition 19. For , suppose (14) did not hold for a negatively oriented Jordan curve . Then the almost disjointness implies that either or they are not comparable. Suppose the former case holds, a path from one point at the left of to another point at the left of must contain some points not in , which contradicts the condition of being connected; see Figure 7 (d). The latter case does not hold either because it contradicts the fact that is part of the boundary of ; see Figure 7 (e). Hence (14) must hold. By arguments in the previous paragraph, the negatively oriented Jordan curves must also be pairwise incomparable. Therefore, (12) follows from Definition 19; see Figure 7 (c).
Suppose contains two positively oriented Jordan curves . Then their almost disjointness implies that is either in the unbounded complement or the bounded complement of . By similar arguments, the former contradicts the fact of being connected, as in Figure 7 (f), and the latter contradicts the fact of both and are part of the boundary of , as in Figure 7 (f). Hence contains at most one positively oriented Jordan curve. This completes the proof. ∎
Corollary 26**.**
Each Yin set can be uniquely expressed as
[TABLE]
where is the index of connected components of and ’s are oriented Jordan curves that are pairwise almost disjoint.
Proof.
The conclusion follows from applying Theorem 25 to each connected component of . ∎
We illustrate (12) and (15) by the two distinct types of Yin sets in Figure 8.
By results on the global topology, it is straightforward to identify the Betti numbers of a Yin set with the numbers of oriented Jordan curves in its representation.
Corollary 27**.**
The number of holes in a connected Yin set is the number of negatively oriented Jordan curves in the unique expression (12). The number of connected components in a bounded Yin set is the number of positively oriented Jordan curves in the unique expression (15).
This simple result is due to the topological stratification of the Yin space and the natural correspondence of holes to negatively oriented Jordan curves.
3.5 :
representing Yin sets via realizable spadjors
Our starting point is the following acronym.
Definition 28**.**
A spadjor is a nonempty set of pairwise almost disjoint Jordan curves with orientations.
Not all spadjors are useful for representing Yin sets. The global topology of Yin sets in Theorem 25 and Corollary 26 naturally suggests that we should limit our attention to certain types of spadjors.
Definition 29**.**
An atom spadjor is a spadjor that consists of at most one positively oriented Jordan curve and a finite number of negatively oriented Jordan curves , , , such that
- (a)
’s are pairwise incomparable with respect to inclusion, 2. (b)
* for each .*
Since a spadjor cannot be an empty set, implies the presence of and the absence of implies . By definition, a spadjor is in the form of either or in (13).
The following boundary-to-interior map assigns to each atom spadjor a connected Yin set,
[TABLE]
Definition 30**.**
A realizable spadjor is the union of a finite number of atom spadjors such that and being distinct implies .
Intuitively, an atom spadjor represents a connected Yin set while a realizable spadjor may represent a Yin set with multiple connected components. For example, the Yin set in Figure 8(b) can be represented by the realizable spadjor
[TABLE]
Lemma 31 concerns recovering the atom spadjors in a realizable spadjor.
Lemma 31**.**
Any realizable spajor can be uniquely expressed as
[TABLE]
where the ’s and the are extracted from as follows.
- (R2A-a)
For each positively oriented Jordan curve , form an atom spadjor by adding and all negatively oriented Jordan curves covered by . 2. (R2A-b)
If there are negatively oriented Jordan curves left in , group them into an atom spadjor .
Proof.
The existence of the expression in (18) follows from Definition 30 and Theorem 25. As for the uniqueness, we first note that at most one atom spadjor in the form of can be extracted from any realizable spadjor; otherwise it would contradict the condition in Definition 30. Second, and imply that the positively oriented Jordan curve of any is covered by a negatively oriented element . Third, any negatively oriented Jordan curve not belonging to can be covered by at most one . ∎
The partition of a realizable spadjor into atom spadjors is best illustrated by the Hasse diagram of the poset with respect to inclusion, c.f. Figure 9.
Definition 32**.**
The Jordan space is the set
[TABLE]
where denotes the set of all realizable spadjors and , are two symbols satisfying
[TABLE]
One can interpret and as atom spadjors consisting of a single oriented Jordan curve with infinitesimal diameter such that its interior goes to and , respectively.
It now makes sense to extend the definition of the boundary-to-interior map in (16) and (20) to the Jordan space.
Definition 33**.**
The boundary-to-interior map associates a Yin set with each element in the Jordan space as
[TABLE]
where the ’s are atom spadjors extracted from as in Lemma 31.
Theorem 34**.**
The boundary-to-interior map in Definition 33 is bijective.
Proof.
For the Yin sets and , (20) states that and are their preimages. For any other Yin set , we can uniquely decompose it as , where the connected components ’s are pairwise disjoint. By Theorem 25, each is uniquely expressed as the intersection of interiors of a number of oriented Jordan curves. Hence is surjective. Also, is injective because of the uniqueness in Lemma 31. ∎
Corollary 35**.**
A Yin set is uniquely represented by a realizable spadjor.
Proof.
This follows from Theorem 34 and Corollary 26. ∎
We sum up this section by Figure 10, where a physically meaningful region with complex topology is modeled by a fun Yin set, which is further uniquely represented by a realizable spadjor.
4 The Boolean algebra on Yin sets
After introducing the pasting map in Section 4.1, we define in Sections 4.2 and 4.3 the complementation and the meet operations on realizable spadjors to equip the Jordan space as a bounded distributive lattice. Along the way, we show that these operations are counterparts to Boolean operations on the Yin space. Our theory culminates in Section 4.4. In Section 4.5, we discuss implementation issues and present a fun example of our Boolean algorithms on Yin sets.
4.1 The pasting map of realizable spadjors
The following cutting map is trivial, but its inverse in Lemma 37 is not. They are crucial for the complementation and the meet operations in Sections 4.2 and 4.3.
Definition 36**.**
For a realizable spadjor , let denote a finite point set that contains all intersections of the Jordan curves in . The associated cutting map or segmentation map assigns to a set of oriented paths obtained by dividing the oriented Jordan curve in at points in . The set of (oriented) paths is called a segmented realizable spadjor.
Lemma 37**.**
The realizable spadjor corresponding to a segmented realizable spadjor can be uniquely constructed as follows.
- (S2R-a)
Remove all self-loops in and insert them into . 2. (S2R-b)
Start with a path and denote by its ending point. If there exists only one path whose starting point is , call it and append it to . Otherwise, set to be the edge that starts at and of which the positive counter-clockwise angle is the smallest. Repeat the above conditional to grow the path until it becomes a loop , and remove from all paths that constitute . 3. (S2R-c)
If is a Jordan curve, add it into ; otherwise divide into Jordan curves and/or self-loops and add them into . 4. (S2R-d)
Repeat (S2R-b,c) to add other Jordan curves into until becomes empty.
Proof.
First we note that Theorem 22 is not applicable here because the Yin set may be disconnected. By Definition 19, the Yin set always lies at the left of any oriented path , the steps (S2R-a,b) are sufficient to fulfill this invariant. The choice for growing the path in (S2R-b) also avoids potential proper intersections of Jordan curves in ; see Figure 4(a). However, as suggested by Figure 4(b) and the proof of Theorem 22, the loop might not be a single Jordan curve, hence we need to divide it into Jordan curves and/or self-loops in (S2R-c); see Figure 11. The uniqueness of the constructed realizable spadjor follows from the uniqueness in Corollary 35. ∎
The procedures in Lemma 37 define the inverse of the cutting map, to which we refer as the pasting map of realizable spadjors.
4.2 Complementation: a unitary operation on
The following is an easy result on the local topology of regular sets.
Corollary 38**.**
Suppose is a regular open or regular closed set. Then a point is a boundary point of if and only if, for any sufficiently small , the open ball centered at with radius contains both points in and .
Proof.
The necessity follows directly from Lemma 21 (c), we only prove the sufficiency. If is sufficiently small, there are only seven cases for the type of points contained in : (i) , (ii) , (iii) , (iv) and , (v) and , (vi) and , and (vii) all three sets. Because of the regularity, cases (iii) to (vi) are impossible. By definitions in Section 3.1, (i) implies an interior point and (ii) implies an exterior point. Hence (vii) must imply a boundary point. In other words, the presence of and in dictates that of in . ∎
Corollary 38 and Lemma 37 motivate our complementation operation on .
Definition 39**.**
The complementation operation is defined as
[TABLE]
where is the set of improper intersections of Jordan curves in and the orientation-reversing map reverses the orientation of each path in the segmented realizable spadjor .
Lemma 40**.**
The complementation operation in Definition 39 satisfies
[TABLE]
Proof.
By definition, a regular set satisfies , which, together with Corollary 38, imply that and have exactly the same boundary. By Corollary 26 and Definition 19, the realizable spadjors representing and are the same set of Jordan curves except that each pair of corresponding Jordan curves has different orientations, which justifies the necessity of the orientation-reversing map . More precisely, the conjugate of by the cutting map is needed here because multiple improper intersections of two Jordan curves may dictate that the paths constituting oriented Jordan curves in be reorganized in order to represent properly. For example, the calculation of for the Yin set in Figure 11 (b) involves not only reversing the orientation of each path, but also reorganizing these paths into different Jordan curves. ∎
4.3 Meet: a binary operation on
To define the meet of two realizable spadjors and , we cut them by , select those paths that are on the boundary of the Yin set , and paste the set of selected paths by to form the result. Lemma 41 and Corollary 42 tell us which paths we should choose.
Lemma 41**.**
Denote where and are two oriented Jordan curves. For a curve satisfying and , we have if and only if . For a curve satisfying , we have if and only if the direction of induced from the orientation of is the same as that induced from the orientation of .
Proof.
We only prove the first statement since the second one can be shown similarly. By Definition 19, and are both Yin sets. It follows from Theorem 17 that is also a Yin set. By Corollary 38, it suffices to show that a small open ball centered at contains both points in and if and only if . As shown in Figure 12, and imply that ; then the condition implies . DeMorgan’s law (9) yields
[TABLE]
which, together with , imply . By Corollary 38, we have . Conversely, , , and imply that for all . These arguments are illustrated in Figure 12. ∎
Hereafter we write the union of all Jordan curves in a realizable spadjor as
[TABLE]
which is clearly a subset of .
Corollary 42**.**
Denote where and are two realizable spadjors. For a curve satisfying and , we have if and only if . For a curve satisfying , we have if and only if the direction of induced from the orientation of is the same as that induced from the orientation of .
Definition 43**.**
The meet of two realizable spadjors and is a binary operation defined as
[TABLE]
where the pasting map is defined in Lemma 37, and the directed multigraph is constructed as follows.
- (MRS-a)
The set may contain paths and isolated points. Initialize as an empty set; add into all path endpoints and isolated points in . 2. (MRS-b)
Cut with points in and we have a set of paths . Initialize as an empty set. 3. (MRS-c)
*For each , add it to if minus its endpoints is contained in , or, if there exists such that and they have the same direction. In particular, if is a Jordan curve that satisfies either of the above conditions, we insert as a self-loop into . * 4. (MRS-d)
*For each , add it to if minus its endpoints is contained in . *
Lemma 44**.**
The meet operation in Definition 43 satisfies
[TABLE]
Proof.
Denote . It follows from Corollary 42 that each path is added to in step (MRS-c) if and only if ; similarly, each curve is added to in step (MRS-d) if and only if . Hence the union of the vertices and edges in constitute the boundary of . Furthermore, by the difference between (MRS-c) and (MRS-d), each edge on is inserted into only once. Therefore, contains and only contains points on . The proof is then completed by Lemma 37 and Corollary 35. ∎
4.4 The Yin space
and the Jordan space are isomorphic
The join operation can be expressed by the meet operation and the complementation operation; this is also true for all other Boolean operations.
Definition 45**.**
The join of two realizable spadjors and is a binary operation defined as
[TABLE]
The following theorem is the theoretical culmination of this paper.
Theorem 46**.**
The Boolean algebras and are isomorphic under the boundary-to-interior map in Definition 33.
Proof.
This follows directly from Lemmas 40 and 44, Definitions 33 and 45, and DeMorgan’s law (9). ∎
As the desired consequence, we have reduced the two-dimensional problems , , and ⟂ to the one-dimensional problems , , and ′.
4.5 Algorithmic implementation
Purely algebraic and constructive as they are, Definitions 39, 43, and 45 already constitute a complete set of Boolean algorithms on Yin sets. We implement these algorithms and perform a variety of test cases to validate our theory and verify our implementation; some fun examples are shown in Figure 13.
In our implementation, the data structure of Yin sets is a straightforward orchestration of the realizable spadjor, i.e. a set of point arrays and each point array represent a polygon, with its orientation indicated by the direction of the points. In particular, the user does not need to specify the pairwise inclusion relations of the boundary Jordan curves, since the computation of this information is encapsulated inside the algorithms. So long as each input Yin set is indeed a realizable spadjor, the algorithm returns the correct result. These designs make the software interface simple, flexible, and user-friendly.
As one distinguishing feature, the user can control the uncertainty of Boolean operations of our implementation. Given a small positive real number , we define two points to be the same point if their distance is smaller than . A consistent enforcement of this definition and its implications across the entire package makes our implementation robust and provides an effective mechanism to handle various degenerate cases that characterize topological changes.
It is well known in the community of computational geometry that intersecting line segments might lead to unavoidable self-inconsistencies and cause a program to abort at the run time [16]. The mathematical core of this difficulty is the potentially arbitrary ill-conditioning of intersecting line segments in an unlimited range of length scales. In the context of numerically simulating multiphase flows, there always exists a length scale below which finer details are not needed. Hence this uncertain parameter is not only a device of flexibility and convenience, but more importantly a simple fix of the aforementioned robustness problem in computational geometry.
In calculating intersections of a set of line segments, we modify the standard line sweep algorithm in [2][7, Chap. 2] to enforce this uncertainty criterion. We also need to frequently determine whether or not a point belongs to the interior, the exterior, or the boundary of a polygon; for this purpose, we expand the simple algorithm in [24, Sec. 7.4] so that it applies not only to simple polygons but also to realizable spadjors. These algorithmic details of our implementation will be reported in a separate paper.
5 Conclusion
We have introduced the problem of fluid modeling in multiphase flows as a counterpart of solid modeling in CAD, and have proposed to solve this problem via the Yin space, a topological space equipped with a simple, efficient, and complete Boolean algebra. Under this framework, topological changes of deforming Yin sets can be characterized and handled naturally and topological information such as Betti numbers can be extracted in constant time.
Several prospects for future research follow. The theory and algorithms on the Yin space can be generalized to 2-manifolds in a straightforward manner. Another generalization of Yin sets to three dimensions is currently a work in progress. Finally, it would be exciting to couple Yin sets with high-order finite-volume methods [46] to form fourth- and higher-order solvers for simulating multiphase flows such as free-surface flows and fluid-structure interactions.
Acknowledgments. This work was supported by the grant with approval number 11871429 from the national natural science foundation of China. The authors thank Difei Hu for digitizing the panda image.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Y. Bazilevs, K. Takizawa, and T. E. Tezduyar , Computational Fluid-structure Interaction: Methods and Applications , Wiley Series in Computational Mechanics, Wiley, 2013.
- 2[2] J. L. Bentley and T. A. Ottmann , Algorithms for reporting and counting geometric intersections , IEEE Trans. Comput., C-28 (1979), pp. 643–647.
- 3[3] H. Bieri , Nef polyhedra: A brief introduction , in Geometric Modelling, H. Hagen, G. Farin, and H. Noltemeier, eds., Vienna, 1995, Springer Vienna, pp. 43–60.
- 4[4] B. Bollobás , Modern Graph Theory , vol. 184 of Graduate Texts in Mathematics, Springer-Verlag, New York, corrected ed., 2008. ISBN:0-387-98488-7.
- 5[5] S. Burris and H. P. Sankappanavar , A Course in Universal Algebra , Springer, the millennium ed., 2012. ISBN:978-0-9880552-0-9.
- 6[6] J. A. Cottrell, T. J. R. Hughes, and Y. Bazilevs , Isogeometric Analysis: Toward Integration of CAD and FEA , Wiley, Chichester, 2009.
- 7[7] M. de Berg, O. Cheong, M. van Kreveld, and M. Overmars , Computational Geometry: Algorithms and Applications , Springer, 3rd ed., 2008.
- 8[8] S. Givant and P. Halmos , Introduction to Boolean Algebras , Springer, 2009.
