29 |
#include <boost/python/str.hpp> |
#include <boost/python/str.hpp> |
30 |
#include <boost/python/extract.hpp> |
#include <boost/python/extract.hpp> |
31 |
#include <boost/python/long.hpp> |
#include <boost/python/long.hpp> |
32 |
|
#include <boost/python/tuple.hpp> |
33 |
|
|
34 |
#include "escript/Data/DataException.h" |
#include "escript/Data/DataException.h" |
35 |
#include "escript/Data/DataExpanded.h" |
#include "escript/Data/DataExpanded.h" |
881 |
} |
} |
882 |
} |
} |
883 |
if (rank==2) { |
if (rank==2) { |
884 |
bp_array.resize(shape[0],shape[1]); |
bp_array.resize(shape[0],shape[1]); |
885 |
for (int i=0; i<shape[0]; i++) { |
for (int i=0; i<shape[0]; i++) { |
886 |
for (int j=0; j<shape[1]; j++) { |
for (int j=0; j<shape[1]; j++) { |
887 |
index = i + shape[0] * j; |
index = i + shape[0] * j; |
888 |
bp_array[i,j] = integrals[index]; |
bp_array[make_tuple(i,j)] = integrals[index]; |
889 |
} |
} |
890 |
} |
} |
891 |
} |
} |
892 |
if (rank==3) { |
if (rank==3) { |
893 |
bp_array.resize(shape[0],shape[1],shape[2]); |
bp_array.resize(shape[0],shape[1],shape[2]); |
895 |
for (int j=0; j<shape[1]; j++) { |
for (int j=0; j<shape[1]; j++) { |
896 |
for (int k=0; k<shape[2]; k++) { |
for (int k=0; k<shape[2]; k++) { |
897 |
index = i + shape[0] * ( j + shape[1] * k ); |
index = i + shape[0] * ( j + shape[1] * k ); |
898 |
bp_array[i,j,k] = integrals[index]; |
bp_array[make_tuple(i,j,k)] = integrals[index]; |
899 |
} |
} |
900 |
} |
} |
901 |
} |
} |
907 |
for (int k=0; k<shape[2]; k++) { |
for (int k=0; k<shape[2]; k++) { |
908 |
for (int l=0; l<shape[3]; l++) { |
for (int l=0; l<shape[3]; l++) { |
909 |
index = i + shape[0] * ( j + shape[1] * ( k + shape[2] * l ) ); |
index = i + shape[0] * ( j + shape[1] * ( k + shape[2] * l ) ); |
910 |
bp_array[i,j,k,l] = integrals[index]; |
bp_array[make_tuple(i,j,k,l)] = integrals[index]; |
911 |
} |
} |
912 |
} |
} |
913 |
} |
} |