Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
f2cd4eb4
Commit
f2cd4eb4
authored
Mar 12, 2020
by
Müller, Felix
Browse files
Replace explicit type Dune::DefaultGlobalBasis in ctor argument with concept check
parent
69256912
Changes
2
Hide whitespace changes
Inline
Side-by-side
amdis/DOFVector.hpp
View file @
f2cd4eb4
...
...
@@ -3,8 +3,11 @@
#include
<memory>
#include
<utility>
#include
<dune/common/concept.hh>
#include
<dune/common/shared_ptr.hh>
#include
<dune/functions/functionspacebases/concepts.hh>
#include
<amdis/DataTransfer.hpp>
#include
<amdis/LinearAlgebra.hpp>
#include
<amdis/Observer.hpp>
...
...
@@ -13,15 +16,6 @@
#include
<amdis/gridfunctions/DiscreteFunction.hpp>
#include
<amdis/typetree/TreePath.hpp>
namespace
Dune
{
namespace
Functions
{
template
<
class
PB
>
class
DefaultGlobalBasis
;
}
}
namespace
AMDiS
{
// Forward declarations
...
...
@@ -61,7 +55,7 @@ namespace AMDiS
using
Traits
=
TraitsType
;
public:
/// Constructor. Stores the shared_ptr of the basis and creates a new DataTransfer.
///
(1)
Constructor. Stores the shared_ptr of the basis and creates a new DataTransfer.
DOFVector
(
std
::
shared_ptr
<
GB
>
const
&
basis
,
DataTransferOperation
op
=
DataTransferOperation
::
INTERPOLATE
)
:
Coefficients
(
*
basis
)
...
...
@@ -72,19 +66,22 @@ namespace AMDiS
,
basis_
(
basis
)
{}
/// Constructor creating a new basis from a Dune::Functions::DefaultGlobalBasis.
// TODO(FM): Replace explicit type with concept check
DOFVector
(
Dune
::
Functions
::
DefaultGlobalBasis
<
typename
GB
::
PreBasis
>&&
basis
,
DataTransferOperation
op
=
DataTransferOperation
::
INTERPOLATE
)
:
DOFVector
(
std
::
make_shared
<
GB
>
(
std
::
move
(
basis
)),
op
)
{}
/// (2) Constructor. Forwards to (1) by wrapping reference into non-destroying
/// shared_ptr, see \ref Dune::wrap_or_move.
template
<
class
GB_
,
REQUIRES
(
Concepts
::
Similar
<
GB_
,
GB
>)
>
DOFVector
(
GB_
&&
basis
,
DataTransferOperation
op
=
DataTransferOperation
::
INTERPOLATE
)
:
DOFVector
(
Dune
::
wrap_or_move
(
FWD
(
basis
)),
op
)
{}
/// (3) Constructor. Forwards to (1) by creating a new basis from a dune-functions basis.
template
<
class
GB_
,
REQUIRES
(
not
Concepts
::
Similar
<
GB_
,
GB
>),
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
GlobalBasis
<
typename
GB_
::
GridView
>
,
GB_
>
())
>
DOFVector
(
GB_
&&
basis
,
DataTransferOperation
op
=
DataTransferOperation
::
INTERPOLATE
)
:
DOFVector
(
std
::
make_shared
<
GB
>
(
std
::
move
(
basis
)),
op
)
{}
std
::
shared_ptr
<
GlobalBasis
const
>
const
&
basis
()
const
{
return
basis_
;
}
template
<
class
TreePath
=
RootTreePath
>
...
...
amdis/functions/ParallelGlobalBasis.hpp
View file @
f2cd4eb4
...
...
@@ -99,12 +99,15 @@ namespace AMDiS
:
ParallelGlobalBasis
(
std
::
string
(
""
),
grid
,
FWD
(
args
)...)
{}
/// Converting constructor from
D
une
::DefaultGlobalBasis<PB>
.
/// Converting constructor from
d
une
-functions style basis
.
/**
* This will create a new Parallel
l
GlobalBasis. The pre-basis is copied from the constructor
* This will create a new ParallelGlobalBasis. The pre-basis is copied from the constructor
* argument and a new communication object is built.
*/
ParallelGlobalBasis
(
Dune
::
Functions
::
DefaultGlobalBasis
<
PB
>&&
from
)
template
<
class
GB_
,
Dune
::
disableCopyMove
<
Self
,
GB_
>
=
0
,
REQUIRES
(
Dune
::
models
<
Dune
::
Functions
::
Concept
::
GlobalBasis
<
GridView
>
,
GB_
>
())
>
ParallelGlobalBasis
(
GB_
&&
from
)
:
ParallelGlobalBasis
(
std
::
string
(
""
),
from
.
gridView
().
grid
(),
from
.
preBasis
())
{}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment