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
Tobias Leibner
dune-common
Commits
7b793958
Commit
7b793958
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
read dofmanager if it was written.
[[Imported from SVN: r3799]]
parent
5c3fe8b3
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
+25
-4
25 additions, 4 deletions
io/file/grapedataio.hh
with
25 additions
and
4 deletions
io/file/grapedataio.hh
+
25
−
4
View file @
7b793958
...
...
@@ -161,13 +161,14 @@ namespace Dune {
double
time
,
int
timestep
,
int
precision
)
{
// write dof manager, that corresponds to grid
bool
hasDm
=
false
;
{
typedef
DofManager
<
GridImp
>
DofManagerType
;
typedef
DofManagerFactory
<
DofManagerType
>
DMFactoryType
;
std
::
string
dmname
(
fnprefix
);
dmname
+=
"_dm"
;
DMFactoryType
::
writeDofManager
(
grid
,
dmname
,
timestep
);
hasDm
=
DMFactoryType
::
writeDofManager
(
grid
,
dmname
,
timestep
);
}
// write Grid itself
...
...
@@ -177,6 +178,8 @@ namespace Dune {
file
<<
"Grid: "
<<
transformToGridName
(
grid
.
type
())
<<
std
::
endl
;
file
<<
"Format: "
<<
ftype
<<
std
::
endl
;
file
<<
"Precision: "
<<
precision
<<
std
::
endl
;
int
writeDm
=
(
hasDm
)
?
1
:
0
;
file
<<
"DofManager: "
<<
writeDm
<<
std
::
endl
;
GrapeIOStringType
fnstr
=
genFilename
(
path
,
fnprefix
,
timestep
,
precision
);
...
...
@@ -221,14 +224,18 @@ namespace Dune {
int
precision
=
6
;
readParameter
(
fnprefix
,
"Precision"
,
precision
);
int
hasDm
=
0
;
readParameter
(
fnprefix
,
"DofManager"
,
hasDm
);
const
char
*
path
=
""
;
GrapeIOStringType
fn
=
genFilename
(
path
,
fnprefix
,
timestep
,
precision
);
std
::
cout
<<
"Read file: fnprefix = `"
<<
fn
<<
"'
\n
"
;
bool
succeded
=
false
;
switch
(
ftype
)
{
case
xdr
:
return
grid
.
template
readGrid
<
xdr
>
(
fn
,
time
);
case
ascii
:
return
grid
.
template
readGrid
<
ascii
>(
fn
,
time
);
case
xdr
:
succeded
=
grid
.
template
readGrid
<
xdr
>
(
fn
,
time
);
break
;
case
ascii
:
succeded
=
grid
.
template
readGrid
<
ascii
>(
fn
,
time
);
break
;
default
:
{
std
::
cerr
<<
ftype
<<
" GrapeIOFileFormatType not supported at the moment!
\n
"
;
...
...
@@ -237,7 +244,21 @@ namespace Dune {
return
false
;
}
}
return
false
;
// write dof manager, that corresponds to grid
if
(
hasDm
)
{
typedef
DofManager
<
GridImp
>
DofManagerType
;
typedef
DofManagerFactory
<
DofManagerType
>
DMFactoryType
;
std
::
string
dmname
(
fn
);
dmname
+=
"_dm"
;
//std::cout << "Read DofManager from file " << dmname << "\n";
// this call creates DofManager if not already existing
DMFactoryType
::
getDofManager
(
grid
);
succeded
=
DMFactoryType
::
writeDofManager
(
grid
,
dmname
,
timestep
);
}
return
succeded
;
}
template
<
class
GridType
>
...
...
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