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

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

?? ex4.c

?? 一個用來實現偏微分方程中網格的計算庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
  // in future examples.  const DofMap& dof_map = system.get_dof_map();  // Get a constant reference to the Finite Element type  // for the first (and only) variable in the system.  FEType fe_type = dof_map.variable_type(0);  // Build a Finite Element object of the specified type.  Since the  // \p FEBase::build() member dynamically creates memory we will  // store the object as an \p AutoPtr<FEBase>.  This can be thought  // of as a pointer that will clean up after itself.  AutoPtr<FEBase> fe (FEBase::build(dim, fe_type));    // A 5th order Gauss quadrature rule for numerical integration.  QGauss qrule (dim, FIFTH);  // Tell the finite element object to use our quadrature rule.  fe->attach_quadrature_rule (&qrule);  // Declare a special finite element object for  // boundary integration.  AutoPtr<FEBase> fe_face (FEBase::build(dim, fe_type));                // Boundary integration requires one quadraure rule,  // with dimensionality one less than the dimensionality  // of the element.  QGauss qface(dim-1, FIFTH);    // Tell the finte element object to use our  // quadrature rule.  fe_face->attach_quadrature_rule (&qface);  // Here we define some references to cell-specific data that  // will be used to assemble the linear system.  // We begin with the element Jacobian * quadrature weight at each  // integration point.     const std::vector<Real>& JxW = fe->get_JxW();  // The physical XY locations of the quadrature points on the element.  // These might be useful for evaluating spatially varying material  // 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". More detail is in example 3.  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.  See example 3 for a discussion of the  // element iterators.  Here we use the \p const_local_elem_iterator  // to indicate we only want to loop over elements that are assigned  // to the local processor.  This allows each processor to compute  // its components of the global matrix.  //  // "PARALLEL CHANGE"  MeshBase::const_element_iterator       el     = mesh.local_elements_begin();  const MeshBase::const_element_iterator end_el = mesh.local_elements_end();  for ( ; el != end_el; ++el)    {      // Start logging the shape function initialization.      // This is done through a simple function call with      // the name of the event to log.      perf_log.push("elem init");            // 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).      Ke.resize (dof_indices.size(),                 dof_indices.size());      Fe.resize (dof_indices.size());      // Stop logging the shape function initialization.      // If you forget to stop logging an event the PerfLog      // object will probably catch the error and abort.      perf_log.pop("elem init");            // Now we will build the element matrix.  This involves      // a double loop to integrate the test funcions (i) against      // the trial functions (j).      //      // We have split the numeric integration into two loops      // so that we can log the matrix and right-hand-side      // computation seperately.      //      // Now start logging the element matrix computation      perf_log.push ("Ke");      for (unsigned int qp=0; qp<qrule.n_points(); qp++)        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]);                  // Stop logging the matrix computation      perf_log.pop ("Ke");      // 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.      //      // Start logging the right-hand-side computation      perf_log.push ("Fe");            for (unsigned int qp=0; qp<qrule.n_points(); qp++)        {          // 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 on a structured grid is          //          // u_xx + u_yy = (u(i-1,j) + u(i+1,j) +          //                u(i,j-1) + u(i,j+1) +          //                -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 x = q_point[qp](0);          const Real y = q_point[qp](1);          const Real z = q_point[qp](2);          const Real eps = 1.e-3;          const Real uxx = (exact_solution(x-eps,y,z) +                            exact_solution(x+eps,y,z) +                            -2.*exact_solution(x,y,z))/eps/eps;                        const Real uyy = (exact_solution(x,y-eps,z) +                            exact_solution(x,y+eps,z) +                            -2.*exact_solution(x,y,z))/eps/eps;                    const Real uzz = (exact_solution(x,y,z-eps) +                            exact_solution(x,y,z+eps) +                            -2.*exact_solution(x,y,z))/eps/eps;          Real fxy;          if(dim==1)          {            // In 1D, compute the rhs by differentiating the            // exact solution twice.            const Real pi = libMesh::pi;            fxy = (0.25*pi*pi)*sin(.5*pi*x);          }          else          {            fxy = - (uxx + uyy + ((dim==2) ? 0. : uzz));          }           // Add the RHS contribution          for (unsigned int i=0; i<phi.size(); i++)            Fe(i) += JxW[qp]*fxy*phi[i][qp];                  }            // Stop logging the right-hand-side computation      perf_log.pop ("Fe");      // At this point 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 imposed      // via the penalty method. This is discussed at length in      // example 3.      {                // Start logging the boundary condition computation        perf_log.push ("BCs");        // The following loops 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 penalty value.  \frac{1}{\epsilon}              // in the discussion above.              const Real penalty = 1.e10;              // 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);                const Real zf = qface_point[qp](2);                // The boundary value.                const Real value = exact_solution(xf, yf, zf);                // 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];              }             }                            // Stop logging the boundary condition computation        perf_log.pop ("BCs");      }             // 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 \p PetscMatrix::add_matrix()      // and \p PetscVector::add_vector() members do this for us.      // Start logging the insertion of the local (element)      // matrix and vector into the global matrix and vector      perf_log.push ("matrix insertion");            system.matrix->add_matrix (Ke, dof_indices);      system.rhs->add_vector    (Fe, dof_indices);      // Start logging the insertion of the local (element)      // matrix and vector into the global matrix and vector      perf_log.pop ("matrix insertion");    }  // That's it.  We don't need to do anything else to the  // PerfLog.  When it goes out of scope (at this function return)  // it will print its log to the screen. Pretty easy, huh?}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩在线不卡| 91亚洲精品一区二区乱码| 欧美精品在线视频| 亚洲一区欧美一区| 欧美日韩综合色| 日精品一区二区| 日韩女优制服丝袜电影| 国产一区二区三区免费观看| 久久久久综合网| www.视频一区| 亚洲福利国产精品| 久久亚洲一区二区三区明星换脸| 国产夫妻精品视频| 亚洲男女一区二区三区| 欧美日韩一区三区四区| 九色综合国产一区二区三区| 中文字幕欧美激情一区| 在线免费一区三区| 黄色日韩网站视频| 亚洲天天做日日做天天谢日日欢| 欧美日韩一区二区三区高清| 美女视频黄 久久| 日韩一区有码在线| 在线成人av网站| 国产ts人妖一区二区| 亚洲国产日日夜夜| 26uuu国产一区二区三区| 91美女片黄在线观看| 蜜臀av一区二区在线观看| 日本一区二区成人在线| 欧美揉bbbbb揉bbbbb| 国产a级毛片一区| 五月激情丁香一区二区三区| 国产日韩av一区| 日韩一区二区中文字幕| 99久久综合精品| 激情综合网激情| 亚洲国产毛片aaaaa无费看 | 风间由美一区二区av101| 亚洲人成在线播放网站岛国| 日韩欧美色电影| 色哟哟一区二区三区| 国产又粗又猛又爽又黄91精品| 一区二区三区91| 久久九九久久九九| 欧美一级日韩一级| 色偷偷88欧美精品久久久| 国产在线一区观看| 日韩高清一区二区| 亚洲免费高清视频在线| 欧美国产视频在线| 久久综合久久鬼色中文字| 欧美日韩中文精品| 91丨九色丨蝌蚪富婆spa| 国产一区二区精品久久| 免费高清视频精品| 香蕉久久一区二区不卡无毒影院 | 9i看片成人免费高清| 久久99久久99小草精品免视看| 亚洲制服欧美中文字幕中文字幕| 国产精品素人视频| 国产三级欧美三级| 精品国产91乱码一区二区三区 | 成人app在线观看| 国产一区二区三区最好精华液| 天天色图综合网| 亚洲午夜久久久久久久久电影院| 亚洲色图欧洲色图婷婷| 国产精品美女久久久久aⅴ| 国产欧美日韩精品在线| 久久久久久久久久久99999| 欧美r级在线观看| 日韩欧美国产麻豆| 精品久久久久av影院 | 日韩久久免费av| 欧美久久久久久久久久| 在线日韩一区二区| 欧美日韩一级二级| 欧美精品九九99久久| 欧美日韩电影在线| 宅男噜噜噜66一区二区66| 欧美精品18+| 日韩一区二区在线观看视频播放| 欧美一区二区二区| 精品国产污网站| 久久精品免费在线观看| 亚洲国产成人自拍| 自拍av一区二区三区| 亚洲精品日韩一| 五月天一区二区三区| 石原莉奈一区二区三区在线观看| 午夜激情一区二区三区| 免费精品视频最新在线| 国产一区二区三区美女| 国产成人鲁色资源国产91色综| 不卡区在线中文字幕| 一本色道久久综合亚洲aⅴ蜜桃| 日本道在线观看一区二区| 欧美日韩大陆一区二区| 精品国产乱码久久久久久久| 欧美经典一区二区三区| 亚洲精选免费视频| 免费一区二区视频| 成人免费福利片| 在线观看成人免费视频| 日韩欧美国产系列| 国产精品乱人伦| 亚洲高清免费一级二级三级| 男人操女人的视频在线观看欧美| 精品一二三四区| av午夜一区麻豆| 欧美高清视频在线高清观看mv色露露十八 | 欧美三级在线视频| 日韩一区二区三区视频在线观看| 国产日韩欧美精品在线| 一区二区三区在线免费视频 | 成人欧美一区二区三区| 亚洲一区二区在线免费观看视频| 免费观看一级欧美片| 成+人+亚洲+综合天堂| 欧美另类一区二区三区| 中文字幕av免费专区久久| 香蕉成人啪国产精品视频综合网| 国产成人在线视频免费播放| 欧美色综合网站| 日本一二三不卡| 蜜桃视频在线观看一区二区| 99免费精品在线| 精品福利一二区| 亚洲sss视频在线视频| 国产传媒欧美日韩成人| 欧美精品123区| 一区二区三区精品视频在线| 国产精品一区二区视频| 欧美精品三级在线观看| |精品福利一区二区三区| 韩国女主播成人在线观看| 欧美日韩视频在线第一区| 国产精品久久久久久久浪潮网站 | 亚洲三级久久久| 国产成人午夜精品影院观看视频 | 久久中文字幕电影| 亚洲18女电影在线观看| 91亚洲精品乱码久久久久久蜜桃| 久久久久亚洲蜜桃| 久久成人久久爱| 69堂国产成人免费视频| 亚洲一区二区三区爽爽爽爽爽 | 91片在线免费观看| 中文字幕av在线一区二区三区| 免费欧美高清视频| 欧美人成免费网站| 亚洲在线视频免费观看| 91香蕉视频mp4| 成人免费一区二区三区视频 | 成人av免费在线观看| 久久九九全国免费| 国产在线麻豆精品观看| 日韩一区二区三区观看| 婷婷六月综合网| 欧美精品在线一区二区三区| 亚洲午夜免费电影| 欧美日韩不卡在线| 午夜激情一区二区| 欧美福利一区二区| 日韩电影一区二区三区| 7777精品久久久大香线蕉| 五月天激情综合网| 日韩三级免费观看| 国内成人免费视频| 国产视频一区在线播放| 国产精品一区2区| 国产精品久线观看视频| 欧美精品色综合| 麻豆国产精品一区二区三区| 日韩亚洲欧美成人一区| 久久国产综合精品| 久久久不卡网国产精品一区| 国产成人免费9x9x人网站视频| 国产精品天天摸av网| av激情亚洲男人天堂| 亚洲精品乱码久久久久久久久| 91久久精品一区二区三| 午夜成人在线视频| 精品久久久久久综合日本欧美| 国产福利精品一区二区| 亚洲品质自拍视频网站| 欧美日韩亚洲另类| 激情深爱一区二区| 国产精品午夜春色av| 色诱亚洲精品久久久久久| 亚洲v中文字幕| 精品成人在线观看| 欧美高清在线视频| 国产成人av资源| 亚洲精选在线视频| 日韩欧美国产一区在线观看| 国产综合久久久久影院| 中文字幕五月欧美| 欧美老肥妇做.爰bbww视频|