Page MenuHomec4science

lm_python_couplers.hh
No OneTemporary

File Metadata

Created
Wed, May 29, 08:41

lm_python_couplers.hh

#ifndef __LM_PYTHON_COUPLERS_HH__
#define __LM_PYTHON_COUPLERS_HH__
/* -------------------------------------------------------------------------- */
#include <pybind11/eigen.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
/* -------------------------------------------------------------------------- */
#include "bridging.hh"
#include "xiao.hh"
/* -------------------------------------------------------------------------- */
namespace py = pybind11;
__BEGIN_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
inline void declare_couplers(py::module &m) {
py::class_<DofAssociation, Parsable, Component,
std::shared_ptr<DofAssociation>>(m, "DofAssociation",
py::multiple_inheritance());
py::class_<Bridging, DofAssociation, std::shared_ptr<Bridging>>(
m, "Bridging", py::multiple_inheritance())
.def(py::init<const std::string &>())
.def("init",
[](Bridging &self, ContainerInterface &domA,
ContainerInterface &domB) {
self.checkAllKeywordsAreParsed();
self.init<dispatch>(domA, domB);
})
.def("mesh2Point", py::overload_cast<FieldType, ContainerArray<Real> &>(
&Bridging::mesh2Point))
.def("mesh2Point",
py::overload_cast<const ContainerArray<Real> &,
ContainerArray<Real> &>(&Bridging::mesh2Point))
.def_property_readonly("pointList",
[](Bridging &self) { return self.pointList; },
py::return_value_policy::reference)
.def_property_readonly("meshList",
[](Bridging &self) { return self.meshList; },
py::return_value_policy::reference)
.def_readonly("smatrix", &Bridging::smatrix);
py::class_<BridgingAtomicContinuum, Bridging,
std::shared_ptr<BridgingAtomicContinuum>>(
m, "BridgingAtomicContinuum", py::multiple_inheritance());
/* --------------------------------------------------------------------- */
py::class_<CouplingInterface, Parsable, Component,
std::shared_ptr<CouplingInterface>>(m, "CouplingInterface",
py::multiple_inheritance());
py::class_<CouplingAtomicContinuum, CouplingInterface,
std::shared_ptr<CouplingAtomicContinuum>>(
m, "CouplingAtomicContinuum", py::multiple_inheritance());
py::class_<ArlequinTemplate, CouplingAtomicContinuum,
std::shared_ptr<ArlequinTemplate>>(m, "ArlequinTemplate",
py::multiple_inheritance())
.def_property_readonly(
"bridging_zone",
[](ArlequinTemplate & self) -> auto & { return self.bridging_zone; },
py::return_value_policy::reference)
.def_property_readonly(
"boudary_zone",
[](ArlequinTemplate & self) -> auto & { return self.boundary_zone; },
py::return_value_policy::reference);
py::class_<Xiao, ArlequinTemplate, std::shared_ptr<Xiao>>(
m, "Xiao", py::multiple_inheritance())
.def(py::init<const std::string &>())
.def("init",
[](Xiao &self, DomainInterface &domA, DomainInterface &domC) {
self.init<dispatch>(domA, domC);
})
.def("buildRHS", &Xiao::buildRHS)
.def("buildConstraintMatrix", &Xiao::buildConstraintMatrix);
}
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
#endif //__LM_PYTHON_COUPLERS_HH__

Event Timeline