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


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

/* ===purpose=== */

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

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

 
   clock_t tm1; /* time variable */



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

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

   cbem_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");
       
   cbem_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");
   
   cbem_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");
   
   cbem_lap_solv(); /* Solve the Discretized BIE */

}
