!---------------------------------------------------------------------------
! pmlib_patch.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_patch

USE pmlib_mod_parameters
USE pmlib_mod_write

IMPLICIT NONE

!---------------------------------------------------------------------------
! Define patch class
!---------------------------------------------------------------------------
  TYPE class_patch
    INTEGER                          :: ptype      !patch type
    INTEGER                          :: level      !resolution level
    INTEGER, DIMENSION(2)            :: parent     !patch parent
    REAL(MK),DIMENSION(pmlib_ndim)   :: xmin       !minimum physical extent
    REAL(MK),DIMENSION(pmlib_ndim)   :: xmax       !maximum physical extent
    INTEGER, DIMENSION(pmlib_ndim)   :: ncell      !number of mesh cells
    REAL(MK),DIMENSION(pmlib_ndim)   :: dx         !resolution
    INTEGER, DIMENSION(pmlib_ndim)   :: bound_cond !boundary conditions
    INTEGER                          :: nghost     !number of ghost points
    INTEGER, DIMENSION(pmlib_ndim)   :: fft_seq    !sequence in which to do ffts
  END TYPE class_patch

!----------------------------------------------------------------------------
! Interfaces
!----------------------------------------------------------------------------
  INTERFACE pmlib_patch_adjust
    MODULE PROCEDURE pmlib_patch_adjust
  END INTERFACE

CONTAINS

#include "patch/pmlib_patch_adjust.f"


END MODULE pmlib_mod_patch
