Flow123d  3.9.0-68a662b83
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Region Class Reference

#include <region.hh>

Inheritance diagram for Region:
Inheritance graph
[legend]
Collaboration diagram for Region:
Collaboration graph
[legend]

Public Types

enum  RegionType { bulk =false, boundary =true }
 

Public Member Functions

 Region ()
 Default region is undefined/invalid. More...
 
 Region (RegionIdx r_idx, const RegionDB &db)
 
RegionIdx operator() (const Region &)
 
std::string label () const
 Returns label of the region (using RegionDB) More...
 
unsigned int id () const
 Returns id of the region (using RegionDB) More...
 
unsigned int dim () const
 Returns dimension of the region. More...
 
const RegionDBdb ()
 
bool is_in_region_set (const RegionSet &set) const
 
- Public Member Functions inherited from RegionIdx
 RegionIdx ()
 Default region is undefined/invalid. More...
 
bool is_boundary () const
 Returns true if it is a Boundary region and false if it is a Bulk region. More...
 
bool is_valid () const
 Returns false if the region has undefined/invalid value. More...
 
unsigned int idx () const
 Returns a global index of the region. More...
 
unsigned int boundary_idx () const
 Returns index of the region in the boundary set. More...
 
unsigned int bulk_idx () const
 Returns index of the region in the bulk set. More...
 
bool operator== (const RegionIdx &other) const
 Equality comparison operators for regions. More...
 
bool operator!= (const RegionIdx &other) const
 Equality comparison operators for regions. More...
 

Static Public Member Functions

static bool comp (const Region &a, const Region &b)
 Comparative method of two regions. More...
 

Protected Member Functions

 Region (unsigned int index, const RegionDB &db)
 
- Protected Member Functions inherited from RegionIdx
 RegionIdx (unsigned int index)
 

Protected Attributes

const RegionDBdb_
 Global variable with information about all regions. More...
 
- Protected Attributes inherited from RegionIdx
unsigned int idx_
 

Friends

class RegionDB
 
class Mesh
 

Additional Inherited Members

- Static Protected Attributes inherited from RegionIdx
static const unsigned int undefined =0xffffffff
 index for undefined region More...
 

Detailed Description

Class that represents disjoint part of computational domain (or domains). It consists of one integer value but provides access to other data stored in RegionDB. In particular provides string label and integer ID (unordered) further it provides fast (inlined) methods to: 1) detect if the region is the bulk region or boundary region 2) return index (this is used to select correct Field, possibly we can distinguish boundary_index and bulk_index)

Implementation: currently we number bulk regions by odd indices and boundary regions by even indices.

Definition at line 145 of file region.hh.

Member Enumeration Documentation

◆ RegionType

Types of region in mesh (bulk or boundary)

Enumerator
bulk 
boundary 

Definition at line 151 of file region.hh.

Constructor & Destructor Documentation

◆ Region() [1/3]

Region::Region ( )
inline

Default region is undefined/invalid.

Definition at line 158 of file region.hh.

◆ Region() [2/3]

Region::Region ( RegionIdx  r_idx,
const RegionDB db 
)
inline

This should be used for construction from known RegionIdx. (e.g. in Mesh) Do not use unless you can not get Region in other way.

Definition at line 164 of file region.hh.

◆ Region() [3/3]

Region::Region ( unsigned int  index,
const RegionDB db 
)
inlineprotected

Create accessor from the index. Should be private since implementation specific. We need some way how to iterate over: all regions, boundary regions, bulk regions - solution: have specific RegionSets for these three cases.

Definition at line 200 of file region.hh.

Member Function Documentation

◆ comp()

static bool Region::comp ( const Region a,
const Region b 
)
inlinestatic

Comparative method of two regions.

Definition at line 172 of file region.hh.

Here is the caller graph for this function:

◆ db()

const RegionDB& Region::db ( )
inline

Returns static region database. Meant to be used for getting range of global, boundary, and bulk region indices.

Definition at line 188 of file region.hh.

◆ dim()

unsigned int Region::dim ( ) const

Returns dimension of the region.

Definition at line 42 of file region.cc.

Here is the caller graph for this function:

◆ id()

unsigned int Region::id ( ) const

Returns id of the region (using RegionDB)

Definition at line 37 of file region.cc.

Here is the caller graph for this function:

◆ is_in_region_set()

bool Region::is_in_region_set ( const RegionSet set) const

Definition at line 45 of file region.cc.

Here is the caller graph for this function:

◆ label()

std::string Region::label ( ) const

Returns label of the region (using RegionDB)

Definition at line 32 of file region.cc.

Here is the caller graph for this function:

◆ operator()()

RegionIdx Region::operator() ( const Region )
inline

Definition at line 168 of file region.hh.

Friends And Related Function Documentation

◆ Mesh

friend class Mesh
friend

Definition at line 208 of file region.hh.

◆ RegionDB

friend class RegionDB
friend

Definition at line 207 of file region.hh.

Member Data Documentation

◆ db_

const RegionDB* Region::db_
protected

Global variable with information about all regions.

Definition at line 205 of file region.hh.


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