Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77980546
py_fe_engine.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 17, 15:43
Size
4 KB
Mime Type
text/x-c
Expires
Mon, Aug 19, 15:43 (2 d)
Engine
blob
Format
Raw Data
Handle
19089798
Attached To
rAKA akantu
py_fe_engine.cc
View Options
/* -------------------------------------------------------------------------- */
#include "py_aka_array.hh"
#include "py_aka_common.hh"
/* -------------------------------------------------------------------------- */
#include <fe_engine.hh>
#include <integration_point.hh>
/* -------------------------------------------------------------------------- */
#include <pybind11/functional.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
/* -------------------------------------------------------------------------- */
namespace py = pybind11;
/* -------------------------------------------------------------------------- */
namespace akantu {
__attribute__((visibility("default"))) void
register_fe_engine(py::module & mod) {
py::class_<Element>(mod, "Element");
py::class_<FEEngine>(mod, "FEEngine")
.def(
"getNbIntegrationPoints",
[](FEEngine & fem, const ElementType & type,
const GhostType & ghost_type) {
return fem.getNbIntegrationPoints(type, ghost_type);
},
py::arg("type"), py::arg("ghost_type") = _not_ghost)
.def(
"gradientOnIntegrationPoints",
[](FEEngine & fem, const Array<Real> & u, Array<Real> & nablauq,
UInt nb_degree_of_freedom, ElementType type,
GhostType ghost_type, const Array<UInt> * filter_elements) {
if (filter_elements == nullptr) {
// This is due to the ArrayProxy that looses the
// empty_filter information
filter_elements = &empty_filter;
}
fem.gradientOnIntegrationPoints(u, nablauq, nb_degree_of_freedom,
type, ghost_type, *filter_elements);
},
py::arg("u"), py::arg("nablauq"), py::arg("nb_degree_of_freedom"),
py::arg("type"), py::arg("ghost_type") = _not_ghost,
py::arg("filter_elements") = nullptr)
.def(
"interpolateOnIntegrationPoints",
[](FEEngine & self, const Array<Real> & u, Array<Real> & uq,
UInt nb_degree_of_freedom, ElementType type,
GhostType ghost_type, const Array<UInt> * filter_elements) {
if (filter_elements == nullptr) {
// This is due to the ArrayProxy that looses the
// empty_filter information
filter_elements = &empty_filter;
}
self.interpolateOnIntegrationPoints(u, uq, nb_degree_of_freedom,
type, ghost_type,
*filter_elements);
},
py::arg("u"), py::arg("uq"), py::arg("nb_degree_of_freedom"),
py::arg("type"), py::arg("ghost_type") = _not_ghost,
py::arg("filter_elements") = nullptr)
.def(
"interpolateOnIntegrationPoints",
[](FEEngine & self, const Array<Real> & u,
ElementTypeMapArray<Real> & uq,
const ElementTypeMapArray<UInt> * filter_elements) {
self.interpolateOnIntegrationPoints(u, uq, filter_elements);
},
py::arg("u"), py::arg("uq"), py::arg("filter_elements") = nullptr)
.def(
"computeIntegrationPointsCoordinates",
[](FEEngine & self, ElementTypeMapArray<Real> & coordinates,
const ElementTypeMapArray<UInt> * filter_elements)
-> decltype(auto) {
return self.computeIntegrationPointsCoordinates(coordinates,
filter_elements);
},
py::arg("coordinates"), py::arg("filter_elements") = nullptr)
.def(
"assembleFieldLumped",
[](FEEngine & fem,
const std::function<void(Matrix<Real> &, const Element &)> &
field_funct,
const ID & matrix_id, const ID & dof_id, DOFManager & dof_manager,
ElementType type, GhostType ghost_type) {
fem.assembleFieldLumped(field_funct, matrix_id, dof_id, dof_manager,
type, ghost_type);
},
py::arg("field_funct"), py::arg("matrix_id"), py::arg("dof_id"),
py::arg("dof_manager"), py::arg("type"),
py::arg("ghost_type") = _not_ghost)
.def(
"assembleFieldMatrix",
[](FEEngine & fem,
const std::function<void(Matrix<Real> &, const Element &)> &
field_funct,
const ID & matrix_id, const ID & dof_id, DOFManager & dof_manager,
ElementType type, GhostType ghost_type = _not_ghost) {
fem.assembleFieldMatrix(field_funct, matrix_id, dof_id, dof_manager,
type, ghost_type);
},
py::arg("field_funct"), py::arg("matrix_id"), py::arg("dof_id"),
py::arg("dof_manager"), py::arg("type"),
py::arg("ghost_type") = _not_ghost);
py::class_<IntegrationPoint>(mod, "IntegrationPoint");
}
} // namespace akantu
Event Timeline
Log In to Comment