Flow123d  jenkins-Flow123d-linux-release-multijob-198
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private 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 ()
 
- 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...
 

Private Member Functions

 Region (unsigned int index, const RegionDB &db)
 

Static Private Member Functions

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

Private Attributes

const RegionDBdb_
 Global variable with information about all regions. More...
 

Friends

class RegionDB
 

Additional Inherited Members

- Protected Member Functions inherited from RegionIdx
 RegionIdx (unsigned int index)
 
- Protected Attributes inherited from RegionIdx
unsigned int idx_
 
- 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 125 of file region.hh.

Member Enumeration Documentation

Types of region in mesh (bulk or boundary)

Enumerator
bulk 
boundary 

Definition at line 131 of file region.hh.

Constructor & Destructor Documentation

Region::Region ( )
inline

Default region is undefined/invalid.

Definition at line 138 of file region.hh.

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 144 of file region.hh.

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

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 174 of file region.hh.

Member Function Documentation

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

Comparative method of two regions.

Definition at line 179 of file region.hh.

Here is the caller graph for this function:

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 164 of file region.hh.

unsigned int Region::dim ( ) const

Returns dimension of the region.

Definition at line 33 of file region.cc.

unsigned int Region::id ( ) const

Returns id of the region (using RegionDB)

Definition at line 28 of file region.cc.

Here is the caller graph for this function:

std::string Region::label ( ) const

Returns label of the region (using RegionDB)

Definition at line 23 of file region.cc.

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

Definition at line 148 of file region.hh.

Friends And Related Function Documentation

friend class RegionDB
friend

Definition at line 185 of file region.hh.

Member Data Documentation

const RegionDB* Region::db_
private

Global variable with information about all regions.

Definition at line 183 of file region.hh.


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