Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
amdis
amdis-core
Commits
efb2ca41
Commit
efb2ca41
authored
5 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
corrected visibility bug in lambda
parent
1ba68264
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!58
Add generalized derivative and local-to-global adapter to handle the global derivatives uniformly
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
+29
-15
29 additions, 15 deletions
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
with
29 additions
and
15 deletions
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
+
29
−
15
View file @
efb2ca41
...
...
@@ -220,6 +220,10 @@ public:
using
Domain
=
typename
Super
::
Domain
;
using
Super
::
DerivativeLocalFunctionBase
;
using
Super
::
globalFunction_
;
using
Super
::
geometry_
;
using
Super
::
subTree_
;
using
Super
::
localView_
;
/// Evaluate Gradient at bound element in local coordinates
Range
operator
()(
Domain
const
&
x
)
const
...
...
@@ -227,18 +231,18 @@ public:
assert
(
Super
::
bound_
);
Range
dy
(
0
);
auto
&&
coefficients
=
*
Super
::
globalFunction_
.
dofVector_
;
auto
&&
nodeToRangeEntry
=
Super
::
globalFunction_
.
nodeToRangeEntry_
;
for_each_leaf_node
(
*
Super
::
subTree_
,
[
&
,
this
](
auto
const
&
node
,
auto
const
&
tp
)
auto
&&
coefficients
=
*
globalFunction_
.
dofVector_
;
auto
&&
nodeToRangeEntry
=
globalFunction_
.
nodeToRangeEntry_
;
for_each_leaf_node
(
*
subTree_
,
[
&
,
this
](
auto
const
&
node
,
auto
const
&
tp
)
{
auto
localBasis
=
makeLocalToGlobalBasisAdapter
(
node
,
Super
::
geometry_
.
value
());
auto
localBasis
=
makeLocalToGlobalBasisAdapter
(
node
,
geometry_
.
value
());
auto
const
&
gradients
=
localBasis
.
gradientsAt
(
x
);
// Get range entry associated to this node
auto
re
=
Dune
::
Functions
::
flatVectorView
(
nodeToRangeEntry
(
node
,
tp
,
dy
));
for
(
std
::
size_t
i
=
0
;
i
<
localBasis
.
size
();
++
i
)
{
auto
&&
multiIndex
=
Super
::
localView_
.
index
(
node
.
localIndex
(
i
));
auto
&&
multiIndex
=
localView_
.
index
(
node
.
localIndex
(
i
));
// Get coefficient associated to i-th shape function
auto
c
=
Dune
::
Functions
::
flatVectorView
(
coefficients
[
multiIndex
]);
...
...
@@ -273,6 +277,10 @@ public:
using
Domain
=
typename
Super
::
Domain
;
using
Super
::
DerivativeLocalFunctionBase
;
using
Super
::
globalFunction_
;
using
Super
::
geometry_
;
using
Super
::
subTree_
;
using
Super
::
localView_
;
/// Evaluate divergence at bound element in local coordinates
Range
operator
()(
Domain
const
&
x
)
const
...
...
@@ -294,10 +302,10 @@ private:
assert
(
Super
::
bound_
);
Range
dy
(
0
);
auto
&&
coefficients
=
*
Super
::
globalFunction_
.
dofVector_
;
auto
&&
node
=
*
Super
::
subTree_
;
auto
&&
coefficients
=
*
globalFunction_
.
dofVector_
;
auto
&&
node
=
*
subTree_
;
auto
localBasis
=
makeLocalToGlobalBasisAdapter
(
node
.
child
(
0
),
Super
::
geometry_
.
value
());
auto
localBasis
=
makeLocalToGlobalBasisAdapter
(
node
.
child
(
0
),
geometry_
.
value
());
auto
const
&
gradients
=
localBasis
.
gradientsAt
(
x
);
auto
re
=
Dune
::
Functions
::
flatVectorView
(
dy
);
...
...
@@ -307,7 +315,7 @@ private:
assert
(
int
(
grad
.
size
())
==
GridView
::
dimensionworld
);
for
(
std
::
size_t
j
=
0
;
j
<
GridView
::
dimensionworld
;
++
j
)
{
auto
&&
multiIndex
=
Super
::
localView_
.
index
(
node
.
child
(
j
).
localIndex
(
i
));
auto
&&
multiIndex
=
localView_
.
index
(
node
.
child
(
j
).
localIndex
(
i
));
re
[
0
]
+=
coefficients
[
multiIndex
]
*
grad
[
j
];
}
}
...
...
@@ -328,6 +336,10 @@ public:
using
Domain
=
typename
Super
::
Domain
;
using
Super
::
DerivativeLocalFunctionBase
;
using
Super
::
globalFunction_
;
using
Super
::
geometry_
;
using
Super
::
subTree_
;
using
Super
::
localView_
;
/// Evaluate partial derivative at bound element in local coordinates
Range
operator
()(
Domain
const
&
x
)
const
...
...
@@ -335,18 +347,20 @@ public:
assert
(
Super
::
bound_
);
Range
dy
(
0
);
auto
&&
coefficients
=
*
Super
::
globalFunction_
.
dofVector_
;
auto
&&
nodeToRangeEntry
=
Super
::
globalFunction_
.
nodeToRangeEntry_
;
for_each_leaf_node
(
*
Super
::
subTree_
,
[
&
,
this
](
auto
const
&
node
,
auto
const
&
tp
)
std
::
size_t
comp
=
Super
::
type_
.
comp
;
auto
&&
coefficients
=
*
globalFunction_
.
dofVector_
;
auto
&&
nodeToRangeEntry
=
globalFunction_
.
nodeToRangeEntry_
;
for_each_leaf_node
(
*
subTree_
,
[
&
,
this
](
auto
const
&
node
,
auto
const
&
tp
)
{
auto
localBasis
=
makeLocalToGlobalBasisAdapter
(
node
,
Super
::
geometry_
.
value
());
auto
const
&
partial
=
localBasis
.
partialsAt
(
x
,
Super
::
type_
.
comp
);
auto
localBasis
=
makeLocalToGlobalBasisAdapter
(
node
,
geometry_
.
value
());
auto
const
&
partial
=
localBasis
.
partialsAt
(
x
,
comp
);
// Get range entry associated to this node
auto
re
=
Dune
::
Functions
::
flatVectorView
(
nodeToRangeEntry
(
node
,
tp
,
dy
));
for
(
std
::
size_t
i
=
0
;
i
<
localBasis
.
size
();
++
i
)
{
auto
&&
multiIndex
=
Super
::
localView_
.
index
(
node
.
localIndex
(
i
));
auto
&&
multiIndex
=
localView_
.
index
(
node
.
localIndex
(
i
));
// Get coefficient associated to i-th shape function
auto
c
=
Dune
::
Functions
::
flatVectorView
(
coefficients
[
multiIndex
]);
...
...
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