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
0dbc1320
Commit
0dbc1320
authored
Sep 04, 2018
by
Praetorius, Simon
Browse files
polygongrid writer with legacy vtk function
parent
3fe0ad6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/polygongrid.cc
View file @
0dbc1320
...
...
@@ -12,15 +12,10 @@
#include
<dune/common/exceptions.hh>
// We use exceptions
#include
<dune/common/filledarray.hh>
#include
<dune/functions/functionspacebases/defaultglobalbasis.hh>
#include
<dune/functions/functionspacebases/lagrangebasis.hh>
#include
<dune/functions/functionspacebases/interpolate.hh>
#include
<dune/functions/gridfunctions/analyticgridviewfunction.hh>
#include
<dune/functions/gridfunctions/discreteglobalbasisfunction.hh>
#include
<dune/polygongrid/grid.hh>
#include
<dune/polygongrid/gridfactory.hh>
#include
<dune/vtk/legacyvtkfunction.hh>
#include
<dune/vtk/writers/vtkunstructuredgridwriter.hh>
using
namespace
Dune
;
...
...
@@ -59,7 +54,7 @@ int main(int argc, char** argv)
using
Writer
=
VtkUnstructuredGridWriter
<
GridView
>
;
Writer
vtkWriter
(
gridView
,
Vtk
::
ASCII
);
std
::
vector
<
double
>
p1function
(
gridView
.
size
(
dim
),
1.0
);
std
::
vector
<
double
>
p1function
(
gridView
.
size
(
GridView
::
dimension
),
1.0
);
using
P1Function
=
P1VTKFunction
<
GridView
,
std
::
vector
<
double
>>
;
std
::
shared_ptr
<
VTKFunction
<
GridView
>
const
>
p1FctWrapped
(
new
P1Function
(
gridView
,
p1function
,
"p1"
));
...
...
@@ -67,8 +62,8 @@ int main(int argc, char** argv)
using
P0Function
=
P0VTKFunction
<
GridView
,
std
::
vector
<
double
>>
;
std
::
shared_ptr
<
VTKFunction
<
GridView
>
const
>
p0FctWrapped
(
new
P0Function
(
gridView
,
p0function
,
"p0"
));
vtkWriter
.
addPointData
(
p1FctWrapped
,
"p1"
);
vtkWriter
.
addCellData
(
p0FctWrapped
,
"p0"
);
vtkWriter
.
addPointData
(
p1FctWrapped
);
vtkWriter
.
addCellData
(
p0FctWrapped
);
vtkWriter
.
write
(
"poly_ascii_float32.vtu"
);
}
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