Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
9e5b695a
Commit
9e5b695a
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
Moved FileFormatType from grid.hh to here.
[[Imported from SVN: r2028]]
parent
5c0eb3e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io/file/grapedataio.hh
+20
-9
20 additions, 9 deletions
io/file/grapedataio.hh
with
20 additions
and
9 deletions
io/file/grapedataio.hh
+
20
−
9
View file @
9e5b695a
...
...
@@ -8,6 +8,17 @@
namespace
Dune
{
/*!
Specify the format to store grid and vector data
*/
enum
GrapeIOFileFormatType
{
ascii
,
//!< store data in a human readable form
xdr
,
//!< store data in SUN's library routines
//!< for external data representation (xdr)
pgm
};
//!< store data in portable graymap file format
typedef
std
::
basic_string
<
char
>
GrapeIOStringType
;
/** \brief convert type to string
...
...
@@ -56,7 +67,7 @@ namespace Dune {
* generated out of filename and timestep
*/
inline
bool
writeGrid
(
const
GridType
&
grid
,
const
FileFormatType
ftype
,
const
GrapeIOStringType
fnprefix
const
GrapeIO
FileFormatType
ftype
,
const
GrapeIOStringType
fnprefix
,
double
time
=
0.0
,
int
timestep
=
0
,
int
precision
=
6
);
//! get Grid from file with time and timestep , return true if ok
...
...
@@ -72,7 +83,7 @@ namespace Dune {
//! discrete function
template
<
class
DiscreteFunctionType
>
inline
bool
writeData
(
DiscreteFunctionType
&
df
,
const
FileFormatType
ftype
,
const
GrapeIOStringType
filename
,
const
GrapeIO
FileFormatType
ftype
,
const
GrapeIOStringType
filename
,
int
timestep
,
int
precision
=
6
);
//! same as write only read
...
...
@@ -85,7 +96,7 @@ namespace Dune {
template
<
class
GridType
>
inline
bool
GrapeDataIO
<
GridType
>
::
writeGrid
(
const
GridType
&
grid
,
const
FileFormatType
ftype
,
const
GrapeIOStringType
fnprefix
,
const
GrapeIO
FileFormatType
ftype
,
const
GrapeIOStringType
fnprefix
,
double
time
,
int
timestep
,
int
precision
)
{
const
char
*
path
=
""
;
...
...
@@ -102,7 +113,7 @@ namespace Dune {
case
ascii
:
return
grid
.
template
writeGrid
<
ascii
>(
fnstr
,
time
);
default
:
{
std
::
cerr
<<
ftype
<<
" FileFormatType not supported at the moment! "
<<
__FILE__
<<
__LINE__
<<
"
\n
"
;
std
::
cerr
<<
ftype
<<
"
GrapeIO
FileFormatType not supported at the moment! "
<<
__FILE__
<<
__LINE__
<<
"
\n
"
;
assert
(
false
);
abort
();
return
false
;
...
...
@@ -129,7 +140,7 @@ namespace Dune {
}
readParameter
(
fnprefix
,
"Format"
,
helpType
);
FileFormatType
ftype
=
(
FileFormatType
)
helpType
;
GrapeIO
FileFormatType
ftype
=
(
GrapeIO
FileFormatType
)
helpType
;
int
precision
=
6
;
readParameter
(
fnprefix
,
"Precision"
,
precision
);
...
...
@@ -144,7 +155,7 @@ namespace Dune {
case
ascii
:
return
grid
.
template
readGrid
<
ascii
>(
fn
,
time
);
default
:
{
std
::
cerr
<<
ftype
<<
" FileFormatType not supported at the moment!
\n
"
;
std
::
cerr
<<
ftype
<<
"
GrapeIO
FileFormatType not supported at the moment!
\n
"
;
assert
(
false
);
abort
();
return
false
;
...
...
@@ -156,7 +167,7 @@ namespace Dune {
template
<
class
GridType
>
template
<
class
DiscreteFunctionType
>
inline
bool
GrapeDataIO
<
GridType
>
::
writeData
(
DiscreteFunctionType
&
df
,
const
FileFormatType
ftype
,
const
GrapeIOStringType
filename
,
int
timestep
,
int
precision
)
const
GrapeIO
FileFormatType
ftype
,
const
GrapeIOStringType
filename
,
int
timestep
,
int
precision
)
{
{
typedef
typename
DiscreteFunctionType
::
FunctionSpaceType
DiscreteFunctionSpaceType
;
...
...
@@ -219,7 +230,7 @@ namespace Dune {
readParameter
(
filename
,
"Space"
,
space
,
false
);
int
filetype
;
readParameter
(
filename
,
"Format"
,
filetype
,
false
);
FileFormatType
ftype
=
static_cast
<
FileFormatType
>
(
filetype
);
GrapeIO
FileFormatType
ftype
=
static_cast
<
GrapeIO
FileFormatType
>
(
filetype
);
int
precision
;
readParameter
(
filename
,
"Precision"
,
precision
,
false
);
...
...
@@ -243,7 +254,7 @@ namespace Dune {
if
(
ftype
==
pgm
)
return
df
.
read_pgm
(
fn
);
std
::
cerr
<<
ftype
<<
" FileFormatType not supported at the moment! in file "
<<
__FILE__
<<
" line "
<<
__LINE__
<<
"
\n
"
;
std
::
cerr
<<
ftype
<<
"
GrapeIO
FileFormatType not supported at the moment! in file "
<<
__FILE__
<<
" line "
<<
__LINE__
<<
"
\n
"
;
abort
();
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment