Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-vtk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
iwr
dune-vtk
Commits
178a7777
Commit
178a7777
authored
4 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
fix the fix
parent
8a18a5d6
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
dune/vtk/gridcreators/lagrangegridcreator.hh
+24
-23
24 additions, 23 deletions
dune/vtk/gridcreators/lagrangegridcreator.hh
with
24 additions
and
23 deletions
dune/vtk/gridcreators/lagrangegridcreator.hh
+
24
−
23
View file @
178a7777
...
...
@@ -22,21 +22,21 @@ namespace Dune
// \brief Create a grid from data that represents higher (lagrange) cells.
/**
* The grid is created from the first nodes of a cell parametrization, representing
* the corner vertices. Thus a piecewise "flat" grid is constructed. The
parametrization
* is 1. passed as a local element parametrization to the
`insertElement()` function of a
* gridFactory to allow the grid itself to handle the
parametrization and 2. is stored
* internally that can be accessed by using this
GridCreator object as a grid function,
* or by extracting locally the parametrization
on each existing grid element after
* creation of the grid.
* the corner vertices. Thus a piecewise "flat" grid is constructed. The
*
parametrization
is 1. passed as a local element parametrization to the
*
`insertElement()` function of a
gridFactory to allow the grid itself to handle the
*
parametrization and 2. is stored
internally that can be accessed by using this
*
GridCreator object as a grid function,
or by extracting locally the parametrization
*
on each existing grid element after
creation of the grid.
*
* So, the LagrangeGridCreator models both, a `GridCreator` and a `GridFunction`.
**/
template
<
class
Grid
>
template
<
class
Grid
Type
>
struct
LagrangeGridCreator
:
public
GridCreatorInterface
<
Grid
,
LagrangeGridCreator
<
Grid
>>
:
public
GridCreatorInterface
<
Grid
Type
,
LagrangeGridCreator
<
Grid
Type
>>
{
using
Self
=
LagrangeGridCreator
;
using
Super
=
GridCreatorInterface
<
Grid
,
Self
>
;
using
Super
=
GridCreatorInterface
<
Grid
Type
,
Self
>
;
using
GlobalCoordinate
=
typename
Super
::
GlobalCoordinate
;
using
Nodes
=
std
::
vector
<
GlobalCoordinate
>
;
...
...
@@ -49,7 +49,7 @@ namespace Dune
};
using
Parametrization
=
std
::
vector
<
ElementParametrization
>
;
using
Element
=
typename
Grid
::
template
Codim
<
0
>
::
Entity
;
using
Element
=
typename
Grid
Type
::
template
Codim
<
0
>
::
Entity
;
using
LocalCoordinate
=
typename
Element
::
Geometry
::
LocalCoordinate
;
class
LocalParametrization
;
...
...
@@ -58,7 +58,7 @@ namespace Dune
public
:
using
Super
::
factory
;
LagrangeGridCreator
(
GridFactory
<
Grid
>&
factory
)
LagrangeGridCreator
(
GridFactory
<
Grid
Type
>&
factory
)
:
Super
(
factory
)
{}
...
...
@@ -88,15 +88,15 @@ namespace Dune
std
::
int64_t
vertexIndex
=
0
;
for
(
std
::
size_t
i
=
0
;
i
<
types
.
size
();
++
i
)
{
auto
type
=
Vtk
::
to_geometry
(
types
[
i
]);
if
(
type
.
dim
()
!=
Grid
::
dimension
)
if
(
type
.
dim
()
!=
Grid
Type
::
dimension
)
continue
;
Vtk
::
CellType
cellType
{
type
};
auto
refElem
=
referenceElement
<
double
,
Grid
::
dimension
>
(
type
);
auto
refElem
=
referenceElement
<
double
,
Grid
Type
::
dimension
>
(
type
);
std
::
int64_t
shift
=
(
i
==
0
?
0
:
offsets
[
i
-
1
]);
int
nNodes
=
offsets
[
i
]
-
shift
;
int
nVertices
=
refElem
.
size
(
Grid
::
dimension
);
int
nVertices
=
refElem
.
size
(
Grid
Type
::
dimension
);
// insert vertices into grid and construct element vertices
std
::
vector
<
unsigned
int
>
element
(
nVertices
);
...
...
@@ -129,7 +129,7 @@ namespace Dune
param
.
corners
=
element
;
// try to create element with parametrization
if
constexpr
(
Std
::
is_detected_v
<
HasParametrizedElements
,
GridFactory
<
Grid
>>
)
{
if
constexpr
(
Std
::
is_detected_v
<
HasParametrizedElements
,
GridFactory
<
Grid
Type
>>
)
{
try
{
factory
().
insertElement
(
type
,
element
,
localParametrization
(
parametrization_
.
size
()
-
1
));
}
catch
(
Dune
::
GridError
const
&
/* notImplemented */
)
{
...
...
@@ -162,10 +162,11 @@ namespace Dune
* and `GlobalCoordinate` a world coordinate in the parametrized grid.
*
* Note, when an element is passed, it might have a different local coordinate system
* than the coordinate system used to defined the element parametrization. Thus coordinate
* transform is internally chained to the evaluation of the local parametrization. This
* local geometry transform is obtained by figuring out the permutation of corners in the
* element corresponding to the inserted corner vertices.
* than the coordinate system used to defined the element parametrization. Thus
* coordinate transform is internally chained to the evaluation of the local
* parametrization. This local geometry transform is obtained by figuring out the
* permutation of corners in the element corresponding to the inserted corner
* vertices.
**/
LocalParametrization
localParametrization
(
Element
const
&
element
)
const
{
...
...
@@ -176,9 +177,9 @@ namespace Dune
assert
(
element
.
type
()
==
localParam
.
type
);
// collect indices of vertices
std
::
vector
<
unsigned
int
>
indices
(
element
.
subEntities
(
Grid
::
dimension
));
for
(
unsigned
int
i
=
0
;
i
<
element
.
subEntities
(
Grid
::
dimension
);
++
i
)
indices
[
i
]
=
factory
().
insertionIndex
(
element
.
template
subEntity
<
Grid
::
dimension
>(
i
));
std
::
vector
<
unsigned
int
>
indices
(
element
.
subEntities
(
Grid
Type
::
dimension
));
for
(
unsigned
int
i
=
0
;
i
<
element
.
subEntities
(
Grid
Type
::
dimension
);
++
i
)
indices
[
i
]
=
factory
().
insertionIndex
(
element
.
template
subEntity
<
Grid
Type
::
dimension
>(
i
));
// calculate permutation vector
std
::
vector
<
unsigned
int
>
permutation
(
indices
.
size
());
...
...
@@ -233,7 +234,7 @@ namespace Dune
struct
EntitySet
{
using
Grid
=
typename
Self
::
Grid
;
using
Grid
=
Grid
Type
;
};
/// Dummy function returning a placeholder entityset
...
...
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