Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/***************************************************************************
tnlMeshSuperentityAccessor.h - description
-------------------
begin : Sep 11, 2015
copyright : (C) 2015 by Tomas Oberhuber et al.
email : tomas.oberhuber@fjfi.cvut.cz
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TNLMESHSUPERENTITYACCESSOR_H
#define TNLMESHSUPERENTITYACCESSOR_H
template< typename NetworkPorts >
class tnlMeshSuperentityAccessor
{
public:
typedef typename NetworkPorts::IndexType GlobalIndexType;
typedef typename NetworkPorts::IndexType LocalIndexType;
// TODO: Add LocalIndexType to EllpackNetwork
LocalIndexType getSupernetitiesCount() const
{
return this->ports.getPortsCount();
};
void setSuperentityIndex( const LocalIndexType localIndex,
const GlobalIndexType globalIndex )
{
ports.setOutput( localIndex, globalIndex );
}
GlobalIndexType getSuperentityIndex( const LocalIndexType localIndex ) const
{
return ports.getOutput( localIndex );
}
GlobalIndexType& operator[]( const LocalIndexType localIndex )
{
return this->ports[ localIndex ];
}
const GlobalIndexType& operator[]( const LocalIndexType localIndex ) const
{
return this->ports[ localIndex ];
}
Tomáš Oberhuber
committed
void print( ostream& str ) const
{
str << ports;
}
protected:
NetworkPorts ports;
};
Tomáš Oberhuber
committed
template< typename NetworkPorts >
ostream& operator << ( ostream& str, const tnlMeshSuperentityAccessor< NetworkPorts >& superentityAccessor )
{
superentityAccessor.print( str );
return str;
}
#endif /* TNLMESHSUPERENTITYACCESSOR_H */