SDA (SDA flex)  7.2
Simulation of Diffusional Association
Loading...
Searching...
No Matches
Enumerations | Functions
dtgrid_wrapper.cpp File Reference

Wrapper for linking C++ and Fortran functions. More...

#include <stdlib.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <typeinfo>
#include "./tools/DT-Grid/datastructures/DTGrid3D.hpp"
#include "./tools/DT-Grid/datastructures/DTGrid3Dex.hpp"
Include dependency graph for dtgrid_wrapper.cpp:

Enumerations

enum  grid_type_enum { double_type = 1 , logical_type = 2 }
 

Functions

int associate_grid_ (intptr_t **grdptr, char *file_name, double *scfct_f, int *grid_type)
 Associate the pointer received from SDA code to a DT-Grid pointer.
 
int deallocate_grid_ (intptr_t *grdptr, int *grid_type)
 Deallocator for the DT-Grid object.
 
int access_ (intptr_t *grdptr, int *i, int *j, int *k, double *value)
 Random access to grid points stored in a data grid.
 
int access_voxel_ (intptr_t *grdptr, int *i, int *j, int *k, double *voxel)
 Random access to grid points stored in an excluded-volume grid.
 
int access_exclusion_ (intptr_t *grdptr, int *i, int *j, int *k, bool *b_value)
 Random access to grid cells stored in a data grid.
 
int access_voxel_exclusion_ (intptr_t *grdptr, int *i, int *j, int *k, bool *b_voxel)
 Random access to grid cells stored in an excluded-volume grid.
 

Detailed Description

Wrapper for linking C++ and Fortran functions.

Author
Musa Ozboyaci

C++ wrapper for DT-GRID functions to call from SDA code

Enumeration Type Documentation

◆ grid_type_enum

Enumerator
double_type 
logical_type 

Function Documentation

◆ access_()

int access_ ( intptr_t grdptr,
int i,
int j,
int k,
double value 
)

Random access to grid points stored in a data grid.

Parameters
grdptrthe address that stores the pointer of a DT-Grid object
igrid point coordinate 'i'
jgrid point coordinate 'j'
kgrid point coordinate 'k'
valuepointer to copy the grid point value into
Warning
In fortran, array indexing starts from 1, in C/C++ from 0!
Here is the call graph for this function:

◆ access_exclusion_()

int access_exclusion_ ( intptr_t grdptr,
int i,
int j,
int k,
bool b_value 
)

Random access to grid cells stored in a data grid.

Parameters
grdptrthe address that stores the pointer of a DT-Grid object
igrid cell origin coordinate 'i'
jgrid cell origin coordinate 'j'
kgrid cell origin coordinate 'k'
b_voxelpointer to a unit cell to copy the grid cell values into
Warning
In fortran, array indexing starts from 1, in C/C++ from 0!
Here is the call graph for this function:

◆ access_voxel_()

int access_voxel_ ( intptr_t grdptr,
int i,
int j,
int k,
double voxel 
)

Random access to grid points stored in an excluded-volume grid.

Parameters
grdptrthe address that stores the pointer of a DT-Grid object
igrid point coordinate 'i'
jgrid point coordinate 'j'
kgrid point coordinate 'k'
valuepointer to copy the grid point value into
Warning
In fortran, array indexing starts from 1, in C/C++ from 0!
Here is the call graph for this function:

◆ access_voxel_exclusion_()

int access_voxel_exclusion_ ( intptr_t grdptr,
int i,
int j,
int k,
bool b_voxel 
)

Random access to grid cells stored in an excluded-volume grid.

Parameters
grdptrthe address that stores the pointer of a DT-Grid object
igrid cell origin coordinate 'i'
jgrid cell origin coordinate 'j'
kgrid cell origin coordinate 'k'
b_voxelpointer to a unit cell to copy the grid cell values into
Warning
In fortran, array indexing starts from 1, in C/C++ from 0!
Here is the call graph for this function:

◆ associate_grid_()

int associate_grid_ ( intptr_t **  grdptr,
char file_name,
double scfct_f,
int grid_type 
)

Associate the pointer received from SDA code to a DT-Grid pointer.

This function is called from mod_grid.f90 and associates a DT-Grid object (created and allocated inside) with the pointer address provided by the fortran module.

Parameters
grdptrthe address that stores the pointer of a DT-Grid object and will be known by the fortran modules
file_namethe name of the UHBD file input to SDA.
scfct_fthe scaling factor from the SDA code.
grid_typetype of grid: excluded-volume or data. 1 for data, 2 for excluded-volume (or other logical type) grids

◆ deallocate_grid_()

int deallocate_grid_ ( intptr_t grdptr,
int grid_type 
)

Deallocator for the DT-Grid object.

This function is called from mod_grid.f90 and will deallocate the associated DT-Grid object accessible with the pointer given.

Parameters
grdptrthe address that stores the pointer of a DT-Grid object
grid_typetype of grid: excluded-volume or data
Imprint/Privacy