
/* ===purpose=== */

/**********************************************************************************************************************************/
/*******************************************  Useful data types and routines for GBEM  ********************************************/
/**********************************************************************************************************************************/

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


#ifndef _GBEM_UTIL_H_
#define _GBEM_UTIL_H_

/* Singly Linked List Structure */
typedef struct slnlst { int id;
                        struct slnlst *next;
                      } ilst_t; 

/* mltndinfo == Structure to store information about multiple nodes */
typedef struct { int nn; /* nn == Number of nodes (entries) in the class						       */
                 int *id; /* id[k] == Global index of the k-th entry in the class of equivalence			       */
                 int pnd; /* pnd == Global index of the boundary node in the class at which the potential is prescribed if any */
               } mltndinfo_t; 


double gammai(double p1, double p2, double qet, double cr1, double cr2, double zn, double zd);
double pt_tria_tst(double w, double u, double v, const double *theta, int *theta_id);
inline double asym_chi(double p1, double p2, double d);
void ortho_comp_basis(const double *t1, const double *t2, double *e1, double *e2, double *e3);
double fmin_val_loc(int m, int n, double **x, int dim, int k, int *rw, int *cl);
void int_type(int elP, int elQ, char *flag); /* Determine integration type for element P and element Q */
void mltpl_nd(void); /* Find Multiple nodes on the boundary mesh */

#endif /* _GBEM_UTIL_H_ */
