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
4cb92ef2
Commit
4cb92ef2
authored
5 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[local.discretefunction] improve performance for fv spaces
parent
132f2feb
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/local/discretefunction.hh
+15
-13
15 additions, 13 deletions
dune/gdt/local/discretefunction.hh
with
15 additions
and
13 deletions
dune/gdt/local/discretefunction.hh
+
15
−
13
View file @
4cb92ef2
...
...
@@ -64,12 +64,13 @@ public:
ConstLocalDiscreteFunction
(
const
SpaceType
&
spc
,
const
ConstDofVectorType
&
dof_vector
)
:
BaseType
()
,
space_
(
spc
.
copy
())
,
space_is_fv_
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
,
dof_vector_
(
dof_vector
.
localize
())
,
basis_
(
space_
->
basis
().
localize
())
,
basis_values_
(
space_
->
mapper
().
max_local_size
())
,
dynamic_basis_values_
(
space_
->
mapper
().
max_local_
size
())
,
basis_derivatives_
(
space_
->
mapper
().
max_local_
size
())
,
dynamic_basis_derivatives_
(
space_
->
mapper
().
max_local_
size
())
,
basis_values_
(
space_is_fv_
?
0
:
space_
->
mapper
().
max_local_size
())
,
dynamic_basis_values_
(
basis_values_
.
size
())
,
basis_derivatives_
(
basis_values_
.
size
())
,
dynamic_basis_derivatives_
(
basis_values_
.
size
())
{}
virtual
~
ConstLocalDiscreteFunction
()
=
default
;
...
...
@@ -119,7 +120,7 @@ public:
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
RangeReturnType
result
(
0
);
if
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
{
if
(
space_
is_fv_
)
{
for
(
size_t
ii
=
0
;
ii
<
r
;
++
ii
)
result
[
ii
]
=
dof_vector_
[
ii
];
}
else
{
...
...
@@ -135,7 +136,7 @@ public:
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
DerivativeRangeReturnType
result
(
0
);
if
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
{
if
(
space_
is_fv_
)
{
return
result
;
}
else
{
basis_
->
jacobians
(
point_in_reference_element
,
basis_derivatives_
,
param
);
...
...
@@ -150,7 +151,7 @@ public:
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
DUNE_THROW_IF
(
space_
->
type
()
!=
GDT
::
SpaceType
::
finite_volume
,
DUNE_THROW_IF
(
space_
is_fv_
,
Exceptions
::
discrete_function_error
,
"arbitrary derivatives are not supported by the local finite elements!
\n\n
"
<<
"alpha = "
<<
alpha
<<
"
\n
"
...
...
@@ -182,11 +183,11 @@ public:
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
RangeSelector
::
ensure_size
(
result
);
result
*=
0
;
if
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
{
if
(
space_is_fv_
)
{
for
(
size_t
ii
=
0
;
ii
<
r
;
++
ii
)
result
[
ii
]
=
dof_vector_
[
ii
];
}
else
{
result
*=
0
;
basis_
->
evaluate
(
point_in_reference_element
,
dynamic_basis_values_
,
param
);
for
(
size_t
ii
=
0
;
ii
<
basis_
->
size
();
++
ii
)
result
.
axpy
(
dof_vector_
[
ii
],
dynamic_basis_values_
[
ii
]);
...
...
@@ -200,7 +201,7 @@ public:
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
DerivativeRangeSelector
::
ensure_size
(
result
);
result
*=
0
;
if
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
{
if
(
space_
is_fv_
)
{
return
;
}
else
{
basis_
->
jacobians
(
point_in_reference_element
,
dynamic_basis_derivatives_
,
param
);
...
...
@@ -215,7 +216,7 @@ public:
const
XT
::
Common
::
Parameter
&
/*param*/
=
{})
const
override
final
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
DUNE_THROW_IF
(
space_
->
type
()
!=
GDT
::
SpaceType
::
finite_volume
,
DUNE_THROW_IF
(
space_
is_fv_
,
Exceptions
::
discrete_function_error
,
"arbitrary derivatives are not supported by the local finite elements!
\n\n
"
<<
"alpha = "
<<
alpha
<<
"
\n
"
...
...
@@ -248,7 +249,7 @@ public:
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
this
->
assert_correct_dims
(
row
,
col
,
"evaluate"
);
if
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
{
if
(
space_
is_fv_
)
{
return
dof_vector_
[
row
];
}
else
{
R
result
(
0
);
...
...
@@ -266,7 +267,7 @@ public:
{
DUNE_THROW_IF
(
!
this
->
is_bound_
,
Exceptions
::
not_bound_to_an_element_yet
,
""
);
this
->
assert_correct_dims
(
row
,
col
,
"jacobian"
);
if
(
space_
->
type
()
==
GDT
::
SpaceType
::
finite_volume
)
{
if
(
space_
is_fv_
)
{
return
0
;
}
else
{
SingleDerivativeRangeReturnType
result
(
0
);
...
...
@@ -281,6 +282,7 @@ public:
private
:
std
::
unique_ptr
<
const
SpaceType
>
space_
;
const
bool
space_is_fv_
;
ConstLocalDofVectorType
dof_vector_
;
std
::
unique_ptr
<
LocalBasisType
>
basis_
;
mutable
std
::
vector
<
RangeType
>
basis_values_
;
...
...
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