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
3c94b721
Commit
3c94b721
authored
19 years ago
by
Adrian Burri
Browse files
Options
Downloads
Patches
Plain Diff
added method global() on all reference elements
[[Imported from SVN: r3554]]
parent
d0da0d23
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grid/common/referenceelements.hh
+75
-0
75 additions, 0 deletions
grid/common/referenceelements.hh
with
75 additions
and
0 deletions
grid/common/referenceelements.hh
+
75
−
0
View file @
3c94b721
...
...
@@ -16,8 +16,38 @@
* @brief Definition of reference elements for all types and dims
* @author Peter Bastian
*/
namespace
Dune
{
namespace
{
template
<
class
RT
,
int
codim
>
FieldVector
<
typename
RT
::
CoordType
,
RT
::
d
>
mapGlobal
(
const
RT
&
refElem
,
const
FieldVector
<
typename
RT
::
CoordType
,
RT
::
d
-
codim
>&
l
,
int
i
,
int
cdim
)
{
typedef
typename
RT
::
CoordType
CoordType
;
const
int
dim
=
RT
::
d
;
assert
(
cdim
==
codim
);
static
FieldMatrix
<
CoordType
,
dim
-
codim
,
dim
>
mat
;
int
zeroLocalIdx
=
refElem
.
subEntity
(
i
,
cdim
,
0
,
dim
);
FieldVector
<
CoordType
,
dim
>
result
=
refElem
.
position
(
zeroLocalIdx
,
dim
);
for
(
int
j
=
0
;
j
<
dim
-
cdim
;
++
j
)
{
int
indexLocal
=
refElem
.
subEntity
(
i
,
cdim
,
j
+
1
,
dim
);
mat
[
j
]
=
refElem
.
position
(
indexLocal
,
dim
)
-
result
;
}
mat
.
umtv
(
l
,
result
);
return
result
;
}
}
// end unnamed namespace
/**
@defgroup GridReferenceElements Reference Elements
@ingroup Grid
...
...
@@ -91,6 +121,13 @@ namespace Dune
//! position of entity (i,c)
virtual
const
FieldVector
<
ctype
,
dim
>&
position
(
int
i
,
int
c
)
const
=
0
;
//! maps local coordinate on subentity i of codim cdim onto reference element coordinates
template
<
int
codim
>
FieldVector
<
ctype
,
dim
>
global
(
const
FieldVector
<
ctype
,
dim
-
codim
>&
local
,
int
i
,
int
cdim
)
const
{
return
mapGlobal
<
ReferenceElement
<
ctype
,
dim
>
,
codim
>
(
*
this
,
local
,
i
,
cdim
);
}
//! type of (i,c)
virtual
GeometryType
type
(
int
i
,
int
c
)
const
=
0
;
...
...
@@ -140,6 +177,14 @@ namespace Dune
return
Imp
::
position
(
i
,
c
);
}
//! maps local coordinate on subentity i of codim cdim onto reference element coordinates
template
<
int
codim
>
FieldVector
<
CoordType
,
d
>
global
(
const
FieldVector
<
CoordType
,
d
-
codim
>&
l
,
int
i
,
int
cdim
)
const
{
return
Imp
::
global
(
l
,
i
,
cdim
);
}
//! type of (i,c)
GeometryType
type
(
int
i
,
int
c
)
const
{
...
...
@@ -261,6 +306,13 @@ namespace Dune
return
pos
[
i
][
c
];
}
//! maps local coordinate on subentity i of codim cdim onto reference element coordinates
template
<
int
codim
>
FieldVector
<
ctype
,
dim
>
global
(
const
FieldVector
<
ctype
,
dim
-
codim
>&
local
,
int
i
,
int
cdim
)
const
{
return
mapGlobal
<
ReferenceCube
<
ctype
,
dim
>
,
codim
>
(
*
this
,
local
,
i
,
cdim
);
}
//! type of (i,c)
GeometryType
type
(
int
i
,
int
c
)
const
{
...
...
@@ -555,6 +607,13 @@ namespace Dune
return
pos
[
i
][
c
];
}
//! maps local coordinate on subentity i of codim cdim onto reference element coordinates
template
<
int
codim
>
FieldVector
<
ctype
,
dim
>
global
(
const
FieldVector
<
ctype
,
dim
-
codim
>&
local
,
int
i
,
int
cdim
)
const
{
return
mapGlobal
<
ReferenceSimplex
<
ctype
,
dim
>
,
codim
>
(
*
this
,
local
,
i
,
cdim
);
}
//! type of (i,c)
GeometryType
type
(
int
i
,
int
c
)
const
{
...
...
@@ -938,6 +997,14 @@ namespace Dune
{
return
pos
[
i
][
c
];
}
//! maps local coordinate on subentity i of codim cdim onto reference element coordinates
template
<
int
codim
>
FieldVector
<
ctype
,
dim
>
global
(
const
FieldVector
<
ctype
,
dim
-
codim
>&
local
,
int
i
,
int
cdim
)
const
{
return
mapGlobal
<
ReferencePrism
<
ctype
,
dim
>
,
codim
>
(
*
this
,
local
,
i
,
cdim
);
}
//! type of (i,c)
GeometryType
type
(
int
i
,
int
c
)
const
{
...
...
@@ -1287,6 +1354,14 @@ namespace Dune
{
return
pos
[
i
][
c
];
}
//! maps local coordinate on subentity i of codim cdim onto reference element coordinates
template
<
int
codim
>
FieldVector
<
ctype
,
dim
>
global
(
const
FieldVector
<
ctype
,
dim
-
codim
>&
local
,
int
i
,
int
cdim
)
const
{
return
mapGlobal
<
ReferencePyramid
<
ctype
,
dim
>
,
codim
>
(
*
this
,
local
,
i
,
cdim
);
}
//! type of (i,c)
GeometryType
type
(
int
i
,
int
c
)
const
{
...
...
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