!*********************************************************** !* Test program for cubature over triangles using 3-point * !* Newton-Cotes and Romberg-Richardson extrapolation * !* ------------------------------------------------------- * !* SAMPLE RUN: * !* (Integrate function f(x,y)=xy in triangle defined by * !* 3 points (0, 0), (10, 0) and (0, 10) ). * !* * !* ------------------------------------------------- * !* # Newton- Error Value Error * !* Cotes Code Integral Estimation * !* ------------------------------------------------- * !* 1 0 3750.000000 0.000000E+00 * !* 2 0 618.888889 -0.194444E+00 * !* 3 0 441.358025 -0.308642E+01 * !* 4 0 419.668361 -0.847252E-01 * !* 5 0 417.039311 -0.256743E-02 * !* 6 0 416.713168 -0.796249E-04 * !* 7 0 416.672477 -0.248357E-05 * !* ------------------------------------------------- * !* * !* ------------------------------------------------------- * !* Reference: * !* "Numerical Algorithms with C, By Gisela Engeln-Muellges * !* and Frank Uhlig, Springer-Verlag, 1996" [BIBLI 11]. * !* * !* F90 Release 1.0 By J-P Moreau, Paris. * !* (www.jpmoreau.fr) * !*********************************************************** ! To link with Kubnec.f90 !----------------------------------------------------------- Program TK3NEC implicit none real*8 W, F integer i, j, Kub3RoRi print *,' ' print *,'-------------------------------------------------' print *,' # Newton- Error Value Error ' print *,' Cotes Code Integral Estimation ' print *,'-------------------------------------------------' do j = 1, 7 ! Px, Py, Qx, Qy, Rx, Ry i = Kub3RoRi(0.d0, 0.d0, 10.d0, 0.d0, 0.d0, 10.d0, j, W, F) write(*,10) j, i, W, F end do print *,'-------------------------------------------------' stop 10 format(' ',I2,' ',I2,' ',F12.6,' ',E13.6) END !end of file tk3nec.f90