Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pacxx-projectseminar-2019
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Vladyslav Kucher
pacxx-projectseminar-2019
Commits
6be94734
Commit
6be94734
authored
6 years ago
by
Jö Fahlke
Browse files
Options
Downloads
Patches
Plain Diff
Directly output exact solution.
parent
4aa9ea94
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
src/driver.hh
+2
-3
2 additions, 3 deletions
src/driver.hh
src/vtkfunction.hh
+49
-0
49 additions, 0 deletions
src/vtkfunction.hh
with
51 additions
and
3 deletions
src/driver.hh
+
2
−
3
View file @
6be94734
...
...
@@ -46,6 +46,7 @@
//== }
#include
"problem.hh"
#include
"gridoperator.hh"
#include
"vtkfunction.hh"
template
<
typename
GV
>
void
driver
(
const
GV
&
gv
,
Dune
::
ParameterTree
&
ptree
)
...
...
@@ -151,13 +152,11 @@ void driver (const GV& gv, Dune::ParameterTree& ptree)
newton
.
apply
();
// Write VTK output file
Z
w
(
gfs
);
// Lagrange interpolation of exact solution
Dune
::
PDELab
::
interpolate
(
g
,
gfs
,
w
);
int
subsampling
=
ptree
.
get
(
"output.subsampling"
,(
int
)
1
);
Dune
::
SubsamplingVTKWriter
<
GV
>
vtkwriter
(
gv
,
Dune
::
refinementIntervals
(
subsampling
));
using
Function
=
Dune
::
P1VTKFunction
<
GV
,
typename
Z
::
Container
>
;
vtkwriter
.
addVertexData
(
std
::
make_shared
<
Function
>
(
gv
,
*
z
.
storage
(),
"fesol"
));
vtkwriter
.
addVertexData
(
std
::
make
_shared
<
Function
>
(
gv
,
*
w
.
storage
(),
"exact"
));
vtkwriter
.
addVertexData
(
PPS
::
make
ScalarVTKGridFunction
<
GV
>
(
glambda
,
"exact"
));
vtkwriter
.
write
(
ptree
.
get
(
"output.filename"
,
"output"
),
Dune
::
VTK
::
appendedraw
);
}
...
...
This diff is collapsed.
Click to expand it.
src/vtkfunction.hh
0 → 100644
+
49
−
0
View file @
6be94734
#ifndef PACXX_PROJECTSEMINAR_2019_SRC_VTKFUNCTION_HH
#define PACXX_PROJECTSEMINAR_2019_SRC_VTKFUNCTION_HH
#include
<memory>
#include
<string>
#include
<utility>
#include
<dune/common/fvector.hh>
#include
<dune/grid/io/file/vtk/function.hh>
namespace
PPS
{
template
<
class
GridView
,
class
Functor
>
class
ScalarVTKGridFunction
:
public
Dune
::
VTKFunction
<
GridView
>
{
Functor
functor_
;
std
::
string
name_
;
public:
typedef
typename
GridView
::
ctype
ctype
;
enum
{
dim
=
GridView
::
dimension
};
typedef
typename
GridView
::
template
Codim
<
0
>
::
Entity
Entity
;
ScalarVTKGridFunction
(
Functor
functor
,
std
::
string
name
)
:
functor_
(
std
::
move
(
functor
)),
name_
(
std
::
move
(
name
))
{
}
int
ncomps
()
const
override
{
return
1
;
}
std
::
string
name
()
const
override
{
return
name_
;
}
double
evaluate
(
int
comp
,
const
Entity
&
e
,
const
Dune
::
FieldVector
<
ctype
,
dim
>&
xi
)
const
override
{
assert
(
comp
==
0
);
return
functor_
(
e
,
xi
);
}
};
template
<
class
GridView
,
class
Functor
>
auto
makeScalarVTKGridFunction
(
Functor
functor
,
std
::
string
name
)
{
return
std
::
make_unique
<
ScalarVTKGridFunction
<
GridView
,
Functor
>
>
(
std
::
move
(
functor
),
std
::
move
(
name
));
}
}
// namespace PPS
#endif // PACXX_PROJECTSEMINAR_2019_SRC_VTKFUNCTION_HH
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