Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
ag-ohlberger
dune-community
dune-gdt
Commits
d22cae48
Commit
d22cae48
authored
4 years ago
by
Tobias Leibner
Committed by
github-actions[bot]
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[spaces.basis.default] cache evaluations
parent
9fdcd6ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gdt/spaces/basis/default.hh
+24
-6
24 additions, 6 deletions
dune/gdt/spaces/basis/default.hh
with
24 additions
and
6 deletions
dune/gdt/spaces/basis/default.hh
+
24
−
6
View file @
d22cae48
...
...
@@ -114,21 +114,28 @@ private:
protected
:
void
post_bind
(
const
ElementType
&
elemnt
)
override
final
{
current_local_fe_
=
XT
::
Common
::
ConstStorageProvider
<
LocalFiniteElementInterface
<
D
,
d
,
R
,
r
,
rC
>>
(
self_
.
local_finite_elements_
.
get
(
elemnt
.
type
(),
self_
.
fe_order_
));
auto
&&
new_geometry_type
=
elemnt
.
type
();
if
(
geometry_type_
!=
new_geometry_type
)
{
geometry_type_
=
new_geometry_type
;
current_local_fe_
=
XT
::
Common
::
ConstStorageProvider
<
LocalFiniteElementInterface
<
D
,
d
,
R
,
r
,
rC
>>
(
self_
.
local_finite_elements_
.
get
(
geometry_type_
,
self_
.
fe_order_
));
size_
=
current_local_fe_
.
access
().
size
();
order_
=
current_local_fe_
.
access
().
basis
().
order
();
eval_cache_
.
clear
();
}
}
public
:
size_t
size
(
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
DUNE_THROW_IF
(
!
current_local_fe_
.
valid
(),
Exceptions
::
not_bound_to_an_element_yet
,
""
);
return
current_local_fe_
.
access
().
size
()
;
return
size
_
;
}
int
order
(
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
DUNE_THROW_IF
(
!
current_local_fe_
.
valid
(),
Exceptions
::
not_bound_to_an_element_yet
,
""
);
return
current_local_fe_
.
access
().
basis
().
order
()
;
return
order
_
;
}
using
BaseType
::
evaluate
;
...
...
@@ -140,7 +147,13 @@ private:
{
DUNE_THROW_IF
(
!
current_local_fe_
.
valid
(),
Exceptions
::
not_bound_to_an_element_yet
,
""
);
this
->
assert_inside_reference_element
(
point_in_reference_element
);
current_local_fe_
.
access
().
basis
().
evaluate
(
point_in_reference_element
,
result
);
const
auto
it
=
eval_cache_
.
find
(
point_in_reference_element
);
if
(
it
!=
eval_cache_
.
end
())
result
=
it
->
second
;
else
{
current_local_fe_
.
access
().
basis
().
evaluate
(
point_in_reference_element
,
result
);
eval_cache_
[
point_in_reference_element
]
=
result
;
}
}
void
jacobians
(
const
DomainType
&
point_in_reference_element
,
...
...
@@ -160,7 +173,8 @@ private:
// function gradients) to get the transposed jacobian of the basis function (basis function gradient).
const
auto
J_inv_T
=
this
->
element
().
geometry
().
jacobianInverseTransposed
(
point_in_reference_element
);
auto
tmp_value
=
result
[
0
][
0
];
for
(
size_t
ii
=
0
;
ii
<
current_local_fe_
.
access
().
basis
().
size
();
++
ii
)
const
size_t
basis_size
=
current_local_fe_
.
access
().
basis
().
size
();
for
(
size_t
ii
=
0
;
ii
<
basis_size
;
++
ii
)
for
(
size_t
rr
=
0
;
rr
<
r
;
++
rr
)
{
J_inv_T
.
mv
(
result
[
ii
][
rr
],
tmp_value
);
result
[
ii
][
rr
]
=
tmp_value
;
...
...
@@ -202,6 +216,10 @@ private:
private
:
const
DefaultGlobalBasis
<
GV
,
r
,
rC
,
R
>&
self_
;
XT
::
Common
::
ConstStorageProvider
<
LocalFiniteElementInterface
<
D
,
d
,
R
,
r
,
rC
>>
current_local_fe_
;
size_t
size_
;
int
order_
;
Dune
::
GeometryType
geometry_type_
;
mutable
std
::
map
<
DomainType
,
std
::
vector
<
RangeType
>
,
XT
::
Common
::
FieldVectorLess
>
eval_cache_
;
};
// class LocalizedDefaultGlobalBasis
const
GridViewType
&
grid_view_
;
...
...
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