Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fu-tutorial
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
graeser
dune-fu-tutorial
Commits
ff42b7bf
Commit
ff42b7bf
authored
1 year ago
by
graeser
Browse files
Options
Downloads
Patches
Plain Diff
Update
parent
ecaab53c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune.module
+1
-1
1 addition, 1 deletion
dune.module
src/05-poisson-problem.cc
+3
-3
3 additions, 3 deletions
src/05-poisson-problem.cc
src/06-interpolation.cc
+4
-11
4 additions, 11 deletions
src/06-interpolation.cc
with
8 additions
and
15 deletions
dune.module
+
1
−
1
View file @
ff42b7bf
...
...
@@ -4,7 +4,7 @@
#Name of the module
Module
:
dune
-
fu
-
tutorial
Version
:
0.1
Version
:
1.0
Maintainer
:
graeser
@
mi
.
fu
-
berlin
.
de
#depending on
Depends
:
dune
-
common
dune
-
geometry
dune
-
grid
dune
-
localfunctions
dune
-
istl
dune
-
typetree
dune
-
functions
dune
-
uggrid
This diff is collapsed.
Click to expand it.
src/05-poisson-problem.cc
+
3
−
3
View file @
ff42b7bf
...
...
@@ -100,7 +100,8 @@ int main(int argc, char** argv)
};
assemblePoissonProblemPQ1
(
gridView
,
A
,
rhs
,
rhsFunction
);
x
.
resize
(
rhs
.
size
(),
0
);
x
.
resize
(
rhs
.
size
());
x
=
0
;
std
::
vector
<
bool
>
isBoundary
;
isBoundary
.
resize
(
rhs
.
size
(),
false
);
...
...
@@ -118,8 +119,7 @@ int main(int argc, char** argv)
}
Dune
::
MatrixAdapter
<
Matrix
,
Vector
,
Vector
>
op
(
A
);
Dune
::
SeqILU0
<
Matrix
,
Vector
,
Vector
>
ilu0
(
A
,
1.0
);
Dune
::
SeqSSOR
<
Matrix
,
Vector
,
Vector
>
preconditioner
(
A
,
1
,
1.0
);
Dune
::
SeqILDL
<
Matrix
,
Vector
,
Vector
>
preconditioner
(
A
,
1.0
);
Dune
::
CGSolver
<
Vector
>
cg
(
op
,
preconditioner
,
// preconditione
1e-4
,
// desired residual reduction factor
...
...
This diff is collapsed.
Click to expand it.
src/06-interpolation.cc
+
4
−
11
View file @
ff42b7bf
...
...
@@ -38,9 +38,6 @@
// included dune-localfunctions headers
#include
<dune/localfunctions/lagrange/pqkfactory.hh>
// included dune-functions headers
#include
<dune/functions/common/functionfromcallable.hh>
// included dune-fu-tutorial headers
#include
<dune/fu-tutorial/referenceelementutility.hh>
...
...
@@ -79,11 +76,7 @@ void interpolateFunction(const GridView& gridView, Vector& v, const F& f)
std
::
vector
<
Range
>
localV
;
// localFiniteElement.localInterpolation().interpolate(localF, localV);
using
FunctionFromCallable
=
typename
Dune
::
Functions
::
FunctionFromCallable
<
Range
(
LocalDomain
),
decltype
(
localF
)
>
;
auto
localFWithEvaluate
=
FunctionFromCallable
(
localF
);
localFiniteElement
.
localInterpolation
().
interpolate
(
localFWithEvaluate
,
localV
);
localFiniteElement
.
localInterpolation
().
interpolate
(
localF
,
localV
);
for
(
std
::
size_t
i
=
0
;
i
<
localSize
;
++
i
)
{
...
...
@@ -148,7 +141,8 @@ int main(int argc, char** argv)
};
assemblePoissonProblemPQ1
(
gridView
,
A
,
rhs
,
rhsFunction
);
x
.
resize
(
rhs
.
size
(),
0
);
x
.
resize
(
rhs
.
size
());
x
=
0
;
auto
dirichletFunction
=
[](
auto
x
)
{
return
sin
(
x
[
0
]
*
2.0
*
M_PI
)
*
.1
;
...
...
@@ -171,8 +165,7 @@ int main(int argc, char** argv)
}
Dune
::
MatrixAdapter
<
Matrix
,
Vector
,
Vector
>
op
(
A
);
Dune
::
SeqILU0
<
Matrix
,
Vector
,
Vector
>
ilu0
(
A
,
1.0
);
Dune
::
SeqSSOR
<
Matrix
,
Vector
,
Vector
>
preconditioner
(
A
,
1
,
1.0
);
Dune
::
SeqILDL
<
Matrix
,
Vector
,
Vector
>
preconditioner
(
A
,
1.0
);
Dune
::
CGSolver
<
Vector
>
cg
(
op
,
preconditioner
,
// preconditione
1e-4
,
// desired residual reduction factor
...
...
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