81 grid_type_flag =
flag;
96 grid_type_flag =
flag;
111template <
typename T1>
113 grid_type_flag =
flag;
130template <
typename T1>
140 Generate_DTGrid(
uhbd->Skin,
uhbd->Grid);
155template <
typename T1>
164 Generate_DTGrid(
uhbd->Skin,
uhbd->Grid);
177template <
typename T1>
186 Generate_DTGrid(
uhbd->Grid,
uhbd->Grid);
201template <
typename T1>
204 if (
x >= LengthX
or y >= LengthY
or z >= LengthZ )
233template <
typename T1>
237 for (
int i=0;
i<LengthX;
i++){
238 for (
int j=0;
j<LengthY;
j++){
244 std::cout << std::endl;
247 else if (dimension == 1){
248 for (
int j=0;
j<LengthY;
j++){
249 for (
int k=0;
k<LengthZ;
k++){
255 std::cout << std::endl;
258 else if (dimension == 2){
259 for (
int i=0;
i<LengthX;
i++){
260 for (
int k=0;
k<LengthZ;
k++){
266 std::cout << std::endl;
270 std::cout <<
"Check the dimension flag!!" << std::endl;
291template <
typename T1>
295 for (
int i=0;
i<LengthX;
i++){
297 for (
int j=0;
j<LengthY;
j++){
302 for (
int i=0;
i<LengthX;
i++){
303 for (
int j=0;
j<LengthY;
j++){
304 for (
int k=0;
k<LengthZ;
k++){
310 for (
int i=0;
i<LengthX;
i++){
311 for (
int j=0;
j<LengthY;
j++){
334 for (
int j=0;
j<LengthY;
j++){
335 for (
int k=0;
k<LengthZ;
k++){
359 for (
int i=0;
i<LengthX;
i++){
360 for (
int k=0;
k<LengthZ;
k++){
393template <
typename T1>
396 std::cout <<
"Generating the DT-Grid structure ..." << std::endl;
402 for (
int i=0;
i<LengthX;
i++){
405 for (
int j=0;
j<LengthY;
j++){
407 for (
int k=0;
k<LengthZ;
k++){
408 if (grid_type_flag == 0){
415 proj1D.push_back(((
int) zcoord.size())-1);
424 proj1D.push_back(((
int) zcoord.size())-1);
437 acc.push_back(((
int) Value.size())-1);
438 proj1D.push_back(((
int) Value.size())-1);
439 proj1D.push_back(((
int) zcoord.size())-1);
445 acc.push_back(((
int) Value.size())-1);
447 proj1D.push_back(((
int) Value.size())-1);
448 proj1D.push_back(((
int) zcoord.size())-1);
455 if (
k == (LengthZ-1)){
461 zcoord.push_back((
k-1));
469 zcoord.push_back((
k-1));
479 acc2D.push_back(((
int) proj1D.size())-2);
481 proj2D.push_back(((
int) proj1D.size())-2);
482 proj2D.push_back(((
int) ycoord.size())-1);
490 acc2D.push_back(((
int) proj1D.size())-2);
493 proj2D.push_back(((
int) proj1D.size())-2);
494 proj2D.push_back(((
int) ycoord.size())-1);
499 if (
j == (LengthY-1)){
505 ycoord.push_back(
j-1);
512 ycoord.push_back(
j-1);
521 acc3D.push_back(((
int)
proj2D.size())-2);
528 acc3D.push_back(((
int)
proj2D.size())-2);
532 if (
i == (LengthX-1)){
538 xcoord.push_back(
i-1);
545 xcoord.push_back(
i-1);
551 std::cout <<
"DT-Grid structure is generated successfully!" << std::endl;
564template <
typename T1>
568 std::cout <<
"Writing the DT-Grid (ASCII) to the output file ..." << std::endl;
591template <
typename T1>
597 std::cout <<
"Writing the DT-Grid (Binary) to the output file ..." << std::endl;
634template <
typename T1>
638 char Title [] =
"Sphere ";
646 std::cout <<
"Writing the DT-Grid (ASCII) to the output file ..." << std::endl;
665template <
typename T1>
668 char Title [] =
"Sphere ";
678 std::cout <<
"Writing the DT-Grid to the output file ..." << std::endl;
713template <
typename T1>
718 fprintf(
output_file,
"%10d%10d%10d\n", (
int) xcoord.size(), (
int) ycoord.size(), (
int) zcoord.size());
719 fprintf(
output_file,
"%10d%10d%10d\n", (
int) acc.size(), (
int) acc2D.size(), (
int) acc3D.size());
724 typename std::vector<T1>::iterator
itf;
725 std::vector<int>::iterator
it;
727 if (grid_type_flag == 1){
729 for (
itf = Value.begin();
itf != Value.end();
itf++){
744 for (
it = zcoord.begin();
it != zcoord.end();
it++){
755 for (
it = acc.begin();
it != acc.end();
it++){
766 for (
it = proj1D.begin();
it != proj1D.end();
it++){
767 if (
fmod(counter,2) == 0)
790 for (
it = ycoord.begin();
it != ycoord.end();
it++){
801 for (
it = acc2D.begin();
it != acc2D.end();
it++){
832 for (
it = xcoord.begin();
it != xcoord.end();
it++){
843 for (
it = acc3D.begin();
it != acc3D.end();
it++){
861template <
typename T1>
866 (
int) zcoord.size(), (
int) acc.size(), (
int) acc2D.size(), (
int) acc3D.size(), \
867 ((
int) proj1D.size())+2, ((
int)
proj2D.size())+2};
871 typename std::vector<T1>::iterator
itf;
872 std::vector<int>::iterator
it;
878 if (grid_type_flag == 1){
880 for (
itf = Value.begin();
itf != Value.end();
itf++){
890 for (
it = zcoord.begin();
it != zcoord.end();
it++){
896 for (
it = acc.begin();
it != acc.end();
it++){
903 for (
it = proj1D.begin();
it != proj1D.end();
it++){
904 if (
fmod(counter,2) == 0){
930 for (
it = ycoord.begin();
it != ycoord.end();
it++){
936 for (
it = acc2D.begin();
it != acc2D.end();
it++){
961 for (
it = xcoord.begin();
it != xcoord.end();
it++){
967 for (
it = acc3D.begin();
it != acc3D.end();
it++){
Define a 3D UHBD grid and functions to read-write its format files.
Definition DTGrid3D.hpp:65
int idummy3
Definition DTGrid3D.hpp:148
float dummy5
Definition DTGrid3D.hpp:157
float dummy7
Definition DTGrid3D.hpp:159
float z
Definition DTGrid3D.hpp:122
float dummy3
Definition DTGrid3D.hpp:155
float dummy6
Definition DTGrid3D.hpp:158
char * Title
Definition DTGrid3D.hpp:143
float x
Definition DTGrid3D.hpp:120
struct DTGrid3D::@2::origin o
float y
Definition DTGrid3D.hpp:121
float scale
scaling factor
Definition DTGrid3D.hpp:92
int j
Definition DTGrid3D.hpp:114
float dummy1
Definition DTGrid3D.hpp:153
DTGrid2D< T, K > * proj2D
Definition DTGrid3D.hpp:76
float spacing
Definition DTGrid3D.hpp:93
int i
Definition DTGrid3D.hpp:113
int idummy2
Definition DTGrid3D.hpp:147
int idummy4
Definition DTGrid3D.hpp:149
float dummy4
Definition DTGrid3D.hpp:156
struct DTGrid3D::@2 uhbd
UHBD header information.
int k
Definition DTGrid3D.hpp:115
int idummy5
Definition DTGrid3D.hpp:150
struct DTGrid3D::@2::dimensions dim
int idummy1
Definition DTGrid3D.hpp:146
int one
Definition DTGrid3D.hpp:145
float dummy2
Definition DTGrid3D.hpp:154
int LengthY
number of points along x axis (in uhbd grid)
Definition DTgrd.hpp:38
int grid_type_flag
Definition DTgrd.hpp:34
bool *** exterior_grid(bool ***)
Create the exterior grid.
Definition DTgrd.hpp:292
std::vector< int > ycoord
icoord array (min and max indices of connected components in x direction)
Definition DTgrd.hpp:46
int print_layer(bool ***, int, int)
Print a 2D slice for an exterior grid.
Definition DTgrd.hpp:234
bool pqr_flag
0 for excluded volume, 1 for data grid
Definition DTgrd.hpp:35
std::vector< int > acc
icoord array (min and max indices of connected components in z direction)
Definition DTgrd.hpp:48
int write_dtgrdfilebody_binary(FILE *)
Write the DT-Grid body into the DT-Grid file in Binary format.
Definition DTgrd.hpp:862
int LengthX
input pqr or pdb?
Definition DTgrd.hpp:37
void exclusion(char *, float, float)
Create a UHBD object for excluded volume type interactions.
Definition DTgrd.hpp:156
void UHBD_upload(char *, char *, float, float)
Create a UHBD object using the uhbd-file input.
Definition DTgrd.hpp:131
DT_FILE(int)
DT_FILE constructor - 1.
Definition DTgrd.hpp:80
int write_dtgrdfile_ascii_nouhbd(FILE *)
Write dt-grid file for test cases.
Definition DTgrd.hpp:635
std::vector< int > proj2D
projection array to bridge 1D and 2D DT-Grids
Definition DTgrd.hpp:52
int write_dtgrdfile_binary_nouhbd(FILE *)
Write dt-grid file for test cases.
Definition DTgrd.hpp:666
int write_dtgrdfilebody_ascii(FILE *)
Write the DT-Grid body into the DT-Grid file in ASCII format.
Definition DTgrd.hpp:714
std::vector< int > acc2D
acc pointer array for one dimensional DT-Grid
Definition DTgrd.hpp:49
int write_dtgrdfile_ascii(FILE *)
Write the DT-Grid structure into the DT-Grid file in ASCII format.
Definition DTgrd.hpp:565
std::vector< int > xcoord
'value' array of the DT-Grid
Definition DTgrd.hpp:45
int check_neighbours(bool ***, bool ***, int, int, int)
projection array to bridge 2D and 3D DT-Grids
Definition DTgrd.hpp:202
int write_dtgrdfile_binary(FILE *)
Write the DT-Grid structure into the DT-Grid file in binary format.
Definition DTgrd.hpp:592
std::vector< int > zcoord
icoord array (min and max indices of connected components in y direction)
Definition DTgrd.hpp:47
int uhbd_alloc
a uhbd object for the input UHBD file
Definition DTgrd.hpp:42
std::vector< T1 > Value
Definition DTgrd.hpp:44
std::vector< int > acc3D
acc pointer array for two dimensional DT-Grid
Definition DTgrd.hpp:50
UHBD< T1 > * uhbd
number of points along z axis (in uhbd grid)
Definition DTgrd.hpp:41
int Generate_DTGrid(bool ***, T1 ***)
Generate the DT-Grid structure!
Definition DTgrd.hpp:394
std::vector< int > proj1D
acc pointer array for three dimensional DT-Grid
Definition DTgrd.hpp:51
int LengthZ
number of points along y axis (in uhbd grid)
Definition DTgrd.hpp:39