365 int checkpoint_21 = coord2->v2;
366 int checkpoint_22 = (coord2+1)->v2;
367 int countdown_2 = checkpoint_22 - checkpoint_21;
369 if (countdown_2 == 0){
return;}
371 typename ArrayPrs <int>::PairArray ** ptt2 =
proj2D->Ptr_List_2D->PtrArray+checkpoint_21;
372 typename ArrayPrs <int>::PairArray * coo2 =
proj2D->Ycoord_List->PArray+checkpoint_21;
374 for (; countdown_2 >= 1; countdown_2--){
375 skey2 = b>=coo2->v1 ? (binc<=coo2->v2 ? 1 : (b<=coo2->v2 ? 2 : 0) ) : (binc>=coo2->v1 ? (binc<=coo2->v2 ? 3 : 0) : 0);
384 getCellz(Cell,
x,0,c, *(ptt2)+b-coo2->v1);
386 getCellz(Cell,
x,1,c, *(ptt2)+binc-coo2->v1);
390 getCellz(Cell,
x,0,c, *(ptt2)+b-coo2->v1);
393 getCellz(Cell,
x,1,c, *(ptt2)+binc-coo2->v1);
544 std::ifstream dtgrid_file;
545 dtgrid_file.open(file_binary, std::ifstream::in | std::ifstream::binary);
547 float sc, sp, ox, oy, oz, fval;
548 int dimi, dimj, dimk, ival, flag_binary, flag_grid_type;
551 dtgrid_file.read((
char *) &flag_binary,
sizeof(
int));
552 uhbd.Title =
new char [72];
553 dtgrid_file.read(
uhbd.Title, 72);
554 dtgrid_file.read((
char *) &
uhbd.scale,
sizeof(
float));
555 dtgrid_file.read((
char *) &
uhbd.dummy1,
sizeof(
float));
556 dtgrid_file.read((
char *) &
uhbd.grdflag,
sizeof(
int));
557 dtgrid_file.read((
char *) &
uhbd.idummy1,
sizeof(
int));
558 dtgrid_file.read((
char *) &
uhbd.idummy2,
sizeof(
int));
559 dtgrid_file.read((
char *) &
uhbd.one,
sizeof(
int));
560 dtgrid_file.read((
char *) &
uhbd.idummy3,
sizeof(
int));
561 dtgrid_file.read((
char *) &
uhbd.dim.i,
sizeof(
int));
562 dtgrid_file.read((
char *) &
uhbd.dim.j,
sizeof(
int));
563 dtgrid_file.read((
char *) &
uhbd.dim.k,
sizeof(
int));
564 dtgrid_file.read((
char *) &
uhbd.spacing,
sizeof(
float));
565 dtgrid_file.read((
char *) &
uhbd.o.x,
sizeof(
float));
566 dtgrid_file.read((
char *) &
uhbd.o.y,
sizeof(
float));
567 dtgrid_file.read((
char *) &
uhbd.o.z,
sizeof(
float));
568 dtgrid_file.read((
char *) &
uhbd.dummy2,
sizeof(
float));
569 dtgrid_file.read((
char *) &
uhbd.dummy3,
sizeof(
float));
570 dtgrid_file.read((
char *) &
uhbd.dummy4,
sizeof(
float));
571 dtgrid_file.read((
char *) &
uhbd.dummy5,
sizeof(
float));
572 dtgrid_file.read((
char *) &
uhbd.dummy6,
sizeof(
float));
573 dtgrid_file.read((
char *) &
uhbd.dummy7,
sizeof(
float));
574 dtgrid_file.read((
char *) &
uhbd.idummy4,
sizeof(
int));
575 dtgrid_file.read((
char *) &
uhbd.idummy5,
sizeof(
int));
578 int len_Value, len_xcoord, len_ycoord, len_zcoord;
579 int len_acc, len_acc2, len_acc3, len_projection, len_projection2;
581 dtgrid_file.read((
char *) &flag_grid_type,
sizeof(
int));
582 dtgrid_file.read((
char *) &len_Value,
sizeof(
int));
583 dtgrid_file.read((
char *) &len_xcoord,
sizeof(
int));
584 dtgrid_file.read((
char *) &len_ycoord,
sizeof(
int));
585 dtgrid_file.read((
char *) &len_zcoord,
sizeof(
int));
586 dtgrid_file.read((
char *) &len_acc,
sizeof(
int));
587 dtgrid_file.read((
char *) &len_acc2,
sizeof(
int));
588 dtgrid_file.read((
char *) &len_acc3,
sizeof(
int));
589 dtgrid_file.read((
char *) &len_projection,
sizeof(
int));
590 dtgrid_file.read((
char *) &len_projection2,
sizeof(
int));
594 std::cout <<
"Type of grid: Excluded volume" << std::endl;
596 std::cout <<
"Type of grid: Potential/Energy" << std::endl;
598 std::cout <<
"Type of grid: Unknown/Not-Set" << std::endl;
600 std::cout <<
"DT-Grid Header information: " << std::endl;
601 std::cout <<
"Length of Value array:\t" << len_Value << std::endl;
602 std::cout <<
"Length of xCoord array:\t" << len_xcoord<< std::endl;
603 std::cout <<
"Length of yCoord array:\t" << len_ycoord << std::endl;
604 std::cout <<
"Length of zCoord array:\t" << len_zcoord << std::endl;
605 std::cout <<
"Length of acc1D array:\t" << len_acc << std::endl;
606 std::cout <<
"Length of acc2D array:\t" << len_acc2 << std::endl;
607 std::cout <<
"Length of acc3D array:\t" << len_acc3 << std::endl;
608 std::cout <<
"Length of proj1D array:\t" << len_projection << std::endl;
609 std::cout <<
"Length of proj2D array:\t" << len_projection2 << std::endl << std::endl;
612 dtgrid_size =
sizeof(int) * (len_xcoord + len_ycoord + len_zcoord + \
613 len_acc + len_acc2 + len_acc3) +
sizeof(
int *) * (len_projection + len_projection2);
618 zcoord =
new int [len_zcoord];
619 for (
int i=0;
i<len_zcoord;
i++){
620 dtgrid_file.read((
char *) &ival,
sizeof(
int));
621 zcoord[
i] = (int) ival;
625 acc =
new int [len_acc];
626 for (
int i=0;
i<len_acc;
i++){
627 dtgrid_file.read((
char *) &ival,
sizeof(
int));
632 projection =
new int [len_projection];
633 for (
int i=0;
i<len_projection;
i++){
634 dtgrid_file.read((
char *) &ival,
sizeof(
int));
635 projection[
i] = (int) ival;
639 ycoord =
new int [len_ycoord];
640 for (
int i=0;
i<len_ycoord;
i++){
641 dtgrid_file.read((
char *) &ival,
sizeof(
int));
642 ycoord[
i] = (int) ival;
646 acc2 =
new int [len_acc2];
647 for (
int i=0;
i<len_acc2;
i++){
648 dtgrid_file.read((
char *) &ival,
sizeof(
int));
649 acc2[
i] = (int) ival;
653 projection2 =
new int [len_projection2];
654 for (
int i=0;
i<len_projection2;
i++){
655 dtgrid_file.read((
char *) &ival,
sizeof(
int));
656 projection2[
i] = (int) ival;
660 xcoord =
new int [len_xcoord];
661 for (
int i=0;
i<len_xcoord;
i++){
662 dtgrid_file.read((
char *) &ival,
sizeof(
int));
663 xcoord[
i] = (int) ival;
667 acc3 =
new int [len_acc3];
668 for (
int i=0;
i<len_acc3;
i++){
669 dtgrid_file.read((
char *) &ival,
sizeof(
int));
670 acc3[
i] = (int) ival;
677 set_projection2D(projection,ycoord,acc2,projection2,xcoord,acc3,len_projection, \
678 len_ycoord,len_acc2,len_projection2,len_xcoord,len_acc3);
685 delete[] projection2;
701 std::ifstream dtgrid_file;
702 dtgrid_file.open(file_ascii, std::ifstream::in);
704 std::string title_str, line;
705 std::string scale_str, dum1_str, grdflag_str, idum1_str, idum2_str, one_str, idum3_str;
706 std::string i_str, j_str, k_str;
707 std::string spacing_str, ox_str, oy_str, oz_str;
708 std::string dum2_str, dum3_str, dum4_str, dum5_str;
709 std::string dum6_str, dum7_str, idum4_str, idum5_str;
714 int len_Value, len_xcoord, len_ycoord, len_zcoord;
715 int len_acc, len_acc2, len_acc3, len_projection, len_projection2;
718 getline(dtgrid_file,line);
719 title_str = line.substr(0,72);
722 getline(dtgrid_file,line);
723 scale_str = line.substr(0,12);
724 dum1_str = line.substr(12,12);
725 grdflag_str = line.substr(24,7);
726 idum1_str = line.substr(31,7);
727 idum2_str = line.substr(38,7);
728 one_str = line.substr(45,7);
729 idum3_str = line.substr(52,7);
730 getline(dtgrid_file,line);
731 i_str = line.substr(0,7);
732 j_str = line.substr(7,7);
733 k_str = line.substr(14,7);
734 spacing_str = line.substr(21,12);
735 ox_str = line.substr(33,12);
736 oy_str = line.substr(45,12);
737 oz_str = line.substr(57,12);
738 getline(dtgrid_file,line);
739 dum2_str = line.substr(0,12);
740 dum3_str = line.substr(12,12);
741 dum4_str = line.substr(24,12);
742 dum5_str = line.substr(36,12);
743 getline(dtgrid_file,line);
744 dum6_str = line.substr(0,12);
745 dum7_str = line.substr(12,12);
746 idum4_str = line.substr(24,7);
747 idum5_str = line.substr(31,7);
750 uhbd.Title =
new char [72];
751 std::strncpy (
uhbd.Title, title_str.c_str(), 72);
753 std::stringstream (scale_str) >>
uhbd.scale;
754 std::stringstream (dum1_str) >>
uhbd.dummy1;
755 std::stringstream (grdflag_str) >>
uhbd.grdflag;
756 std::stringstream (idum1_str) >>
uhbd.idummy1;
757 std::stringstream (idum2_str) >>
uhbd.idummy2;
758 std::stringstream (one_str) >>
uhbd.one;
759 std::stringstream (idum3_str) >>
uhbd.idummy3;
760 std::stringstream (i_str) >>
uhbd.dim.i;
761 std::stringstream (j_str) >>
uhbd.dim.j;
762 std::stringstream (k_str) >>
uhbd.dim.k;
763 std::stringstream (spacing_str) >>
uhbd.spacing;
764 std::stringstream (ox_str) >>
uhbd.o.x;
765 std::stringstream (oy_str) >>
uhbd.o.y;
766 std::stringstream (oz_str) >>
uhbd.o.z;
767 std::stringstream (dum2_str) >>
uhbd.dummy2;
768 std::stringstream (dum3_str) >>
uhbd.dummy3;
769 std::stringstream (dum4_str) >>
uhbd.dummy4;
770 std::stringstream (dum5_str) >>
uhbd.dummy5;
771 std::stringstream (dum6_str) >>
uhbd.dummy6;
772 std::stringstream (dum7_str) >>
uhbd.dummy7;
773 std::stringstream (idum4_str) >>
uhbd.idummy4;
774 std::stringstream (idum5_str) >>
uhbd.idummy5;
778 dtgrid_file >> flag_grid_type;
779 dtgrid_file >> len_Value;
780 dtgrid_file >> len_xcoord;
781 dtgrid_file >> len_ycoord;
782 dtgrid_file >> len_zcoord;
783 dtgrid_file >> len_acc;
784 dtgrid_file >> len_acc2;
785 dtgrid_file >> len_acc3;
786 dtgrid_file >> len_projection;
787 dtgrid_file >> len_projection2;
791 std::cout <<
"Type of grid: Excluded volume" << std::endl;
793 std::cout <<
"Type of grid: Potential/Energy" << std::endl;
795 std::cout <<
"Type of grid: Unknown/Not-Set" << std::endl;
797 std::cout <<
"DT-Grid Header information: " << std::endl;
798 std::cout <<
"Length of Value array:\t" << len_Value << std::endl;
799 std::cout <<
"Length of xCoord array:\t" << len_xcoord<< std::endl;
800 std::cout <<
"Length of yCoord array:\t" << len_ycoord << std::endl;
801 std::cout <<
"Length of zCoord array:\t" << len_zcoord << std::endl;
802 std::cout <<
"Length of acc1D array:\t" << len_acc << std::endl;
803 std::cout <<
"Length of acc2D array:\t" << len_acc2 << std::endl;
804 std::cout <<
"Length of acc3D array:\t" << len_acc3 << std::endl;
805 std::cout <<
"Length of proj1D array:\t" << len_projection << std::endl;
806 std::cout <<
"Length of proj2D array:\t" << len_projection2 << std::endl << std::endl;
808 unsigned int dtgrid_size;
809 dtgrid_size =
sizeof(int) * (len_xcoord + len_ycoord + len_zcoord + \
810 len_acc + len_acc2 + len_acc3) +
sizeof(
int *) * (len_projection + len_projection2);
815 zcoord =
new int [len_zcoord];
816 for (
int i=0;
i<len_zcoord;
i++){
822 acc =
new int [len_acc];
823 for (
int i=0;
i<len_acc;
i++){
829 projection =
new int [len_projection];
830 for (
int i=0;
i<len_projection;
i++){
832 projection[
i] = ival;
836 ycoord =
new int [len_ycoord];
837 for (
int i=0;
i<len_ycoord;
i++){
843 acc2 =
new int [len_acc2];
844 for (
int i=0;
i<len_acc2;
i++){
850 projection2 =
new int [len_projection2];
851 for (
int i=0;
i<len_projection2;
i++){
853 projection2[
i] = ival;
857 xcoord =
new int [len_xcoord];
858 for (
int i=0;
i<len_xcoord;
i++){
864 acc3 =
new int [len_acc3];
865 for (
int i=0;
i<len_acc3;
i++){
874 set_projection2D(projection,ycoord,acc2,projection2,xcoord,acc3,len_projection, \
875 len_ycoord,len_acc2,len_projection2,len_xcoord,len_acc3);
881 delete[] projection2;