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
39e97a57
Commit
39e97a57
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
updated yaspgrid to latest grid interface
[[Imported from SVN: r3064]]
parent
9e98a11d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grid/yaspgrid.hh
+28
-43
28 additions, 43 deletions
grid/yaspgrid.hh
with
28 additions
and
43 deletions
grid/yaspgrid.hh
+
28
−
43
View file @
39e97a57
...
...
@@ -50,7 +50,6 @@ namespace Dune {
template
<
int
codim
,
PartitionIteratorType
pitype
,
class
GridImp
>
class
YaspLevelIterator
;
template
<
class
GridImp
>
class
YaspIntersectionIterator
;
template
<
class
GridImp
>
class
YaspHierarchicIterator
;
template
<
class
GridImp
>
class
YaspBoundaryEntity
;
template
<
class
GridImp
>
class
YaspLevelIndexSet
;
template
<
class
GridImp
>
class
YaspGlobalIdSet
;
...
...
@@ -60,7 +59,7 @@ namespace Dune {
template<int dim>
class YaspFatherRelativeLocalElement {
public:
static FieldVector<yaspgrid_ctype, dim> midpoint;
// data neded for the refelem below
static FieldVector<yaspgrid_ctype, dim> midpoint; // data neded for the refelem below
static FieldVector<yaspgrid_ctype, dim> extension; // data needed for the refelem below
static YaspGeometry<dim,dim> element;
static YaspGeometry<dim,dim>& getson (int i)
...
...
@@ -333,7 +332,7 @@ namespace Dune {
}
//! can only be called for mydim=cdim!
FieldMatrix
<
ctype
,
mydim
,
mydim
>&
jacobianInverse
(
const
FieldVector
<
ctype
,
mydim
>&
local
)
const
FieldMatrix
<
ctype
,
mydim
,
mydim
>&
jacobianInverse
Transposed
(
const
FieldVector
<
ctype
,
mydim
>&
local
)
const
{
for
(
int
i
=
0
;
i
<
mydim
;
++
i
)
{
...
...
@@ -650,6 +649,7 @@ namespace Dune {
son
+=
(
1
<<
k
);
// access to one of the 2**dim predefined elements
#warning geometryInFather not implemented
DUNE_THROW
(
NotImplemented
,
" geometryInFather"
);
#if 0
return YaspFatherRelativeLocalElement<dim>::getson(son);
...
...
@@ -1107,21 +1107,6 @@ namespace Dune {
};
//========================================================================
/*!
YaspBoundaryEntity is not yet implemented
*/
//========================================================================
template
<
class
GridImp
>
class
YaspBoundaryEntity
:
public
BoundaryEntityDefault
<
GridImp
,
YaspBoundaryEntity
>
{
public:
private:
};
//========================================================================
/*!
YaspIntersectionIterator enables iteration over intersection with
...
...
@@ -1144,7 +1129,6 @@ namespace Dune {
typedef
typename
SubYGrid
<
dim
,
ctype
>::
TransformingSubIterator
TSI
;
typedef
typename
GridImp
::
template
Codim
<
0
>
::
Entity
Entity
;
typedef
typename
GridImp
::
template
Codim
<
0
>
::
EntityPointer
EntityPointer
;
typedef
typename
GridImp
::
template
Codim
<
0
>
::
BoundaryEntity
BoundaryEntity
;
typedef
typename
GridImp
::
template
Codim
<
1
>
::
Geometry
Geometry
;
typedef
typename
GridImp
::
template
Codim
<
1
>
::
LocalGeometry
LocalGeometry
;
typedef
YaspSpecialEntity
<
0
,
dim
,
GridImp
>
SpecialEntity
;
...
...
@@ -1233,16 +1217,6 @@ namespace Dune {
return
false
;
}
return
true
;
#if 0
// The transforming iterator can be safely moved beyond the boundary.
// So we only have to compare against the cell_global grid
if (this->_it.coord(_dir)>=_myself.gridlevel().cell_overlap().min(_dir)
&&
this->_it.coord(_dir)<=_myself.gridlevel().cell_overlap().max(_dir))
return true;
else
return false;
#endif
}
//! return EntityPointer to the Entity on the inside of this intersection
...
...
@@ -1259,6 +1233,17 @@ namespace Dune {
return
*
this
;
}
//! identifier for boundary segment from macro grid
//! (attach your boundary condition as needed)
int
boundaryId
()
const
{
if
(
this
->
_it
.
coord
(
_dir
)
<
_myself
.
gridlevel
().
cell_global
().
min
(
_dir
))
return
2
*
_dir
;
if
(
this
->
_it
.
coord
(
_dir
)
>
_myself
.
gridlevel
().
cell_global
().
max
(
_dir
))
return
2
*
_dir
+
1
;
return
0
;
}
//! return unit outer normal, this should be dependent on local coordinates for higher order boundary
FieldVector
<
ctype
,
dimworld
>
outerNormal
(
const
FieldVector
<
ctype
,
dim
-
1
>&
local
)
const
{
...
...
@@ -1821,7 +1806,7 @@ namespace Dune {
//! get id of subentity
template
<
int
cc
>
IdType
sub
i
d
(
const
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
Entity
&
e
,
int
i
)
const
IdType
sub
I
d
(
const
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
Entity
&
e
,
int
i
)
const
{
return
grid
.
template
getRealEntity
<
0
>(
e
).
template
subPersistentIndex
<
cc
>(
i
);
}
...
...
@@ -1853,7 +1838,7 @@ namespace Dune {
struct
YaspGridFamily
{
typedef
GridTraits
<
dim
,
dimworld
,
Dune
::
YaspGrid
<
dim
,
dimworld
>
,
YaspGeometry
,
YaspEntity
,
YaspBoundaryEntity
,
YaspGeometry
,
YaspEntity
,
YaspEntityPointer
,
YaspLevelIterator
,
YaspIntersectionIterator
,
YaspHierarchicIterator
,
YaspLevelIterator
,
...
...
@@ -1915,7 +1900,7 @@ namespace Dune {
/*! Return maximum level defined in this grid. Levels are numbered
0 ... maxlevel with 0 the coarsest level.
*/
int
max
l
evel
()
const
{
return
MultiYGrid
<
dim
,
ctype
>::
maxlevel
();}
// delegate
int
max
L
evel
()
const
{
return
MultiYGrid
<
dim
,
ctype
>::
maxlevel
();}
// delegate
//! refine the grid refCount times. What about overlap?
void
globalRefine
(
int
refCount
)
...
...
@@ -1925,7 +1910,7 @@ namespace Dune {
{
MultiYGrid
<
dim
,
ctype
>::
refine
(
b
);
setsizes
();
indexsets
.
push_back
(
new
YaspLevelIndexSet
<
YaspGrid
<
dim
,
dimworld
>
>
(
*
this
,
max
l
evel
())
);
indexsets
.
push_back
(
new
YaspLevelIndexSet
<
YaspGrid
<
dim
,
dimworld
>
>
(
*
this
,
max
L
evel
())
);
}
}
...
...
@@ -1940,7 +1925,7 @@ namespace Dune {
{
MultiYGrid
<
dim
,
ctype
>::
refine
(
b
);
setsizes
();
indexsets
.
push_back
(
new
YaspLevelIndexSet
<
YaspGrid
<
dim
,
dimworld
>
>
(
*
this
,
max
l
evel
())
);
indexsets
.
push_back
(
new
YaspLevelIndexSet
<
YaspGrid
<
dim
,
dimworld
>
>
(
*
this
,
max
L
evel
())
);
}
//! one past the end on this level
...
...
@@ -1975,28 +1960,28 @@ namespace Dune {
template
<
int
cd
,
PartitionIteratorType
pitype
>
typename
Traits
::
template
Codim
<
cd
>
::
template
Partition
<
pitype
>
::
LeafIterator
leafbegin
()
const
{
return
levelbegin
<
cd
,
pitype
>
(
max
l
evel
());
return
levelbegin
<
cd
,
pitype
>
(
max
L
evel
());
};
//! return LeafIterator which points behind the last entity in maxLevel
template
<
int
cd
,
PartitionIteratorType
pitype
>
typename
Traits
::
template
Codim
<
cd
>
::
template
Partition
<
pitype
>
::
LeafIterator
leafend
()
const
{
return
levelend
<
cd
,
pitype
>
(
max
l
evel
());
return
levelend
<
cd
,
pitype
>
(
max
L
evel
());
}
//! return LeafIterator which points to the first entity in maxLevel
template
<
int
cd
>
typename
Traits
::
template
Codim
<
cd
>
::
template
Partition
<
All_Partition
>
::
LeafIterator
leafbegin
()
const
{
return
levelbegin
<
cd
,
All_Partition
>
(
max
l
evel
());
return
levelbegin
<
cd
,
All_Partition
>
(
max
L
evel
());
};
//! return LeafIterator which points behind the last entity in maxLevel
template
<
int
cd
>
typename
Traits
::
template
Codim
<
cd
>
::
template
Partition
<
All_Partition
>
::
LeafIterator
leafend
()
const
{
return
levelend
<
cd
,
All_Partition
>
(
max
l
evel
());
return
levelend
<
cd
,
All_Partition
>
(
max
L
evel
());
}
//! return size (= distance in graph) of overlap region
...
...
@@ -2021,7 +2006,7 @@ namespace Dune {
//! number of leaf entities per codim in this process
int
size
(
int
codim
)
const
{
return
sizes
[
max
l
evel
()][
codim
];
return
sizes
[
max
L
evel
()][
codim
];
}
//! number of entities per level, codim and geometry type in this process
...
...
@@ -2052,7 +2037,7 @@ namespace Dune {
//! number of leaf entities per codim and geometry type in this process
int
size
(
int
codim
,
GeometryType
type
)
const
{
return
size
(
max
l
evel
(),
codim
,
type
);
return
size
(
max
L
evel
(),
codim
,
type
);
}
/*! The communication interface
...
...
@@ -2214,7 +2199,7 @@ namespace Dune {
const
typename
Traits
::
LeafIndexSet
&
leafIndexSet
()
const
{
return
*
(
indexsets
[
max
l
evel
()]);
return
*
(
indexsets
[
max
L
evel
()]);
}
private
:
...
...
@@ -2294,7 +2279,7 @@ namespace Dune {
{
IsTrue
<
(
cd
==
dim
||
cd
==
0
)
>::
yes
();
YGLI
g
=
MultiYGrid
<
dim
,
ctype
>::
begin
(
level
);
if
(
level
<
0
||
level
>
max
l
evel
())
DUNE_THROW
(
RangeError
,
"level out of range"
);
if
(
level
<
0
||
level
>
max
L
evel
())
DUNE_THROW
(
RangeError
,
"level out of range"
);
if
(
cd
==
0
)
// the elements
{
if
(
pitype
<=
InteriorBorder_Partition
)
...
...
@@ -2322,7 +2307,7 @@ namespace Dune {
{
IsTrue
<
(
cd
==
dim
||
cd
==
0
)
>::
yes
();
YGLI
g
=
MultiYGrid
<
dim
,
ctype
>::
begin
(
level
);
if
(
level
<
0
||
level
>
max
l
evel
())
DUNE_THROW
(
RangeError
,
"level out of range"
);
if
(
level
<
0
||
level
>
max
L
evel
())
DUNE_THROW
(
RangeError
,
"level out of range"
);
if
(
cd
==
0
)
// the elements
{
if
(
pitype
<=
InteriorBorder_Partition
)
...
...
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