571 in3Dmap.getDimensions(xDim, yDim, zDim);
572 double x_offset = x_origin - xDim/2.;
573 double y_offset = y_origin - yDim/2.;
574 double z_offset = z_origin - zDim/2.;
577 rmax = (double) xDim / 2.;
581 std::ofstream testFile;
582 testFile.open(
"ico2.bild");
586 testFile <<
".scale 1\n.color blue\n";
588 for (
int i = 0;
i < 4;
i++) {
589 t = expandedUnitCell[
i] * scale;
590 tt = expandedUnitCell[
i] * scale + planeVectors[
i] * scale;
591 testFile <<
".v " << t(0) <<
" " << t(1) <<
" " << t(2) <<
" " 592 << tt(0) <<
" " << tt(1) <<
" " << tt(2) <<
" 1\n";
607 if (sym_order != 1) {
621 }
else if (symmetry !=
pg_CN && symmetry !=
pg_DN) {
627 expandedUnitCell.begin(); it != expandedUnitCell.end();
630 || symmetry ==
pg_O) {
633 }
else if (symmetry >=
pg_I1 || symmetry <=
pg_I4) {
635 minVector = (*it) * rmin;
636 maxVector = (*it) *
std::min(rmax, (
double) xDim / 2.);
639 expandedUnitCellMin.push_back(minVector);
640 expandedUnitCellMax.push_back(maxVector);
642 minX =
std::min(minX, minVector(0));
643 minX =
std::min(minX, maxVector(0));
645 minY =
std::min(minY, minVector(1));
646 minY =
std::min(minY, maxVector(1));
648 minZ =
std::min(minZ, minVector(2));
649 minZ =
std::min(minZ, maxVector(2));
651 maxX =
std::max(maxX, minVector(0));
652 maxX =
std::max(maxX, maxVector(0));
654 maxY =
std::max(maxY, minVector(1));
655 maxY =
std::max(maxY, maxVector(1));
657 maxZ =
std::max(maxZ, minVector(2));
658 maxZ =
std::max(maxZ, maxVector(2));
663 else if(sym_order == 1 && symmetry ==
pg_CN) {
672 std::cout <<
"minX " << minX << std::endl;
673 std::cout <<
"minY " << minY << std::endl;
674 std::cout <<
"minZ " << minZ << std::endl;
675 std::cout <<
"maxX " << maxX << std::endl;
676 std::cout <<
"maxY " << maxY << std::endl;
677 std::cout <<
"maxZ " << maxZ << std::endl;
684 std::ofstream testFile;
687 testFile.open(
"box.bild");
692 testFile <<
".color red\n";
693 testFile <<
".box " << t(0) <<
" " << t(1) <<
" " << t(2) <<
" " 694 << tt(0) <<
" " << tt(1) <<
" " << tt(2) <<
"\n";
701 in3Dmap().getMultidimArrayPointer(map);
703 out3DDmap.
resize(xDim, yDim, zDim, 1);
704 out3DDmap().getMultidimArrayPointer(imageMap2);
707 int rmin2 = rmin * rmin;
708 int rmax2 = rmax * rmax;
709 int iMinZ, iMinY, iMinX, iMaxZ, iMaxY, iMaxX;
710 iMinZ = (int) ceil(minZ);
711 iMaxZ = (int)
floor(maxZ);
712 iMinY = (int) ceil(minY);
713 iMaxY = (int)
floor(maxY);
714 iMinX = (int) ceil(minX);
715 iMaxX = (int)
floor(maxX);
719 const size_t N = 1168;
720 int a[N] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
721 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34,
722 35, 36, 38, 39, 40, 42, 44, 45, 48, 49, 50, 51, 52, 54, 55,
723 56, 57, 60, 63, 64, 65, 66, 68, 70, 72, 75, 76, 77, 78, 80,
724 81, 84, 85, 88, 90, 91, 95, 96, 98, 99, 100, 102, 104, 105,
725 108, 110, 112, 114, 117, 119, 120, 121, 125, 126, 128, 130,
726 132, 133, 135, 136, 140, 143, 144, 147, 150, 152, 153, 154,
727 156, 160, 162, 165, 168, 169, 170, 171, 175, 176, 180, 182,
728 187, 189, 190, 192, 195, 196, 198, 200, 204, 208, 209, 210,
729 216, 220, 221, 224, 225, 228, 231, 234, 238, 240, 242, 243,
730 245, 247, 250, 252, 255, 256, 260, 264, 266, 270, 272, 273,
731 275, 280, 285, 286, 288, 289, 294, 297, 300, 304, 306, 308,
732 312, 315, 320, 323, 324, 325, 330, 336, 338, 340, 342, 343,
733 350, 351, 352, 357, 360, 361, 363, 364, 374, 375, 378, 380,
734 384, 385, 390, 392, 396, 399, 400, 405, 408, 416, 418, 420,
735 425, 429, 432, 440, 441, 442, 448, 450, 455, 456, 459, 462,
736 468, 475, 476, 480, 484, 486, 490, 494, 495, 500, 504, 507,
737 510, 512, 513, 520, 525, 528, 532, 539, 540, 544, 546, 550,
738 560, 561, 567, 570, 572, 576, 578, 585, 588, 594, 595, 600,
739 605, 608, 612, 616, 624, 625, 627, 630, 637, 640, 646, 648,
740 650, 660, 663, 665, 672, 675, 676, 680, 684, 686, 693, 700,
741 702, 704, 714, 715, 720, 722, 726, 728, 729, 735, 741, 748,
742 750, 756, 760, 765, 768, 770, 780, 784, 792, 798, 800, 810,
743 816, 819, 825, 832, 833, 836, 840, 845, 847, 850, 855, 858,
744 864, 867, 875, 880, 882, 884, 891, 896, 900, 910, 912, 918,
745 924, 931, 935, 936, 945, 950, 952, 960, 968, 969, 972, 975,
746 980, 988, 990, 1000, 1001, 1008, 1014, 1020, 1024, 1026,
747 1029, 1040, 1045, 1050, 1053, 1056, 1064, 1071, 1078, 1080,
748 1083, 1088, 1089, 1092, 1100, 1105, 1120, 1122, 1125, 1134,
749 1140, 1144, 1152, 1155, 1156, 1170, 1176, 1183, 1188, 1190,
750 1197, 1200, 1210, 1215, 1216, 1224, 1225, 1232, 1235, 1248,
751 1250, 1254, 1260, 1274, 1275, 1280, 1287, 1292, 1296, 1300,
752 1309, 1320, 1323, 1326, 1330, 1331, 1344, 1350, 1352, 1360,
753 1365, 1368, 1372, 1375, 1377, 1386, 1400, 1404, 1408, 1425,
754 1428, 1430, 1440, 1444, 1445, 1452, 1456, 1458, 1463, 1470,
755 1482, 1485, 1496, 1500, 1512, 1520, 1521, 1530, 1536, 1539,
756 1540, 1547, 1560, 1568, 1573, 1575, 1584, 1596, 1600, 1615,
757 1617, 1620, 1625, 1632, 1638, 1650, 1664, 1666, 1672, 1680,
758 1683, 1690, 1694, 1700, 1701, 1710, 1715, 1716, 1728, 1729,
759 1734, 1750, 1755, 1760, 1764, 1768, 1782, 1785, 1792, 1800,
760 1805, 1815, 1820, 1824, 1836, 1848, 1859, 1862, 1870, 1872,
761 1875, 1881, 1890, 1900, 1904, 1911, 1920, 1925, 1936, 1938,
762 1944, 1950, 1960, 1976, 1980, 1989, 1995, 2000, 2002, 2016,
763 2023, 2025, 2028, 2040, 2048, 2052, 2057, 2058, 2079, 2080,
764 2090, 2100, 2106, 2112, 2125, 2128, 2142, 2145, 2156, 2160,
765 2166, 2176, 2178, 2184, 2187, 2197, 2200, 2205, 2210, 2223,
766 2240, 2244, 2250, 2261, 2268, 2275, 2280, 2288, 2295, 2299,
767 2304, 2310, 2312, 2340, 2352, 2366, 2375, 2376, 2380, 2394,
768 2400, 2401, 2420, 2430, 2431, 2432, 2448, 2450, 2457, 2464,
769 2470, 2475, 2496, 2499, 2500, 2508, 2520, 2527, 2535, 2541,
770 2548, 2550, 2560, 2565, 2574, 2584, 2592, 2600, 2601, 2618,
771 2625, 2640, 2646, 2652, 2660, 2662, 2673, 2688, 2695, 2700,
772 2704, 2717, 2720, 2730, 2736, 2744, 2750, 2754, 2772, 2793,
773 2800, 2805, 2808, 2816, 2835, 2850, 2856, 2860, 2873, 2880,
774 2888, 2890, 2904, 2907, 2912, 2916, 2925, 2926, 2940, 2964,
775 2970, 2975, 2992, 3000, 3003, 3024, 3025, 3040, 3042, 3060,
776 3072, 3078, 3080, 3087, 3094, 3120, 3125, 3135, 3136, 3146,
777 3150, 3159, 3168, 3179, 3185, 3192, 3200, 3211, 3213, 3230,
778 3234, 3240, 3249, 3250, 3264, 3267, 3276, 3300, 3315, 3325,
779 3328, 3332, 3344, 3360, 3366, 3375, 3380, 3388, 3400, 3402,
780 3420, 3430, 3432, 3456, 3458, 3465, 3468, 3500, 3510, 3520,
781 3528, 3536, 3549, 3553, 3564, 3570, 3575, 3584, 3591, 3600,
782 3610, 3630, 3640, 3645, 3648, 3672, 3675, 3696, 3705, 3718,
783 3724, 3740, 3744, 3750, 3757, 3762, 3773, 3780, 3800, 3808,
784 3822, 3825, 3840, 3850, 3861, 3872, 3876, 3888, 3900, 3920,
785 3927, 3952, 3960, 3969, 3971, 3978, 3990, 3993, 4000, 4004,
786 4032, 4046, 4050, 4056, 4080, 4095, 4096, 4104, 4114, 4116,
787 4125, 4131, 4158, 4160, 4165, 4180, 4199, 4200, 4212, 4224,
788 4225, 4235, 4250, 4256, 4275, 4284, 4290, 4312, 4320, 4332,
789 4335, 4352, 4356, 4368, 4374, 4375, 4389, 4394, 4400, 4410,
790 4420, 4446, 4455, 4459, 4480, 4488, 4500, 4522, 4536, 4550,
791 4560, 4563, 4576, 4590, 4598, 4608, 4617, 4620, 4624, 4641,
792 4655, 4675, 4680, 4693, 4704, 4719, 4725, 4732, 4750, 4752,
793 4760, 4788, 4800, 4802, 4840, 4845, 4851, 4860, 4862, 4864,
794 4875, 4896, 4900, 4913, 4914, 4928, 4940, 4950, 4992, 4998,
795 5000, 5005, 5016, 5040, 5049, 5054, 5070, 5082, 5096, 5100,
796 5103, 5120, 5130, 5145, 5148, 5168, 5184, 5187, 5200, 5202,
797 5225, 5236, 5250, 5265, 5280, 5292, 5304, 5320, 5324, 5346,
798 5355, 5376, 5390, 5400, 5408, 5415, 5434, 5440, 5445, 5460,
799 5472, 5488, 5491, 5500, 5508, 5525, 5544, 5577, 5586, 5600,
800 5610, 5616, 5625, 5632, 5643, 5670, 5700, 5712, 5720, 5733,
801 5746, 5760, 5775, 5776, 5780, 5808, 5814, 5824, 5831, 5832,
802 5850, 5852, 5880, 5915, 5928, 5929, 5940, 5950, 5967, 5984,
803 5985, 6000, 6006, 6048, 6050, 6069, 6075, 6080, 6084, 6120,
804 6125, 6137, 6144, 6156, 6160, 6171, 6174, 6175, 6188, 6237,
805 6240, 6250, 6270, 6272, 6292, 6300, 6318, 6336, 6358, 6370,
806 6375, 6384, 6400, 6422, 6426, 6435, 6460, 6468, 6480, 6498,
807 6500, 6517, 6528, 6534, 6545, 6552, 6561, 6591, 6600, 6615,
808 6630, 6650, 6655, 6656, 6664, 6669, 6688, 6720, 6732, 6750,
809 6760, 6776, 6783, 6800, 6804, 6825, 6840, 6859, 6860, 6864,
810 6875, 6885, 6897, 6912, 6916, 6930, 6936, 7000, 7007, 7020,
811 7040, 7056, 7072, 7098, 7106, 7125, 7128, 7140, 7150, 7168,
812 7182, 7200, 7203, 7220, 7225, 7260, 7280, 7290, 7293, 7296,
813 7315, 7344, 7350, 7371, 7392, 7410, 7425, 7436, 7448, 7480,
814 7488, 7497, 7500, 7514, 7524, 7546, 7560, 7581, 7600, 7605,
815 7616, 7623, 7644, 7650, 7680, 7695, 7700, 7722, 7735, 7744,
816 7752, 7776, 7800, 7803, 7840, 7854, 7865, 7875, 7904, 7920,
817 7938, 7942, 7956, 7980, 7986, 8000, 8008, 8019, 8064, 8075,
818 8085, 8092, 8100, 8112, 8125, 8151, 8160, 8190, 8192, 8208,
819 8228, 8232, 8250, 8262, 8281, 8316, 8320, 8330, 8360, 8379,
820 8398, 8400, 8415, 8424, 8448, 8450, 8470, 8500, 8505, 8512,
821 8550, 8568, 8575, 8580, 8619, 8624, 8640, 8645, 8664, 8670,
822 8704, 8712, 8721, 8736, 8748, 8750, 8775, 8778, 8788, 8800,
823 8820, 8840, 8892, 8910, 8918, 8925, 8960, 8976, 9000, 9009,
824 9025, 9044, 9072, 9075, 9100, 9120, 9126, 9152, 9163, 9180,
825 9196, 9216, 9234, 9240, 9248, 9261, 9282, 9295, 9310, 9317,
826 9350, 9360, 9375, 9386, 9405, 9408, 9438, 9450, 9464, 9477,
827 9500, 9504, 9520, 9537, 9555, 9576, 9600, 9604, 9625, 9633,
828 9639, 9680, 9690, 9702, 9720, 9724, 9728, 9747, 9750, 9792,
829 9800, 9801, 9826, 9828, 9856, 9880, 9900, 9945, 9975, 9984,
832 std::vector<int> validSizes(a, a +
sizeof(a) /
sizeof(
int));
833 std::vector<int>::iterator low;
834 low = std::lower_bound(validSizes.begin(), validSizes.end(), iMaxX);
835 if (validSizes[low - validSizes.begin()] != iMaxX)
836 iMaxX = validSizes[low - validSizes.begin()];
837 low = std::lower_bound(validSizes.begin(), validSizes.end(), iMaxY);
838 if (validSizes[low - validSizes.begin()] != iMaxY)
839 iMaxY = validSizes[low - validSizes.begin()];
840 low = std::lower_bound(validSizes.begin(), validSizes.end(), iMaxZ);
841 if (validSizes[low - validSizes.begin()] != iMaxZ)
842 iMaxZ = validSizes[low - validSizes.begin()];
849 for (
int k = iMinZ;
k <= iMaxZ; ++
k)
850 for (
int i = iMinY;
i <= iMaxY; ++
i)
851 for (
int j = iMinX;
j <= iMaxX; ++
j) {
852 r2 = (
i *
i +
j *
j +
k *
k);
853 if (r2 >= rmin2 && r2 < rmax2) {
855 if (sym_order != 1) {
857 planeVectors.begin();
858 it1 != planeVectors.end(); ++it1) {
864 - newOriginAfterExpansion(
867 - newOriginAfterExpansion(
870 - newOriginAfterExpansion(
873 if (dotproduct < 0) {
881 if (x_offset == 0.0 && y_offset == 0.0 && z_offset == 0.0){
884 int k1 =
k + z_offset;
885 int i1 = i + y_offset;
886 int j1 = j + x_offset;
892 if (x_offset != 0.0 || y_offset != 0.0 || z_offset != 0.0){
893 iMinZ = iMinZ + z_offset;
894 iMinY = iMinY + y_offset;
895 iMinX = iMinX + x_offset;
896 iMaxZ = iMaxZ + z_offset;
897 iMaxY = iMaxY + y_offset;
898 iMaxX = iMaxX + x_offset;
900 imageMap2->
selfWindow(iMinZ, iMinY, iMinX, iMaxZ, iMaxY, iMaxX, 0.);
void setDataMode(DataMode mode)
void selfWindow(int n0, int z0, int y0, int x0, int nF, int zF, int yF, int xF, T init_value=0)
void min(Image< double > &op1, const Image< double > &op2)
void resize(int Xdim, int Ydim, int Zdim, size_t Ndim, bool copy=true)
__host__ __device__ float2 floor(const float2 v)
void setValue(const MDObject &object) override
Matrix1D< double > vectorR3(double x, double y, double z)
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
#define A3D_ELEM(V, k, i, j)
void setValue(const MDObject &object) override
void max(Image< double > &op1, const Image< double > &op2)
void setDatatype(DataType _datatype)
T dotProduct(const Matrix1D< T > &v1, const Matrix1D< T > &v2)
void setGeo(const MDRow &row, size_t n=0)