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
0c9fc541
Commit
0c9fc541
authored
6 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Adapt to changes in VTK writing in dune-grid 2.7
But keep compatibility with dune-grid 2.6 as well.
parent
d58607bf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#1621
failed
6 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/gfe/cosseratvtkwriter.hh
+4
-0
4 additions, 0 deletions
dune/gfe/cosseratvtkwriter.hh
dune/gfe/vtkfile.hh
+44
-0
44 additions, 0 deletions
dune/gfe/vtkfile.hh
with
48 additions
and
0 deletions
dune/gfe/cosseratvtkwriter.hh
+
4
−
0
View file @
0c9fc541
...
@@ -448,7 +448,11 @@ public:
...
@@ -448,7 +448,11 @@ public:
// dump point coordinates
// dump point coordinates
writer
.
beginPoints
();
writer
.
beginPoints
();
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
writer
.
addArray
<
float
>
(
"Coordinates"
,
3
);
writer
.
addArray
<
float
>
(
"Coordinates"
,
3
);
#else
writer
.
addArray
(
"Coordinates"
,
3
,
Dune
::
VTK
::
Precision
::
float32
);
#endif
writer
.
endPoints
();
writer
.
endPoints
();
for
(
int
i
=
0
;
i
<
gridView
.
comm
().
size
();
i
++
)
for
(
int
i
=
0
;
i
<
gridView
.
comm
().
size
();
i
++
)
...
...
This diff is collapsed.
Click to expand it.
dune/gfe/vtkfile.hh
+
44
−
0
View file @
0c9fc541
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#endif
#endif
#include
<dune/common/fvector.hh>
#include
<dune/common/fvector.hh>
#include
<dune/common/version.hh>
// For parallel infrastructure stuff:
// For parallel infrastructure stuff:
#include
<dune/grid/io/file/vtk.hh>
#include
<dune/grid/io/file/vtk.hh>
...
@@ -55,19 +56,34 @@ namespace Dune {
...
@@ -55,19 +56,34 @@ namespace Dune {
writer
.
beginMain
();
writer
.
beginMain
();
writer
.
beginPointData
();
writer
.
beginPointData
();
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
writer
.
addArray
<
float
>
(
"director0"
,
3
);
writer
.
addArray
<
float
>
(
"director0"
,
3
);
writer
.
addArray
<
float
>
(
"director1"
,
3
);
writer
.
addArray
<
float
>
(
"director1"
,
3
);
writer
.
addArray
<
float
>
(
"director2"
,
3
);
writer
.
addArray
<
float
>
(
"director2"
,
3
);
writer
.
addArray
<
float
>
(
"zCoord"
,
1
);
writer
.
addArray
<
float
>
(
"zCoord"
,
1
);
#else
writer
.
addArray
(
"director0"
,
3
,
VTK
::
Precision
::
float32
);
writer
.
addArray
(
"director1"
,
3
,
VTK
::
Precision
::
float32
);
writer
.
addArray
(
"director2"
,
3
,
VTK
::
Precision
::
float32
);
writer
.
addArray
(
"zCoord"
,
1
,
VTK
::
Precision
::
float32
);
#endif
writer
.
endPointData
();
writer
.
endPointData
();
writer
.
beginCellData
();
writer
.
beginCellData
();
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
writer
.
addArray
<
float
>
(
"mycelldata"
,
1
);
writer
.
addArray
<
float
>
(
"mycelldata"
,
1
);
#else
writer
.
addArray
(
"mycelldata"
,
1
,
VTK
::
Precision
::
float32
);
#endif
writer
.
endCellData
();
writer
.
endCellData
();
// dump point coordinates
// dump point coordinates
writer
.
beginPoints
();
writer
.
beginPoints
();
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
writer
.
addArray
<
float
>
(
"Coordinates"
,
3
);
writer
.
addArray
<
float
>
(
"Coordinates"
,
3
);
#else
writer
.
addArray
(
"Coordinates"
,
3
,
VTK
::
Precision
::
float32
);
#endif
writer
.
endPoints
();
writer
.
endPoints
();
for
(
int
i
=
0
;
i
<
mpiHelper
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
mpiHelper
.
size
();
i
++
)
...
@@ -88,7 +104,11 @@ namespace Dune {
...
@@ -88,7 +104,11 @@ namespace Dune {
// Write vertex coordinates
// Write vertex coordinates
outFile
<<
" <Points>"
<<
std
::
endl
;
outFile
<<
" <Points>"
<<
std
::
endl
;
{
// extra parenthesis to control destruction of the pointsWriter object
{
// extra parenthesis to control destruction of the pointsWriter object
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
pointsWriter
(
outFile
,
"Coordinates"
,
3
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
pointsWriter
(
outFile
,
"Coordinates"
,
3
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
pointsWriter
(
outFile
,
"Coordinates"
,
3
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
float32
);
#endif
for
(
size_t
i
=
0
;
i
<
points_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
points_
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
for
(
int
j
=
0
;
j
<
3
;
j
++
)
pointsWriter
.
write
(
points_
[
i
][
j
]);
pointsWriter
.
write
(
points_
[
i
][
j
]);
...
@@ -98,19 +118,31 @@ namespace Dune {
...
@@ -98,19 +118,31 @@ namespace Dune {
// Write elements
// Write elements
outFile
<<
" <Cells>"
<<
std
::
endl
;
outFile
<<
" <Cells>"
<<
std
::
endl
;
{
// extra parenthesis to control destruction of the cellConnectivityWriter object
{
// extra parenthesis to control destruction of the cellConnectivityWriter object
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
int
>
cellConnectivityWriter
(
outFile
,
"connectivity"
,
1
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
int
>
cellConnectivityWriter
(
outFile
,
"connectivity"
,
1
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
cellConnectivityWriter
(
outFile
,
"connectivity"
,
1
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
int32
);
#endif
for
(
size_t
i
=
0
;
i
<
cellConnectivity_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
cellConnectivity_
.
size
();
i
++
)
cellConnectivityWriter
.
write
(
cellConnectivity_
[
i
]);
cellConnectivityWriter
.
write
(
cellConnectivity_
[
i
]);
}
}
{
// extra parenthesis to control destruction of the writer object
{
// extra parenthesis to control destruction of the writer object
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
int
>
cellOffsetsWriter
(
outFile
,
"offsets"
,
1
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
int
>
cellOffsetsWriter
(
outFile
,
"offsets"
,
1
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
cellOffsetsWriter
(
outFile
,
"offsets"
,
1
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
int32
);
#endif
for
(
size_t
i
=
0
;
i
<
cellOffsets_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
cellOffsets_
.
size
();
i
++
)
cellOffsetsWriter
.
write
(
cellOffsets_
[
i
]);
cellOffsetsWriter
.
write
(
cellOffsets_
[
i
]);
}
}
{
// extra parenthesis to control destruction of the writer object
{
// extra parenthesis to control destruction of the writer object
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
unsigned
int
>
cellTypesWriter
(
outFile
,
"types"
,
1
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
unsigned
int
>
cellTypesWriter
(
outFile
,
"types"
,
1
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
cellTypesWriter
(
outFile
,
"types"
,
1
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
uint32
);
#endif
for
(
size_t
i
=
0
;
i
<
cellTypes_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
cellTypes_
.
size
();
i
++
)
cellTypesWriter
.
write
(
cellTypes_
[
i
]);
cellTypesWriter
.
write
(
cellTypes_
[
i
]);
}
}
...
@@ -124,7 +156,11 @@ namespace Dune {
...
@@ -124,7 +156,11 @@ namespace Dune {
// Z coordinate for better visualization of wrinkles
// Z coordinate for better visualization of wrinkles
{
// extra parenthesis to control destruction of the writer object
{
// extra parenthesis to control destruction of the writer object
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
zCoordWriter
(
outFile
,
"zCoord"
,
1
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
zCoordWriter
(
outFile
,
"zCoord"
,
1
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
zCoordWriter
(
outFile
,
"zCoord"
,
1
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
float32
);
#endif
for
(
size_t
i
=
0
;
i
<
zCoord_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
zCoord_
.
size
();
i
++
)
zCoordWriter
.
write
(
zCoord_
[
i
]);
zCoordWriter
.
write
(
zCoord_
[
i
]);
}
}
...
@@ -132,7 +168,11 @@ namespace Dune {
...
@@ -132,7 +168,11 @@ namespace Dune {
// The three director fields
// The three director fields
for
(
size_t
i
=
0
;
i
<
3
;
i
++
)
for
(
size_t
i
=
0
;
i
<
3
;
i
++
)
{
{
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
directorWriter
(
outFile
,
"director"
+
std
::
to_string
(
i
),
3
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
directorWriter
(
outFile
,
"director"
+
std
::
to_string
(
i
),
3
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
directorWriter
(
outFile
,
"director"
+
std
::
to_string
(
i
),
3
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
float32
);
#endif
for
(
size_t
j
=
0
;
j
<
directors_
[
i
].
size
();
j
++
)
for
(
size_t
j
=
0
;
j
<
directors_
[
i
].
size
();
j
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
directorWriter
.
write
(
directors_
[
i
][
j
][
k
]);
directorWriter
.
write
(
directors_
[
i
][
j
][
k
]);
...
@@ -148,7 +188,11 @@ namespace Dune {
...
@@ -148,7 +188,11 @@ namespace Dune {
{
{
outFile
<<
" <CellData>"
<<
std
::
endl
;
outFile
<<
" <CellData>"
<<
std
::
endl
;
{
// extra parenthesis to control destruction of the writer object
{
// extra parenthesis to control destruction of the writer object
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
cellDataWriter
(
outFile
,
"mycelldata"
,
1
,
Dune
::
Indent
(
4
));
Dune
::
VTK
::
AsciiDataArrayWriter
<
float
>
cellDataWriter
(
outFile
,
"mycelldata"
,
1
,
Dune
::
Indent
(
4
));
#else
Dune
::
VTK
::
AsciiDataArrayWriter
cellDataWriter
(
outFile
,
"mycelldata"
,
1
,
Dune
::
Indent
(
4
),
VTK
::
Precision
::
float32
);
#endif
for
(
size_t
i
=
0
;
i
<
cellData_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
cellData_
.
size
();
i
++
)
cellDataWriter
.
write
(
cellData_
[
i
]);
cellDataWriter
.
write
(
cellData_
[
i
]);
}
}
...
...
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