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
Tobias Leibner
dune-common
Commits
62397d5c
Commit
62397d5c
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
compile ReferenceTopologySet into libdune
[[Imported from SVN: r2057]]
parent
d7ed8434
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/Makefile.am
+3
-0
3 additions, 0 deletions
grid/Makefile.am
grid/reftopology.cc
+152
-0
152 additions, 0 deletions
grid/reftopology.cc
grid/reftopology.hh
+11
-147
11 additions, 147 deletions
grid/reftopology.hh
with
166 additions
and
147 deletions
grid/Makefile.am
+
3
−
0
View file @
62397d5c
...
...
@@ -2,6 +2,9 @@
SUBDIRS
=
albertagrid alu3dgrid common onedgrid sgrid uggrid yaspgrid
.
test
noinst_LTLIBRARIES
=
libgrid.la
libgrid_la_SOURCES
=
reftopology.cc
griddir
=
$(
includedir
)
/dune/grid
grid_HEADERS
=
albertagrid.hh
\
alu3dgrid.hh
\
...
...
This diff is collapsed.
Click to expand it.
grid/reftopology.cc
0 → 100644
+
152
−
0
View file @
62397d5c
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/** \file
* \brief Implementation of the reference topologies
*/
#include
<dune/grid/reftopology.hh>
using
namespace
Dune
;
namespace
Dune
{
template
<
int
inputCodim
,
int
outputCodim
>
void
Dune
::
ReferenceTopologySet
::
getSubEntities
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
DUNE_THROW
(
NotImplemented
,
"no subEntity information for these codims"
);
}
template
<
>
void
Dune
::
ReferenceTopologySet
::
getSubEntities
<
1
,
1
>
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
switch
(
eType
)
{
case
line
:
{
n
=
1
;
result
=
&
lineVerticesPerFace
[
entity
];
return
;
}
default
:
DUNE_THROW
(
NotImplemented
,
"No subEntity handling for codims (1,2) and element type"
<<
eType
);
}
}
template
<
>
void
Dune
::
ReferenceTopologySet
::
getSubEntities
<
1
,
2
>
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
switch
(
eType
)
{
case
line
:
{
n
=
1
;
result
=
&
lineVerticesPerFace
[
entity
];
return
;
}
case
triangle
:
{
n
=
2
;
result
=
&
triangleVerticesPerFace
[
entity
][
0
];
return
;
}
case
quadrilateral
:
{
n
=
2
;
result
=
&
quadrilateralVerticesPerFace
[
entity
][
0
];
return
;
}
default
:
DUNE_THROW
(
NotImplemented
,
"No subEntity handling for codims (1,2) and element type"
<<
eType
);
}
}
template
<
>
void
Dune
::
ReferenceTopologySet
::
getSubEntities
<
1
,
3
>
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
switch
(
eType
)
{
case
tetrahedron
:
{
n
=
3
;
result
=
&
tetrahedronVerticesPerFace
[
entity
][
0
];
return
;
}
case
pyramid
:
{
const
int
faceSizes
[
5
]
=
{
4
,
3
,
3
,
3
,
3
};
n
=
faceSizes
[
entity
];
result
=
&
pyramidVerticesPerFace
[
entity
][
0
];
return
;
}
case
prism
:
{
const
int
faceSizes
[
5
]
=
{
3
,
4
,
4
,
4
,
3
};
n
=
faceSizes
[
entity
];
result
=
&
prismVerticesPerFace
[
entity
][
0
];
return
;
}
case
hexahedron
:
{
n
=
4
;
result
=
&
hexahedronVerticesPerFace
[
entity
][
0
];
return
;
}
default
:
DUNE_THROW
(
NotImplemented
,
"No subEntity handling for codims (1,3) and element type"
<<
eType
);
}
}
}
// end namespace Dune
const
int
Dune
::
ReferenceTopologySet
::
lineVerticesPerFace
[
2
]
=
{
0
,
1
};
const
int
Dune
::
ReferenceTopologySet
::
triangleVerticesPerFace
[
3
][
2
]
=
{
{
1
,
2
},
{
2
,
0
},
{
0
,
1
}
};
const
int
Dune
::
ReferenceTopologySet
::
quadrilateralVerticesPerFace
[
4
][
2
]
=
{
{
2
,
0
},
{
1
,
3
}
,
{
0
,
1
}
,
{
3
,
2
}};
const
int
Dune
::
ReferenceTopologySet
::
tetrahedronVerticesPerFace
[
4
][
3
]
=
{
{
1
,
2
,
3
},
{
0
,
3
,
2
},
{
0
,
1
,
3
},
{
0
,
2
,
1
}
};
const
int
Dune
::
ReferenceTopologySet
::
pyramidVerticesPerFace
[
5
][
4
]
=
{
{
0
,
3
,
2
,
1
},
{
0
,
1
,
4
,
-
1
},
{
1
,
2
,
4
,
-
1
},
{
2
,
3
,
4
,
-
1
},
{
0
,
4
,
3
,
-
1
}
};
const
int
Dune
::
ReferenceTopologySet
::
prismVerticesPerFace
[
5
][
4
]
=
{
{
0
,
2
,
1
,
-
1
},
{
0
,
1
,
4
,
3
},
{
1
,
2
,
5
,
4
},
{
0
,
3
,
5
,
2
},
{
3
,
4
,
5
,
-
1
}
};
const
int
Dune
::
ReferenceTopologySet
::
hexahedronVerticesPerFace
[
6
][
4
]
=
{
{
0
,
4
,
6
,
2
},
{
1
,
3
,
7
,
5
},
{
0
,
1
,
5
,
4
},
{
2
,
6
,
7
,
3
},
{
0
,
2
,
3
,
1
},
{
5
,
7
,
6
,
4
}
};
This diff is collapsed.
Click to expand it.
grid/reftopology.hh
+
11
−
147
View file @
62397d5c
...
...
@@ -3,6 +3,9 @@
#ifndef DUNE_REFERENCE_TOPOLOGY_HH
#define DUNE_REFERENCE_TOPOLOGY_HH
#include
<dune/grid/common/grid.hh>
#include
<dune/common/exceptions.hh>
/** \file
* \brief The reference topologies
*/
...
...
@@ -14,19 +17,19 @@ namespace Dune {
*/
class
ReferenceTopologySet
{
static
const
int
ReferenceTopologySet
::
lineVerticesPerFace
[
2
];
static
const
int
lineVerticesPerFace
[
2
];
static
const
int
ReferenceTopologySet
::
triangleVerticesPerFace
[
3
][
2
];
static
const
int
triangleVerticesPerFace
[
3
][
2
];
static
const
int
ReferenceTopologySet
::
quadrilateralVerticesPerFace
[
4
][
2
];
static
const
int
quadrilateralVerticesPerFace
[
4
][
2
];
static
const
int
ReferenceTopologySet
::
tetrahedronVerticesPerFace
[
4
][
3
];
static
const
int
tetrahedronVerticesPerFace
[
4
][
3
];
static
const
int
ReferenceTopologySet
::
pyramidVerticesPerFace
[
5
][
4
];
static
const
int
pyramidVerticesPerFace
[
5
][
4
];
static
const
int
ReferenceTopologySet
::
prismVerticesPerFace
[
5
][
4
];
static
const
int
prismVerticesPerFace
[
5
][
4
];
static
const
int
ReferenceTopologySet
::
hexahedronVerticesPerFace
[
6
][
4
];
static
const
int
hexahedronVerticesPerFace
[
6
][
4
];
public:
...
...
@@ -54,146 +57,7 @@ namespace Dune {
};
template
<
int
inputCodim
,
int
outputCodim
>
void
ReferenceTopologySet
::
getSubEntities
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
DUNE_THROW
(
NotImplemented
,
"no subEntity information for these codims"
);
}
template
<
>
void
ReferenceTopologySet
::
getSubEntities
<
1
,
1
>
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
switch
(
eType
)
{
case
line
:
{
n
=
1
;
result
=
&
lineVerticesPerFace
[
entity
];
return
;
}
default
:
DUNE_THROW
(
NotImplemented
,
"No subEntity handling for codims (1,2) and element type"
<<
eType
);
}
}
template
<
>
void
ReferenceTopologySet
::
getSubEntities
<
1
,
2
>
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
switch
(
eType
)
{
case
line
:
{
n
=
1
;
result
=
&
lineVerticesPerFace
[
entity
];
return
;
}
case
triangle
:
{
n
=
2
;
result
=
&
triangleVerticesPerFace
[
entity
][
0
];
return
;
}
case
quadrilateral
:
{
n
=
2
;
result
=
&
quadrilateralVerticesPerFace
[
entity
][
0
];
return
;
}
default
:
DUNE_THROW
(
NotImplemented
,
"No subEntity handling for codims (1,2) and element type"
<<
eType
);
}
}
template
<
>
void
ReferenceTopologySet
::
getSubEntities
<
1
,
3
>
(
const
GeometryType
&
eType
,
int
entity
,
const
int
*&
result
,
int
&
n
)
{
switch
(
eType
)
{
case
tetrahedron
:
{
n
=
3
;
result
=
&
tetrahedronVerticesPerFace
[
entity
][
0
];
return
;
}
case
pyramid
:
{
const
int
faceSizes
[
5
]
=
{
4
,
3
,
3
,
3
,
3
};
n
=
faceSizes
[
entity
];
result
=
&
pyramidVerticesPerFace
[
entity
][
0
];
return
;
}
case
prism
:
{
const
int
faceSizes
[
5
]
=
{
3
,
4
,
4
,
4
,
3
};
n
=
faceSizes
[
entity
];
result
=
&
prismVerticesPerFace
[
entity
][
0
];
return
;
}
case
hexahedron
:
{
n
=
4
;
result
=
&
hexahedronVerticesPerFace
[
entity
][
0
];
return
;
}
default
:
DUNE_THROW
(
NotImplemented
,
"No subEntity handling for codims (1,3) and element type"
<<
eType
);
}
}
const
int
ReferenceTopologySet
::
lineVerticesPerFace
[
2
]
=
{
0
,
1
};
const
int
ReferenceTopologySet
::
triangleVerticesPerFace
[
3
][
2
]
=
{
{
1
,
2
},
{
2
,
0
},
{
0
,
1
}
};
const
int
ReferenceTopologySet
::
quadrilateralVerticesPerFace
[
4
][
2
]
=
{
{
2
,
0
},
{
1
,
3
}
,
{
0
,
1
}
,
{
3
,
2
}};
const
int
ReferenceTopologySet
::
tetrahedronVerticesPerFace
[
4
][
3
]
=
{
{
1
,
2
,
3
},
{
0
,
3
,
2
},
{
0
,
1
,
3
},
{
0
,
2
,
1
}
};
const
int
ReferenceTopologySet
::
pyramidVerticesPerFace
[
5
][
4
]
=
{
{
0
,
3
,
2
,
1
},
{
0
,
1
,
4
,
-
1
},
{
1
,
2
,
4
,
-
1
},
{
2
,
3
,
4
,
-
1
},
{
0
,
4
,
3
,
-
1
}
};
const
int
ReferenceTopologySet
::
prismVerticesPerFace
[
5
][
4
]
=
{
{
0
,
2
,
1
,
-
1
},
{
0
,
1
,
4
,
3
},
{
1
,
2
,
5
,
4
},
{
0
,
3
,
5
,
2
},
{
3
,
4
,
5
,
-
1
}
};
const
int
ReferenceTopologySet
::
hexahedronVerticesPerFace
[
6
][
4
]
=
{
{
0
,
4
,
6
,
2
},
{
1
,
3
,
7
,
5
},
{
0
,
1
,
5
,
4
},
{
2
,
6
,
7
,
3
},
{
0
,
2
,
3
,
1
},
{
5
,
7
,
6
,
4
}
};
}
}
// end namespace Dune
#endif
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