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
f9724a1d
Commit
f9724a1d
authored
6 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[spaces.bochner] allow to evaluate out of bounds
parent
e4a746fa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/gdt/discretefunction/bochner.hh
+7
-4
7 additions, 4 deletions
dune/gdt/discretefunction/bochner.hh
dune/gdt/spaces/bochner.hh
+18
-1
18 additions, 1 deletion
dune/gdt/spaces/bochner.hh
with
25 additions
and
5 deletions
dune/gdt/discretefunction/bochner.hh
+
7
−
4
View file @
f9724a1d
...
...
@@ -12,6 +12,7 @@
#define DUNE_GDT_DISCRETEFUNCTION_BOCHNER_HH
#include
<dune/xt/common/memory.hh>
#include
<dune/xt/common/math.hh>
#include
<dune/xt/la/container/vector-array/list.hh>
#include
<dune/xt/grid/search.hh>
...
...
@@ -78,14 +79,16 @@ public:
DiscreteFunction
<
V
,
GV
,
r
,
rC
,
R
>
evaluate
(
const
double
&
time
)
const
{
const
auto
search_result
=
XT
::
Grid
::
make_entity_in_level_search
(
bochner_space_
.
temporal_space
().
grid_view
())(
std
::
vector
<
double
>
(
1
,
time
));
const
double
t
=
XT
::
Common
::
clamp
(
time
,
bochner_space_
.
time_interval
().
first
,
bochner_space_
.
time_interval
().
second
);
const
auto
search_result
=
XT
::
Grid
::
make_entity_in_level_search
(
bochner_space_
.
temporal_space
().
grid_view
())(
std
::
vector
<
double
>
(
1
,
t
));
DUNE_THROW_IF
(
!
search_result
.
at
(
0
),
Exceptions
::
finite_element_error
,
"when evaluating timedependent function: could not find time_interval for time = "
<<
t
ime
);
"when evaluating timedependent function: could not find time_interval for time = "
<<
t
);
const
auto
&
time_interval
=
*
search_result
.
at
(
0
);
const
auto
temporal_basis
=
bochner_space_
.
temporal_space
().
basis
().
localize
(
time_interval
);
const
auto
time_in_reference_element
=
time_interval
.
geometry
().
local
(
t
ime
);
const
auto
time_in_reference_element
=
time_interval
.
geometry
().
local
(
t
);
const
auto
temporal_basis_values
=
temporal_basis
->
evaluate_set
(
time_in_reference_element
);
V
result
(
bochner_space_
.
spatial_space
().
mapper
().
size
(),
0.
);
const
auto
global_dof_indices
=
bochner_space_
.
temporal_space
().
mapper
().
global_indices
(
time_interval
);
...
...
This diff is collapsed.
Click to expand it.
dune/gdt/spaces/bochner.hh
+
18
−
1
View file @
f9724a1d
...
...
@@ -12,7 +12,9 @@
#define DUNE_GDT_SPACES_BOCHNER_HH
#include
<dune/grid/onedgrid.hh>
#include
<dune/grid/common/rangegenerators.hh>
#include
<dune/xt/common/ranges.hh>
#include
<dune/gdt/spaces/h1/continuous-lagrange.hh>
#include
"interface.hh"
...
...
@@ -30,7 +32,16 @@ public:
:
spatial_space_
(
spatial_space
)
,
temporal_grid_
(
std
::
forward
<
TemporalGridArgs
>
(
temporal_grid_args
)...)
,
temporal_space_
(
temporal_grid_
.
leafGridView
(),
/*order=*/
1
)
{}
,
time_interval_
(
std
::
make_pair
(
std
::
numeric_limits
<
double
>::
max
(),
std
::
numeric_limits
<
double
>::
min
()))
{
for
(
auto
&&
time_interval
:
elements
(
temporal_space_
.
grid_view
()))
{
for
(
auto
ii
:
XT
::
Common
::
value_range
(
time_interval
.
geometry
().
corners
()))
{
const
auto
time_point
=
time_interval
.
geometry
().
corner
(
ii
);
time_interval_
.
first
=
std
::
min
(
time_interval_
.
first
,
time_point
[
0
]);
time_interval_
.
second
=
std
::
max
(
time_interval_
.
second
,
time_point
[
0
]);
}
}
}
const
ContinuousLagrangeSpace
<
typename
OneDGrid
::
LeafGridView
>&
temporal_space
()
const
{
...
...
@@ -42,10 +53,16 @@ public:
return
spatial_space_
;
}
const
std
::
pair
<
double
,
double
>&
time_interval
()
const
{
return
time_interval_
;
}
private
:
const
SpaceInterface
<
GV
,
r
,
rC
,
R
>&
spatial_space_
;
const
OneDGrid
temporal_grid_
;
const
ContinuousLagrangeSpace
<
typename
OneDGrid
::
LeafGridView
>
temporal_space_
;
std
::
pair
<
double
,
double
>
time_interval_
;
};
// class BochnerSpace
...
...
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