Any specification of a domain of integration must be able to identify on a mesh the set of cells on which a particular integration is to be done. In general, then, a specification of a subregion is a specification of a filter that can extract from a mesh the subset of cells which satisfies some condition, i.e., those cells that "pass through" the filter. The Sundance CellFilter object does this job, acting on a Mesh to produce a set of cells. Internally, a set of cells will be represented in a number of ways depending on the properties of the set; the important thing to understand is that the interface to a cell set is an abstract iterator. Thus a CellFilter is utlimately an operator, acting on a Mesh, which produces an iterator that can sequence through those cells that pass through the filter. Looping over cells in system assembly is done using iterators returned by CellFilter operations.
CellFilter::labeledSubset()operators produce new CellFilters that pick out a subset of the cells satisfying an additional condition given in the argument to the subset methods.
subset() method of CellFilter takes as an argument a CellPredicate object. A CellPredicate is an operator that acts on a cell and returns a boolean variable. It is described further in the section on CellFilter Predicates below.
labeledSubset() method of CellFilter takes as an argument an integer. Each cell in a Mesh has an optional integer label field, and
labeledSubset() identifies those cells having a given label. Most mesh generation programs have the ability to associate labels with regions of a solid model. In practice, identifying regions by label is the most common method of filtering cells.
bare CellFilters whose
getCells()methods produce CellSets and , respectively. There exist operators for the following binary operations:
a+b.The result of a union operation is a filter that will produce the union of the two operand's cell sets,
i.e., all cells that are in either or
a.intersection(b)The result of an intersection operation is a filter that will produce the intersection of the two operand's cell sets,
i.e., all cells that are in both and
a-b.The result of an exclusion operation is a filter that will produce the exclusion (or set difference) of the two operand's cell sets,
i.e., all cells that are in but not in
CellFilter elements = new MaximalCellFilter(); CellFilter leftHalf = elements.subset( x <= 0.0 ); CellFilter topHalf = elements.subset( x >= 0.0 ); CellFilter topLeftQuarter = leftHalf.intersection(topHalf); CellFilter