123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- interface
- !> Create a tree and return its pointer
- !! @param tree_ctx pointer to the tree
- subroutine Createtree_(tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- type(c_ptr), intent(out) :: tree_ctx
- end subroutine
- !> Delete the tree and free memeory
- !! @param tree_ctx pointer to the tree
- subroutine DeleteTree(tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Get the node list for the tree
- !! @param node_coord coordinates of each tree node {x1,y1,z1,x2,y2,z2,...}
- !! @param parent_lst index of the parent node if it exists; -1 otherwise
- !! @param child_lst index of 8 child nodes if it has children; -1 otherwise
- !! @param node_depth depth of the tree node
- !! @param node_ghost 1 if the node is a ghost node; 0 otherwise
- !! @param node_leaf 1 if the node is a leaf node; 0 otherwise
- !! @param Nnodes number of tree nodes
- !! @param tree_ctx pointer to the tree
- subroutine GetTree(node_coord, parent_lst, child_lst, node_depth, node_ghost, node_leaf, Nnodes, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- type(c_ptr), intent(out) :: node_coord ! real*8, dimension(Nnode*3)
- type(c_ptr), intent(out) :: parent_lst ! integer*4, dimension(Nnode)
- type(c_ptr), intent(out) :: child_lst ! integer*4, dimension(Nnode*8)
- type(c_ptr), intent(out) :: node_depth ! integer*1, dimension(Nnode)
- type(c_ptr), intent(out) :: node_ghost ! integer*1, dimension(Nnode)
- type(c_ptr), intent(out) :: node_leaf ! integer*1, dimension(Nnode)
- integer*4 , intent(out) :: Nnodes
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Change refinement of the tree
- !! @param pt_coord coordinates of the points
- !! @param Npt number of points
- !! @param max_pts maximum number of points per tree node
- !! @param level_restrict .true. to enable level restriction
- !! @param periodic .true. for periodic level restriction
- !! @param tree_ctx pointer to the tree
- subroutine UpdateRefinement(pt_coord, Npt, max_pts, level_restrict, periodic, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- real*8 , intent(in) :: pt_coord(*)
- integer*4 , intent(in) :: Npt
- integer*4 , intent(in) :: max_pts
- logical , intent(in) :: level_restrict
- logical , intent(in) :: periodic
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Add some data to the tree nodes (for example multipole expansions)
- !! @param data_name name for the data
- !! @param node_data data array
- !! @param Ndata length of the data array
- !! @param cnt array of data-length for each node
- !! @param Ncnt length of cnt array (must be equal to #-of-nodes)
- !! @param tree_ctx pointer to the tree
- subroutine AddData(data_name, node_data, Ndata, cnt, Ncnt, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: data_name(*)
- real*8 , intent(in) :: node_data(*)
- integer*4 , intent(in) :: Ndata
- integer*4 , intent(in) :: cnt(*)
- integer*4 , intent(in) :: Ncnt
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Get node data from the tree
- !! @param node_data data array
- !! @param Ndata length of the data array
- !! @param cnt array of data-length for each node
- !! @param Ncnt length of cnt array (equal to #-of-nodes)
- !! @param data_name name for the data
- !! @param tree_ctx pointer to the tree
- subroutine GetData(node_data, Ndata, cnt, Ncnt, data_name, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- type(c_ptr), intent(out) :: node_data ! real*8 , dimension(Ndata)
- integer*4 , intent(out) :: Ndata
- type(c_ptr), intent(out) :: cnt ! integer*4, dimension(Ncnt)
- integer*4 , intent(out) :: Ncnt
- character , intent(in) :: data_name(*)
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Delete node data from the tree
- !! @param data_name name for the data
- !! @param tree_ctx pointer to the tree
- subroutine DeleteData(data_name, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: data_name(*)
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Write VTK output
- !! @param fname name of output file
- !! @param show_ghost .true. to show ghost nodes
- !! @param tree_ctx pointer to the tree
- subroutine WriteTreeVTK(fname, show_ghost, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: fname(*)
- logical , intent(in) :: show_ghost
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Add particles to the tree
- !! @param pt_name name of the particles
- !! @param coord coordinates of the particles {x1,y1,z1,x2,y2,...}
- !! @param Npt number of particles
- !! @param tree_ctx pointer to the tree
- subroutine AddParticles(pt_name, coord, Npt, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: pt_name
- real*8 , intent(in) :: coord(*)
- integer*4 , intent(in) :: Npt
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Associate some data with the particles (for example charge density). The
- !! data must be in the original order of the points.
- !! @param pt_name name of the particles
- !! @param data_name name of the data
- !! @param pt_data data array
- !! @param Ndata size of the data array
- !! @param tree_ctx pointer to the tree
- subroutine AddParticleData(data_name, pt_name, pt_data, Ndata, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: data_name(*)
- character , intent(in) :: pt_name(*)
- real*8 , intent(in) :: pt_data(*)
- integer*4 , intent(in) :: Ndata
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Get data associated with the particles. The output array will be ordered
- !! according to the original ordering of the points
- !! @param pt_data data array
- !! @param Ndata size of the data array
- !! @param data_name name of the data
- !! @param tree_ctx pointer to the tree
- subroutine GetParticleData(pt_data, Ndata, data_name, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- type(c_ptr), intent(out) :: pt_data ! real*8, dimension(N)
- integer*4 , intent(out) :: Ndata
- character , intent(in) :: data_name(*)
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Delete data associated with a particle (or a particle and all its data)
- !! @param data_name name of the data (or particle)
- !! @param tree_ctx pointer to the tree
- subroutine DeleteParticleData(data_name, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: data_name
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- !> Write VTK output
- !! @param fname name of output file
- !! @param data_name name of the data
- !! @param show_ghost .true. to show ghost nodes
- !! @param tree_ctx pointer to the tree
- subroutine WriteParticleVTK(fname, data_name, show_ghost, tree_ctx)
- use, intrinsic :: ISO_C_BINDING
- character , intent(in) :: fname(*)
- character , intent(in) :: data_name(*)
- logical , intent(in) :: show_ghost
- type(c_ptr), intent(in) :: tree_ctx
- end subroutine
- end interface
|