Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-vtk
Commits
f2d0d57b
Commit
f2d0d57b
authored
Sep 27, 2019
by
Praetorius, Simon
Browse files
yasp-datacollector writes only on initial gridview level
parent
cdc91a18
Changes
2
Hide whitespace changes
Inline
Side-by-side
dune/vtk/datacollectors/yaspdatacollector.hh
View file @
f2d0d57b
...
...
@@ -26,7 +26,7 @@ public:
,
extent_
(
filledArray
<
6
,
int
>
(
0
))
,
origin_
(
0.0
)
,
spacing_
(
0.0
)
,
level_
(
gridView
.
template
begin
<
0
,
All_Partition
>()
->
level
()
)
,
level_
(
0
)
{}
std
::
array
<
int
,
6
>
const
&
wholeExtentImpl
()
const
...
...
@@ -53,12 +53,13 @@ public:
{
Super
::
updateImpl
();
level_
=
gridView_
.
template
begin
<
0
,
All_Partition
>()
->
level
();
for
(
int
i
=
0
;
i
<
dim
;
++
i
)
{
wholeExtent_
[
2
*
i
]
=
0
;
wholeExtent_
[
2
*
i
+
1
]
=
grid
(
gridView_
).
levelSize
(
level_
,
i
);
wholeExtent_
[
2
*
i
+
1
]
=
grid
(
gridView_
.
grid
()
).
levelSize
(
level_
,
i
);
}
auto
const
&
gl
=
*
grid
(
gridView_
).
begin
(
level_
);
auto
const
&
gl
=
*
grid
(
gridView_
.
grid
()
).
begin
(
level_
);
auto
const
&
g
=
gl
.
interior
[
0
];
auto
const
&
gc
=
*
g
.
dataBegin
();
for
(
int
i
=
0
;
i
<
dim
;
++
i
)
{
...
...
@@ -66,7 +67,7 @@ public:
extent_
[
2
*
i
+
1
]
=
gc
.
max
(
i
)
+
1
;
}
auto
it
=
grid
(
gridView_
).
begin
(
level_
);
auto
it
=
grid
(
gridView_
.
grid
()
).
begin
(
level_
);
initGeometry
(
it
->
coords
);
}
...
...
@@ -99,7 +100,7 @@ public:
template
<
class
T
>
std
::
array
<
std
::
vector
<
T
>
,
3
>
coordinatesImpl
()
const
{
auto
it
=
grid
(
gridView_
).
begin
(
level_
);
auto
it
=
grid
(
gridView_
.
grid
()
).
begin
(
level_
);
auto
const
&
coords
=
it
->
coords
;
std
::
array
<
std
::
vector
<
T
>
,
3
>
ordinates
{};
...
...
@@ -122,18 +123,18 @@ private:
template
<
class
G
>
using
HostGrid
=
decltype
(
std
::
declval
<
G
>
().
hostGrid
());
template
<
class
G
V
,
std
::
enable_if_t
<
Std
::
is_detected
<
HostGrid
,
typename
GV
::
Grid
>
::
value
,
int
>
=
0
>
auto
const
&
grid
(
G
V
const
&
g
ridView
)
const
template
<
class
G
,
std
::
enable_if_t
<
not
Std
::
is_detected
<
HostGrid
,
G
>
::
value
,
int
>
=
0
>
auto
const
&
grid
(
G
const
&
g
)
const
{
return
g
ridView
.
grid
().
hostGrid
()
;
return
g
;
}
template
<
class
G
V
,
std
::
enable_if_t
<
not
Std
::
is_detected
<
HostGrid
,
typename
GV
::
Grid
>
::
value
,
int
>
=
0
>
auto
const
&
grid
(
G
V
const
&
g
ridView
)
const
template
<
class
G
,
std
::
enable_if_t
<
Std
::
is_detected
<
HostGrid
,
G
>
::
value
,
int
>
=
0
>
auto
const
&
grid
(
G
const
&
g
)
const
{
return
grid
View
.
g
rid
();
return
grid
(
g
.
hostG
rid
()
)
;
}
protected:
...
...
dune/vtk/vtkwriter.hh
View file @
f2d0d57b
...
...
@@ -41,19 +41,19 @@ namespace Dune
namespace
Impl
{
// A structured grid with co
nstant spacing
in x, y, and z direction
.
// A structured grid with co
ordinates
in x, y, and z direction
with arbitrary spacing
template
<
class
GridView
,
int
dim
,
class
Coordinates
>
struct
VtkWriterImpl
<
GridView
,
YaspGrid
<
dim
,
Coordinates
>>
{
using
type
=
Vtk
ImageData
Writer
<
GridView
,
YaspDataCollector
<
GridView
>>
;
using
type
=
Vtk
RectilinearGrid
Writer
<
GridView
,
YaspDataCollector
<
GridView
>>
;
};
#if HAVE_DUNE_SPGRID
// A structured grid with co
nstant spacing
in x, y, and z direction
.
// A structured grid with co
ordinates
in x, y, and z direction
with arbitrary spacing
template
<
class
GridView
,
class
ct
,
int
dim
,
template
<
int
>
class
Ref
,
class
Comm
>
struct
VtkWriterImpl
<
GridView
,
SPGrid
<
ct
,
dim
,
Ref
,
Comm
>>
{
using
type
=
Vtk
ImageData
Writer
<
GridView
,
SPDataCollector
<
GridView
>>
;
using
type
=
Vtk
RectilinearGrid
Writer
<
GridView
,
SPDataCollector
<
GridView
>>
;
};
#endif
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment