3
0
mirror of https://github.com/triqs/dft_tools synced 2024-09-12 05:38:31 +02:00

Automated porting to triqs + meshes + nda

This commit is contained in:
Nils Wentzell 2021-05-18 14:29:45 -04:00
parent 342aa363d9
commit 3648fd74e8
3 changed files with 10 additions and 10 deletions

View File

@ -18,7 +18,7 @@
* TRIQS. If not, see <http://www.gnu.org/licenses/>. * TRIQS. If not, see <http://www.gnu.org/licenses/>.
* *
*******************************************************************************/ *******************************************************************************/
#include <triqs/arrays.hpp> #include <nda/nda.hpp>
#include <iostream> #include <iostream>
#include <complex> #include <complex>
@ -28,8 +28,8 @@
//#define __TETRA_DEBUG //#define __TETRA_DEBUG
#define __TETRA_ARRAY_VIEW #define __TETRA_ARRAY_VIEW
using triqs::arrays::array; using nda::array;
using triqs::arrays::array_view; using nda::array_view;
/*************************************************** /***************************************************
@ -79,12 +79,12 @@ array<double, 2> dos_tetra_weights_3d(array<double, 1> eigk, double en, array<lo
int ntet; /// Number of tetrahedra int ntet; /// Number of tetrahedra
// Auxiliary variables and loop indices // Auxiliary variables and loop indices
if (first_dim(itt) != NUM_TET_CORNERS + 1) if (itt.shape()[0] != NUM_TET_CORNERS + 1)
{ {
TRIQS_RUNTIME_ERROR << " The first dimension of 'itt' must be equal to 5"; TRIQS_RUNTIME_ERROR << " The first dimension of 'itt' must be equal to 5";
} }
ntet = second_dim(itt); ntet = itt.shape()[1];
array<double, 2> cti(NUM_TET_CORNERS, ntet); // Corner weights to be returned array<double, 2> cti(NUM_TET_CORNERS, ntet); // Corner weights to be returned

View File

@ -20,16 +20,16 @@
*******************************************************************************/ *******************************************************************************/
#pragma once #pragma once
#include <triqs/arrays.hpp> #include <nda/nda.hpp>
/// DOS of a band by analytical tetrahedron method /// DOS of a band by analytical tetrahedron method
/// ///
/// Returns corner weights for all tetrahedra for a given band and real energy. /// Returns corner weights for all tetrahedra for a given band and real energy.
triqs::arrays::array<double, 2> nda::array<double, 2>
dos_tetra_weights_3d(triqs::arrays::array_view<double, 1> eigk, /// Band energies for each k-point dos_tetra_weights_3d(nda::array_view<double, 1> eigk, /// Band energies for each k-point
double en, /// Energy at which DOS weights are to be calculated double en, /// Energy at which DOS weights are to be calculated
triqs::arrays::array_view<long, 2> itt /// Tetrahedra defined by k-point indices nda::array_view<long, 2> itt /// Tetrahedra defined by k-point indices
); );
//array<double, 2> //array<double, 2>
//dos_tetra_weights_3d(array<double, 1> eigk, /// Band energies for each k-point //dos_tetra_weights_3d(array<double, 1> eigk, /// Band energies for each k-point

View File

@ -13,7 +13,7 @@ module.add_include("triqs_dft_tools/converters/vasp/dos_tetra3d.hpp")
# Add here anything to add in the C++ code at the start, e.g. namespace using # Add here anything to add in the C++ code at the start, e.g. namespace using
module.add_preamble(""" module.add_preamble("""
#include <triqs/cpp2py_converters/arrays.hpp> #include <triqs/cpp2py_converters/arrays.hpp>
using namespace triqs::arrays; using namespace nda;
""") """)
module.add_function ("array<double,2> dos_tetra_weights_3d (array_view<double,1> eigk, double en, array_view<long,2> 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<double,2> dos_tetra_weights_3d (array_view<double,1> eigk, double en, array_view<long,2> 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.""")