dune-grid
2.3beta2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
dune
grid
io
file
dgfparser
blocks
gridparameter.hh
Go to the documentation of this file.
1
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=4 sw=2 sts=2:
3
#ifndef DUNE_DGF_GRIDPARAMETERBLOCK_HH
4
#define DUNE_DGF_GRIDPARAMETERBLOCK_HH
5
6
#include <iostream>
7
#include <string>
8
9
#include <
dune/grid/io/file/dgfparser/blocks/basic.hh
>
10
11
12
namespace
Dune
13
{
14
15
namespace
dgf
16
{
31
class
GridParameterBlock
32
:
public
BasicBlock
33
{
34
public
:
35
typedef
unsigned
int
Flags
;
36
37
static
const
Flags
foundName
= 1 << 0;
38
static
const
Flags
foundDumpFileName
= 1 << 1;
39
static
const
Flags
foundLongestEdge
= 1 << 5;
40
41
protected
:
42
Flags
foundFlags_
;
// supportFlags, this block was created with
43
std::string
name_
;
// name of the grid
44
std::string
dumpFileName_
;
// name of the grid
45
bool
markLongestEdge_
;
// Mark longest edge for AlbertaGrid
46
47
private
:
48
// copy not implemented
49
GridParameterBlock
(
const
GridParameterBlock
&);
50
51
public
:
53
GridParameterBlock
( std::istream &in );
54
56
const
std::string &
name
(
const
std::string &defaultValue )
const
57
{
58
if
( (
foundFlags_
&
foundName
) == 0 )
59
{
60
dwarn <<
"GridParameterBlock: Parameter 'name' not specified, "
61
<<
"defaulting to '"
<< defaultValue <<
"'."
<< std::endl;
62
return
defaultValue;
63
}
64
else
65
return
name_
;
66
}
67
68
const
std::string &
dumpFileName
( )
const
69
{
70
if
( (
foundFlags_
&
foundDumpFileName
) != 0 )
71
{
72
dwarn <<
"GridParameterBlock: found Parameter 'dumpfilename', "
73
<<
"dumping file to `"
<<
dumpFileName_
<<
"'"
<< std::endl;
74
}
75
return
dumpFileName_
;
76
}
77
79
bool
markLongestEdge
()
const
80
{
81
if
( (
foundFlags_
&
foundLongestEdge
) == 0 )
82
{
83
dwarn <<
"GridParameterBlock: Parameter 'refinementedge' not specified, "
84
<<
"defaulting to 'ARBITRARY'."
<< std::endl;
85
}
86
return
markLongestEdge_
;
87
}
88
89
// some information
90
bool
ok
()
91
{
92
return
true
;
93
}
94
};
95
96
97
}
// end namespace dgf
98
99
}
// end namespace Dune
100
101
#endif
Generated on Mon Feb 10 2014 21:12:32 for dune-grid by
1.8.1.2