10 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
13 #include "../classes.h"
14 #include "../../shared/shared.h"
59 for(
int i=0;i<numnodes;i++) dpx += dbasis[0*numnodes+i]*plist[i];
60 for(
int i=0;i<numnodes;i++) dpy += dbasis[1*numnodes+i]*plist[i];
84 for(
int i=0;i<numnodes;i++) value += basis[i]*plist[i];
101 J[2*0+0] = 0.5*(x2-x1);
102 J[2*1+0] =
SQRT3/6.0*(2*x3-x1-x2);
103 J[2*0+1] = 0.5*(y2-y1);
104 J[2*1+1] =
SQRT3/6.0*(2*y3-y1-y2);
117 if(*Jdet<0)
_error_(
"negative jacobian determinant!");
154 GaussTria* gauss = xDynamicCast<GaussTria*>(gauss_in);
156 switch(finiteelement){
222 for(
int i=0;i<numnodes;i++){
223 dbasis[numnodes*0+i] = Jinv[0][0]*dbasis_ref[0*numnodes+i]+Jinv[0][1]*dbasis_ref[1*numnodes+i];
224 dbasis[numnodes*1+i] = Jinv[1][0]*dbasis_ref[0*numnodes+i]+Jinv[1][1]*dbasis_ref[1*numnodes+i];
238 *Jdet = .5*sqrt(pow(x2-x1,2) + pow(y2-y1,2));
239 if(*Jdet<0)
_error_(
"negative jacobian determinant!");
253 IssmDouble* triabasis=xNew<IssmDouble>(numnodes);
256 switch(finiteelement){
258 basis[0]=triabasis[0];
259 xDelete<IssmDouble>(triabasis);
262 basis[0]=triabasis[index1];
263 basis[1]=triabasis[index2];
264 xDelete<IssmDouble>(triabasis);
267 basis[0]=triabasis[index1];
268 basis[1]=triabasis[index2];
269 xDelete<IssmDouble>(triabasis);
273 basis[0]=triabasis[index1];
274 basis[1]=triabasis[index2];
275 basis[2]=triabasis[3+index2-1];
276 xDelete<IssmDouble>(triabasis);
283 xDelete<IssmDouble>(triabasis);
296 IssmDouble* dtriabasis=xNew<IssmDouble>(2*numnodes);
299 switch(finiteelement){
301 dbasis[2*0+0] = dtriabasis[numnodes*0+index1];
302 dbasis[2*0+1] = dtriabasis[numnodes*1+index1];
303 dbasis[2*1+0] = dtriabasis[numnodes*0+index2];
304 dbasis[2*1+1] = dtriabasis[numnodes*1+index2];
311 xDelete<IssmDouble>(dtriabasis);
322 GaussTria* gauss = xDynamicCast<GaussTria*>(gauss_in);
324 switch(finiteelement){
410 switch(finiteelement){
413 indices = xNew<int>(numindices);
428 _error_(
"Edge index provided ("<<index<<
") is not between 0 and 2");
433 indices = xNew<int>(numindices);
451 _error_(
"Edge index provided ("<<index<<
") is not between 0 and 2");
459 *pnumindices = numindices;
465 switch(finiteelement){