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
cdd3e768
Commit
cdd3e768
authored
Mar 25, 2019
by
Praetorius, Simon
Browse files
Implement the copy constructor for DiscreteFunction
parent
6887ffb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/amdis/gridfunctions/DiscreteFunction.hpp
View file @
cdd3e768
...
...
@@ -10,7 +10,9 @@
#include
<dune/typetree/childextraction.hh>
#include
<amdis/GridFunctions.hpp>
#include
<amdis/LinearAlgebra.hpp>
#include
<amdis/typetree/FiniteElementType.hpp>
#include
<amdis/typetree/RangeType.hpp>
#include
<amdis/typetree/TreePath.hpp>
namespace
AMDiS
...
...
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
View file @
cdd3e768
...
...
@@ -29,6 +29,12 @@ public:
,
subTree_
(
&
child
(
localView_
.
tree
(),
globalFunction_
.
treePath
()))
{}
LocalFunction
(
LocalFunction
const
&
other
)
:
globalFunction_
(
other
.
globalFunction_
)
,
localView_
(
globalFunction_
.
basis
().
localView
())
,
subTree_
(
&
child
(
localView_
.
tree
(),
globalFunction_
.
treePath
()))
{}
/// \brief Bind the LocalView to the element
void
bind
(
Element
const
&
element
)
{
...
...
@@ -100,6 +106,12 @@ public:
,
subTree_
(
&
child
(
localView_
.
tree
(),
globalFunction_
.
treePath
()))
{}
GradientLocalFunction
(
GradientLocalFunction
const
&
other
)
:
globalFunction_
(
other
.
globalFunction_
)
,
localView_
(
globalFunction_
.
basis
().
localView
())
,
subTree_
(
&
child
(
localView_
.
tree
(),
globalFunction_
.
treePath
()))
{}
void
bind
(
Element
const
&
element
)
{
localView_
.
bind
(
element
);
...
...
@@ -144,7 +156,7 @@ typename DiscreteFunction<GB,VT,TP>::Range DiscreteFunction<GB,VT,TP>::
LocalFunction
::
operator
()(
Domain
const
&
x
)
const
{
assert
(
bound_
);
auto
y
=
Range
(
0
);
Range
y
(
0
);
auto
&&
coefficients
=
*
globalFunction_
.
dofVector_
;
auto
&&
nodeToRangeEntry
=
globalFunction_
.
nodeToRangeEntry_
;
...
...
@@ -188,9 +200,7 @@ typename DiscreteFunction<GB,VT,TP>::GradientLocalFunction::Range DiscreteFuncti
GradientLocalFunction
::
operator
()(
Domain
const
&
x
)
const
{
assert
(
bound_
);
Range
dy
;
for
(
std
::
size_t
j
=
0
;
j
<
dy
.
size
();
++
j
)
dy
[
j
]
=
0
;
Range
dy
(
0
);
auto
&&
coefficients
=
*
globalFunction_
.
dofVector_
;
auto
&&
nodeToRangeEntry
=
globalFunction_
.
nodeToRangeEntry_
;
...
...
@@ -203,6 +213,7 @@ GradientLocalFunction::operator()(Domain const& x) const
auto
&&
fe
=
node
.
finiteElement
();
auto
&&
localBasis
=
fe
.
localBasis
();
std
::
size_t
size
=
localBasis
.
size
();
NodeCache
<
TYPEOF
(
node
)
>
localBasisCache
(
localBasis
);
auto
const
&
referenceGradients
=
localBasisCache
.
evaluateJacobian
(
localView_
.
element
().
type
(),
x
);
...
...
@@ -218,7 +229,7 @@ GradientLocalFunction::operator()(Domain const& x) const
// Get range entry associated to this node
auto
re
=
Dune
::
Functions
::
flatVectorView
(
nodeToRangeEntry
(
node
,
tp
,
dy
));
for
(
std
::
size_t
i
=
0
;
i
<
localBasis
.
size
()
;
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
size
;
++
i
)
{
auto
&&
multiIndex
=
localView_
.
index
(
node
.
localIndex
(
i
));
// Get coefficient associated to i-th shape function
...
...
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