Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One corner #117

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/custom/fetch_mrcpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else()
GIT_REPOSITORY
https://github.com/MRChemSoft/mrcpp.git
GIT_TAG
8107aabe28d6e75f04d66c95a94c157731484eae
f9e50bae7c28ece70fa0c909e4be7170d406543a
)

set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
Expand Down
31 changes: 31 additions & 0 deletions src/vampyr/operators/convolutions.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <MRCPP/operators/IdentityConvolution.h>
#include <MRCPP/operators/PoissonOperator.h>
#include <MRCPP/operators/TimeEvolutionOperator.h>
#include <MRCPP/operators/HeatOperator.h>
#include <MRCPP/treebuilders/apply.h>

namespace vampyr {
Expand All @@ -15,6 +16,7 @@ void cartesian_convolution(pybind11::module &);
void helmholtz_operator(pybind11::module &);
void poisson_operator(pybind11::module &);
void time_evolution_operator(pybind11::module &m);
void heat_operator(pybind11::module &m);

template <int D> void convolutions(pybind11::module &m) {
namespace py = pybind11;
Expand Down Expand Up @@ -53,6 +55,7 @@ template <int D> void convolutions(pybind11::module &m) {
if constexpr (D == 3) helmholtz_operator(m);
if constexpr (D == 3) poisson_operator(m);
if constexpr (D == 1) time_evolution_operator(m);
if constexpr (D == 1) heat_operator(m);
}

void cartesian_convolution(pybind11::module &m) {
Expand Down Expand Up @@ -135,6 +138,12 @@ void time_evolution_operator(pybind11::module &m)
"finest_scale"_a,
"imaginary"_a,
"max_Jpower"_a = 20)
.def(py::init<const MultiResolutionAnalysis<1> &, double, double, bool, int>(),
"mra"_a,
"prec"_a,
"time"_a,
"imaginary"_a,
"max_Jpower"_a = 40)
.def(
"__call__",
[](TimeEvolutionOperator<1> &T, FunctionTree<1> *inp) {
Expand All @@ -145,4 +154,26 @@ void time_evolution_operator(pybind11::module &m)
"inp"_a);
}


void heat_operator(pybind11::module &m)
{
namespace py = pybind11;
using namespace mrcpp;
using namespace pybind11::literals;

py::class_<HeatOperator<1>, ConvolutionOperator<1>>(m, "HeatOperator")
.def(py::init<const MultiResolutionAnalysis<1> &, double, double>(),
"mra"_a,
"time"_a,
"prec"_a)
.def(
"__call__",
[](HeatOperator<1> &T, FunctionTree<1> *inp) {
auto out = std::make_unique<FunctionTree<1>>(inp->getMRA());
apply<1>(T.getBuildPrec(), *out, T, *inp);
return out;
},
"inp"_a);
}

} // namespace vampyr
Loading