funValue[1] = -0.5*(gc[0] + gc[1]);
funValue[2] = 0.5*(1.0 + gc[0]);
SHAPE_FUN_MACRO_END;
+
+ DEV_SHAPE_FUN_MACRO_BEGIN;
+
+ devFunValue[0] = 0.0 ;
+ devFunValue[1] = 0.5 ;
+
+ devFunValue[2] = -0.5;
+ devFunValue[3] = -0.5;
+
+ devFunValue[4] = 0.5;
+ devFunValue[5] = 0.0;
+
+ DEV_SHAPE_FUN_MACRO_END;
}
/*!
funValue[4] = -1.0*(1.0 + gc[0])*(gc[0] + gc[1]);
funValue[5] = (1.0 + gc[1])*(1.0 + gc[1]);
SHAPE_FUN_MACRO_END;
+
+ DEV_SHAPE_FUN_MACRO_BEGIN;
+
+ devFunValue[0] = 0.0;
+ devFunValue[1] = 0.5*( 2*gc[1] + 1.0 );
+
+ devFunValue[2] = 0.5*( 2*gc[0] + 2.0*gc[1] + 1.0);
+ devFunValue[3] = 0.5*( 2*gc[1] + 2.0*gc[0] + 1.0);
+
+ devFunValue[4] = gc[0] + 0.5;
+ devFunValue[5] = 0.0;
+
+ devFunValue[6] = -1.0*(1.0 + gc[1]);
+ devFunValue[7] = -1.0*(2*gc[1]+gc[0]+1.0);
+
+ devFunValue[8] = -1.0*(2*gc[0]+gc[1]+1.0);
+ devFunValue[9] = -1.0*(1.0 + gc[0]);
+
+ devFunValue[10] = 0.0;
+ devFunValue[11] = (2*gc[1]+2.0);
+
+ DEV_SHAPE_FUN_MACRO_END;
}
/*!
delta_Z.abs()
self.assertTrue(delta_Z.findIdsNotInRange(-1e-5,+1e-5).empty())
+ # 2D cells
+ vec = [0.64,0.2]
+
+ for gt in [NORM_QUAD8,NORM_QUAD4,NORM_TRI3,NORM_TRI6]:
+ ref_coord = [list(elt) for elt in MEDCouplingGaussLocalization.GetDefaultReferenceCoordinatesOf(gt).getValuesAsTuple()]
+
+ der_computed = GetDerivative(ref_coord,vec)
+ der_computed.rearrange(2)
+
+ der_deduced = ( GetShapeFunc(ref_coord,[vec[0]+eps,vec[1]])-GetShapeFunc(ref_coord,vec) ) / eps
+ delta_X = der_computed[:,0]-der_deduced
+ delta_X.abs()
+ self.assertTrue(delta_X.findIdsNotInRange(-1e-5,+1e-5).empty())
+
+ der_deduced = ( GetShapeFunc(ref_coord,[vec[0],vec[1]+eps])-GetShapeFunc(ref_coord,vec) ) / eps
+ delta_Y = der_computed[:,1]-der_deduced
+ delta_Y.abs()
+ self.assertTrue(delta_Y.findIdsNotInRange(-1e-5,+1e-5).empty())
+
def testComputeTriangleHeight0(self):
arr = DataArrayDouble([0,1])
m = MEDCouplingCMesh() ; m.setCoords(arr,arr)