Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90455043
py_solver.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
Fri, Nov 1, 20:39
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Nov 3, 20:39 (2 d)
Engine
blob
Format
Raw Data
Handle
21369761
Attached To
rAKA akantu
py_solver.cc
View Options
/* -------------------------------------------------------------------------- */
#include "py_aka_array.hh"
/* -------------------------------------------------------------------------- */
#include "py_solver.h"
/* -------------------------------------------------------------------------- */#include <model.hh>
#include <non_linear_solver.hh>
#include <sparse_matrix_aij.hh>
/* -------------------------------------------------------------------------- */
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
/* -------------------------------------------------------------------------- */
namespace
py
=
pybind11
;
/* -------------------------------------------------------------------------- */
namespace
akantu
{
/* -------------------------------------------------------------------------- */
void
register_solver
(
py
::
module
&
mod
)
{
py
::
class_
<
SparseMatrix
>
(
mod
,
"SparseMatrix"
)
.
def
(
"getMatrixType"
,
&
SparseMatrix
::
getMatrixType
)
.
def
(
"size"
,
&
SparseMatrix
::
size
)
.
def
(
"zero"
,
&
SparseMatrix
::
zero
)
.
def
(
"saveProfile"
,
&
SparseMatrix
::
saveProfile
)
.
def
(
"saveMatrix"
,
&
SparseMatrix
::
saveMatrix
)
.
def
(
"add"
,
[](
SparseMatrix
&
self
,
UInt
i
,
UInt
j
)
{
self
.
add
(
i
,
j
);
},
"Add entry in the profile"
)
.
def
(
"add"
,
[](
SparseMatrix
&
self
,
UInt
i
,
UInt
j
,
Real
value
)
{
self
.
add
(
i
,
j
,
value
);
},
"Add the value to the matrix"
)
.
def
(
"__call__"
,
[](
const
SparseMatrix
&
self
,
UInt
i
,
UInt
j
)
{
return
self
(
i
,
j
);
});
py
::
class_
<
SparseMatrixAIJ
,
SparseMatrix
>
(
mod
,
"SparseMatrixAIJ"
)
.
def
(
"getIRN"
,
&
SparseMatrixAIJ
::
getIRN
)
.
def
(
"getJCN"
,
&
SparseMatrixAIJ
::
getJCN
)
.
def
(
"getA"
,
&
SparseMatrixAIJ
::
getA
);
py
::
class_
<
SolverVector
>
(
mod
,
"SolverVector"
);
}
Event Timeline
Log In to Comment