Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80327975
py_aka_mesh.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
Sat, Aug 31, 04:27
Size
2 KB
Mime Type
text/x-c
Expires
Mon, Sep 2, 04:27 (2 d)
Engine
blob
Format
Raw Data
Handle
20343490
Attached To
rAKA akantu
py_aka_mesh.cc
View Options
/* -------------------------------------------------------------------------- */
#include "aka_common.hh"
#include "element_group.hh"
#include "mesh.hh"
#include "py_aka_array.hh"
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
/* -------------------------------------------------------------------------- */
namespace
py
=
pybind11
;
namespace
akantu
{
/* -------------------------------------------------------------------------- */
__attribute__
((
visibility
(
"default"
)))
void
register_mesh
(
py
::
module
&
mod
)
{
py
::
class_
<
ElementGroup
>
(
mod
,
"ElementGroup"
)
.
def
(
"getNodes"
,
&
ElementGroup
::
getNodes
);
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
(
"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
);
py
::
class_
<
Mesh
,
GroupManager
>
(
mod
,
"Mesh"
,
py
::
multiple_inheritance
())
.
def
(
py
::
init
<
UInt
,
const
ID
&
,
const
MemoryID
&>
(),
py
::
arg
(
"spatial_dimension"
),
py
::
arg
(
"id"
)
=
"mesh"
,
py
::
arg
(
"memory_id"
)
=
0
)
.
def
(
"read"
,
&
Mesh
::
read
,
py
::
arg
(
"filename"
),
py
::
arg
(
"mesh_io_type"
)
=
_miot_auto
,
"read the mesh from a file"
)
.
def
(
"getNodes"
,
[](
Mesh
&
self
)
->
Array
<
Real
>
{
return
self
.
getNodes
();
},
py
::
return_value_policy
::
reference
)
.
def
(
"getNbNodes"
,
&
Mesh
::
getNbNodes
)
.
def
(
"distribute"
,
[](
Mesh
&
self
)
{
self
.
distribute
();
});
}
}
// namespace akantu
Event Timeline
Log In to Comment