20 #pragma warning(disable: 4786)
24 #include "vnl/vnl_math.h"
36 if (order==0) { order=DefaultIntegrationOrder; }
40 pt[0]=gaussPoint[order][i%order];
41 pt[1]=gaussPoint[order][i/order];
43 w=gaussWeight[order][i%order]*gaussWeight[order][i/order];
54 if (order==0) { order=DefaultIntegrationOrder; }
74 shapeF[0] = (1 - pt[0]) * (1 - pt[1]) * .25;
77 shapeF[1] = (1 + pt[0]) * (1 - pt[1]) * .25;
80 shapeF[2] = (1 + pt[0]) * (1 + pt[1]) * .25;
83 shapeF[3] = (1 - pt[0]) * (1 + pt[1]) * .25;
96 shapeD[0][0] = -(1 - pt[1]) * .25;
99 shapeD[1][0] = -(1 - pt[0]) * .25;
102 shapeD[0][1] = +(1 - pt[1]) * .25;
105 shapeD[1][1] = -(1 + pt[0]) * .25;
108 shapeD[0][2] = +(1 + pt[1]) * .25;
111 shapeD[1][2] = +(1 + pt[0]) * .25;
114 shapeD[0][3] = -(1 + pt[1]) * .25;
117 shapeD[1][3] = +(1 - pt[0]) * .25;
126 Float x1, x2, x3, x4, y1, y2, y3, y4, xce, yce, xb, yb, xcn, ycn,
127 A, J1, J2, x0, y0, dx, dy, be, bn, ce, cn;
132 x1 = this->m_node[0]->GetCoordinates()[0]; y1 = this->m_node[0]->GetCoordinates()[1];
133 x2 = this->m_node[1]->GetCoordinates()[0]; y2 = this->m_node[1]->GetCoordinates()[1];
134 x3 = this->m_node[2]->GetCoordinates()[0]; y3 = this->m_node[2]->GetCoordinates()[1];
135 x4 = this->m_node[3]->GetCoordinates()[0]; y4 = this->m_node[3]->GetCoordinates()[1];
137 xb = x1 - x2 + x3 - x4;
138 yb = y1 - y2 + y3 - y4;
140 xce = x1 + x2 - x3 - x4;
141 yce = y1 + y2 - y3 - y4;
143 xcn = x1 - x2 - x3 + x4;
144 ycn = y1 - y2 - y3 + y4;
146 A = 0.5 * (((x3 - x1) * (y4 - y2)) - ((x4 - x2) * (y3 - y1)));
147 J1 = ((x3 - x4) * (y1 - y2)) - ((x1 - x2) * (y3 - y4));
148 J2 = ((x2 - x3) * (y1 - y4)) - ((x1 - x4) * (y2 - y3));
150 x0 = 0.25 * (x1 + x2 + x3 + x4);
151 y0 = 0.25 * (y1 + y2 + y3 + y4);
153 dx = globalPt[0] - x0;
154 dy = globalPt[1] - y0;
156 be = A - (dx * yb) + (dy * xb);
157 bn = -A - (dx * yb) + (dy * xb);
158 ce = (dx * yce) - (dy * xce);
159 cn = (dx * ycn) - (dy * xcn);
161 localPt[0] = (2 * ce) / (-vcl_sqrt((be * be) - (2 * J1 * ce)) - be);
162 localPt[1] = (2 * cn) / ( vcl_sqrt((bn * bn) + (2 * J2 * cn)) - bn);
166 if (localPt[0] < -1.0 || localPt[0] > 1.0 || localPt[1] < -1.0 || localPt[1] > 1.0 )
177 #ifdef FEM_BUILD_VISUALIZATION
179 Element2DC0LinearQuadrilateral