Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
pyAMRTestModel.cpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
15
19#include <pybind11/numpy.h>
20#include <memory>
21
23 auto &m = root_module;
24
25 shamcomm::logs::debug_ln("[Py]", "registering shamrock.AMRTestModel");
26 py::class_<AMRTestModel>(m, "AMRTestModel")
27 .def(py::init([](AMRTestModel::Grid &grd) {
28 return std::make_unique<AMRTestModel>(grd);
29 }))
30 .def(
31 "refine",
32 [](AMRTestModel &obj) {
33 obj.refine();
34 })
35 .def(
36 "derefine",
37 [](AMRTestModel &obj) {
38 obj.derefine();
39 })
40 .def("step", [](AMRTestModel &obj) {
41 obj.step();
42 });
43}
void refine()
does the refinment step of the AMR
Pybind11 include and definitions.
#define ON_PYTHON_INIT
Register a Python module init function using static initialization.
void debug_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
Definition logs.hpp:133