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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
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
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
Core Modules
dune-common
Commits
8708446d
Commit
8708446d
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
bugfix
[[Imported from SVN: r4486]]
parent
9657db46
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
grid/onedgrid/onedgridgeometry.hh
+13
-41
13 additions, 41 deletions
grid/onedgrid/onedgridgeometry.hh
grid/onedgrid/onedintersectionit.hh
+4
-10
4 additions, 10 deletions
grid/onedgrid/onedintersectionit.hh
with
17 additions
and
51 deletions
grid/onedgrid/onedgridgeometry.hh
+
13
−
41
View file @
8708446d
...
...
@@ -22,6 +22,10 @@ namespace Dune {
this
->
realGeometry
.
target_
=
target
;
}
void
setPosition
(
double
p
)
{
this
->
realGeometry
.
storeCoordsLocally_
=
true
;
this
->
realGeometry
.
pos_
[
0
]
=
p
;
}
};
template
<
class
GridImp
>
...
...
@@ -48,45 +52,6 @@ namespace Dune {
template
<
int
codim
,
int
dim
,
class
GridImp
>
class
OneDGridEntity
;
/****************************************************************/
/* Specialization for faces in a 1d grid (i.e. vertices) */
/****************************************************************/
/** \brief Special implementation of the vertex geometry class directly holding the vertex position
This vertex geometry class directly holds the vertex position instead of a pointer to an
implementation class. Therefore it can store vertices that don't actually exist in the
current grid. This is necessary for methods like
OneDGridIntersectionIterator::intersectionSelfLocal()
\todo This class can maybe completely replace the other one
*/
template
<
class
GridImp
>
class
OneDGridVertex
:
public
Geometry
<
0
,
1
,
GridImp
,
OneDGridGeometry
>
{
public:
OneDGridVertex
()
:
Geometry
<
0
,
1
,
GridImp
,
OneDGridGeometry
>
(
OneDGridGeometry
<
0
,
1
,
GridImp
>
())
{};
//! return the element type identifier (vertex)
GeometryType
type
()
const
{
return
GeometryType
(
GeometryType
::
cube
,
0
);}
//! return the number of corners of this element (==1)
int
corners
()
const
{
return
1
;}
//! access to coordinates of corners. Index is the number of the corner
const
FieldVector
<
typename
GridImp
::
ctype
,
1
>&
operator
[]
(
int
i
)
const
{
return
pos_
;
}
//private:
FieldVector
<
typename
GridImp
::
ctype
,
1
>
pos_
;
};
template
<
class
GridImp
>
class
OneDGridGeometry
<
0
,
1
,
GridImp
>
:
...
...
@@ -100,6 +65,8 @@ namespace Dune {
public:
OneDGridGeometry
()
:
storeCoordsLocally_
(
false
)
{}
//! return the element type identifier (vertex)
GeometryType
type
()
const
{
return
GeometryType
(
0
);}
...
...
@@ -108,13 +75,13 @@ namespace Dune {
//! access to coordinates of corners. Index is the number of the corner
const
FieldVector
<
typename
GridImp
::
ctype
,
1
>&
operator
[]
(
int
i
)
const
{
return
target_
->
pos_
;
return
(
storeCoordsLocally_
)
?
pos_
:
target_
->
pos_
;
}
/** \brief Maps a local coordinate within reference element to
* global coordinate in element */
FieldVector
<
typename
GridImp
::
ctype
,
1
>
global
(
const
FieldVector
<
typename
GridImp
::
ctype
,
0
>&
local
)
const
{
return
target_
->
pos_
;
return
(
storeCoordsLocally_
)
?
pos_
:
target_
->
pos_
;
}
/** \brief Maps a global coordinate within the element to a
...
...
@@ -149,6 +116,11 @@ namespace Dune {
}
//private:
bool
storeCoordsLocally_
;
// Stores the element corner positions if it is returned as geometryInFather
FieldVector
<
typename
GridImp
::
ctype
,
1
>
pos_
;
OneDEntityImp
<
0
>*
target_
;
FieldMatrix
<
typename
GridImp
::
ctype
,
0
,
0
>
jacInverse_
;
...
...
This diff is collapsed.
Click to expand it.
grid/onedgrid/onedintersectionit.hh
+
4
−
10
View file @
8708446d
...
...
@@ -150,14 +150,14 @@ namespace Dune {
//! Here returned element is in LOCAL coordinates of the element
//! where iteration started.
const
LocalGeometry
&
intersectionSelfLocal
()
const
{
intersectionSelfLocal_
.
pos_
=
(
numberInSelf
()
==
0
)
?
0
:
1
;
intersectionSelfLocal_
.
setPosition
(
(
numberInSelf
()
==
0
)
?
0
:
1
)
;
return
intersectionSelfLocal_
;
}
//! intersection of codimension 1 of this neighbor with element where iteration started.
//! Here returned element is in LOCAL coordinates of neighbor
const
LocalGeometry
&
intersectionNeighborLocal
()
const
{
intersectionNeighborLocal_
.
pos_
=
(
numberInSelf
()
==
0
)
?
1
:
0
;
intersectionNeighborLocal_
.
setPosition
(
(
numberInSelf
()
==
0
)
?
1
:
0
)
;
return
intersectionNeighborLocal_
;
}
...
...
@@ -213,18 +213,12 @@ namespace Dune {
int
neighbor_
;
/** \brief The geometry that's being returned when intersectionSelfLocal() is called
\todo This one is returned either with coordinate 1 or zero. Can't we make two
static instances of this class and return those instead of carrying them around
in the iterator?
*/
mutable
OneD
GridVertex
<
GridImp
>
intersectionSelfLocal_
;
mutable
OneD
MakeableGeometry
<
0
,
1
,
GridImp
>
intersectionSelfLocal_
;
/** \brief The geometry that's being returned when intersectionSelfLocal() is called
\todo This one is returned either with coordinate 1 or zero. Can't we make two
static instances of this class and return those instead of carrying them around
in the iterator?
*/
mutable
OneD
GridVertex
<
GridImp
>
intersectionNeighborLocal_
;
mutable
OneD
MakeableGeometry
<
0
,
1
,
GridImp
>
intersectionNeighborLocal_
;
//! The geometry that's being returned when intersectionSelfGlobal() is called
mutable
OneDMakeableGeometry
<
dim
-
1
,
dimworld
,
GridImp
>
intersectionGlobal_
;
...
...
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