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
fa8d3dc2
Commit
fa8d3dc2
authored
20 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
File for (java-like) interfaces.\nAdded Cloneable interface
[[Imported from SVN: r1639]]
parent
34afe99c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/function.hh
+18
-4
18 additions, 4 deletions
common/function.hh
common/genericiterator.hh
+4
-4
4 additions, 4 deletions
common/genericiterator.hh
common/interfaces.hh
+15
-0
15 additions, 0 deletions
common/interfaces.hh
with
37 additions
and
8 deletions
common/function.hh
+
18
−
4
View file @
fa8d3dc2
...
...
@@ -44,20 +44,34 @@ namespace Dune {
//! Constructor
Function
(
const
FunctionSpaceType
&
f
)
:
functionSpace_
(
f
)
{}
;
//! application operator
virtual
void
operator
()(
const
Domain
&
arg
,
Range
&
dest
)
const
{
eval
(
arg
,
dest
);
}
//! evaluate Function
void
eval
(
const
Domain
&
,
Range
&
)
const
;
void
eval
(
const
Domain
&
arg
,
Range
&
dest
)
const
{
asImp
().
eval
(
arg
,
dest
);
}
//! evaluate function and derivatives
template
<
int
derivation
>
//! ???
void
evaluate
(
const
FieldVector
<
deriType
,
derivation
>
&
diffVariable
,
const
Domain
&
,
Range
&
)
const
{};
const
Domain
&
arg
,
Range
&
dest
)
const
{
asImp
().
evaluate
(
diffVariable
,
arg
,
dest
);
}
//! Get access to the related function space
const
FunctionSpaceType
&
getFunctionSpace
()
const
{
return
functionSpace_
;
}
protected
:
//! Barton-Nackman trick
FunctionImp
&
asImp
()
{
return
static_cast
<
FunctionImp
&>
(
*
this
);
}
const
FunctionImp
&
asImp
()
const
{
return
static_cast
<
const
FunctionImp
&>
(
*
this
);
}
//! The related function space
const
FunctionSpaceType
&
functionSpace_
;
...
...
This diff is collapsed.
Click to expand it.
common/genericiterator.hh
+
4
−
4
View file @
fa8d3dc2
...
...
@@ -7,8 +7,7 @@
#include
<dune/common/iteratorfacades.hh>
#include
<cassert>
namespace
Dune
{
namespace
Dune
{
/*! \defgroup GenericIterator GenericIterator
\ingroup IteratorFacades
...
...
@@ -87,7 +86,8 @@ namespace Dune
*
*/
template
<
class
C
,
class
T
>
class
GenericIterator
:
public
Dune
::
RandomAccessIteratorFacade
<
GenericIterator
<
C
,
T
>
,
T
,
T
&
,
int
>
class
GenericIterator
:
public
Dune
::
RandomAccessIteratorFacade
<
GenericIterator
<
C
,
T
>
,
T
,
T
&
,
int
>
{
friend
class
GenericIterator
<
typename
Dune
::
RemoveConst
<
C
>::
Type
,
typename
Dune
::
RemoveConst
<
T
>::
Type
>
;
friend
class
GenericIterator
<
const
typename
Dune
::
RemoveConst
<
C
>::
Type
,
const
typename
Dune
::
RemoveConst
<
T
>::
Type
>
;
...
...
@@ -161,6 +161,6 @@ namespace Dune
/** @} */
}
}
// end namespace Dune
#endif
This diff is collapsed.
Click to expand it.
common/interfaces.hh
0 → 100644
+
15
−
0
View file @
fa8d3dc2
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_INTERFACES_HH
#define DUNE_INTERFACES_HH
namespace
Dune
{
//! An interface class for cloneable objects
struct
Cloneable
{
virtual
Cloneable
*
clone
()
const
=
0
;
};
}
// end namespace Dune
#endif
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