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
b7648292
Commit
b7648292
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
Constification
[[Imported from SVN: r3257]]
parent
22e9eb2e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fem/common/discretefunction.hh
+6
-5
6 additions, 5 deletions
fem/common/discretefunction.hh
fem/common/localfunctionwrapper.hh
+9
-9
9 additions, 9 deletions
fem/common/localfunctionwrapper.hh
with
15 additions
and
14 deletions
fem/common/discretefunction.hh
+
6
−
5
View file @
b7648292
...
...
@@ -269,16 +269,17 @@ namespace Dune {
//this methods are used by the LocalFunctionStorage class
//! return pointer to local function implementation
LocalFunctionImp
*
newLocalFunctionObject
()
{
return
asImp
().
newLocalFunctionObject
();
LocalFunctionImp
*
newLocalFunctionObject
()
const
{
return
asImp
().
newLocalFunctionObject
();
}
//! return reference for local function storage
LocalFunctionStorageType
*
localFunctionStorage
()
{
return
&
lfStorage_
;
}
LocalFunctionStorageType
*
localFunctionStorage
()
const
{
return
&
lfStorage_
;
}
// the local function storage stack
LocalFunctionStorageType
lfStorage_
;
mutable
LocalFunctionStorageType
lfStorage_
;
private
:
// Barton-Nackman trick
...
...
This diff is collapsed.
Click to expand it.
fem/common/localfunctionwrapper.hh
+
9
−
9
View file @
b7648292
...
...
@@ -18,11 +18,11 @@ namespace Dune {
typedef
DiscreteFunctionImp
DiscreteFunctionType
;
typedef
typename
DiscreteFunctionImp
::
LocalFunctionImp
LocalFunctionImp
;
std
::
stack
<
LocalFunctionImp
*
>
lfStack_
;
DiscreteFunctionType
&
df_
;
const
DiscreteFunctionType
&
df_
;
public:
//! constructor
LocalFunctionStorage
(
DiscreteFunctionType
&
df
)
:
df_
(
df
)
{}
LocalFunctionStorage
(
const
DiscreteFunctionType
&
df
)
:
df_
(
df
)
{}
//! delete all objects on stack
~
LocalFunctionStorage
()
...
...
@@ -59,8 +59,8 @@ namespace Dune {
private
:
//! prohibited methods
LocalFunctionStorage
(
const
MyType
&
c
)
:
df_
(
c
.
df_
)
{};
MyType
&
operator
=
(
const
MyType
&
c
)
{
return
*
this
;
}
LocalFunctionStorage
(
const
MyType
&
c
)
;
//
: df_(c.df_) {};
MyType
&
operator
=
(
const
MyType
&
c
)
;
//
{ return *this; }
};
template
<
class
DFTraits
>
class
DiscreteFunctionDefault
;
...
...
@@ -76,7 +76,7 @@ namespace Dune {
class
LocalFunctionWrapper
:
public
LocalFunctionDefault
<
typename
DiscreteFunctionImp
::
DiscreteFunctionSpaceType
,
LocalFunctionWrapper
<
DiscreteFunctionImp
>
>
LocalFunctionWrapper
<
DiscreteFunctionImp
>
>
{
public:
typedef
typename
DiscreteFunctionImp
::
LocalFunctionImp
LocalFunctionImp
;
...
...
@@ -112,7 +112,7 @@ namespace Dune {
public
:
//! Constructor initializing the underlying local function
template
<
class
EntityType
>
LocalFunctionWrapper
(
const
EntityType
&
en
,
DiscreteFunctionImp
&
df
)
:
LocalFunctionWrapper
(
const
EntityType
&
en
,
const
DiscreteFunctionImp
&
df
)
:
storage_
(
df
.
localFunctionStorage
()
),
lf_
(
storage_
->
getObject
()
),
refCount_
(
new
int
(
1
))
...
...
@@ -122,7 +122,7 @@ namespace Dune {
}
//! Constructor creating empty local function
LocalFunctionWrapper
(
DiscreteFunctionImp
&
df
)
LocalFunctionWrapper
(
const
DiscreteFunctionImp
&
df
)
:
storage_
(
df
.
localFunctionStorage
()
)
,
lf_
(
storage_
->
getObject
()
),
refCount_
(
new
int
(
1
))
...
...
@@ -139,7 +139,8 @@ namespace Dune {
//! Destructor , push local function to stack if there are no other
//! to it references
~
LocalFunctionWrapper
()
{
~
LocalFunctionWrapper
()
{
assert
(
*
refCount_
>
0
);
--
(
*
refCount_
);
if
(
*
refCount_
==
0
)
{
...
...
@@ -150,7 +151,6 @@ namespace Dune {
//! Assignment operator
LocalFunctionWrapper
&
operator
=
(
const
LocalFunctionWrapper
&
org
)
{
//assert(storage_ == org.storage_); // only assign local functions belonging to the same discrete function ! why not! perfectly safe to do it!
if
(
this
!=
&
org
)
{
--
(
*
refCount_
);
if
(
*
refCount_
==
0
)
{
...
...
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