Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
amdis
amdis-core
Commits
cdd3e768
Commit
cdd3e768
authored
6 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
Implement the copy constructor for DiscreteFunction
parent
6887ffb9
No related branches found
No related tags found
1 merge request
!19
Implement the copy constructor for DiscreteFunction
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/amdis/gridfunctions/DiscreteFunction.hpp
+2
-0
2 additions, 0 deletions
src/amdis/gridfunctions/DiscreteFunction.hpp
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
+16
-5
16 additions, 5 deletions
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
with
18 additions
and
5 deletions
src/amdis/gridfunctions/DiscreteFunction.hpp
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
src/amdis/gridfunctions/DiscreteFunction.inc.hpp
+
16
−
5
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
...
...
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