#include <stdio.h>
#include <time.h>
#include "gbem_lap_srf_eval.h"


void gbem_lap_srf_eval(const char *InfParams, const char *InfData, clock_t tm0)
{

/* ===purpose=== */

/**********************************************************************************************************************************/
/**********************************  GALERKIN BEM for 3D LAPLACE EQUATION: SINGULAR FORMULATION  **********************************/
/************************************  3-NODED TRIANGULAR ELEMENT: SEMI-ANALYTIC INTEGRATION  *************************************/
/************************************************  PIECEWISE LINEAR APPROXIMATION  ************************************************/
/***************************************  Solve the Singular BIE for the Laplace equation  ****************************************/
/**********************************************************************************************************************************/

/* Developer: Sylvain Nintcheu Fata */
/* Version:   V.1.1                 */
/* Released:  Jun 14, 2012          */

 
   clock_t tm1; /* time variable */



   printf(" >>>  GALERKIN BEM for 3D LAPLACE EQUATION: SINGULAR FORMULATION ==> GBEM_LAP <== Version 1.1  <<<\n");
   printf(" >>>  Data Input & Initializations  <<<\n");

   gbem_lap_input(InfParams,InfData); /* Read input data and parameters */

   gbem_lap_init(); /* Initialize arrays and parameters */

   tm1 = clock();
   printf("Time == %#.14G\n",((double)(tm1-tm0))/CLOCKS_PER_SEC); /* cpu time used */
       
   printf(" >>>  Assembly of the Discretized BIE  <<<\n");
       
   gbem_lap_assem(); /* Assemble h and g influence matrices */

   tm1 = clock();
   printf("Time == %#.14G\n",((double)(tm1-tm0))/CLOCKS_PER_SEC); /* cpu time used */
   
   printf(" >>>  Left-hand side & Right-hand side of the Discretized BIE  <<<\n");
   
   gbem_lap_lrhs(); /* Form the left- and right-hand sides of the discretized BIE */

   tm1 = clock();
   printf("Time == %#.14G\n",((double)(tm1-tm0))/CLOCKS_PER_SEC); /* cpu time used */
   
   printf(" >>>  Solution of the Discretized BIE  <<<\n");
   
   gbem_lap_solv(); /* Solve the Discretized BIE */

}
