Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
a73b6f6f
There was an error fetching the commit references. Please try again later.
Commit
a73b6f6f
authored
8 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Fixed MeshEntityStorageRebinder for meshes with disabled subentities/superentities
parent
04bd295d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h
+77
-6
77 additions, 6 deletions
...TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h
with
77 additions
and
6 deletions
src/TNL/Meshes/MeshDetails/layers/MeshEntityStorageRebinder.h
+
77
−
6
View file @
a73b6f6f
...
@@ -30,18 +30,79 @@
...
@@ -30,18 +30,79 @@
namespace
TNL
{
namespace
TNL
{
namespace
Meshes
{
namespace
Meshes
{
template
<
typename
Mesh
,
typename
DimensionsTag
,
typename
SuperdimensionsTag
,
bool
Enabled
=
Mesh
::
MeshTraitsType
::
template
SuperentityTraits
<
typename
Mesh
::
template
EntityType
<
DimensionsTag
::
value
>
::
EntityTopology
,
SuperdimensionsTag
::
value
>
::
storageEnabled
>
struct
MeshEntityStorageRebinderSuperentityWorker
{
template
<
typename
Worker
>
static
void
exec
(
Mesh
&
mesh
)
{
// If the reader is wondering why the code is in the Worker and not here:
// that's because we're accessing protected method bindSuperentitiesStorageNetwork
// and friend templates in GCC 6.1 apparently don't play nice with partial
// template specializations.
Worker
::
bindSuperentities
(
mesh
);
}
};
template
<
typename
Mesh
,
typename
DimensionsTag
,
typename
SuperdimensionsTag
>
struct
MeshEntityStorageRebinderSuperentityWorker
<
Mesh
,
DimensionsTag
,
SuperdimensionsTag
,
false
>
{
template
<
typename
Worker
>
static
void
exec
(
Mesh
&
mesh
)
{}
};
template
<
typename
Mesh
,
typename
DimensionsTag
,
typename
SuperdimensionsTag
,
bool
Enabled
=
Mesh
::
MeshTraitsType
::
template
SubentityTraits
<
typename
Mesh
::
template
EntityType
<
SuperdimensionsTag
::
value
>
::
EntityTopology
,
DimensionsTag
::
value
>
::
storageEnabled
>
struct
MeshEntityStorageRebinderSubentityWorker
{
template
<
typename
Worker
>
static
void
exec
(
Mesh
&
mesh
)
{
// If the reader is wondering why the code is in the Worker and not here:
// that's because we're accessing protected method bindSubentitiesStorageNetwork
// and friend templates in GCC 6.1 apparently don't play nice with partial
// template specializations.
Worker
::
bindSubentities
(
mesh
);
}
};
template
<
typename
Mesh
,
typename
DimensionsTag
,
typename
SuperdimensionsTag
>
struct
MeshEntityStorageRebinderSubentityWorker
<
Mesh
,
DimensionsTag
,
SuperdimensionsTag
,
false
>
{
template
<
typename
Worker
>
static
void
exec
(
Mesh
&
mesh
)
{}
};
template
<
typename
Mesh
,
typename
DimensionsTag
,
typename
SuperdimensionsTag
>
template
<
typename
Mesh
,
typename
DimensionsTag
,
typename
SuperdimensionsTag
>
struct
MeshEntityStorageRebinderWorker
struct
MeshEntityStorageRebinderWorker
{
{
static
void
exec
(
Mesh
&
mesh
)
static
void
exec
(
Mesh
&
mesh
)
{
{
for
(
typename
Mesh
::
GlobalIndexType
i
=
0
;
i
<
mesh
.
template
getNumberOfEntities
<
SuperdimensionsTag
::
value
>();
i
++
)
MeshEntityStorageRebinderSuperentityWorker
<
Mesh
,
DimensionsTag
,
SuperdimensionsTag
>::
{
template
exec
<
MeshEntityStorageRebinderWorker
>(
mesh
);
auto
&
superentity
=
mesh
.
template
getEntity
<
SuperdimensionsTag
::
value
>(
i
);
MeshEntityStorageRebinderSubentityWorker
<
Mesh
,
DimensionsTag
,
SuperdimensionsTag
>::
auto
&
subentitiesStorage
=
mesh
.
template
getSubentityStorageNetwork
<
SuperdimensionsTag
::
value
,
DimensionsTag
::
value
>();
template
exec
<
MeshEntityStorageRebinderWorker
>(
mesh
);
superentity
.
template
bindSubentitiesStorageNetwork
<
DimensionsTag
::
value
>(
subentitiesStorage
.
getValues
(
i
)
);
}
}
static
void
bindSuperentities
(
Mesh
&
mesh
)
{
for
(
typename
Mesh
::
GlobalIndexType
i
=
0
;
i
<
mesh
.
template
getNumberOfEntities
<
DimensionsTag
::
value
>();
i
++
)
for
(
typename
Mesh
::
GlobalIndexType
i
=
0
;
i
<
mesh
.
template
getNumberOfEntities
<
DimensionsTag
::
value
>();
i
++
)
{
{
auto
&
subentity
=
mesh
.
template
getEntity
<
DimensionsTag
::
value
>(
i
);
auto
&
subentity
=
mesh
.
template
getEntity
<
DimensionsTag
::
value
>(
i
);
...
@@ -49,6 +110,16 @@ struct MeshEntityStorageRebinderWorker
...
@@ -49,6 +110,16 @@ struct MeshEntityStorageRebinderWorker
subentity
.
template
bindSuperentitiesStorageNetwork
<
SuperdimensionsTag
::
value
>(
superentitiesStorage
.
getValues
(
i
)
);
subentity
.
template
bindSuperentitiesStorageNetwork
<
SuperdimensionsTag
::
value
>(
superentitiesStorage
.
getValues
(
i
)
);
}
}
}
}
static
void
bindSubentities
(
Mesh
&
mesh
)
{
for
(
typename
Mesh
::
GlobalIndexType
i
=
0
;
i
<
mesh
.
template
getNumberOfEntities
<
SuperdimensionsTag
::
value
>();
i
++
)
{
auto
&
superentity
=
mesh
.
template
getEntity
<
SuperdimensionsTag
::
value
>(
i
);
auto
&
subentitiesStorage
=
mesh
.
template
getSubentityStorageNetwork
<
SuperdimensionsTag
::
value
,
DimensionsTag
::
value
>();
superentity
.
template
bindSubentitiesStorageNetwork
<
DimensionsTag
::
value
>(
subentitiesStorage
.
getValues
(
i
)
);
}
}
};
};
...
...
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