From 815e9adee80907164118e460a630e6203a483e97 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Tue, 2 Jul 2019 10:49:35 -0400 Subject: [PATCH] Fix in dos_tetra_weights_3d: return array<..> instead of array_view<..> -In triqs version 2.2 array_views no longer own the memory they point to This means that array variables that are local to a function should always be returned as arrray and never as an array_view --- c++/plovasp/atm/dos_tetra3d.cpp | 2 +- c++/plovasp/atm/dos_tetra3d.hpp | 2 +- python/converters/plovasp/atm_desc.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/plovasp/atm/dos_tetra3d.cpp b/c++/plovasp/atm/dos_tetra3d.cpp index f3310f0a..7055ac56 100644 --- a/c++/plovasp/atm/dos_tetra3d.cpp +++ b/c++/plovasp/atm/dos_tetra3d.cpp @@ -71,7 +71,7 @@ static const double small = 2.5e-2, tol = 1e-8; Returns corner contributions to the DOS of a band */ #ifdef __TETRA_ARRAY_VIEW -array_view dos_tetra_weights_3d(array_view eigk, double en, array_view itt) +array dos_tetra_weights_3d(array_view eigk, double en, array_view itt) #else array dos_tetra_weights_3d(array eigk, double en, array itt) #endif diff --git a/c++/plovasp/atm/dos_tetra3d.hpp b/c++/plovasp/atm/dos_tetra3d.hpp index 8b07d1dd..abdda06b 100644 --- a/c++/plovasp/atm/dos_tetra3d.hpp +++ b/c++/plovasp/atm/dos_tetra3d.hpp @@ -28,7 +28,7 @@ using triqs::arrays::array_view; /// DOS of a band by analytical tetrahedron method /// /// Returns corner weights for all tetrahedra for a given band and real energy. -array_view +array dos_tetra_weights_3d(array_view eigk, /// Band energies for each k-point double en, /// Energy at which DOS weights are to be calculated array_view itt /// Tetrahedra defined by k-point indices diff --git a/python/converters/plovasp/atm_desc.py b/python/converters/plovasp/atm_desc.py index ac3776f0..55ff109a 100644 --- a/python/converters/plovasp/atm_desc.py +++ b/python/converters/plovasp/atm_desc.py @@ -15,6 +15,6 @@ module.add_preamble(""" #include """) -module.add_function ("array_view dos_tetra_weights_3d (array_view eigk, double en, array_view itt)", doc = """DOS of a band by analytical tetrahedron method\n\n Returns corner weights for all tetrahedra for a given band and real energy.""") +module.add_function ("array dos_tetra_weights_3d (array_view eigk, double en, array_view itt)", doc = """DOS of a band by analytical tetrahedron method\n\n Returns corner weights for all tetrahedra for a given band and real energy.""") module.generate_code()