Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
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
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
Sander, Oliver
dune-gfe
Commits
d58607bf
Commit
d58607bf
authored
6 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Update Periodic1DPQ1NodalBasis to work with current dune-functions
parent
ef05ead0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1608
failed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gfe/periodic1dpq1nodalbasis.hh
+45
-46
45 additions, 46 deletions
dune/gfe/periodic1dpq1nodalbasis.hh
with
45 additions
and
46 deletions
dune/gfe/periodic1dpq1nodalbasis.hh
+
45
−
46
View file @
d58607bf
...
...
@@ -7,11 +7,9 @@
#include
<dune/localfunctions/lagrange/pqkfactory.hh>
#include
<dune/typetree/leafnode.hh>
#include
<dune/functions/functionspacebases/nodes.hh>
#include
<dune/functions/functionspacebases/defaultglobalbasis.hh>
#include
<dune/functions/functionspacebases/flatmultiindex.hh>
#include
<dune/functions/functionspacebases/defaultglobalbasis.hh>
namespace
Dune
{
...
...
@@ -20,48 +18,46 @@ namespace Functions {
// *****************************************************************************
// This is the reusable part of the basis. It contains
//
// PQ1
NodeFactory
// PQ1
PreBasis
// PQ1NodeIndexSet
// PQ1Node
//
// The
factory
allows to create the others and is the owner of possible shared
// The
pre-basis
allows to create the others and is the owner of possible shared
// state. These three components do _not_ depend on the global basis or index
// set and can be used without a global basis.
// *****************************************************************************
template
<
typename
GV
,
typename
ST
,
typename
TP
>
template
<
typename
GV
>
class
Periodic1DPQ1Node
;
template
<
typename
GV
,
class
MI
,
class
TP
,
class
ST
>
template
<
typename
GV
,
class
MI
>
class
Periodic1DPQ1NodeIndexSet
;
template
<
typename
GV
,
class
MI
,
class
ST
>
class
Periodic1DPQ1NodeFactory
;
template
<
typename
GV
,
class
MI
,
class
ST
>
class
Periodic1DPQ1NodeFactory
template
<
typename
GV
,
class
MI
>
class
Periodic1DPQ1PreBasis
{
static
const
int
dim
=
GV
::
dimension
;
public:
/
** \brief
The grid view that the FE
space
is defined on
*/
/
/!
The grid view that the FE
basis
is defined on
using
GridView
=
GV
;
using
size_type
=
ST
;
template
<
class
TP
>
using
Node
=
Periodic1DPQ1Node
<
GV
,
size_type
,
TP
>
;
//! Type used for indices and size information
using
size_type
=
std
::
size_t
;
template
<
class
TP
>
using
IndexSet
=
Periodic1DPQ1NodeIndexSet
<
GV
,
MI
,
TP
,
ST
>
;
using
Node
=
Periodic1DPQ1Node
<
GV
>
;
using
IndexSet
=
Periodic1DPQ1NodeIndexSet
<
GV
,
MI
>
;
/** \brief Type used for global numbering of the basis vectors */
using
MultiIndex
=
MI
;
using
SizePrefix
=
Dune
::
ReservedVector
<
size_type
,
2
>
;
//! Type used for prefixes handed to the size() method
using
SizePrefix
=
Dune
::
ReservedVector
<
size_type
,
1
>
;
/
** \brief
Constructor for a given grid view object
*/
Periodic1DPQ1
NodeFactory
(
const
GridView
&
gv
)
:
/
/!
Constructor for a given grid view object
Periodic1DPQ1
PreBasis
(
const
GridView
&
gv
)
:
gridView_
(
gv
)
{}
...
...
@@ -75,16 +71,20 @@ public:
return
gridView_
;
}
template
<
class
TP
>
Node
<
TP
>
node
(
const
TP
&
tp
)
const
//! Update the stored grid view, to be called if the grid has changed
void
update
(
const
GridView
&
gv
)
{
gridView_
=
gv
;
}
Node
makeNode
()
const
{
return
Node
<
TP
>
{
tp
};
return
Node
{
};
}
template
<
class
TP
>
IndexSet
<
TP
>
indexSet
()
const
IndexSet
makeIndexSet
()
const
{
return
IndexSet
<
TP
>
{
*
this
};
return
IndexSet
{
*
this
};
}
size_type
size
()
const
...
...
@@ -102,7 +102,7 @@ public:
DUNE_THROW
(
RangeError
,
"Method size() can only be called for prefixes of length up to one"
);
}
/
** \todo This method has been added to the interface without prior discussion. */
/
/! Get the total dimension of the space spanned by this basis
size_type
dimension
()
const
{
return
size
()
-
1
;
...
...
@@ -119,25 +119,22 @@ public:
template
<
typename
GV
,
typename
ST
,
typename
TP
>
template
<
typename
GV
>
class
Periodic1DPQ1Node
:
public
LeafBasisNode
<
ST
,
TP
>
public
LeafBasisNode
{
static
const
int
dim
=
GV
::
dimension
;
static
const
int
maxSize
=
StaticPower
<
2
,
GV
::
dimension
>::
power
;
using
Base
=
LeafBasisNode
<
ST
,
TP
>
;
using
FiniteElementCache
=
typename
Dune
::
PQkLocalFiniteElementCache
<
typename
GV
::
ctype
,
double
,
dim
,
1
>
;
public:
using
size_type
=
ST
;
using
TreePath
=
TP
;
using
size_type
=
std
::
size_t
;
using
Element
=
typename
GV
::
template
Codim
<
0
>
::
Entity
;
using
FiniteElement
=
typename
FiniteElementCache
::
FiniteElementType
;
Periodic1DPQ1Node
(
const
TreePath
&
treePath
)
:
Base
(
treePath
),
Periodic1DPQ1Node
()
:
finiteElement_
(
nullptr
),
element_
(
nullptr
)
{}
...
...
@@ -174,24 +171,25 @@ protected:
template
<
typename
GV
,
class
MI
,
class
TP
,
class
ST
>
template
<
typename
GV
,
class
MI
>
class
Periodic1DPQ1NodeIndexSet
{
enum
{
dim
=
GV
::
dimension
};
public
:
using
size_type
=
ST
;
using
size_type
=
std
::
size_t
;
/** \brief Type used for global numbering of the basis vectors */
using
MultiIndex
=
MI
;
using
NodeFactory
=
Periodic1DPQ1
NodeFactory
<
GV
,
MI
,
ST
>
;
using
PreBasis
=
Periodic1DPQ1
PreBasis
<
GV
,
MI
>
;
using
Node
=
typename
NodeFactory
::
template
Node
<
TP
>;
using
Node
=
Periodic1DPQ1
Node
<
GV
>
;
Periodic1DPQ1NodeIndexSet
(
const
NodeFactory
&
nodeFactory
)
:
nodeFactory_
(
&
nodeFactory
)
Periodic1DPQ1NodeIndexSet
(
const
PreBasis
&
preBasis
)
:
preBasis_
(
&
preBasis
),
node_
(
nullptr
)
{}
/** \brief Bind the view to a grid element
...
...
@@ -215,6 +213,7 @@ public:
*/
size_type
size
()
const
{
assert
(
node_
!=
nullptr
);
return
node_
->
finiteElement
().
size
();
}
...
...
@@ -222,7 +221,7 @@ public:
MultiIndex
index
(
size_type
i
)
const
{
Dune
::
LocalKey
localKey
=
node_
->
finiteElement
().
localCoefficients
().
localKey
(
i
);
const
auto
&
gridIndexSet
=
nodeFactory
_
->
gridView
().
indexSet
();
const
auto
&
gridIndexSet
=
preBasis
_
->
gridView
().
indexSet
();
const
auto
&
element
=
node_
->
element
();
//return {{ gridIndexSet.subIndex(element,localKey.subEntity(),dim) }};
...
...
@@ -237,18 +236,18 @@ public:
}
protected
:
const
NodeFactory
*
nodeFactory
_
;
const
PreBasis
*
preBasis
_
;
const
Node
*
node_
;
};
/** \brief Nodal basis of a scalar first-order Lagrangian finite element space
* on a one-dimensional domain with periodic boundary conditions
*
* \tparam GV The GridView that the space is defined on
* \tparam ST The type used for local indices; global indices are FlatMultiIndex<ST>
*/
template
<
typename
GV
,
class
ST
=
std
::
size_t
>
using
Periodic1DPQ1NodalBasis
=
DefaultGlobalBasis
<
Periodic1DPQ1
NodeFactory
<
GV
,
FlatMultiIndex
<
ST
>
,
ST
>
>
;
template
<
typename
GV
>
using
Periodic1DPQ1NodalBasis
=
DefaultGlobalBasis
<
Periodic1DPQ1
PreBasis
<
GV
,
FlatMultiIndex
<
std
::
size_t
>
>
>
;
}
// end namespace Functions
}
// end namespace Dune
...
...
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