Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dorie
dorie
Commits
38de83d1
Commit
38de83d1
authored
Feb 06, 2019
by
Lukas Riedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable get_solute_flux_reconstructed at compile-time
Use enable_if instead of run-time exception.
parent
4f660b1e
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
34 deletions
+29
-34
dune/dorie/model/transport/transport.hh
dune/dorie/model/transport/transport.hh
+29
-34
No files found.
dune/dorie/model/transport/transport.hh
View file @
38de83d1
...
...
@@ -471,56 +471,49 @@ public:
*
* @return Pointer to a solute grid function
*/
std
::
shared_ptr
<
const
GFFluxReconstruction
>
get_solute_flux_reconstructed
(
ConstState
state
)
const
template
<
bool
enabled
=
enable_rt_engine
>
std
::
enable_if_t
<
enabled
,
std
::
shared_ptr
<
const
GFFluxReconstruction
>>
get_solute_flux_reconstructed
(
ConstState
state
)
const
{
std
::
shared_ptr
<
GFFluxReconstruction
>
gf_ptr
;
auto
&
cache
=
cache_solute_flux_gf_rt
;
if
constexpr
(
enable_rt_engine
)
if
(
state
.
grid_function_space
!=
gfs
or
state
.
coefficients
!=
u
or
state
.
time
!=
current_time
())
{
// if state is different to current state, create flux from zero
if
(
state
.
grid_function_space
!=
gfs
or
state
.
coefficients
!=
u
or
state
.
time
!=
current_time
())
{
// if state is different to current state, create flux from zero
gf_ptr
=
std
::
make_unique
<
GFFluxReconstruction
>
(
this
->
_log
,
gv
,
inifile
.
sub
(
"fluxReconstruction"
));
gf_ptr
=
std
::
make_unique
<
GFFluxReconstruction
>
(
this
->
_log
,
gv
,
inifile
.
sub
(
"fluxReconstruction"
));
slop
->
setTime
(
state
.
time
);
slop
->
setTime
(
state
.
time
);
// update it with the state
gf_ptr
->
update
(
*
(
state
.
coefficients
),
*
(
state
.
grid_function_space
),
*
slop
);
// update it with the state
gf_ptr
->
update
(
*
(
state
.
coefficients
),
*
(
state
.
grid_function_space
),
*
slop
);
slop
->
setTime
(
current_time
());
}
else
if
(
not
cache
)
{
// if state is equal to current state, use cache.
slop
->
setTime
(
current_time
());
}
else
if
(
not
cache
)
{
// if state is equal to current state, use cache.
cache
=
std
::
make_unique
<
GFFluxReconstruction
>
(
this
->
_log
,
gv
,
inifile
.
sub
(
"fluxReconstruction"
));
slop
->
setTime
(
state
.
time
);
cache
=
std
::
make_unique
<
GFFluxReconstruction
>
(
this
->
_log
,
gv
,
inifile
.
sub
(
"fluxReconstruction"
));
// update it with current state
cache
->
update
(
*
u
,
*
gfs
,
*
slop
);
slop
->
setTime
(
state
.
time
);
slop
->
setTime
(
current_time
());
// update it with current state
cache
->
update
(
*
u
,
*
gfs
,
*
slop
);
gf_ptr
=
cache
;
}
else
{
gf_ptr
=
cache
;
}
slop
->
setTime
(
current_time
());
gf_ptr
=
cache
;
}
else
{
DUNE_THROW
(
NotImplemented
,
"Flux reconstruction is not implemented for the selected "
<<
"configuration"
);
gf_ptr
=
cache
;
}
return
gf_ptr
;
}
...
...
@@ -529,7 +522,9 @@ public:
*
* @return Pointer to a solute grid function
*/
std
::
shared_ptr
<
const
GFFluxReconstruction
>
get_solute_flux_reconstructed
()
const
template
<
bool
enabled
=
enable_rt_engine
>
std
::
enable_if_t
<
enabled
,
std
::
shared_ptr
<
const
GFFluxReconstruction
>>
get_solute_flux_reconstructed
()
const
{
return
get_solute_flux_reconstructed
(
current_state
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment