Sundance::CellFilter Class Reference

Inheritance diagram for Sundance::CellFilter:

Sundance::OrderedHandle< CellFilterStub > Playa::Handle< CellFilterStub >

List of all members.

Public Member Functions

 ORDERED_HANDLE_CTORS (CellFilter, CellFilterStub)
CellSet getCells (const Mesh &mesh) const
int dimension (const Mesh &mesh) const
CellFilter operator+ (const CellFilter &other) const
CellFilter operator- (const CellFilter &other) const
CellFilter intersection (const CellFilter &other) const
CellFilter labeledSubset (int label) const
CellFilter labeledSubset (const Array< int > &labels) const
CellFilter coordSubset (int dir, const double &coordVal) const
CellFilter subset (const CellPredicate &test) const
CellFilter subset (const RCP< CellPredicateFunctorBase > &test) const
const Set< CellFilter > & knownSubsets () const
const Set< CellFilter > & knownDisjoints () const
bool isKnownSubsetOf (const CellFilter &other) const
bool isKnownDisjointWith (const CellFilter &other) const
bool isSubsetOf (const CellFilter &other, const Mesh &mesh) const
bool isDisjointWith (const CellFilter &other, const Mesh &mesh) const
void registerSubset (const CellFilter &sub) const
void registerDisjoint (const CellFilter &sub) const
void registerLabeledSubset (const Set< int > &label, const CellFilter &sub) const
bool isNullCellFilter () const
bool areFacetsOf (const CellFilter &other, const Mesh &mesh) const
bool isNull () const
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 323 of file SundanceCellFilter.cpp.

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

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

CellFilter CellFilter::coordSubset ( int  dir,
const double &  coordVal 
) const

Return a filter that will return the subset of cells for which the dir-th coordinate takes on value coordVal

Definition at line 193 of file SundanceCellFilter.cpp.

References registerSubset().

Referenced by main().

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 140 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 223 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 217 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 53 of file SundanceCellFilter.cpp.

References isNullCellFilter(), and Playa::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 48 of file SundanceCellFilter.cpp.

References Playa::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 231 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 268 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 264 of file SundanceCellFilter.cpp.

References Sundance::SubsetManager::getSubsets().

Referenced by isKnownSubsetOf(), and registerSubset().

CellFilter CellFilter::labeledSubset ( const Array< int > &  labels  )  const

Return a filter that will return the subset of cells having any one of the given labels

Definition at line 182 of file SundanceCellFilter.cpp.

References registerLabeledSubset(), 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 177 of file SundanceCellFilter.cpp.

CellFilterBase * CellFilter::nonConstCfbPtr (  ) 

Definition at line 330 of file SundanceCellFilter.cpp.

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

Referenced by setName().

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

Definition at line 258 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 86 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 108 of file SundanceCellFilter.cpp.

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

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

Definition at line 251 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 285 of file SundanceCellFilter.cpp.

References knownDisjoints().

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

void CellFilter::registerLabeledSubset ( const Set< int > &  label,
const CellFilter sub 
) const

Register a labeled subset

Definition at line 296 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 273 of file SundanceCellFilter.cpp.

References knownSubsets().

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

void CellFilter::setName ( const std::string &  name  ) 

Definition at line 58 of file SundanceCellFilter.cpp.

References nonConstCfbPtr(), and Sundance::CellFilterBase::setName().

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 210 of file SundanceCellFilter.cpp.

References registerSubset().

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 202 of file SundanceCellFilter.cpp.

References registerSubset().

Referenced by Sundance::RectangleDomain::init(), Sundance::LineDomain::init(), and Sundance::PointData::init().

string CellFilter::toString (  )  const

XMLObject CellFilter::toXML (  )  const


Friends And Related Function Documentation

typedef Array<CellFilter> CellFilterArray [related]

Definition at line 409 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 391 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 370 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 351 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 333 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 316 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 300 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 286 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 273 of file SundanceCellFilter.hpp.

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

Create an array with two entries.

Definition at line 261 of file SundanceCellFilter.hpp.

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

Create an array with one entry.

Definition at line 251 of file SundanceCellFilter.hpp.

Site Contact