MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::AttributeSets Class Reference

#include <attribute_sets.hpp>

Collaboration diagram for mfem::AttributeSets:
[legend]

Public Member Functions

 AttributeSets (const Array< int > &attr)
 
void Copy (AttributeSets &copy) const
 Create a copy of the internal data to the provided copy.
 
bool SetsExist () const
 Return true if any named sets are currently defined.
 
std::set< std::string > GetAttributeSetNames () const
 Return all attribute set names as an STL set.
 
bool AttributeSetExists (const std::string &name) const
 Return true is the named attribute set is present.
 
Array< int > & CreateAttributeSet (const std::string &set_name)
 Create an empty named attribute set.
 
void DeleteAttributeSet (const std::string &set_name)
 Delete a named attribute set.
 
void SetAttributeSet (const std::string &set_name, const Array< int > &attr)
 Create a new attribute set.
 
void AddToAttributeSet (const std::string &set_name, int attr)
 Add a single entry to an existing attribute set.
 
void AddToAttributeSet (const std::string &set_name, const Array< int > &attr)
 Add an array of entries to an existing attribute set.
 
void RemoveFromAttributeSet (const std::string &set_name, int attr)
 Remove a single entry from an existing attribute set.
 
void Print (std::ostream &out=mfem::out, int width=-1) const
 Print the contents of the container to an output stream.
 
Array< int > & GetAttributeSet (const std::string &set_name)
 Access a named attribute set.
 
Array< int > GetAttributeSetMarker (const std::string &set_name)
 Return a marker array corresponding to a named attribute set.
 

Static Public Member Functions

static Array< int > AttrToMarker (int max_attr, const Array< int > &attrs)
 Prepares a marker array corresponding to an array of element attributes.
 

Public Attributes

ArraysByName< int > attr_sets
 Named sets of attributes.
 

Detailed Description

Definition at line 26 of file attribute_sets.hpp.

Constructor & Destructor Documentation

◆ AttributeSets()

mfem::AttributeSets::AttributeSets ( const Array< int > & attr)

Definition at line 17 of file attribute_sets.cpp.

Member Function Documentation

◆ AddToAttributeSet() [1/2]

void mfem::AttributeSets::AddToAttributeSet ( const std::string & set_name,
const Array< int > & attr )

Add an array of entries to an existing attribute set.

Parameters
[in]set_nameThe name of the set being augmented
[in]attrArray of attribute numbers to be inserted in the set
Note
If the named set does not exist an error message will be printed and execution will halt. AttributeSetExists() may be used to verify existence of a named set.
Duplicate entries will be ignored and the resulting sets will be sorted.

Definition at line 70 of file attribute_sets.cpp.

◆ AddToAttributeSet() [2/2]

void mfem::AttributeSets::AddToAttributeSet ( const std::string & set_name,
int attr )

Add a single entry to an existing attribute set.

Parameters
[in]set_nameThe name of the set being augmented
[in]attrA single attribute number to be inserted in the set
Note
If the named set does not exist an error message will be printed and execution will halt. AttributeSetExists() may be used to verify existence of a named set.
Duplicate entries will be ignored and the resulting sets will be sorted.

Definition at line 63 of file attribute_sets.cpp.

◆ AttributeSetExists()

bool mfem::AttributeSets::AttributeSetExists ( const std::string & name) const

Return true is the named attribute set is present.

Definition at line 36 of file attribute_sets.cpp.

◆ AttrToMarker()

Array< int > mfem::AttributeSets::AttrToMarker ( int max_attr,
const Array< int > & attrs )
static

Prepares a marker array corresponding to an array of element attributes.

Parameters
[in]max_attrNumber of entries to create in the marker array
[in]attrsAn array of attribute numbers which should be activated

The returned marker array will be of size max_attr and it will contain only zeroes and ones. Ones indicate which attribute numbers are present in the attrs array.

Definition at line 107 of file attribute_sets.cpp.

◆ Copy()

void mfem::AttributeSets::Copy ( AttributeSets & copy) const

Create a copy of the internal data to the provided copy.

Definition at line 21 of file attribute_sets.cpp.

◆ CreateAttributeSet()

Array< int > & mfem::AttributeSets::CreateAttributeSet ( const std::string & set_name)

Create an empty named attribute set.

Definition at line 41 of file attribute_sets.cpp.

◆ DeleteAttributeSet()

void mfem::AttributeSets::DeleteAttributeSet ( const std::string & set_name)

Delete a named attribute set.

Definition at line 46 of file attribute_sets.cpp.

◆ GetAttributeSet()

Array< int > & mfem::AttributeSets::GetAttributeSet ( const std::string & set_name)

Access a named attribute set.

Parameters
[in]set_nameThe name of the set being accessed
Note
If the named set does not exist an error message will be printed and execution will halt. AttributeSetExists() may be used to verify existence of a named set.
The reference returned by this method can be invalidated by subsequent calls to SetAttributeSet, ClearAttributeSet, or RemoveFromAttributeSet. AddToAttributeSet should not invalidate this reference.

Definition at line 97 of file attribute_sets.cpp.

◆ GetAttributeSetMarker()

Array< int > mfem::AttributeSets::GetAttributeSetMarker ( const std::string & set_name)

Return a marker array corresponding to a named attribute set.

Parameters
[in]set_nameThe name of the set being accessed
Note
If the named set does not exist an error message will be printed and execution will halt. AttributeSetExists() may be used to verify existence of a named set.

Definition at line 102 of file attribute_sets.cpp.

◆ GetAttributeSetNames()

std::set< std::string > mfem::AttributeSets::GetAttributeSetNames ( ) const

Return all attribute set names as an STL set.

Definition at line 31 of file attribute_sets.cpp.

◆ Print()

void mfem::AttributeSets::Print ( std::ostream & out = mfem::out,
int width = -1 ) const

Print the contents of the container to an output stream.

Note
The array entries will contain 10 entries per line. A specific number of entries per line can be used by changing the width argument.

Definition at line 92 of file attribute_sets.cpp.

◆ RemoveFromAttributeSet()

void mfem::AttributeSets::RemoveFromAttributeSet ( const std::string & set_name,
int attr )

Remove a single entry from an existing attribute set.

Parameters
[in]set_nameThe name of the set being modified
[in]attrA single attribute number to be removed from the set
Note
If the named set does not exist an error message will be printed and execution will halt. AttributeSetExists() may be used to verify existence of a named set.
If attr is not a member of the named set the set will not be modified and no error will occur.

Definition at line 78 of file attribute_sets.cpp.

◆ SetAttributeSet()

void mfem::AttributeSets::SetAttributeSet ( const std::string & set_name,
const Array< int > & attr )

Create a new attribute set.

Parameters
[in]set_nameThe name of the new set
[in]attrAn array of attribute numbers making up the new set
Note
If an attribute set matching this name already exists, that set will be replaced with this new attribute set.
The attribute numbers are not checked for validity or existence within the mesh.

Definition at line 51 of file attribute_sets.cpp.

◆ SetsExist()

bool mfem::AttributeSets::SetsExist ( ) const

Return true if any named sets are currently defined.

Definition at line 26 of file attribute_sets.cpp.

Member Data Documentation

◆ attr_sets

ArraysByName<int> mfem::AttributeSets::attr_sets

Named sets of attributes.

Definition at line 35 of file attribute_sets.hpp.


The documentation for this class was generated from the following files: