Workspace 6.21.5
Public Member Functions | List of all members
ElementCriterionInRegion Class Reference

Element criterion that will pass for all elements in a provided Region. More...

#include <Mesh/Geometry/elementcriterioninregion.h>

Inheritance diagram for ElementCriterionInRegion:
[legend]

Public Member Functions

 ElementCriterionInRegion ()
 
 ElementCriterionInRegion (const ElementCriterionInRegion &criterion)
 
 ElementCriterionInRegion (const Region &region)
 
 ~ElementCriterionInRegion () override
 
ElementCriterionInRegionclone () const override
 
void destroy () override
 
bool getAllNodesMustPass () const
 
ElementCriterionInRegionoperator= (const ElementCriterionInRegion &criterion)
 
bool pass (const Element &element) const override
 
void setAllNodesMustPass (bool b)
 
void setRegion (const Region &region)
 
- Public Member Functions inherited from ElementCriterion
 ~ElementCriterion () override=default
 
ElementCriterionclone () const override=0
 
virtual void destroy ()=0
 
virtual bool pass (const Element &element) const =0
 
virtual void postVisits ()
 
virtual bool preVisits (MeshModel &model)
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 

Additional Inherited Members

- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Detailed Description

Set the region for the criterion either in the constructor or by using the setRegion() function. You can choose whether only one node of an element or all nodes of an element must be in the region for it to pass.

Constructor & Destructor Documentation

◆ ElementCriterionInRegion() [1/3]

◆ ElementCriterionInRegion() [2/3]

◆ ElementCriterionInRegion() [3/3]

ElementCriterionInRegion ( const Region region)

◆ ~ElementCriterionInRegion()

~ElementCriterionInRegion ( )
override

Member Function Documentation

◆ clone()

ElementCriterionInRegion * clone ( ) const
overridevirtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

We redeclare this function only so that the more derived return type is available without casting.

Implements ElementCriterion.

◆ destroy()

void destroy ( )
overridevirtual

Destroys the object. This function is usually implemented by calling operator delete on the object.

See also
clone()

Implements ElementCriterion.

◆ getAllNodesMustPass()

bool getAllNodesMustPass ( ) const
Returns
True if all of an element's nodes must be within the region for the element to pass.
See also
setAllNodesMustPass()

◆ operator=()

ElementCriterionInRegion & operator= ( const ElementCriterionInRegion criterion)

◆ pass()

bool pass ( const Element element) const
overridevirtual
Parameters
elementThe element to be tested against the currently set region.
Returns
True if element is within the currently set region. If the region is null, this will always be false.

When working out whether an element should be considered within a region, a test is performed to check whether each of its nodes is within the region. The criterion can be configured to pass when one or when all nodes are within the region. No attempt is made to determine if element edges, faces, etc. intersect the region - this test is purely based on the element's nodes.

Implements ElementCriterion.

◆ setAllNodesMustPass()

void setAllNodesMustPass ( bool  b)
Parameters
bIf set to true, then all of an element's nodes must be within the region for the element to pass. The default is false, which means only one or more of the element's nodes has to be within the region for the element to pass.
See also
getAllNodesMustPass()

◆ setRegion()

void setRegion ( const Region region)
Parameters
regionThe new region to match nodes against.