Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78390963
py_group_manager.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 20, 13:47
Size
3 KB
Mime Type
text/x-c
Expires
Thu, Aug 22, 13:47 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19984953
Attached To
rAKA akantu
py_group_manager.cc
View Options
/* -------------------------------------------------------------------------- */
#include "py_aka_array.hh"
/* -------------------------------------------------------------------------- */
#include <element_group.hh>
#include <node_group.hh>
/* -------------------------------------------------------------------------- */
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
/* -------------------------------------------------------------------------- */
namespace
py
=
pybind11
;
/* -------------------------------------------------------------------------- */
namespace
akantu
{
/* -------------------------------------------------------------------------- */
void
register_group_manager
(
py
::
module
&
mod
)
{
/* ------------------------------------------------------------------------ */
py
::
class_
<
NodeGroup
>
(
mod
,
"NodeGroup"
)
.
def
(
"getNodes"
,
[](
NodeGroup
&
self
)
->
decltype
(
auto
)
{
return
self
.
getNodes
();
},
py
::
return_value_policy
::
reference
);
/* ------------------------------------------------------------------------ */
py
::
class_
<
ElementGroup
>
(
mod
,
"ElementGroup"
)
.
def
(
"getNodeGroup"
,
[](
ElementGroup
&
self
)
->
decltype
(
auto
)
{
return
self
.
getNodeGroup
();
},
py
::
return_value_policy
::
reference
);
/* ------------------------------------------------------------------------ */
py
::
class_
<
GroupManager
>
(
mod
,
"GroupManager"
)
.
def
(
"getElementGroup"
,
[](
GroupManager
&
self
,
const
std
::
string
&
name
)
->
decltype
(
auto
)
{
return
self
.
getElementGroup
(
name
);
},
py
::
return_value_policy
::
reference
)
.
def
(
"iterateElementGroups"
,
[](
GroupManager
&
self
)
->
decltype
(
auto
)
{
std
::
vector
<
std
::
reference_wrapper
<
ElementGroup
>>
groups
;
for
(
auto
&
group
:
self
.
iterateElementGroups
())
{
groups
.
emplace_back
(
group
);
}
return
groups
;
})
.
def
(
"iterateNodeGroups"
,
[](
GroupManager
&
self
)
->
decltype
(
auto
)
{
std
::
vector
<
std
::
reference_wrapper
<
NodeGroup
>>
groups
;
for
(
auto
&
group
:
self
.
iterateNodeGroups
())
{
groups
.
emplace_back
(
group
);
}
return
groups
;
})
.
def
(
"createNodeGroup"
,
&
GroupManager
::
createNodeGroup
,
py
::
return_value_policy
::
reference
)
.
def
(
"createElementGroup"
,
py
::
overload_cast
<
const
std
::
string
&
,
UInt
,
bool
>
(
&
GroupManager
::
createElementGroup
),
py
::
return_value_policy
::
reference
)
.
def
(
"createGroupsFromMeshDataUInt"
,
&
GroupManager
::
createGroupsFromMeshData
<
UInt
>
)
.
def
(
"createElementGroupFromNodeGroup"
,
&
GroupManager
::
createElementGroupFromNodeGroup
,
py
::
arg
(
"name"
),
py
::
arg
(
"node_group"
),
py
::
arg
(
"dimension"
)
=
_all_dimensions
)
.
def
(
"getNodeGroup"
,
[](
GroupManager
&
self
,
const
std
::
string
&
name
)
->
decltype
(
auto
)
{
return
self
.
getNodeGroup
(
name
);
},
py
::
return_value_policy
::
reference
)
.
def
(
"createBoundaryGroupFromGeometry"
,
&
GroupManager
::
createBoundaryGroupFromGeometry
);
}
}
// namespace akantu
Event Timeline
Log In to Comment