!>
!> @file transfer1d_col.f90
!>
!> @brief
!>
!> @copyright
!> Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
!> SPC (Swiss Plasma Center)
!>
!> SPClibs is free software: you can redistribute it and/or modify it under
!> the terms of the GNU Lesser General Public License as published by the Free
!> Software Foundation, either version 3 of the License, or (at your option)
!> any later version.
!>
!> SPClibs 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 Lesser General Public License
!> along with this program. If not, see .
!>
!> @authors
!> (in alphabetical order)
!> @author Trach-Minh Tran
!>
PROGRAM main
!
! Obtain grid transfer by collocation
!
USE multigrid
IMPLICIT NONE
!
INTEGER :: nx=8, nidbas=1
LOGICAL :: nlper=.TRUE.
!
TYPE(grid1d) :: gridx(2)
TYPE(gemat) :: pmat
!
NAMELIST /newrun/ nx, nidbas, nlper
!--------------------------------------------------------------------------------
READ(*,newrun)
WRITE(*,newrun)
!
CALL create_grid(nx, nidbas, 1, 0, gridx, period=nlper)
CALL printmat('** Prolongation matrix (using mass matrix) **', gridx(2)%transf)
!
CALL calc_pmat(gridx(1), gridx(2), pmat, .TRUE.)
CALL printmat('** Prolongation matrix (by collocation) **', pmat)
!
WRITE(*,'(/a,1pe12.3)') 'Max diff =', MAXVAL(ABS(pmat%val-gridx(2)%transf%val))
!
END PROGRAM main