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
3a8242e7
Commit
3a8242e7
authored
5 years ago
by
graeser
Browse files
Options
Downloads
Patches
Plain Diff
Update to changes in dune-functions
parent
e4253f1f
Branches
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
src/07-poisson-problem-functions.cc
+5
-10
5 additions, 10 deletions
src/07-poisson-problem-functions.cc
with
5 additions
and
10 deletions
src/07-poisson-problem-functions.cc
+
5
−
10
View file @
3a8242e7
...
...
@@ -39,7 +39,7 @@
#include
<dune/localfunctions/lagrange/pqkfactory.hh>
// included dune-functions headers
#include
<dune/functions/functionspacebases/
pqknodal
basis.hh>
#include
<dune/functions/functionspacebases/
lagrange
basis.hh>
#include
<dune/functions/functionspacebases/interpolate.hh>
#include
<dune/functions/gridfunctions/discreteglobalbasisfunction.hh>
...
...
@@ -74,12 +74,10 @@ void assemblePoissonProblem(
ElementRhs
elementRhs
;
auto
localView
=
basis
.
localView
();
auto
localIndexSet
=
basis
.
localIndexSet
();
for
(
const
auto
&
e
:
Dune
::
elements
(
gridView
))
{
localView
.
bind
(
e
);
localIndexSet
.
bind
(
localView
);
const
auto
&
localFiniteElement
=
localView
.
tree
().
finiteElement
();
...
...
@@ -90,10 +88,10 @@ void assemblePoissonProblem(
for
(
std
::
size_t
i
=
0
;
i
<
localSize
;
++
i
)
{
std
::
size_t
globalI
=
local
IndexSet
.
index
(
i
);
std
::
size_t
globalI
=
local
View
.
index
(
i
);
for
(
std
::
size_t
j
=
0
;
j
<
localSize
;
++
j
)
{
std
::
size_t
globalJ
=
local
IndexSet
.
index
(
j
);
std
::
size_t
globalJ
=
local
View
.
index
(
j
);
matrixBuilder
[
globalI
][
globalJ
]
+=
elementMatrix
[
i
][
j
];
}
...
...
@@ -110,12 +108,10 @@ void computeBoundaryVertices(const GridView& gridView, BitVector& isBoundary, co
using
namespace
Dune
::
FuTutorial
;
auto
localView
=
basis
.
localView
();
auto
localIndexSet
=
basis
.
localIndexSet
();
for
(
const
auto
&
element
:
elements
(
gridView
))
{
localView
.
bind
(
element
);
localIndexSet
.
bind
(
localView
);
const
auto
&
localFiniteElement
=
localView
.
tree
().
finiteElement
();
std
::
size_t
localSize
=
localFiniteElement
.
localBasis
().
size
();
...
...
@@ -130,7 +126,7 @@ void computeBoundaryVertices(const GridView& gridView, BitVector& isBoundary, co
if
(
localKey
.
codim
()
>
0
)
for
(
const
auto
&
subEntity
:
subEntities
(
referenceElement
(
element
),
insideFacet
(
intersection
),
codim
(
localKey
.
codim
())))
if
(
subEntity
==
localKey
.
subEntity
())
isBoundary
[
local
IndexSet
.
index
(
i
)]
=
true
;
isBoundary
[
local
View
.
index
(
i
)]
=
true
;
}
}
}
...
...
@@ -191,7 +187,7 @@ int main(int argc, char** argv)
};
using
Basis
=
typename
Dune
::
Functions
::
PQkNodal
Basis
<
GridView
,
4
>
;
using
Basis
=
typename
Dune
::
Functions
::
Lagrange
Basis
<
GridView
,
4
>
;
Basis
basis
(
gridView
);
assemblePoissonProblem
(
gridView
,
A
,
rhs
,
rhsFunction
,
basis
);
...
...
@@ -201,7 +197,6 @@ int main(int argc, char** argv)
auto
dirichletFunction
=
[](
auto
x
)
{
return
sin
(
x
[
0
]
*
2.0
*
M_PI
)
*
.1
;
};
// Dune::Functions::interpolate(basis, Dune::TypeTree::hybridTreePath(), dirichletNodes, dirichletFunction);
Dune
::
Functions
::
interpolate
(
basis
,
x
,
dirichletFunction
);
std
::
vector
<
bool
>
isBoundary
;
...
...
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