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
fcd7481f
Commit
fcd7481f
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
implemented geometryInFather correctly.
Also removed not needed getCoordVec method. [[Imported from SVN: r3291]]
parent
97cadf1d
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
grid/alu3dgrid/entity_imp.cc
+5
-5
5 additions, 5 deletions
grid/alu3dgrid/entity_imp.cc
grid/alu3dgrid/geometry.hh
+23
-14
23 additions, 14 deletions
grid/alu3dgrid/geometry.hh
grid/alu3dgrid/geometry_imp.cc
+65
-21
65 additions, 21 deletions
grid/alu3dgrid/geometry_imp.cc
with
93 additions
and
40 deletions
grid/alu3dgrid/entity_imp.cc
+
5
−
5
View file @
fcd7481f
...
...
@@ -134,6 +134,7 @@ namespace Dune {
inline
const
typename
ALU3dGridEntity
<
cd
,
dim
,
GridImp
>::
Geometry
&
ALU3dGridEntity
<
cd
,
dim
,
GridImp
>::
geometry
()
const
{
assert
(
(
cd
==
1
)
?
(
face_
>=
0
)
:
1
);
if
(
!
builtgeometry_
)
builtgeometry_
=
geo_
.
buildGeom
(
*
item_
,
twist_
,
face_
);
return
geo_
;
}
...
...
@@ -330,12 +331,10 @@ namespace Dune {
inline
const
typename
ALU3dGridEntity
<
0
,
dim
,
GridImp
>::
Geometry
&
ALU3dGridEntity
<
0
,
dim
,
GridImp
>
::
geometryInFather
()
const
{
const
Geometry
&
vati
=
(
*
this
->
father
()).
geometry
();
const
Geometry
&
myself
=
this
->
geometry
();
for
(
int
i
=
0
;
i
<
vati
.
corners
();
i
++
)
geoInFather_
.
getCoordVec
(
i
)
=
vati
.
local
(
myself
[
i
]
);
const
typename
GridImp
::
template
Codim
<
0
>
::
EntityPointer
ep
=
father
();
geoInFather_
.
buildGeomInFather
(
(
*
ep
).
geometry
()
,
geometry
()
);
return
geoInFather_
;
}
...
...
@@ -684,6 +683,7 @@ namespace Dune {
,
done_
(
false
)
{
assert
(
entity_
);
if
(
codim
==
1
)
assert
(
face
>=
0
);
(
*
entity_
).
setElement
(
const_cast
<
MyHElementType
&>
(
item
),
twist
,
face
);
}
...
...
This diff is collapsed.
Click to expand it.
grid/alu3dgrid/geometry.hh
+
23
−
14
View file @
fcd7481f
...
...
@@ -65,12 +65,12 @@ namespace Dune {
//! build geometry out of different ALU3dGrid Geometrys
//! ItemType are HElementType, HFaceType, HEdgeType and VertexType
template
<
class
ItemType
>
bool
buildGeom
(
const
ItemType
&
item
,
int
twist
=
0
,
int
face
=
-
1
)
bool
buildGeom
(
const
ItemType
&
item
,
int
twist
=
0
,
int
face
=
-
1
)
{
return
this
->
realGeometry
.
buildGeom
(
item
,
twist
,
face
);
}
bool
buildGeom
(
const
ALU3DSPACE
HFaceType
&
item
,
int
twist
,
int
face
=
-
1
)
{
bool
buildGeom
(
const
ALU3DSPACE
HFaceType
&
item
,
int
twist
,
int
face
)
{
return
this
->
realGeometry
.
buildGeom
(
item
,
twist
,
face
);
}
...
...
@@ -84,18 +84,18 @@ namespace Dune {
return
this
->
realGeometry
.
buildGhost
(
ghost
);
}
// print real entity for debugging
void
print
(
std
::
ostream
&
ss
)
const
//! build geometry of local coordinates relative to father
template
<
class
GeometryType
>
bool
buildGeomInFather
(
const
GeometryType
&
fatherGeom
,
const
GeometryType
&
myGeom
)
{
this
->
realGeometry
.
print
(
ss
);
return
this
->
realGeometry
.
buildGeomInFather
(
fatherGeom
,
myGeom
);
}
//
for changing the coordinates of one element
FieldVector
<
alu3d_ctype
,
coorddim
>
&
getCoordVec
(
int
i
)
//
print real entity for debugging
void
print
(
std
::
ostream
&
ss
)
const
{
return
this
->
realGeometry
.
getCoordVec
(
i
);
this
->
realGeometry
.
print
(
ss
);
}
};
//! ALU3dGridGeometry
...
...
@@ -167,13 +167,14 @@ namespace Dune {
//! build ghost out of internal boundary segment
bool
buildGhost
(
const
PLLBndFaceType
&
ghost
);
//! build geometry of local coordinates relative to father
template
<
class
GeometryType
>
bool
buildGeomInFather
(
const
GeometryType
&
fatherGeom
,
const
GeometryType
&
myGeom
);
//! print internal data
//! no interface method
void
print
(
std
::
ostream
&
ss
)
const
;
// for changing the coordinates of one element
FieldVector
<
alu3d_ctype
,
cdim
>
&
getCoordVec
(
int
i
);
private
:
//! calculates the vertex index in the reference element out of a face index
//! and a local vertex index
...
...
@@ -273,14 +274,22 @@ namespace Dune {
//! build ghost out of internal boundary segment
bool
buildGhost
(
const
PLLBndFaceType
&
ghost
);
//! build geometry of local coordinates relative to father
template
<
class
GeometryType
>
bool
buildGeomInFather
(
const
GeometryType
&
fatherGeom
,
const
GeometryType
&
myGeom
);
//! print internal data
//! no interface method
void
print
(
std
::
ostream
&
ss
)
const
;
// for changing the coordinates of one element
FieldVector
<
alu3d_ctype
,
cdim
>
&
getCoordVec
(
int
i
);
private:
// create triMap from coordinates
void
buildMapping
();
// delete triMap
void
removeMapping
();
//! the vertex coordinates
mutable
FieldMatrix
<
alu3d_ctype
,
Power_m_p
<
2
,
mydim
>::
power
,
cdim
>
coord_
;
//mutable FieldVector<alu3d_ctype, mydim> tmp1_;
...
...
This diff is collapsed.
Click to expand it.
grid/alu3dgrid/geometry_imp.cc
+
65
−
21
View file @
fcd7481f
...
...
@@ -95,6 +95,23 @@ namespace Dune {
}
}
// built Geometry
template
<
int
mydim
,
int
cdim
>
template
<
class
GeometryType
>
inline
bool
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
tetra
>
>::
buildGeomInFather
(
const
GeometryType
&
fatherGeom
,
const
GeometryType
&
myGeom
)
{
// reset flags, because mappings need to be calculated again
builtinverse_
=
builtA_
=
builtDetDF_
=
false
;
// compute the local coordinates in father refelem
for
(
int
i
=
0
;
i
<
myGeom
.
corners
()
;
i
++
)
coord_
[
i
]
=
fatherGeom
.
local
(
myGeom
[
i
]
);
return
true
;
}
template
<
>
inline
bool
ALU3dGridGeometry
<
3
,
3
,
const
ALU3dGrid
<
3
,
3
,
tetra
>
>
::
buildGeom
(
const
IMPLElementType
&
item
,
int
,
int
)
...
...
@@ -262,14 +279,6 @@ namespace Dune {
return
coord_
[
i
];
}
template
<
int
mydim
,
int
cdim
>
inline
FieldVector
<
alu3d_ctype
,
cdim
>&
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
tetra
>
>
::
getCoordVec
(
int
i
)
{
assert
((
i
>=
0
)
&&
(
i
<
mydim
+
1
));
return
coord_
[
i
];
}
// G L O B A L - - -
// dim = 1,2,3 dimworld = 3
...
...
@@ -414,14 +423,6 @@ namespace Dune {
return
Power_m_p
<
2
,
mydim
>::
power
;
}
template
<
int
mydim
,
int
cdim
>
inline
FieldVector
<
alu3d_ctype
,
cdim
>&
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
hexa
>
>
::
getCoordVec
(
int
i
)
{
assert
((
i
>=
0
)
&&
(
i
<
corners
()));
return
coord_
[
i
];
}
template
<
int
mydim
,
int
cdim
>
const
FieldVector
<
alu3d_ctype
,
cdim
>&
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
hexa
>
>::
...
...
@@ -516,6 +517,48 @@ namespace Dune {
ss
<<
"}
\n
"
;
}
template
<
int
mydim
,
int
cdim
>
inline
void
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
hexa
>
>::
buildMapping
()
{
assert
(
mydim
==
3
);
assert
(
cdim
==
3
);
assert
(
triMap_
==
0
);
triMap_
=
new
TrilinearMapping
(
coord_
[
0
],
coord_
[
1
],
coord_
[
2
],
coord_
[
3
],
coord_
[
4
],
coord_
[
5
],
coord_
[
6
],
coord_
[
7
]);
}
template
<
int
mydim
,
int
cdim
>
inline
void
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
hexa
>
>::
removeMapping
()
{
if
(
triMap_
)
{
delete
triMap_
;
triMap_
=
0
;
}
}
// built Geometry
template
<
int
mydim
,
int
cdim
>
template
<
class
GeometryType
>
inline
bool
ALU3dGridGeometry
<
mydim
,
cdim
,
const
ALU3dGrid
<
3
,
3
,
hexa
>
>::
buildGeomInFather
(
const
GeometryType
&
fatherGeom
,
const
GeometryType
&
myGeom
)
{
removeMapping
();
// compute the local coordinates in father refelem
for
(
int
i
=
0
;
i
<
myGeom
.
corners
()
;
i
++
)
coord_
[
i
]
=
fatherGeom
.
local
(
myGeom
[
i
]
);
buildMapping
();
return
true
;
}
template
<
>
inline
bool
ALU3dGridGeometry
<
3
,
3
,
const
ALU3dGrid
<
3
,
3
,
hexa
>
>::
...
...
@@ -530,11 +573,9 @@ namespace Dune {
coord_
[
i
][
j
]
=
p
[
j
];
}
}
if
(
triMap_
)
delete
triMap_
;
triMap_
=
new
TrilinearMapping
(
coord_
[
0
],
coord_
[
1
],
coord_
[
2
],
coord_
[
3
],
coord_
[
4
],
coord_
[
5
],
coord_
[
6
],
coord_
[
7
]);
// delete old mapping
removeMapping
();
buildMapping
();
return
true
;
}
...
...
@@ -605,6 +646,9 @@ namespace Dune {
const
GEOFaceType
&
face
=
static_cast
<
const
GEOFaceType
&>
(
item
);
if
(
faceNum
>=
6
)
std
::
cout
<<
"
\n
"
<<
faceNum
<<
" wrong face num (too big)
\n
"
;
if
(
faceNum
<
0
)
std
::
cout
<<
"
\n
"
<<
faceNum
<<
" wrong face num
\n
"
;
// for all vertices of this face
for
(
int
i
=
0
;
i
<
4
;
++
i
)
{
// Transform Dune index to ALU index and apply twist
...
...
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