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
19#include <pybind11/numpy.h>
20#include <memory>
21
22Register_pymod(pyamrtestmode) {
23
24 shamcomm::logs::debug_ln("[Py]", "registering shamrock.AMRTestModel");
25 py::class_<AMRTestModel>(m, "AMRTestModel")
26 .def(py::init([](AMRTestModel::Grid &grd) {
27 return std::make_unique<AMRTestModel>(grd);
28 }))
29 .def(
30 "refine",
31 [](AMRTestModel &obj) {
32 obj.refine();
33 })
34 .def(
35 "derefine",
36 [](AMRTestModel &obj) {
37 obj.derefine();
38 })
39 .def("step", [](AMRTestModel &obj) {
40 obj.step();
41 });
42}
void refine()
does the refinment step of the AMR
The AMR grid only sees the grid as an integer map.
Definition AMRGrid.hpp:44
Pybind11 include and definitions.
#define Register_pymod(placeholdername)
Register a python module init function using static initialisation.
void debug_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
Definition logs.hpp:133