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
b39b761e
Commit
b39b761e
authored
5 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Modernize the code in interillustration.cc a bit
parent
57b82803
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/interillustration.cc
+9
-13
9 additions, 13 deletions
test/interillustration.cc
with
9 additions
and
13 deletions
test/interillustration.cc
+
9
−
13
View file @
b39b761e
...
...
@@ -8,7 +8,7 @@
#include
<dune/localfunctions/lagrange/p2.hh>
#include
<dune/functions/functionspacebases/lagrangebasis.hh>
#include
<dune/functions/gridfunctions/discrete
scalar
globalbasisfunction.hh>
#include
<dune/functions/gridfunctions/discreteglobalbasisfunction.hh>
#include
<dune/gfe/unitvector.hh>
#include
<dune/gfe/localgeodesicfefunction.hh>
...
...
@@ -79,11 +79,9 @@ void interpolate(const LocalFEFunctionType& localGeodesicFEFunction,
factory
.
insertVertex
({
1
,
0
});
factory
.
insertVertex
({
0
,
1
});
GeometryType
triangle
;
triangle
.
makeTriangle
();
factory
.
insertElement
(
triangle
,
{
0
,
1
,
2
});
factory
.
insertElement
(
GeometryTypes
::
triangle
,
{
0
,
1
,
2
});
shared_ptr
<
GridType
>
grid
=
shared_ptr
<
GridType
>
(
factory
.
createGrid
()
)
;
shared_ptr
<
GridType
>
grid
=
factory
.
createGrid
();
grid
->
globalRefine
(
3
);
...
...
@@ -146,16 +144,14 @@ void interpolate(const LocalFEFunctionType& localGeodesicFEFunction,
typedef
Functions
::
LagrangeBasis
<
typename
DeformedGridType
::
LeafGridView
,
1
>
FEBasis
;
FEBasis
feBasis
(
deformedGrid
.
leafGridView
());
Functions
::
DiscreteScalarGlobalBasisFunction
<
decltype
(
feBasis
),
decltype
(
variation0
)
>
variation0Function
(
feBasis
,
variation0
);
Functions
::
DiscreteScalarGlobalBasisFunction
<
decltype
(
feBasis
),
decltype
(
variation1
)
>
variation1Function
(
feBasis
,
variation1
);
auto
localVariation0Function
=
localFunction
(
variation0Function
);
auto
localVariation1Function
=
localFunction
(
variation1Function
);
auto
variation0Function
=
Functions
::
makeDiscreteGlobalBasisFunction
<
typename
TargetSpace
::
EmbeddedTangentVector
>
(
feBasis
,
variation0
);
auto
variation1Function
=
Functions
::
makeDiscreteGlobalBasisFunction
<
typename
TargetSpace
::
EmbeddedTangentVector
>
(
feBasis
,
variation1
);
Dune
::
VTKWriter
<
typename
DeformedGridType
::
LeafGridView
>
vtkWriter
(
deformedGrid
.
leafGridView
());
vtkWriter
.
addCellData
(
colors
,
"colors"
);
vtkWriter
.
addVertexData
(
localV
ariation0Function
,
VTK
::
FieldInfo
(
"variation 0"
,
VTK
::
FieldInfo
::
Type
::
scalar
,
variation0
[
0
].
size
()));
vtkWriter
.
addVertexData
(
localV
ariation1Function
,
VTK
::
FieldInfo
(
"variation 1"
,
VTK
::
FieldInfo
::
Type
::
scalar
,
variation1
[
0
].
size
()));
vtkWriter
.
addVertexData
(
v
ariation0Function
,
VTK
::
FieldInfo
(
"variation 0"
,
VTK
::
FieldInfo
::
Type
::
scalar
,
variation0
[
0
].
size
()));
vtkWriter
.
addVertexData
(
v
ariation1Function
,
VTK
::
FieldInfo
(
"variation 1"
,
VTK
::
FieldInfo
::
Type
::
scalar
,
variation1
[
0
].
size
()));
vtkWriter
.
write
(
"sphere-patch-"
+
nameSuffix
);
}
...
...
@@ -211,8 +207,8 @@ int main(int argc, char* argv[]) try
//interpolate<TargetSpace,LocalProjectedFEFunctionType>(coefficients, "projected");
//interpolate<TargetSpace,LocalTangentFEFunctionType>(coefficients, "tangent");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
&
e
)
{
std
::
cout
<<
e
<<
std
::
endl
;
std
::
cout
<<
e
.
what
()
<<
std
::
endl
;
}
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