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
db552de6
Commit
db552de6
authored
9 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[spaces.interface] add ProductSpaceInterface
parent
d33342cf
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/spaces/interface.hh
+45
-0
45 additions, 0 deletions
dune/gdt/spaces/interface.hh
with
45 additions
and
0 deletions
dune/gdt/spaces/interface.hh
+
45
−
0
View file @
db552de6
...
...
@@ -25,6 +25,8 @@
#include
<dune/stuff/grid/layers.hh>
#include
<dune/stuff/la/container/pattern.hh>
#include
<dune/gdt/mapper/interface.hh>
#include
"constraints.hh"
namespace
Dune
{
...
...
@@ -461,6 +463,49 @@ public:
/* @} */
};
// class SpaceInterface
class
IsProductSpace
{
};
/** Interface for function spaces that can be written as a product of several function spaces with the same domain. For
* example, a function space containing all functions f: \mathbb{R}^d \to \mathbb{R}^r can also be seen as r times the
* function space containing all functions f: \mathbb{R}^d \to \mathbb{R}.
* rangeDim and rangeDimCols are the respective dimensions of the product function space. If rangeDimCols is not the
* same for all factors, e.g. if the functions map to \mathbb{R} \times \mathbb{R}^{2 \times 2}, the range is regarded
* as a vector, i.e. rangeDimCols has to be specified as 1 and the dimensions have to be added up in rangeDim. In the
* example, this gives rangeDim = 5;
* */
template
<
class
Traits
,
size_t
domainDim
,
size_t
rangeDim
,
rangeDimCols
=
1
>
class
ProductSpaceInterface
:
public
SpaceInterface
<
Traits
,
domainDim
,
rangeDim
,
rangeDimCols
>
,
IsProductSpace
{
typedef
SpaceInterface
<
Traits
,
domainDim
,
rangeDim
,
rangeDimCols
>
BaseType
;
public:
using
typename
BaseType
::
EntityType
;
using
typename
BaseType
::
PatternType
;
using
typename
BaseType
::
RangeFieldType
;
using
typename
BaseType
::
MapperType
;
static_assert
(
std
::
is_base_of
<
IsProductMapper
,
MapperType
>::
value
,
"MapperType has to be derived from ProductMapperInterface"
);
typedef
typename
Traits
::
SpaceTupleType
SpaceTupleType
;
static
const
size_t
num_factors
=
std
::
tuple_size
<
SpaceTupleType
>::
value
;
/**
* \defgroup interface This method has to be implemented in addition to the SpaceInterface methods!''
* @{
**/
template
<
size_t
ii
>
const
typename
std
::
tuple_element
<
ii
,
SpaceTupleType
>::
type
&
factor
()
const
{
static_assert
(
ii
<
num_factors
,
"This factor does not exist!"
);
CHECK_CRTP
(
this
->
as_imp
().
template
factor
<
ii
>());
return
this
->
as_imp
().
template
factor
<
ii
>();
}
/**
}
**/
};
// class ProductSpaceInterface< ... >
template
<
class
Traits
,
size_t
d
,
size_t
r
,
size_t
rC
,
size_t
codim
=
0
>
typename
Traits
::
GridViewType
::
template
Codim
<
codim
>
::
Iterator
...
...
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