00001 #include "isotropicelasticeqvar.h"
00002
00003
00004 const Index IsotropicElasticEqVar::m_local_dof_face_cell_map[6][4] = {{0,2,4,6},
00005 {1,3,5,7},
00006 {0,1,4,5},
00007 {2,3,6,7},
00008 {0,1,2,3},
00009 {4,5,6,7}};
00010
00011
00012
00013
00014 IsotropicElasticEqVar::IsotropicElasticEqVar(OrthoMesh &mesh, VecDouble &cK, double l1,double l2, Function3D &fD, Function3D &fN,unsigned debugLevel)
00015 :m_FE(1),m_FES(m_FE,3),m_cQG(2),m_fQG(2),
00016 m_global_dofs_map(OrthoMesh::VERTICES_PER_CELL*3),m_mesh(mesh),m_l1(l1),m_l2(l2)
00017 {
00018 initFEValues(m_mesh,m_FES,m_cQG,m_fQG, update_quadrature_points|update_gradients|update_JxW_values|update_values, update_JxW_values|update_values|update_quadrature_points);
00019
00020 }
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 void IsotropicElasticEqVar::setCell(OrthoMesh::Cell_It &cell)
00041 {
00042 DealFEWrapper::setCell(cell);
00043 unsigned i=0;
00044
00045 for (unsigned v=0;v<OrthoMesh::VERTICES_PER_CELL;v++)
00046 {
00047 for (unsigned comp=0;comp<3;comp++)
00048 {
00049 m_global_dofs_map[i++]=cell->vertex_index(static_cast<VertexDirection3D>(v))+m_mesh.numVertices()*comp;
00050 }
00051 }
00052 }
00053
00054
00055 double IsotropicElasticEqVar::localEqVar(unsigned i,unsigned j,unsigned qPoint)
00056 {
00057 unsigned iComp=local_dof_component(i);
00058 unsigned jComp=local_dof_component(j);
00059 const Tensor<1,DIM>& gradV = shape_grad(i,qPoint);
00060 double l1 = m_l1;
00061 double l2 = m_l2;
00062 switch(iComp)
00063 {
00064 case U0:
00065 {
00066
00067 switch(jComp)
00068 {
00069 case U0:
00070 return (
00071 (l1+2*l2)*shape_grad(j,qPoint)[0]*gradV[0] +
00072 l2*shape_grad(j,qPoint)[1]*gradV[1] +
00073 l2*shape_grad(j,qPoint)[2]*gradV[2])*JxW(qPoint);
00074 case U1:
00075 return (
00076 l1*shape_grad(j,qPoint)[1]*gradV[0]+
00077 l2*shape_grad(j,qPoint)[0]*gradV[1])*JxW(qPoint);
00078 case U2:
00079 return (
00080 l1*shape_grad(j,qPoint)[2]*gradV[0] +
00081 l2*shape_grad(j,qPoint)[0]*gradV[2])*JxW(qPoint);
00082 }
00083 }
00084 case U1:
00085 {
00086 switch (jComp)
00087 {
00088 case U0:
00089 return (
00090 l2*shape_grad(j,qPoint)[1]*gradV[0] +
00091 l1*shape_grad(j,qPoint)[0]*gradV[1]
00092 )*JxW(qPoint);
00093 case U1:
00094 return (
00095 l2 *shape_grad(j,qPoint)[0]*gradV[0]+
00096 (l1+2*l2)*shape_grad(j,qPoint)[1]*gradV[1]+
00097 l2 *shape_grad(j,qPoint)[2]*gradV[2]
00098 )*JxW(qPoint);
00099 case U2:
00100 return (
00101 l1*shape_grad(j,qPoint)[2]*gradV[1] +
00102 l2*shape_grad(j,qPoint)[1]*gradV[2]
00103 )*JxW(qPoint);
00104 }
00105 }
00106 case U2:
00107 {
00108 switch (jComp)
00109 {
00110 case U0:
00111 return (
00112 l2*shape_grad(j,qPoint)[2]*gradV[0] +
00113 l1*shape_grad(j,qPoint)[0]*gradV[2]
00114 )*JxW(qPoint);
00115 case U1:
00116 return (
00117 l2*shape_grad(j,qPoint)[2]*gradV[1] +
00118 l1*shape_grad(j,qPoint)[1]*gradV[2]
00119 )*JxW(qPoint);
00120 case U2:
00121 return (
00122 l2 *shape_grad(j,qPoint)[0]*gradV[0]+
00123 l2 *shape_grad(j,qPoint)[1]*gradV[1]+
00124 (l1+2*l2)*shape_grad(j,qPoint)[2]*gradV[2]
00125 )*JxW(qPoint);
00126 }
00127 }
00128 }
00129 assert(0);
00130 return NAN;
00131 }
00132
00133
00134
00135
00136 int IsotropicElasticEqVar::nullProduct(unsigned i,unsigned j)
00137 {
00138 return false;
00139 }
00140
00141
00142 double IsotropicElasticEqVar::localRHS(unsigned i,unsigned j)
00143 {
00144 return 0.0;
00145 }