dune-grid
2.11
Toggle main menu visibility
Loading...
Searching...
No Matches
dune
grid
io
file
dgfparser
blocks
gridparameter.hh
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4
// vi: set et ts=4 sw=2 sts=2:
5
#ifndef DUNE_DGF_GRIDPARAMETERBLOCK_HH
6
#define DUNE_DGF_GRIDPARAMETERBLOCK_HH
7
8
#include <iostream>
9
#include <string>
10
11
#include <
dune/grid/io/file/dgfparser/blocks/basic.hh
>
12
13
14
namespace
Dune
15
{
16
17
namespace
dgf
18
{
32
33
class
GridParameterBlock
34
:
public
BasicBlock
35
{
36
public
:
37
typedef
unsigned
int
Flags
;
38
39
static
const
Flags
foundName
= 1 << 0;
40
static
const
Flags
foundDumpFileName
= 1 << 1;
41
static
const
Flags
foundLongestEdge
= 1 << 5;
42
static
const
Flags
foundCompatible
= 1 << 13;
43
44
protected
:
45
Flags
foundFlags_
;
// supportFlags, this block was created with
46
std::string
name_
;
// name of the grid
47
std::string
dumpFileName_
;
// name of the grid
48
bool
markLongestEdge_
;
// Mark longest edge for AlbertaGrid or ALUGrid
49
bool
bisectionCompatibility_
;
// true if grid is compatible (bisection refinement works)
50
51
private
:
52
// copy not implemented
53
GridParameterBlock(
const
GridParameterBlock&);
54
55
public
:
57
GridParameterBlock
( std::istream &in );
58
60
const
std::string &
name
(
const
std::string &defaultValue )
const
61
{
62
if
( (
foundFlags_
&
foundName
) == 0 )
63
{
64
dwarn <<
"GridParameterBlock: Parameter 'name' not specified, "
65
<<
"defaulting to '"
<< defaultValue <<
"'."
<< std::endl;
66
return
defaultValue;
67
}
68
else
69
return
name_
;
70
}
71
72
const
std::string &
dumpFileName
( )
const
73
{
74
if
( (
foundFlags_
&
foundDumpFileName
) != 0 )
75
{
76
dwarn <<
"GridParameterBlock: found Parameter 'dumpfilename', "
77
<<
"dumping file to `"
<<
dumpFileName_
<<
"'"
<< std::endl;
78
}
79
return
dumpFileName_
;
80
}
81
83
bool
markLongestEdge
()
const
84
{
85
if
( (
foundFlags_
&
foundLongestEdge
) == 0 )
86
{
87
dwarn <<
"GridParameterBlock: Parameter 'refinementedge' not specified, "
88
<<
"defaulting to 'ARBITRARY'."
<< std::endl;
89
}
90
return
markLongestEdge_
;
91
}
92
94
bool
bisectionCompatibility
()
const
95
{
96
if
( (
foundFlags_
&
foundCompatible
) == 0 )
97
{
98
dwarn <<
"GridParameterBlock: Parameter 'bisectioncompatibility' not specified, "
99
<<
"defaulting to '0' (false)."
<< std::endl;
100
}
101
return
bisectionCompatibility_
;
102
}
103
104
// some information
105
bool
ok
()
106
{
107
return
true
;
108
}
109
};
110
111
112
}
// end namespace dgf
113
114
}
// end namespace Dune
115
116
#endif
basic.hh
Dune
Include standard header files.
Definition
agrid.hh:60
Dune::dgf
Definition
basic.cc:12
Dune::dgf::BasicBlock::BasicBlock
BasicBlock(std::istream &in, const char *id)
Definition
basic.cc:17
Dune::dgf::GridParameterBlock::foundDumpFileName
static const Flags foundDumpFileName
Definition
gridparameter.hh:40
Dune::dgf::GridParameterBlock::dumpFileName
const std::string & dumpFileName() const
Definition
gridparameter.hh:72
Dune::dgf::GridParameterBlock::foundName
static const Flags foundName
Definition
gridparameter.hh:39
Dune::dgf::GridParameterBlock::GridParameterBlock
GridParameterBlock(std::istream &in)
constructor: read common parameters
Dune::dgf::GridParameterBlock::foundCompatible
static const Flags foundCompatible
Definition
gridparameter.hh:42
Dune::dgf::GridParameterBlock::Flags
unsigned int Flags
Definition
gridparameter.hh:37
Dune::dgf::GridParameterBlock::bisectionCompatibility_
bool bisectionCompatibility_
Definition
gridparameter.hh:49
Dune::dgf::GridParameterBlock::dumpFileName_
std::string dumpFileName_
Definition
gridparameter.hh:47
Dune::dgf::GridParameterBlock::ok
bool ok()
Definition
gridparameter.hh:105
Dune::dgf::GridParameterBlock::foundFlags_
Flags foundFlags_
Definition
gridparameter.hh:45
Dune::dgf::GridParameterBlock::name
const std::string & name(const std::string &defaultValue) const
return the name of the grid
Definition
gridparameter.hh:60
Dune::dgf::GridParameterBlock::name_
std::string name_
Definition
gridparameter.hh:46
Dune::dgf::GridParameterBlock::bisectionCompatibility
bool bisectionCompatibility() const
returns true if grid is compatible for bisection refinement
Definition
gridparameter.hh:94
Dune::dgf::GridParameterBlock::markLongestEdge
bool markLongestEdge() const
returns true if longest edge should be marked for AlbertaGrid
Definition
gridparameter.hh:83
Dune::dgf::GridParameterBlock::foundLongestEdge
static const Flags foundLongestEdge
Definition
gridparameter.hh:41
Dune::dgf::GridParameterBlock::markLongestEdge_
bool markLongestEdge_
Definition
gridparameter.hh:48
Generated by
1.17.0