5#ifndef DUNE_DGF_INTERVALBLOCK_HH
6#define DUNE_DGF_INTERVALBLOCK_HH
29 copy( interval, map );
33 const int size = map.size();
38 assert( size ==
int(interval.
n.size()) );
39 for(
int i=0; i<size; ++i )
41 p[ 0 ][ i ] = interval.
p[ 0 ][ map[ i ] ];
42 p[ 1 ][ i ] = interval.
p[ 1 ][ map[ i ] ];
43 n[ i ] = interval.
n[ map[ i ] ];
44 h[ i ] = interval.
h[ map[ i ] ];
47 std::array< std::vector< double >, 2 >
p;
48 std::vector< double >
h;
53 std::vector< Interval > intervals_;
54 std::vector< int > map_;
61 void get ( std::vector< std::vector< double > > &vtx,
int &
nofvtx,
62 std::vector< std::vector< unsigned int > > &simplex,
int &nofsimpl )
64 for(
size_t i = 0; i < intervals_.size(); ++i )
68 nofsimpl +=
getHexa( i, simplex, oldvtx );
72 void get ( std::vector< std::vector< double > > &vtx,
int &
nofvtx )
74 for(
size_t i = 0; i < intervals_.size(); ++i )
80 return intervals_[ block ];
85 return intervals_.size();
93 int getVtx (
int block, std::vector< std::vector< double > > &vtx )
const;
94 int getHexa (
int block, std::vector< std::vector< unsigned int > > &cubes,
95 int offset = 0 )
const;
101 for(
int i = 0; i < dimw_; ++i )
102 n *= (interval.
n[ i ] + 1);
110 for(
int i = 0; i < dimw_; ++i )
111 n *= interval.
n[ i ];
117 void parseLine ( std::vector< T > &v );
122 inline std::ostream &
125 if( interval.
p[ 0 ].empty() || interval.
p[ 1 ].empty() || interval.
n.empty() )
126 return out <<
"Interval {}";
128 out <<
"Interval { p0 = (" << interval.
p[ 0 ][ 0 ];
129 for(
size_t i = 1; i < interval.
p[ 0 ].size(); ++i )
130 out <<
", " << interval.
p[ 0 ][ i ];
131 out <<
"), p1 = (" << interval.
p[ 1 ][ 0 ];
132 for(
size_t i = 1; i < interval.
p[ 1 ].size(); ++i )
133 out <<
", " << interval.
p[ 1 ][ i ];
134 out <<
"), n = (" << interval.
n[ 0 ];
135 for(
size_t i = 1; i < interval.
n.size(); ++i )
136 out <<
", " << interval.
n[ i ];
Include standard header files.
Definition: agrid.hh:60
std::ostream & operator<<(std::ostream &out, const IntervalBlock::Interval &interval)
Definition: interval.hh:123
Definition: interval.hh:23
IntervalBlock(std::istream &in)
Definition: interval.cc:18
void get(std::vector< std::vector< double > > &vtx, int &nofvtx, std::vector< std::vector< unsigned int > > &simplex, int &nofsimpl)
Definition: interval.hh:61
int numIntervals() const
Definition: interval.hh:83
int getVtx(int block, std::vector< std::vector< double > > &vtx) const
Definition: interval.cc:84
const Interval & get(int block) const
Definition: interval.hh:78
int getHexa(int block, std::vector< std::vector< unsigned int > > &cubes, int offset=0) const
Definition: interval.cc:122
int nofhexa(int block) const
Definition: interval.hh:106
int dimw() const
Definition: interval.hh:88
int nofvtx(int block) const
Definition: interval.hh:97
void get(std::vector< std::vector< double > > &vtx, int &nofvtx)
Definition: interval.hh:72
Definition: interval.hh:25
Interval()
Definition: interval.hh:26
std::array< std::vector< double >, 2 > p
Definition: interval.hh:47
std::vector< int > n
Definition: interval.hh:49
Interval(const Interval &interval, const std::vector< int > &map)
Definition: interval.hh:27
void copy(const Interval &interval, const std::vector< int > &map)
Definition: interval.hh:31
std::vector< double > h
Definition: interval.hh:48