Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
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
Model registry
Operate
Environments
Monitor
Incidents
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
Sander, Oliver
dune-gfe
Commits
d24ea71d
Commit
d24ea71d
authored
10 years ago
by
Oliver Sander
Committed by
sander
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Don't store rank and size in the VTKFile object
Use MPIHelper instead. [[Imported from SVN: r9908]]
parent
ea84ec85
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/gfe/cosseratvtkwriter.hh
+1
-1
1 addition, 1 deletion
dune/gfe/cosseratvtkwriter.hh
dune/gfe/vtkfile.hh
+16
-25
16 additions, 25 deletions
dune/gfe/vtkfile.hh
with
17 additions
and
26 deletions
dune/gfe/cosseratvtkwriter.hh
+
1
−
1
View file @
d24ea71d
...
...
@@ -228,7 +228,7 @@ public:
#else // Write as P2 or as P1 space
Dune
::
GFE
::
VTKFile
vtkFile
(
gridView
.
comm
().
rank
(),
gridView
.
comm
().
size
())
;
Dune
::
GFE
::
VTKFile
vtkFile
;
// Stupid: I can't directly get the number of Interior_Partition elements
size_t
numElements
=
0
;
...
...
This diff is collapsed.
Click to expand it.
dune/gfe/vtkfile.hh
+
16
−
25
View file @
d24ea71d
...
...
@@ -31,31 +31,23 @@ namespace Dune {
public:
/** \brief Empty constructor, for a single-process situation */
VTKFile
()
:
commRank_
(
0
),
commSize_
(
1
)
{}
/** \brief Constructor taking the communicator rank and size */
VTKFile
(
int
commRank
,
int
commSize
)
:
commRank_
(
commRank
),
commSize_
(
commSize
)
{}
/** \brief Write the file to disk */
void
write
(
const
std
::
string
&
filename
)
const
{
int
argc
=
0
;
char
**
argv
;
Dune
::
MPIHelper
&
mpiHelper
=
Dune
::
MPIHelper
::
instance
(
argc
,
argv
);
std
::
string
fullfilename
=
filename
+
".vtu"
;
// Prepend rank and communicator size to the filename, if there are more than one process
if
(
commS
ize
_
>
1
)
fullfilename
=
getParallelPieceName
(
filename
,
""
,
commRank_
,
commS
ize
_
);
if
(
mpiHelper
.
s
ize
()
>
1
)
fullfilename
=
getParallelPieceName
(
filename
,
""
,
mpiHelper
.
rank
(),
mpiHelper
.
s
ize
()
);
// Write the pvtu file that ties together the different parts
if
(
commSize_
>
1
&&
commR
ank
_
==
0
)
if
(
mpiHelper
.
size
()
>
1
&&
mpiHelper
.
r
ank
()
==
0
)
{
std
::
ofstream
pvtuOutFile
(
getParallelName
(
filename
,
""
,
commS
ize
_
));
std
::
ofstream
pvtuOutFile
(
getParallelName
(
filename
,
""
,
mpiHelper
.
s
ize
()
));
Dune
::
VTK
::
PVTUWriter
writer
(
pvtuOutFile
,
Dune
::
VTK
::
unstructuredGrid
);
writer
.
beginMain
();
...
...
@@ -72,8 +64,8 @@ namespace Dune {
writer
.
addArray
<
float
>
(
"Coordinates"
,
3
);
writer
.
endPoints
();
for
(
int
i
=
0
;
i
<
commS
ize
_
;
i
++
)
writer
.
addPiece
(
getParallelPieceName
(
filename
,
""
,
i
,
commS
ize
_
));
for
(
int
i
=
0
;
i
<
mpiHelper
.
s
ize
()
;
i
++
)
writer
.
addPiece
(
getParallelPieceName
(
filename
,
""
,
i
,
mpiHelper
.
s
ize
()
));
// finish main section
writer
.
endMain
();
...
...
@@ -154,11 +146,15 @@ namespace Dune {
*/
void
read
(
const
std
::
string
&
filename
)
{
int
argc
=
0
;
char
**
argv
;
Dune
::
MPIHelper
&
mpiHelper
=
Dune
::
MPIHelper
::
instance
(
argc
,
argv
);
std
::
string
fullfilename
=
filename
+
".vtu"
;
// Prepend rank and communicator size to the filename, if there are more than one process
if
(
commS
ize
_
>
1
)
fullfilename
=
getParallelPieceName
(
filename
,
""
,
commRank_
,
commS
ize
_
);
if
(
mpiHelper
.
s
ize
()
>
1
)
fullfilename
=
getParallelPieceName
(
filename
,
""
,
mpiHelper
.
rank
(),
mpiHelper
.
s
ize
()
);
#if ! HAVE_TINYXML2
DUNE_THROW
(
Dune
::
NotImplemented
,
"You need TinyXML2 for vtk file reading!"
);
...
...
@@ -326,11 +322,6 @@ namespace Dune {
return
s
.
str
();
}
int
commRank_
;
// Communicator size
int
commSize_
;
};
}
...
...
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