Public Member Functions | Related Functions
Sundance::CellFilter Class Reference

CellFilter is a user-level object representing a filter that selects from a mesh all cells that satisfy some condition. More...

Inheritance diagram for Sundance::CellFilter:
Sundance::OrderedHandle< CellFilterStub > Sundance::Handle< CellFilterStub > Sundance::ObjectWithVerbosityBase

List of all members.

Public Member Functions

 ORDERED_HANDLE_CTORS (CellFilter, CellFilterStub)
CellSet getCells (const Mesh &mesh) const
 Find the cells passing this filter on the given mesh.
int dimension (const Mesh &mesh) const
 Return the dimension of this cell set on the given mesh.
CellFilter operator+ (const CellFilter &other) const
 Return a filter that returns the set union of the sets produced by the two operand filters.
CellFilter operator- (const CellFilter &other) const
 Return a filter that returns the set difference between the sets produced by the two operand filters.
CellFilter intersection (const CellFilter &other) const
 Return a filter that returns the set intersection of the sets produced by the two operand filters.
CellFilter labeledSubset (int label) const
 Return a filter that returns the subset of cells for which the logical expression is true.
CellFilter subset (const CellPredicate &test) const
 Return a filter that will return the subset of cells for which the given predicate is true.
CellFilter subset (const RCP< CellPredicateFunctorBase > &test) const
 Return a filter that will return the subset of cells for which the given predicate is true.
const Set< CellFilter > & knownSubsets () const
 Return a compilation of all registered subsets of this filter.
const Set< CellFilter > & knownDisjoints () const
 Return a compilation of all filters registered as disjoint with this filter.
bool isKnownSubsetOf (const CellFilter &other) const
 Indicate whether this filter is known to be a subset of the specified filter.
bool isKnownDisjointWith (const CellFilter &other) const
 Indicate whether this filter is known to be disjoint with the specified filter.
bool isSubsetOf (const CellFilter &other, const Mesh &mesh) const
 Do a brute-force check of whether this filter is a subset of the specified filter.
bool isDisjointWith (const CellFilter &other, const Mesh &mesh) const
 Do a brute-force check of whether this filter is disjoint with the specified filter.
void registerSubset (const CellFilter &sub) const
 Register a subset.
void registerDisjoint (const CellFilter &sub) const
 Register a filter known to be disjoint.
void registerLabeledSubset (int label, const CellFilter &sub) const
 Register a labeled subset.
bool isNullCellFilter () const
 Indicate whether this is a null cell filter.
bool areFacetsOf (const CellFilter &other, const Mesh &mesh) const
 Determine whether all cells identified by this filter are facets of cells identified by the other filter.
bool isNull () const
 Indicate whether this cell set is null.
bool operator== (const CellFilter &other) const
bool operator!= (const CellFilter &other) const
XMLObject toXML () const
std::string toString () const
void setName (const std::string &name)
const CellFilterBasecfbPtr () const
CellFilterBasenonConstCfbPtr ()

Related Functions

(Note that these are not member functions.)

typedef Array< CellFilterCellFilterArray
Array< CellFilterList (const CellFilter &a)
 Create an array with one entry.
Array< CellFilterList (const CellFilter &a, const CellFilter &b)
 Create an array with two entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c)
 Create an array with three entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d)
 Create an array with four entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d, const CellFilter &e)
 Create an array with five entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d, const CellFilter &e, const CellFilter &f)
 Create an array with six entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d, const CellFilter &e, const CellFilter &f, const CellFilter &g)
 Create an array with seven entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d, const CellFilter &e, const CellFilter &f, const CellFilter &g, const CellFilter &h)
 Create an array with eight entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d, const CellFilter &e, const CellFilter &f, const CellFilter &g, const CellFilter &h, const CellFilter &i)
 Create an array with nine entries.
Array< CellFilterList (const CellFilter &a, const CellFilter &b, const CellFilter &c, const CellFilter &d, const CellFilter &e, const CellFilter &f, const CellFilter &g, const CellFilter &h, const CellFilter &i, const CellFilter &j)
 Create an array with ten entries.

Detailed Description

CellFilter is a user-level object representing a filter that selects from a mesh all cells that satisfy some condition.

CellFilters are used to identify subdomains on which equations or boundary conditions apply. Examples of cell filters are to identify all cells on the boundary of the mesh, or all cells whose node positions satisfy some mathematical equation or inequality.

Use of CellFilter

 // Define a filter that will pick out all maximal cells located 
 // entirely in the left half-plane x < 0 
 CellFilter elements = new MaximalCellFilter();
 CellFilter leftHalf = elements.subset( x <= 0.0 );
 
 // Apply the leftHalf filter to a mesh, thus enumerating
 // all the cells of that mesh living in the left half-plane
 CellSet leftCells = leftHalf.getCells(mesh);

Set operations with CellFilter objects

Operations on cell filters can produce new filters.

The subset() and 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.

Binary set operations can also produce new filters. Suppose a and b are CellFilters whose getCells() methods produce CellSets $\{A\}$ and $\{B\}$, respectively. There exist operators for the following binary operations:

 CellFilter elements = new MaximalCellFilter();
 CellFilter leftHalf = elements.subset( x <= 0.0 );
 CellFilter topHalf = elements.subset( x >= 0.0 );
 CellFilter topLeftQuarter = leftHalf.intersection(topHalf);
 CellFilter 

Definition at line 120 of file SundanceCellFilter.hpp.


Member Function Documentation

bool Sundance::CellFilter::areFacetsOf ( const CellFilter other,
const Mesh mesh 
) const

Determine whether all cells identified by this filter are facets of cells identified by the other filter.

const CellFilterBase * CellFilter::cfbPtr ( ) const

Definition at line 306 of file SundanceCellFilter.cpp.

References Sundance::Handle< CellFilterStub >::ptr().

Referenced by dimension(), getCells(), and toString().

int CellFilter::dimension ( const Mesh mesh) const
CellSet CellFilter::getCells ( const Mesh mesh) const
CellFilter CellFilter::intersection ( const CellFilter other) const

Return a filter that returns the set intersection of the sets produced by the two operand filters.

Definition at line 139 of file SundanceCellFilter.cpp.

References Sundance::BinaryCellFilter::Intersection, isKnownDisjointWith(), isKnownSubsetOf(), isNull(), and registerSubset().

Referenced by Sundance::CFMeshPair::intersection().

bool Sundance::CellFilter::isDisjointWith ( const CellFilter other,
const Mesh mesh 
) const

Do a brute-force check of whether this filter is disjoint with the specified filter.

bool CellFilter::isKnownDisjointWith ( const CellFilter other) const

Indicate whether this filter is known to be disjoint with the specified filter.

Note that a negative answer here does NOT mean that it is not disjoint, only that it can't be determined to be one through structural properties alone. If this function returns false, then to get a definitive answer one must do a test using an actual realization on a mesh.

Definition at line 207 of file SundanceCellFilter.cpp.

References knownDisjoints().

Referenced by intersection(), and operator-().

bool CellFilter::isKnownSubsetOf ( const CellFilter other) const

Indicate whether this filter is known to be a subset of the specified filter.

Note that a negative answer here does NOT mean that it is not a subset, only that it can't be determined to be one through structural properties alone. If this function returns false, then to get a definitive answer one must do a test using an actual realization on a mesh.

Definition at line 201 of file SundanceCellFilter.cpp.

References knownSubsets().

Referenced by intersection(), isSubsetOf(), and operator-().

bool CellFilter::isNull ( ) const

Indicate whether this cell set is null.

Definition at line 52 of file SundanceCellFilter.cpp.

References isNullCellFilter(), and Sundance::Handle< CellFilterStub >::ptr().

Referenced by getCells(), intersection(), operator+(), and operator-().

bool CellFilter::isNullCellFilter ( ) const

Indicate whether this is a null cell filter.

Definition at line 47 of file SundanceCellFilter.cpp.

References Sundance::Handle< CellFilterStub >::ptr().

Referenced by dimension(), getCells(), and isNull().

bool CellFilter::isSubsetOf ( const CellFilter other,
const Mesh mesh 
) const

Do a brute-force check of whether this filter is a subset of the specified filter.

Definition at line 215 of file SundanceCellFilter.cpp.

References Sundance::CellSet::begin(), Sundance::CellSet::end(), getCells(), isKnownSubsetOf(), Sundance::CellSet::setDifference(), and Sundance::CellSet::setIntersection().

const Set< CellFilter > & CellFilter::knownDisjoints ( ) const

Return a compilation of all filters registered as disjoint with this filter.

Definition at line 252 of file SundanceCellFilter.cpp.

References Sundance::SubsetManager::getDisjoints().

Referenced by isKnownDisjointWith(), and registerDisjoint().

const Set< CellFilter > & CellFilter::knownSubsets ( ) const

Return a compilation of all registered subsets of this filter.

Definition at line 248 of file SundanceCellFilter.cpp.

References Sundance::SubsetManager::getSubsets().

Referenced by isKnownSubsetOf(), and registerSubset().

CellFilter CellFilter::labeledSubset ( int  label) const

Return a filter that returns the subset of cells for which the logical expression is true.

Return a filter that will return the subset of cells having the given label

Definition at line 176 of file SundanceCellFilter.cpp.

References registerLabeledSubset(), and registerSubset().

CellFilterBase * CellFilter::nonConstCfbPtr ( )

Definition at line 313 of file SundanceCellFilter.cpp.

References Sundance::Handle< CellFilterStub >::ptr().

Referenced by setName().

bool CellFilter::operator!= ( const CellFilter other) const

Definition at line 242 of file SundanceCellFilter.cpp.

CellFilter CellFilter::operator+ ( const CellFilter other) const

Return a filter that returns the set union of the sets produced by the two operand filters.

Definition at line 85 of file SundanceCellFilter.cpp.

References isNull(), registerSubset(), and Sundance::BinaryCellFilter::Union.

CellFilter CellFilter::operator- ( const CellFilter other) const

Return a filter that returns the set difference between the sets produced by the two operand filters.

Definition at line 107 of file SundanceCellFilter.cpp.

References Sundance::BinaryCellFilter::Difference, isKnownDisjointWith(), isKnownSubsetOf(), isNull(), registerDisjoint(), and registerSubset().

bool CellFilter::operator== ( const CellFilter other) const

Definition at line 235 of file SundanceCellFilter.cpp.

Sundance::CellFilter::ORDERED_HANDLE_CTORS ( CellFilter  ,
CellFilterStub   
)
void CellFilter::registerDisjoint ( const CellFilter sub) const

Register a filter known to be disjoint.

Definition at line 269 of file SundanceCellFilter.cpp.

References knownDisjoints().

Referenced by operator-(), and registerLabeledSubset().

void CellFilter::registerLabeledSubset ( int  label,
const CellFilter sub 
) const

Register a labeled subset.

Definition at line 280 of file SundanceCellFilter.cpp.

References Sundance::SubsetManager::getLabeledSubsets(), and registerDisjoint().

Referenced by labeledSubset().

void CellFilter::registerSubset ( const CellFilter sub) const

Register a subset.

Definition at line 257 of file SundanceCellFilter.cpp.

References knownSubsets().

Referenced by intersection(), labeledSubset(), operator+(), operator-(), and subset().

void CellFilter::setName ( const std::string &  name)
CellFilter CellFilter::subset ( const CellPredicate test) const

Return a filter that will return the subset of cells for which the given predicate is true.

Definition at line 186 of file SundanceCellFilter.cpp.

References registerSubset().

Referenced by Sundance::LineDomain::init().

CellFilter CellFilter::subset ( const RCP< CellPredicateFunctorBase > &  test) const

Return a filter that will return the subset of cells for which the given predicate is true.

Definition at line 194 of file SundanceCellFilter.cpp.

References registerSubset().

string CellFilter::toString ( ) const
XMLObject CellFilter::toXML ( ) const

Friends And Related Function Documentation

typedef Array<CellFilter> CellFilterArray [related]

Definition at line 401 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d,
const CellFilter e,
const CellFilter f,
const CellFilter g,
const CellFilter h,
const CellFilter i,
const CellFilter j 
) [related]

Create an array with ten entries.

Definition at line 383 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d,
const CellFilter e,
const CellFilter f,
const CellFilter g,
const CellFilter h,
const CellFilter i 
) [related]

Create an array with nine entries.

Definition at line 362 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d,
const CellFilter e,
const CellFilter f,
const CellFilter g,
const CellFilter h 
) [related]

Create an array with eight entries.

Definition at line 343 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d,
const CellFilter e,
const CellFilter f,
const CellFilter g 
) [related]

Create an array with seven entries.

Definition at line 325 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d,
const CellFilter e,
const CellFilter f 
) [related]

Create an array with six entries.

Definition at line 308 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d,
const CellFilter e 
) [related]

Create an array with five entries.

Definition at line 292 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c,
const CellFilter d 
) [related]

Create an array with four entries.

Definition at line 278 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b,
const CellFilter c 
) [related]

Create an array with three entries.

Definition at line 265 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a,
const CellFilter b 
) [related]

Create an array with two entries.

Definition at line 253 of file SundanceCellFilter.hpp.

Array< CellFilter > List ( const CellFilter a) [related]

Create an array with one entry.

Definition at line 243 of file SundanceCellFilter.hpp.

Site Contact