亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ex3.c

?? 一個用來實現偏微分方程中網格的計算庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
  // properties at the quadrature points.  const std::vector<Point>& q_point = fe->get_xyz();  // The element shape functions evaluated at the quadrature points.  const std::vector<std::vector<Real> >& phi = fe->get_phi();  // The element shape function gradients evaluated at the quadrature  // points.  const std::vector<std::vector<RealGradient> >& dphi = fe->get_dphi();  // Define data structures to contain the element matrix  // and right-hand-side vector contribution.  Following  // basic finite element terminology we will denote these  // "Ke" and "Fe".  These datatypes are templated on  //  Number, which allows the same code to work for real  // or complex numbers.  DenseMatrix<Number> Ke;  DenseVector<Number> Fe;  // This vector will hold the degree of freedom indices for  // the element.  These define where in the global system  // the element degrees of freedom get mapped.  std::vector<unsigned int> dof_indices;  // Now we will loop over all the elements in the mesh.  // We will compute the element matrix and right-hand-side  // contribution.  //  // Element iterators are a nice way to iterate through  // all the elements, or all the elements that have some property.  // There are many types of element iterators, but here we will  // use the most basic type, the  const_elem_iterator.  The iterator  //  el will iterate from the first to the last element.  The  // iterator  end_el tells us when to stop.  It is smart to make  // this one  const so that we don't accidentally mess it up!//   const_elem_iterator           el (mesh.elements_begin());//   const const_elem_iterator end_el (mesh.elements_end());  MeshBase::const_element_iterator       el     = mesh.elements_begin();  const MeshBase::const_element_iterator end_el = mesh.elements_end();  // Loop over the elements.  Note that  ++el is preferred to  // el++ since the latter requires an unnecessary temporary  // object.  for ( ; el != end_el ; ++el)    {      // Store a pointer to the element we are currently      // working on.  This allows for nicer syntax later.      const Elem* elem = *el;      // Get the degree of freedom indices for the      // current element.  These define where in the global      // matrix and right-hand-side this element will      // contribute to.      dof_map.dof_indices (elem, dof_indices);      // Compute the element-specific data for the current      // element.  This involves computing the location of the      // quadrature points (q_point) and the shape functions      // (phi, dphi) for the current element.      fe->reinit (elem);      // Zero the element matrix and right-hand side before      // summing them.  We use the resize member here because      // the number of degrees of freedom might have changed from      // the last element.  Note that this will be the case if the      // element type is different (i.e. the last element was a      // triangle, now we are on a quadrilateral).      // The  DenseMatrix::resize() and the  DenseVector::resize()      // members will automatically zero out the matrix  and vector.      Ke.resize (dof_indices.size(),                 dof_indices.size());      Fe.resize (dof_indices.size());      // Now loop over the quadrature points.  This handles      // the numeric integration.      for (unsigned int qp=0; qp<qrule.n_points(); qp++)        {          // Now we will build the element matrix.  This involves          // a double loop to integrate the test funcions (i) against          // the trial functions (j).          for (unsigned int i=0; i<phi.size(); i++)            for (unsigned int j=0; j<phi.size(); j++)              {                Ke(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp]);              }                    // This is the end of the matrix summation loop          // Now we build the element right-hand-side contribution.          // This involves a single loop in which we integrate the          // "forcing function" in the PDE against the test functions.          {            const Real x = q_point[qp](0);            const Real y = q_point[qp](1);            const Real eps = 1.e-3;                        // "fxy" is the forcing function for the Poisson equation.            // In this case we set fxy to be a finite difference            // Laplacian approximation to the (known) exact solution.            //            // We will use the second-order accurate FD Laplacian            // approximation, which in 2D is            //            // u_xx + u_yy = (u(i,j-1) + u(i,j+1) +            //                u(i-1,j) + u(i+1,j) +            //                -4*u(i,j))/h^2            //            // Since the value of the forcing function depends only            // on the location of the quadrature point (q_point[qp])            // we will compute it here, outside of the i-loop            const Real fxy = -(exact_solution(x,y-eps) +                               exact_solution(x,y+eps) +                               exact_solution(x-eps,y) +                               exact_solution(x+eps,y) -                               4.*exact_solution(x,y))/eps/eps;                        for (unsigned int i=0; i<phi.size(); i++)              Fe(i) += JxW[qp]*fxy*phi[i][qp];          }         }             // We have now reached the end of the RHS summation,      // and the end of quadrature point loop, so      // the interior element integration has      // been completed.  However, we have not yet addressed      // boundary conditions.  For this example we will only      // consider simple Dirichlet boundary conditions.      //      // There are several ways Dirichlet boundary conditions      // can be imposed.  A simple approach, which works for      // interpolary bases like the standard Lagrange polynomials,      // is to assign function values to the      // degrees of freedom living on the domain boundary. This      // works well for interpolary bases, but is more difficult      // when non-interpolary (e.g Legendre or Hierarchic) bases      // are used.      //      // Dirichlet boundary conditions can also be imposed with a      // "penalty" method.  In this case essentially the L2 projection      // of the boundary values are added to the matrix. The      // projection is multiplied by some large factor so that, in      // floating point arithmetic, the existing (smaller) entries      // in the matrix and right-hand-side are effectively ignored.      //      // This amounts to adding a term of the form (in latex notation)      //      // \frac{1}{\epsilon} \int_{\delta \Omega} \phi_i \phi_j = \frac{1}{\epsilon} \int_{\delta \Omega} u \phi_i      //      // where      //      // \frac{1}{\epsilon} is the penalty parameter, defined such that \epsilon << 1      {        // The following loop is over the sides of the element.        // If the element has no neighbor on a side then that        // side MUST live on a boundary of the domain.        for (unsigned int side=0; side<elem->n_sides(); side++)          if (elem->neighbor(side) == NULL)            {              // The value of the shape functions at the quadrature              // points.              const std::vector<std::vector<Real> >&  phi_face = fe_face->get_phi();                            // The Jacobian * Quadrature Weight at the quadrature              // points on the face.              const std::vector<Real>& JxW_face = fe_face->get_JxW();                            // The XYZ locations (in physical space) of the              // quadrature points on the face.  This is where              // we will interpolate the boundary value function.              const std::vector<Point >& qface_point = fe_face->get_xyz();                            // Compute the shape function values on the element              // face.              fe_face->reinit(elem, side);                            // Loop over the face quadrature points for integration.              for (unsigned int qp=0; qp<qface.n_points(); qp++)                {                  // The location on the boundary of the current                  // face quadrature point.                  const Real xf = qface_point[qp](0);                  const Real yf = qface_point[qp](1);                  // The penalty value.  \frac{1}{\epsilon}                  // in the discussion above.                  const Real penalty = 1.e10;                  // The boundary value.                  const Real value = exact_solution(xf, yf);                                    // Matrix contribution of the L2 projection.                   for (unsigned int i=0; i<phi_face.size(); i++)                    for (unsigned int j=0; j<phi_face.size(); j++)                      Ke(i,j) += JxW_face[qp]*penalty*phi_face[i][qp]*phi_face[j][qp];                  // Right-hand-side contribution of the L2                  // projection.                  for (unsigned int i=0; i<phi_face.size(); i++)                    Fe(i) += JxW_face[qp]*penalty*value*phi_face[i][qp];                }             }      }            // We have now finished the quadrature point loop,      // and have therefore applied all the boundary conditions.      //      // The element matrix and right-hand-side are now built      // for this element.  Add them to the global matrix and      // right-hand-side vector.  The  SparseMatrix::add_matrix()      // and  NumericVector::add_vector() members do this for us.      system.matrix->add_matrix (Ke, dof_indices);      system.rhs->add_vector    (Fe, dof_indices);    }    // All done!}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲日韩在线| 91精品综合久久久久久| 另类小说欧美激情| 亚洲不卡在线观看| 亚洲va天堂va国产va久| 亚洲一区二区三区四区五区黄 | 一区二区三区欧美| 亚洲欧洲性图库| 亚洲精品日产精品乱码不卡| 亚洲天堂成人网| 亚洲一区二区欧美日韩| 亚洲第一激情av| 免费精品视频在线| 久久99精品一区二区三区| 狠狠色综合日日| 国产999精品久久| 99精品视频免费在线观看| 欧美性大战久久久久久久蜜臀| 在线免费亚洲电影| 欧美日本韩国一区二区三区视频 | 色老汉一区二区三区| 97超碰欧美中文字幕| 色欧美片视频在线观看在线视频| 91高清视频免费看| 91精品国产综合久久香蕉的特点| 欧美tk—视频vk| 中文一区二区完整视频在线观看 | 欧美三级中文字幕| 日韩精品一区二区三区中文不卡 | 色哟哟一区二区| 7777精品久久久大香线蕉| 精品少妇一区二区三区免费观看| 久久久亚洲精品石原莉奈| 国产精品高潮呻吟久久| 午夜精品久久久久久久99水蜜桃 | 亚洲国产中文字幕在线视频综合| 三级在线观看一区二区| 狠狠色综合色综合网络| 91农村精品一区二区在线| 欧美一区二区黄| 国产精品素人一区二区| 三级欧美在线一区| 99精品久久只有精品| 欧美精品丝袜中出| 中文字幕在线一区| 精品一区二区免费视频| 色狠狠av一区二区三区| 久久久久国产精品麻豆ai换脸 | 中文字幕不卡三区| 日韩av一区二区三区| 成人av免费观看| 日韩欧美久久久| 亚洲国产日韩a在线播放| 国产精品亚洲午夜一区二区三区| 欧美午夜免费电影| 国产精品精品国产色婷婷| 久久精品国内一区二区三区| 日本二三区不卡| 国产精品丝袜久久久久久app| 首页亚洲欧美制服丝腿| 99精品久久只有精品| 国产片一区二区三区| 青青草精品视频| 欧美日韩情趣电影| 一区二区三区**美女毛片| 国产高清精品网站| 精品国产污网站| 国产精品资源在线观看| 日韩精品影音先锋| 免费观看在线色综合| 欧美日本高清视频在线观看| 亚洲综合久久久久| 一本大道久久a久久精二百| 国产精品大尺度| 不卡av在线网| 国产精品激情偷乱一区二区∴| 国产精品888| 久久午夜电影网| 韩国视频一区二区| 久久久www免费人成精品| 久久99精品国产麻豆婷婷洗澡| 日韩欧美一区二区视频| 久久国产婷婷国产香蕉| 欧美精品一区在线观看| 国内精品不卡在线| 久久久精品2019中文字幕之3| 国产精品一区二区三区网站| 亚洲精品一区二区三区精华液| 黑人巨大精品欧美一区| 久久综合久久鬼色| 国产丶欧美丶日本不卡视频| 久久蜜桃av一区精品变态类天堂 | 欧美激情一区二区三区全黄| 国产精选一区二区三区| 国产蜜臀av在线一区二区三区| 国产 欧美在线| 亚洲日本一区二区| 欧美浪妇xxxx高跟鞋交| 久久99精品久久只有精品| 国产日产欧美一区| 色婷婷亚洲精品| 毛片一区二区三区| 国产亚洲欧洲997久久综合| 不卡的电影网站| 日日噜噜夜夜狠狠视频欧美人| 日韩欧美亚洲另类制服综合在线 | 国产日韩亚洲欧美综合| 成人免费av在线| 亚洲成人激情社区| 欧美精品一区二区在线播放| 成人av中文字幕| 亚洲成人av福利| 亚洲国产精品高清| 在线电影欧美成精品| 国产精品99久久久久久似苏梦涵| 亚洲欧美日韩中文字幕一区二区三区| 欧美日韩在线播放三区四区| 国产一区啦啦啦在线观看| 精品亚洲国产成人av制服丝袜| 国产精品久久久久久久久果冻传媒 | 91精品婷婷国产综合久久| 国产91精品入口| 免费在线视频一区| 亚洲色图色小说| 久久麻豆一区二区| 69久久夜色精品国产69蝌蚪网| 高清在线成人网| 免费成人av在线播放| 亚洲人成伊人成综合网小说| 精品国产免费人成在线观看| 色久综合一二码| 99在线热播精品免费| 久久国产综合精品| 午夜精品久久一牛影视| 国产精品久久久久久久久免费丝袜 | 国产精品美女久久福利网站| 日韩午夜精品视频| 欧美天天综合网| www.一区二区| 国产ts人妖一区二区| 九九精品视频在线看| 日本中文一区二区三区| 亚洲一区二区三区自拍| 亚洲视频免费在线| 国产精品三级电影| 日本一区二区在线不卡| 精品国精品国产尤物美女| 在线成人午夜影院| 4hu四虎永久在线影院成人| 在线免费观看不卡av| 91麻豆蜜桃一区二区三区| 成人app软件下载大全免费| 国产风韵犹存在线视精品| 国产精品 欧美精品| 国产成人鲁色资源国产91色综| 国产一区二区在线看| 精品一区二区三区蜜桃| 国产麻豆成人精品| 国产一区二区三区综合| 国产麻豆成人传媒免费观看| 国产最新精品免费| 国产在线一区二区综合免费视频| 美国毛片一区二区三区| 久久99国产精品麻豆| 国产精品1区2区3区| 成人毛片视频在线观看| 99国产精品久| 精品视频全国免费看| 91精品国产色综合久久| 日韩一区二区影院| 久久久噜噜噜久噜久久综合| 中文字幕va一区二区三区| 亚洲精选在线视频| 日韩电影在线一区| 国产一区二区三区在线观看免费| 国产91精品一区二区| 99久久免费国产| 欧美精品高清视频| 久久精品人人做人人综合| 国产精品久久毛片av大全日韩| 亚洲精品美腿丝袜| 麻豆精品在线看| 99这里都是精品| 日韩亚洲欧美一区二区三区| 久久综合丝袜日本网| 一区二区三区免费看视频| 美女www一区二区| 99riav久久精品riav| 欧美精三区欧美精三区 | 成人天堂资源www在线| 色婷婷av一区二区三区gif| 91麻豆精品国产91久久久久久 | 日本道精品一区二区三区| 日韩视频免费观看高清完整版| 欧美韩日一区二区三区| 亚洲国产综合色| 成人a级免费电影| 欧美xxxxxxxx| 午夜一区二区三区在线观看| 国产凹凸在线观看一区二区|