!---------------------------------------------------------------------------
! pmlib_particles.f
!   version: 2D single-core
!---------------------------------------------------------------------------
!                  __    __
!    ___  _ _     / /__ / /
!   | _ \/ ` \ _ / // // _ \
!   | ,_/_,_,_\  \_/\_/\___/
!   |_|                      Mads M. Hejlesen* and Jens H. Walther*^
!                            * Technical University of Denmark
!                            ^ ETH-Zurich
!
!---------------------------------------------------------------------------
! Copyright (c) 2014 Technical University of Denmark, 
!                    Department of Mechanical Engineering
!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 2 of the License, or
! (at your option) any later version.
! 
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program; if not, see <http://www.gnu.org/licenses/>
!
! Contact: mmhej@mek.dtu.dk or jhwa@mek.dtu.dk
!---------------------------------------------------------------------------
MODULE pmlib_mod_particles

USE pmlib_mod_parameters
USE pmlib_mod_write

IMPLICIT NONE

!---------------------------------------------------------------------------
! Define particle class
!---------------------------------------------------------------------------
  TYPE class_particles
! position (dim,ipart)
    REAL(MK),DIMENSION(:,:),POINTER :: pos => NULL()
! velocity (dim,ipart)
    REAL(MK),DIMENSION(:,:),POINTER :: vel => NULL()
! vorticity (ncom,ipart)
    REAL(MK),DIMENSION(:,:),POINTER :: vort => NULL()
! material derivative of vorticity (ncom,ipart)
    REAL(MK),DIMENSION(:,:),POINTER :: dvort => NULL()

! substep velocity (dim,ipart)
    REAL(MK),DIMENSION(:,:),POINTER :: vel_rk => NULL()
! substep material derivative of vorticity (ncom,ipart)
    REAL(MK),DIMENSION(:,:),POINTER :: dvort_rk => NULL()
  END TYPE class_particles

!----------------------------------------------------------------------------
! Interfaces
!----------------------------------------------------------------------------
  INTERFACE pmlib_particles_advance
    MODULE PROCEDURE pmlib_particles_advance
  END INTERFACE

CONTAINS

#include "particles/pmlib_particles_map.f"

#include "particles/pmlib_particles_advance.f"

END MODULE pmlib_mod_particles
