Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
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
Timo Koch
dune-common
Commits
db8abc78
Commit
db8abc78
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
Implemented eval and evaluate for DiscreteFunctionDefault so that they fail with a proper assert
[[Imported from SVN: r2710]]
parent
2cd23e35
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fem/common/discretefunction.cc
+18
-0
18 additions, 0 deletions
fem/common/discretefunction.cc
fem/common/discretefunction.hh
+25
-5
25 additions, 5 deletions
fem/common/discretefunction.hh
with
43 additions
and
5 deletions
fem/common/discretefunction.cc
+
18
−
0
View file @
db8abc78
...
...
@@ -12,6 +12,24 @@ namespace Dune
//************************************************************
// Default Implementations
//************************************************************
template
<
class
DiscreteFunctionTraits
>
void
DiscreteFunctionDefault
<
DiscreteFunctionTraits
>::
clear
()
{
DofIteratorType
endit
=
this
->
dend
();
for
(
DofIteratorType
it
=
this
->
dbegin
();
it
!=
endit
;
++
it
)
{
*
it
=
0.0
;
}
}
template
<
class
DiscreteFunctionTraits
>
void
DiscreteFunctionDefault
<
DiscreteFunctionTraits
>::
addScaled
(
const
DiscreteFunctionType
&
g
,
const
RangeFieldType
&
c
)
{
DofIteratorType
endit
=
this
->
dend
();
ConstDofIteratorType
oit
=
g
.
dbegin
();
for
(
DofIteratorType
it
=
this
->
dbegin
();
it
!=
endit
;
++
it
,
++
oit
)
{
*
it
+=
*
oit
*
c
;
}
}
// scalarProductDofs
template
<
class
DiscreteFunctionTraits
>
inline
typename
DiscreteFunctionTraits
::
DiscreteFunctionSpaceType
::
RangeFieldType
...
...
This diff is collapsed.
Click to expand it.
fem/common/discretefunction.hh
+
25
−
5
View file @
db8abc78
...
...
@@ -91,11 +91,6 @@ namespace Dune {
return
asImp
().
name
();
}
//! Continuous data
bool
continuous
()
const
{
return
asImp
().
continuous
();
}
//! the implementation of an iterator to iterate efficient
//! over all dofs of a discrete function
DofIteratorType
dbegin
()
...
...
@@ -210,6 +205,17 @@ namespace Dune {
DiscreteFunctionDefault
(
const
DiscreteFunctionSpaceType
&
f
)
:
DiscreteFunctionInterfaceType
(
f
)
{}
//! Continuous data
bool
continuous
()
const
{
return
this
->
functionSpace_
.
continuous
();
}
//! Set all elements to zero
void
clear
();
//! daxpy operation
void
addScaled
(
const
DiscreteFunctionType
&
g
,
const
RangeFieldType
&
c
);
//! Evaluate a scalar product of the dofs of two DiscreteFunctions
//! on the top level of the underlying grid
RangeFieldType
scalarProductDofs
(
const
DiscreteFunctionType
&
g
)
const
;
...
...
@@ -235,6 +241,20 @@ namespace Dune {
DiscreteFunctionType
&
add
(
const
DiscreteFunctionType
&
g
,
RangeFieldType
scalar
);
//! evaluate Function (which just dies because there is no meaningful implementation)
void
eval
(
const
DomainType
&
arg
,
RangeType
&
dest
)
const
{
// Die a horrible death! Never call that one...
assert
(
false
);
}
//! evaluate function and derivatives (just dies)
template
<
int
derivation
>
void
evaluate
(
const
FieldVector
<
deriType
,
derivation
>
&
diffVariable
,
const
DomainType
&
arg
,
RangeType
&
dest
)
const
{
// Die a horrible death! Never call that one...
assert
(
false
);
}
private
:
// Barton-Nackman trick
DiscreteFunctionType
&
asImp
()
...
...
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