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
57100b46
There was an error fetching the commit references. Please try again later.
Commit
57100b46
authored
5 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Python bindings for Mesh
parent
98e54256
No related branches found
No related tags found
1 merge request
!65
VTK formats, distributed mesh and synchronizer
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Python/pytnl/tnl/Mesh.h
+22
-20
22 additions, 20 deletions
src/Python/pytnl/tnl/Mesh.h
with
22 additions
and
20 deletions
src/Python/pytnl/tnl/Mesh.h
+
22
−
20
View file @
57100b46
...
...
@@ -13,15 +13,12 @@ namespace py = pybind11;
#include
<type_traits>
struct
_general
{};
struct
_special
:
_general
{};
template
<
typename
MeshEntity
,
int
Superdimension
,
typename
Scope
,
typename
=
typename
std
::
enable_if
<
Superdimension
<=
MeshEntity
::
MeshT
raitsT
ype
::
m
eshDimension
>
::
typ
e
>
std
::
enable_if
_t
<
Superdimension
<=
MeshEntity
::
MeshType
::
getM
eshDimension
(),
bool
>
=
tru
e
>
// && MeshEntity::template SuperentityTraits< Superdimension >::storageEnabled >::type >
void
export_getSuperentityIndex
(
Scope
&
m
,
_special
)
void
export_getSuperentityIndex
(
Scope
&
m
)
{
m
.
def
(
"getSuperentityIndex"
,
[](
const
MeshEntity
&
entity
,
const
typename
MeshEntity
::
LocalIndexType
&
i
)
{
return
entity
.
template
getSuperentityIndex
<
Superdimension
>(
i
);
...
...
@@ -31,8 +28,9 @@ void export_getSuperentityIndex( Scope & m, _special )
template
<
typename
MeshEntity
,
int
Superdimension
,
typename
Scope
>
void
export_getSuperentityIndex
(
Scope
&
,
_general
)
typename
Scope
,
std
::
enable_if_t
<
!
(
Superdimension
<=
MeshEntity
::
MeshType
::
getMeshDimension
()
),
bool
>
=
true
>
void
export_getSuperentityIndex
(
Scope
&
)
{
}
...
...
@@ -40,9 +38,9 @@ void export_getSuperentityIndex( Scope &, _general )
template
<
typename
MeshEntity
,
int
Subdimension
,
typename
Scope
,
typename
=
typename
std
::
enable_if
<
Subdimension
<=
MeshEntity
::
MeshT
raitsT
ype
::
m
eshDimension
&&
(
Subdimension
<
MeshEntity
::
getEntityDimension
())
>
::
typ
e
>
void
export_getSubentityIndex
(
Scope
&
m
,
const
char
*
name
,
_special
)
std
::
enable_if
_t
<
Subdimension
<=
MeshEntity
::
MeshType
::
getM
eshDimension
()
&&
(
Subdimension
<
MeshEntity
::
getEntityDimension
())
,
bool
>
=
tru
e
>
void
export_getSubentityIndex
(
Scope
&
m
,
const
char
*
name
)
{
m
.
def
(
name
,
[](
const
MeshEntity
&
entity
,
const
typename
MeshEntity
::
LocalIndexType
&
i
)
{
return
entity
.
template
getSubentityIndex
<
Subdimension
>(
i
);
...
...
@@ -51,17 +49,20 @@ void export_getSubentityIndex( Scope & m, const char* name, _special )
}
template
<
typename
MeshEntity
,
int
Superdimension
,
typename
Scope
>
void
export_getSubentityIndex
(
Scope
&
,
const
char
*
,
_general
)
int
Subdimension
,
typename
Scope
,
std
::
enable_if_t
<
!
(
Subdimension
<=
MeshEntity
::
MeshType
::
getMeshDimension
()
&&
(
Subdimension
<
MeshEntity
::
getEntityDimension
())
),
bool
>
=
true
>
void
export_getSubentityIndex
(
Scope
&
,
const
char
*
)
{
}
template
<
typename
MeshEntity
,
typename
Scope
,
typename
=
typename
std
::
enable_if
<
MeshEntity
::
getEntityDimension
()
==
0
>
::
typ
e
>
void
export_getPoint
(
Scope
&
scope
,
_special
)
std
::
enable_if
_t
<
MeshEntity
::
getEntityDimension
()
==
0
,
bool
>
=
tru
e
>
void
export_getPoint
(
Scope
&
scope
)
{
scope
.
def
(
"getPoint"
,
[](
const
MeshEntity
&
entity
)
{
return
entity
.
getPoint
();
...
...
@@ -70,8 +71,9 @@ void export_getPoint( Scope & scope, _special )
}
template
<
typename
MeshEntity
,
typename
Scope
>
void
export_getPoint
(
Scope
&
,
_general
)
typename
Scope
,
std
::
enable_if_t
<
MeshEntity
::
getEntityDimension
()
!=
0
,
bool
>
=
true
>
void
export_getPoint
(
Scope
&
)
{
}
...
...
@@ -85,9 +87,9 @@ void export_MeshEntity( Scope & scope, const char* name )
// TODO
;
export_getSuperentityIndex
<
MeshEntity
,
MeshEntity
::
getEntityDimension
()
+
1
>
(
entity
,
_special
()
);
export_getSubentityIndex
<
MeshEntity
,
0
>
(
entity
,
"getSubvertexIndex"
,
_special
()
);
export_getPoint
<
MeshEntity
>
(
entity
,
_special
()
);
export_getSuperentityIndex
<
MeshEntity
,
MeshEntity
::
getEntityDimension
()
+
1
>
(
entity
);
export_getSubentityIndex
<
MeshEntity
,
0
>
(
entity
,
"getSubvertexIndex"
);
export_getPoint
<
MeshEntity
>
(
entity
);
}
template
<
typename
Mesh
>
...
...
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