20 #pragma warning(disable: 4786)
24 #include "vnl/algo/vnl_svd.h"
25 #include "vnl/algo/vnl_qr.h"
30 #ifdef FEM_BUILD_VISUALIZATION
33 double Element::DC_Scale=1000.0;
36 double &Element::Node::DC_Scale=Element::DC_Scale;
51 CPen pen(PS_SOLID, 0, (COLORREF) RGB(0,0,0) );
52 CBrush brush( RGB(255,255,255) );
54 CPen* pOldpen=pDC->SelectObject(&pen);
55 CBrush* pOldbrush=pDC->SelectObject(&brush);
62 CPoint r1=CPoint(0,0);
69 pDC->Ellipse(x1-r.x, y1-r.y, x1+r.x, y1+r.y);
71 pDC->SelectObject(pOldbrush);
72 pDC->SelectObject(pOldpen);
94 this->m_coordinates.set_size(n);
101 throw FEMExceptionIO(__FILE__,__LINE__,
"Element::Node::Read()",
"Error reading FEM node!");
120 f<<
"\t"<<this->m_coordinates.size();
121 f<<
" "<<this->m_coordinates<<
"\t% Node coordinates"<<
"\n";
126 throw FEMExceptionIO(__FILE__,__LINE__,
"Element::Node::Write()",
"Error writing FEM node!");
178 Ke=detJ*w*B.transpose()*D*B;
181 for(
unsigned int i=1; i<Nip; i++)
190 Ke += detJ*w*B.transpose()*D*B;
216 unsigned int itkNotUsed(index)) const
240 Le.set_size(NDOF,NDOF);
246 for(
unsigned int i=0; i<Nip; i++)
251 for(
unsigned int ni=0; ni<Nnodes; ni++)
253 for(
unsigned int nj=0; nj<Nnodes; nj++)
255 Float m=w*shape[ni]*shape[nj];
256 for(
unsigned int d=0; d<NnDOF; d++)
258 Le[ni*NnDOF+d][nj*NnDOF+d] += m;
276 U=LocalSolution.transpose()*Ke*LocalSolution;
296 Me.set_size(NDOF,NDOF);
303 for(
unsigned int i=0; i<Nip; i++)
311 for(
unsigned int ni=0; ni<Nnodes; ni++)
313 for(
unsigned int nj=0; nj<Nnodes; nj++)
315 Float m=detJ*w*shape[ni]*shape[nj];
316 for(
unsigned int d=0; d<NnDOF; d++)
318 Me[ni*NnDOF+d][nj*NnDOF+d] += m;
337 for(
unsigned int f=0; f<Ndofs_per_node; f++)
341 for(
unsigned int n=0; n<Nnodes; n++)
362 for(
unsigned int n=0; n<Nnodes; n++)
386 pshapeD=pshapeDlocal;
389 const unsigned int Nn=pshapeD->columns();
394 for(
unsigned int n=0; n<Nn; n++ )
423 Float det=vnl_qr<Float>(*pJ).determinant();
447 invJ=vnl_qr<Float>(*pJ).inverse();
465 pshapeD=pshapeDlocal;
473 this->
Jacobian( pt, *pJlocal, pshapeD );
480 shapeDgl=invJ*(*pshapeD);
492 for(
unsigned int n=0; n<Nnodes; n++)
507 { 0.000000000000000 },
508 { 0.577350269189626,-0.577350269189626 },
509 { 0.774596669241483, 0.000000000000000,-0.774596669241483 },
510 { 0.861136311594053, 0.339981043584856,-0.339981043584856,-0.861136311594053 },
511 { 0.906179845938664, 0.538469310105683, 0.000000000000000,-0.538469310105683,-0.906179845938664},
512 { 0.932469514203152, 0.661209386466264, 0.238619186083197,-0.238619186083197,-0.661209386466264,-0.932469514203152 },
513 { 0.949107912342759, 0.741531185599394, 0.405845151377397, 0.000000000000000,-0.405845151377397,-0.741531185599394,-0.949107912342759 },
514 { 0.960289856497536, 0.796666477413627, 0.525532409916329, 0.183434642495650,-0.183434642495650,-0.525532409916329,-0.796666477413627,-0.960289856497536 },
515 { 0.968160239507626, 0.836031107326636, 0.613371432700590, 0.324253423403809, 0.000000000000000,-0.324253423403809,-0.613371432700590,-0.836031107326636,-0.968160239507626 },
516 { 0.973906528517172, 0.865063366688985, 0.679409568299024, 0.433395394129247, 0.148874338981631,-0.148874338981631,-0.433395394129247,-0.679409568299024,-0.865063366688985,-0.973906528517172 }
522 { 2.000000000000000 },
523 { 1.000000000000000, 1.000000000000000 },
524 { 0.555555555555555, 0.888888888888889, 0.555555555555555 },
525 { 0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454 },
526 { 0.236926885056189, 0.478628670499366, 0.568888888888889, 0.478628670499366, 0.236926885056189 },
527 { 0.171324492379170, 0.360761573048139, 0.467913934572691, 0.467913934572691, 0.360761573048139, 0.171324492379170 },
528 { 0.129484966168869, 0.279705391489277, 0.381830050505119, 0.417959183673469, 0.381830050505119, 0.279705391489277, 0.129484966168869 },
529 { 0.101228536290376, 0.222381034453374, 0.313706645877887, 0.362683783378362, 0.362683783378362, 0.313706645877887, 0.222381034453374, 0.101228536290376 },
530 { 0.081274388361575, 0.180648160694858, 0.260610696402935, 0.312347077040003, 0.330239355001260, 0.312347077040003, 0.260610696402935, 0.180648160694858, 0.081274388361575 },
531 { 0.066671344308688, 0.149451349150581, 0.219086362515982, 0.269266719309996, 0.295524224714753, 0.295524224714753, 0.269266719309996, 0.219086362515982, 0.149451349150581, 0.066671344308688 }