Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-foamgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
extensions
dune-foamgrid
Commits
e42655e8
Commit
e42655e8
authored
5 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[factory] Adapt to function.hh deprecation
parent
995e0a13
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#25187
failed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/foamgrid/foamgrid/foamgridelements.hh
+4
-0
4 additions, 0 deletions
dune/foamgrid/foamgrid/foamgridelements.hh
dune/foamgrid/foamgrid/foamgridfactory.hh
+25
-0
25 additions, 0 deletions
dune/foamgrid/foamgrid/foamgridfactory.hh
with
29 additions
and
0 deletions
dune/foamgrid/foamgrid/foamgridelements.hh
+
4
−
0
View file @
e42655e8
...
...
@@ -6,6 +6,8 @@
#include
<memory>
#include
<dune/common/fmatrix.hh>
#define DUNE_FUNCTION_HH_SILENCE_DEPRECATION
#include
<dune/common/function.hh>
#include
<dune/foamgrid/foamgrid/foamgridvertex.hh>
...
...
@@ -181,6 +183,7 @@ namespace Dune {
bool
isNew_
;
/** \brief The element parametrization */
// TODO after deprecation period (release 2.8) change this to std::function
std
::
shared_ptr
<
VirtualFunction
<
FieldVector
<
ctype
,
dimgrid
>
,
FieldVector
<
ctype
,
dimworld
>
>
>
elementParametrization_
;
/** \brief This flag is set by postGrow() if the element looses its right to coarsen
...
...
@@ -366,6 +369,7 @@ namespace Dune {
FoamGridEntityImp
<
dimgrid
,
dimgrid
,
dimworld
,
ctype
>*
father_
;
/** \brief The element parametrization */
// TODO after deprecation period (release 2.8) change this to std::function
std
::
shared_ptr
<
VirtualFunction
<
FieldVector
<
ctype
,
dimgrid
>
,
FieldVector
<
ctype
,
dimworld
>
>
>
elementParametrization_
;
/** \brief This flag is set by postGrow() if the element looses its right to coarsen
...
...
This diff is collapsed.
Click to expand it.
dune/foamgrid/foamgrid/foamgridfactory.hh
+
25
−
0
View file @
e42655e8
...
...
@@ -11,8 +11,11 @@
#include
<vector>
#include
<memory>
#include
<unordered_map>
#include
<functional>
#include
<dune/common/deprecated.hh>
#include
<dune/common/version.hh>
#define DUNE_FUNCTION_HH_SILENCE_DEPRECATION
#include
<dune/common/function.hh>
#include
<dune/common/fvector.hh>
#include
<dune/common/hash.hh>
...
...
@@ -189,11 +192,13 @@ template <int dimworld, class ct>
);
}
DUNE_NO_DEPRECATED_BEGIN
/** \brief Insert a parametrized element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
\param elementParametrization A function prescribing the shape of this element
*/
[[
deprecated
(
"After Dune 2.7: VirtualFunction is deprecated: use overload taking std::function!"
)]]
void
insertElement
(
const
GeometryType
&
type
,
const
std
::
vector
<
unsigned
int
>&
vertices
,
const
std
::
shared_ptr
<
VirtualFunction
<
FieldVector
<
ctype
,
dimgrid
>
,
FieldVector
<
ctype
,
dimworld
>
>
>&
elementParametrization
)
override
...
...
@@ -208,6 +213,26 @@ template <int dimworld, class ct>
std
::
get
<
dimgrid
>
(
this
->
grid_
->
entityImps_
[
0
]).
push_back
(
newElement
);
}
DUNE_NO_DEPRECATED_END
/** \brief Insert a parametrized element into the coarse grid
\param type The GeometryType of the new element
\param vertices The vertices of the new element, using the DUNE numbering
\param elementParametrization A function prescribing the shape of this element
*/
void
insertElement
(
const
GeometryType
&
type
,
const
std
::
vector
<
unsigned
int
>&
vertices
,
std
::
function
<
FieldVector
<
ctype
,
dimworld
>
(
FieldVector
<
ctype
,
dimgrid
>
)
>&
elementParametrization
)
override
{
// for the deprecation period forward to the deprecated interface
// after release 2.8 remove old interface and adapt internal implementation to use std::function
using
D
=
FieldVector
<
ctype
,
dimgrid
>
;
using
R
=
FieldVector
<
ctype
,
dimworld
>
;
DUNE_NO_DEPRECATED_BEGIN
auto
f
=
makeVirtualFunction
<
D
,
R
>
(
std
::
move
(
elementParametrization
));
insertElement
(
type
,
vertices
,
std
::
make_unique
<
decltype
(
f
)
>
(
std
::
move
(
f
)));
DUNE_NO_DEPRECATED_END
}
/** \brief Finalize grid creation and hand over the grid
...
...
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