Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-alugrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-alugrid
Commits
2308ea68
Commit
2308ea68
authored
9 years ago
by
Robert Kloefkorn
Browse files
Options
Downloads
Patches
Plain Diff
merge from trunk.
parent
a9fd4519
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/alugrid/common/intersectioniteratorwrapper.hh
+63
-21
63 additions, 21 deletions
dune/alugrid/common/intersectioniteratorwrapper.hh
with
63 additions
and
21 deletions
dune/alugrid/common/intersectioniteratorwrapper.hh
+
63
−
21
View file @
2308ea68
#ifndef DUNE_INTERSECTIONITERATORWRAPPER_HH
#define DUNE_INTERSECTIONITERATORWRAPPER_HH
#include
<dune/common/nullptr.hh>
#include
<dune/grid/common/intersectioniterator.hh>
#include
<dune/alugrid/common/macrogridview.hh>
...
...
@@ -52,11 +54,13 @@ public:
typedef
typename
IntersectionIteratorImpl
::
Twists
Twists
;
typedef
typename
Twists
::
Twist
Twist
;
IntersectionIteratorWrapper
()
:
factory_
(
nullptr
),
it_
(
nullptr
)
{}
//! constructor called from the ibegin and iend method
template
<
class
EntityImp
>
IntersectionIteratorWrapper
(
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
factory_
(
en
.
factory
()
)
,
it_
(
factory
_
.
getIntersection
(
wLevel
,
(
IntersectionIteratorImpl
*
)
0
)
)
IntersectionIteratorWrapper
(
const
FactoryType
&
factory
,
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
factory_
(
&
factory
)
,
it_
(
&
factory
.
getIntersection
(
wLevel
,
(
IntersectionIteratorImpl
*
)
0
)
)
{
if
(
end
)
it
().
done
(
en
);
...
...
@@ -67,26 +71,50 @@ public:
//! The copy constructor
IntersectionIteratorWrapper
(
const
ThisType
&
org
)
:
factory_
(
org
.
factory_
)
,
it_
(
factory_
.
getIntersection
(
-
1
,
(
IntersectionIteratorImpl
*
)
0
)
)
{
it
().
assign
(
org
.
it
()
);
if
(
factory_
)
{
it_
=
&
factory
().
getIntersection
(
-
1
,
static_cast
<
IntersectionIteratorImpl
*
>
(
nullptr
)
);
it_
->
assign
(
org
.
it
()
);
}
}
//! the
f*cking
assignment operator
//! the assignment operator
ThisType
&
operator
=
(
const
ThisType
&
org
)
{
it
().
assign
(
org
.
it
()
);
if
(
factory_
)
{
if
(
!
org
.
factory_
)
{
factory_
->
freeIntersection
(
*
it_
);
factory_
=
nullptr
;
}
else
it_
->
assign
(
*
org
.
it_
);
}
else
if
(
org
.
factory_
)
{
factory_
=
org
.
factory_
;
it_
=
&
factory
().
getIntersection
(
-
1
,
static_cast
<
IntersectionIteratorImpl
*
>
(
nullptr
)
);
it_
->
assign
(
*
org
.
it_
);
}
return
*
this
;
}
//! The Destructor puts internal object back to stack
~
IntersectionIteratorWrapper
()
{
factory_
.
freeIntersection
(
it
()
);
if
(
factory_
)
factory_
->
freeIntersection
(
*
it_
);
}
operator
bool
()
const
{
return
bool
(
factory_
);
}
//! the equality method
bool
equals
(
const
ThisType
&
i
)
const
{
return
it
().
equals
(
i
.
it
());
}
bool
equals
(
const
ThisType
&
other
)
const
{
return
(
factory_
==
other
.
factory_
)
&&
(
!
factory_
||
it
().
equals
(
other
.
it
()
));
}
//! increment iterator
void
increment
()
{
it
().
increment
();
}
...
...
@@ -200,8 +228,8 @@ public:
bool
conforming
()
const
{
return
it
().
conforming
();
}
//! returns reference to underlying intersection iterator implementation
IntersectionIteratorImp
&
it
()
{
return
it_
;
}
const
IntersectionIteratorImp
&
it
()
const
{
return
it_
;
}
IntersectionIteratorImp
&
it
()
{
assert
(
*
this
);
return
*
it_
;
}
const
IntersectionIteratorImp
&
it
()
const
{
assert
(
*
this
);
return
*
it_
;
}
//! return weight associated with graph edge between the neighboring elements
int
weight
()
const
...
...
@@ -210,8 +238,10 @@ public:
}
private
:
const
FactoryType
&
factory_
;
IntersectionIteratorImp
&
it_
;
const
FactoryType
&
factory
()
const
{
assert
(
factory_
);
return
*
factory_
;
}
const
FactoryType
*
factory_
;
IntersectionIteratorImp
*
it_
;
};
// end class IntersectionIteratorWrapper
template
<
class
GridImp
>
...
...
@@ -221,10 +251,13 @@ class LeafIntersectionWrapper
typedef
LeafIntersectionWrapper
<
GridImp
>
ThisType
;
typedef
IntersectionIteratorWrapper
<
GridImp
,
typename
GridImp
::
LeafIntersectionIteratorImp
>
BaseType
;
public:
typedef
typename
BaseType
::
FactoryType
FactoryType
;
LeafIntersectionWrapper
()
{}
//! constructor called from the ibegin and iend method
template
<
class
EntityImp
>
LeafIntersectionWrapper
(
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
BaseType
(
en
,
wLevel
,
end
)
LeafIntersectionWrapper
(
const
FactoryType
&
factory
,
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
BaseType
(
factory
,
en
,
wLevel
,
end
)
{
}
...
...
@@ -245,6 +278,7 @@ class LeafIntersectionIteratorWrapper
typedef
LeafIntersectionWrapper
<
GridImp
>
IntersectionImp
;
public:
typedef
typename
IntersectionImp
::
FactoryType
FactoryType
;
typedef
Dune
::
Intersection
<
GridImp
,
IntersectionImp
>
Intersection
;
//! dimension
...
...
@@ -268,10 +302,12 @@ public:
//! type of normal vector
typedef
FieldVector
<
ctype
,
dimensionworld
>
NormalType
;
LeafIntersectionIteratorWrapper
()
{}
//! constructor called from the ibegin and iend method
template
<
class
EntityImp
>
LeafIntersectionIteratorWrapper
(
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
intersection_
(
IntersectionImp
(
en
,
wLevel
,
end
)
)
LeafIntersectionIteratorWrapper
(
const
FactoryType
&
factory
,
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
intersection_
(
IntersectionImp
(
factory
,
en
,
wLevel
,
end
)
)
{}
//! The copy constructor
...
...
@@ -319,10 +355,13 @@ class LevelIntersectionWrapper
typedef
LevelIntersectionWrapper
<
GridImp
>
ThisType
;
typedef
IntersectionIteratorWrapper
<
GridImp
,
typename
GridImp
::
LevelIntersectionIteratorImp
>
BaseType
;
public:
typedef
typename
BaseType
::
FactoryType
FactoryType
;
LevelIntersectionWrapper
()
{}
//! constructor called from the ibegin and iend method
template
<
class
EntityImp
>
LevelIntersectionWrapper
(
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
BaseType
(
en
,
wLevel
,
end
)
LevelIntersectionWrapper
(
const
FactoryType
&
factory
,
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
BaseType
(
factory
,
en
,
wLevel
,
end
)
{
}
...
...
@@ -340,6 +379,7 @@ class LevelIntersectionIteratorWrapper
{
typedef
LevelIntersectionIteratorWrapper
<
GridImp
>
ThisType
;
typedef
LevelIntersectionWrapper
<
GridImp
>
IntersectionImp
;
typedef
typename
IntersectionImp
::
FactoryType
FactoryType
;
public:
typedef
Dune
::
Intersection
<
GridImp
,
IntersectionImp
>
Intersection
;
...
...
@@ -364,10 +404,12 @@ public:
//! type of normal vector
typedef
FieldVector
<
ctype
,
dimensionworld
>
NormalType
;
LevelIntersectionIteratorWrapper
()
{}
//! constructor called from the ibegin and iend method
template
<
class
EntityImp
>
LevelIntersectionIteratorWrapper
(
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
intersection_
(
IntersectionImp
(
en
,
wLevel
,
end
)
)
LevelIntersectionIteratorWrapper
(
const
FactoryType
&
factory
,
const
EntityImp
&
en
,
int
wLevel
,
bool
end
)
:
intersection_
(
IntersectionImp
(
factory
,
en
,
wLevel
,
end
)
)
{}
//! The copy constructor
...
...
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