#ifndef HYPER_H
#define HYPER_H
#include <stdio.h>
#include <string.h>
#include "mex.h"
#include "math.h"
#include "../mex/of_def.h"

#ifdef FORMATLAB
#include "matrix.h"
#else
#include "stack-c.h"
#endif



static double dI1dc[6]={1.,1.,1.,0.,0.,0.};
static double d2I2dcdc[36]={0.0,1.0,1.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,
            0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.5,0.0,0.0,
            0.0,0.0,0.0,0.0,-0.5,0.0,0.0,0.0,0.0,0.0,0.0,-0.5};

int elemcalc(int jw, int Nw, int Nnode, double *def, double *NDN, double *e0,
	     double *e,double *F_ij, double *I, double *dI2dc, double *dI3dc, double *d2I3dcdc, int Mdef);

int EnPassiv(int *integ,double *constit,double *I,double *dWdI,double *d2WdI2);

int matPassiv( int *opt1, double *Sigma, double *dWdI, double *d2WdI2,
	       double *dI2dc, double *dI3dc, double *d2I3dcdc,double *d2wde2);

#endif
