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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ex8.c

?? 一個用來實(shí)現(xiàn)偏微分方程中網(wǎng)格的計算庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
      // Write nodal results to file.  The results can then      // be viewed with e.g. gnuplot (run gnuplot and type      // 'plot "pressure_node.res" with lines' in the command line)      res_out << t_time << "\t"              << global_displacement[dof_no]              << std::endl;    }#endif    // All done.    return 0;}// This function assembles the system matrix and right-hand-side// for our wave equation.void assemble_wave(EquationSystems& es,                   const std::string& system_name){    // It is a good idea to make sure we are assembling  // the proper system.  libmesh_assert (system_name == "Wave");  // Get a constant reference to the mesh object.  const MeshBase& mesh = es.get_mesh();  // The dimension that we are running.  const unsigned int dim = mesh.mesh_dimension();  // Copy the speed of sound and fluid density  // to a local variable.  const Real speed = es.parameters.get<Real>("speed");  const Real rho   = es.parameters.get<Real>("fluid density");  // Get a reference to our system, as before.  NewmarkSystem & t_system = es.get_system<NewmarkSystem> (system_name);  // Get a constant reference to the Finite Element type  // for the first (and only) variable in the system.  FEType fe_type = t_system.get_dof_map().variable_type(0);  // In here, we will add the element matrices to the  // @e additional matrices "stiffness_mass" and "damping"  // and the additional vector "force", not to the members   // "matrix" and "rhs".  Therefore, get writable  // references to them.  SparseMatrix<Number>&   stiffness = t_system.get_matrix("stiffness");  SparseMatrix<Number>&   damping   = t_system.get_matrix("damping");  SparseMatrix<Number>&   mass      = t_system.get_matrix("mass");  NumericVector<Number>&  force     = t_system.get_vector("force");  // Some solver packages (PETSc) are especially picky about  // allocating sparsity structure and truly assigning values  // to this structure.  Namely, matrix additions, as performed  // later, exhibit acceptable performance only for identical  // sparsity structures.  Therefore, explicitly zero the  // values in the collective matrix, so that matrix additions  // encounter identical sparsity structures.  SparseMatrix<Number>&  matrix     = *t_system.matrix;  DenseMatrix<Number>    zero_matrix;  // 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 2nd order Gauss quadrature rule for numerical integration.  QGauss qrule (dim, SECOND);  // Tell the finite element object to use our quadrature rule.  fe->attach_quadrature_rule (&qrule);  // The element Jacobian * quadrature weight at each integration point.     const std::vector<Real>& JxW = fe->get_JxW();  // 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();  // A reference to the \p DofMap object for this system.  The \p DofMap  // object handles the index translation from node and element numbers  // to degree of freedom numbers.  const DofMap& dof_map = t_system.get_dof_map();  // The element mass, damping and stiffness matrices  // and the element contribution to the rhs.  DenseMatrix<Number>   Ke, Ce, Me;  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.//   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();    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 matrices and rhs 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 HEX8      // and now have a PRISM6).      {        const unsigned int n_dof_indices = dof_indices.size();        Ke.resize          (n_dof_indices, n_dof_indices);        Ce.resize          (n_dof_indices, n_dof_indices);        Me.resize          (n_dof_indices, n_dof_indices);        zero_matrix.resize (n_dof_indices, n_dof_indices);        Fe.resize          (n_dof_indices);      }      // 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]);                Me(i,j) += JxW[qp]*phi[i][qp]*phi[j][qp]                           *1./(speed*speed);              } // end of the matrix summation loop                  } // end of quadrature point loop      // Now compute the contribution to the element matrix and the      // right-hand-side vector if the current element lies on the      // boundary.       {        // In this example no natural boundary conditions will        // be considered.  The code is left here so it can easily        // be extended.        //         // don't do this for any side        for (unsigned int side=0; side<elem->n_sides(); side++)          if (!true)            // if (elem->neighbor(side) == NULL)            {              // 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, SECOND);                            // Tell the finte element object to use our              // quadrature rule.              fe_face->attach_quadrature_rule (&qface);                            // 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();                            // Compute the shape function values on the element              // face.              fe_face->reinit(elem, side);              // Here we consider a normal acceleration acc_n=1 applied to              // the whole boundary of our mesh.              const Real acc_n_value = 1.0;                            // Loop over the face quadrature points for integration.              for (unsigned int qp=0; qp<qface.n_points(); qp++)                {                  // Right-hand-side contribution due to prescribed                  // normal acceleration.                  for (unsigned int i=0; i<phi_face.size(); i++)                    {                      Fe(i) += acc_n_value*rho                        *phi_face[i][qp]*JxW_face[qp];                    }                } // end face quadrature point loop                      } // end if (elem->neighbor(side) == NULL)                // In this example the Dirichlet boundary conditions will be         // imposed via panalty method after the        // system is assembled.              } // end boundary condition section                // Finally, simply add the contributions to the additional      // matrices and vector.      stiffness.add_matrix (Ke, dof_indices);      damping.add_matrix   (Ce, dof_indices);      mass.add_matrix      (Me, dof_indices);            force.add_vector     (Fe, dof_indices);          // For the overall matrix, explicitly zero the entries where      // we added values in the other ones, so that we have       // identical sparsity footprints.      matrix.add_matrix(zero_matrix, dof_indices);        } // end of element loop    // All done!  return;}// This function applies the initial conditionsvoid apply_initial(EquationSystems& es,                   const std::string& system_name){  // Get a reference to our system, as before  NewmarkSystem & t_system = es.get_system<NewmarkSystem> (system_name);    // Numeric vectors for the pressure, velocity and acceleration  // values.  NumericVector<Number>&  pres_vec       = t_system.get_vector("displacement");  NumericVector<Number>&  vel_vec        = t_system.get_vector("velocity");  NumericVector<Number>&  acc_vec        = t_system.get_vector("acceleration");  // Assume our fluid to be at rest, which would  // also be the default conditions in class NewmarkSystem,  // but let us do it explicetly here.  pres_vec.zero();  vel_vec.zero();  acc_vec.zero();}// This function applies the Dirichlet boundary conditionsvoid fill_dirichlet_bc(EquationSystems& es,                       const std::string& system_name){  // It is a good idea to make sure we are assembling  // the proper system.  libmesh_assert (system_name == "Wave");  // Get a reference to our system, as before.  NewmarkSystem & t_system = es.get_system<NewmarkSystem> (system_name);  // Get writable references to the overall matrix and vector.  SparseMatrix<Number>&  matrix = *t_system.matrix;  NumericVector<Number>& rhs    = *t_system.rhs;  // Get a constant reference to the mesh object.  const MeshBase& mesh = es.get_mesh();  // Get \p libMesh's  \f$ \pi \f$  const Real pi = libMesh::pi;  // Ask the \p EquationSystems flag whether  // we should do this also for the matrix  const bool do_for_matrix =    es.parameters.get<bool>("Newmark set BC for Matrix");  // Ge the current time from \p EquationSystems  const Real current_time = es.parameters.get<Real>("time");  // Number of nodes in the mesh.  unsigned int n_nodes = mesh.n_nodes();  for (unsigned int n_cnt=0; n_cnt<n_nodes; n_cnt++)    {      // Get a reference to the current node.      const Node& curr_node = mesh.node(n_cnt);      // Check if Dirichlet BCs should be applied to this node.      // Use the \p TOLERANCE from \p mesh_common.h as tolerance.      // Here a pressure value is applied if the z-coord.      // is equal to 4, which corresponds to one end of the      // pipe-mesh in this directory.      const Real z_coo = 4.;      if (fabs(curr_node(2)-z_coo) < TOLERANCE)        {          // The global number of the respective degree of freedom.          unsigned int dn = curr_node.dof_number(0,0,0);          // The penalty parameter.          const Real penalty = 1.e10;          // Here we apply sinusoidal pressure values for 0<t<0.002          // at one end of the pipe-mesh.          Real p_value;          if (current_time < .002 )            p_value = sin(2*pi*current_time/.002);          else            p_value = .0;          // Now add the contributions to the matrix and the rhs.          rhs.add(dn, p_value*penalty);          // Add the panalty parameter to the global matrix          // if desired.          if (do_for_matrix)            matrix.add(dn, dn, penalty);        }    } // loop n_cnt}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av亚洲精华国产精华精| 蜜臀av亚洲一区中文字幕| 99国产精品久| 亚洲欧美在线视频| 99re66热这里只有精品3直播| 亚洲女人的天堂| 欧美日韩精品免费观看视频 | 欧美精品色综合| 丝袜美腿成人在线| 欧美xingq一区二区| 国产黄人亚洲片| 亚洲精品国产a| 91精品久久久久久蜜臀| 国产精品资源在线看| 成人欧美一区二区三区在线播放| 91久久一区二区| 看电影不卡的网站| 欧美高清在线一区| 欧美三级韩国三级日本三斤| 久久精品国内一区二区三区| 国产精品美女视频| 7777精品伊人久久久大香线蕉的| 国产美女精品人人做人人爽 | 欧美午夜精品久久久久久孕妇| 亚洲va国产va欧美va观看| 精品久久久久久久久久久久久久久| 成人一二三区视频| 性做久久久久久免费观看欧美| 精品少妇一区二区三区视频免付费 | 欧美变态口味重另类| a4yy欧美一区二区三区| 秋霞国产午夜精品免费视频| 国产精品免费网站在线观看| 7777精品伊人久久久大香线蕉 | 亚洲免费高清视频在线| 欧美欧美午夜aⅴ在线观看| 国产精品小仙女| 午夜精品爽啪视频| 中文字幕在线不卡视频| 日韩一区二区在线看片| 欧美丰满少妇xxxxx高潮对白| 国产一区二区三区久久久| 亚洲午夜日本在线观看| 久久久久久久久久电影| 在线播放91灌醉迷j高跟美女 | 久久精品亚洲国产奇米99| 欧美网站大全在线观看| 成人激情图片网| 精品一区二区在线看| 亚洲第一激情av| 国产精品不卡一区| 久久精品人人爽人人爽| 日韩视频国产视频| 欧美日韩久久一区二区| a级高清视频欧美日韩| 国产一区二区三区四区在线观看| 亚洲123区在线观看| 一区二区三区国产精华| 亚洲国产成人自拍| 久久伊人中文字幕| 日韩欧美久久久| 91精品婷婷国产综合久久| 色悠悠久久综合| av在线播放不卡| 成人综合日日夜夜| 国产成人av电影| 国产精品综合av一区二区国产馆| 麻豆成人综合网| 六月婷婷色综合| 男男gaygay亚洲| 日本大胆欧美人术艺术动态 | 精品国产乱码91久久久久久网站| 欧美日韩高清在线播放| 欧洲av在线精品| 欧美色图免费看| 欧美精品免费视频| 欧美精品99久久久**| 欧美精品久久天天躁| 欧美日韩中字一区| 在线播放91灌醉迷j高跟美女| 欧美军同video69gay| 9191成人精品久久| 日韩欧美一级二级| 久久网这里都是精品| 久久久蜜桃精品| 国产精品毛片高清在线完整版 | 色婷婷综合在线| 欧美亚洲禁片免费| 91精品久久久久久久久99蜜臂| 欧美一卡二卡在线| 久久婷婷综合激情| 中文欧美字幕免费| 一区二区三区鲁丝不卡| 五月婷婷久久丁香| 久久99久久久久| 色综合咪咪久久| 欧美美女bb生活片| 精品国产一区二区三区久久影院| 久久久久国产精品人| 成人免费小视频| 亚洲国产毛片aaaaa无费看| 免费观看在线综合| 国产91丝袜在线播放九色| 一本色道久久综合狠狠躁的推荐| 欧美亚洲免费在线一区| 欧美va亚洲va在线观看蝴蝶网| 久久久久久久久久电影| 一区二区三区不卡在线观看| 奇米影视一区二区三区小说| 国产成人精品三级| 欧美性一区二区| 欧美精品一区二区三区四区| 亚洲裸体xxx| 毛片基地黄久久久久久天堂| av网站一区二区三区| 欧美美女喷水视频| 国产清纯美女被跳蛋高潮一区二区久久w | 一区二区三区**美女毛片| 蜜乳av一区二区三区| 99热精品一区二区| 日韩一区二区免费在线观看| 国产精品免费观看视频| 日韩成人午夜精品| 成人激情开心网| 91精品国产综合久久精品| 国产精品国产三级国产普通话蜜臀| 午夜精品久久久| 99riav久久精品riav| 欧美xingq一区二区| 亚洲一区二区三区不卡国产欧美| 韩国av一区二区三区在线观看 | 欧美偷拍一区二区| 国产欧美日韩亚州综合| 日韩精品电影一区亚洲| 色婷婷国产精品| 国产人伦精品一区二区| 天堂久久久久va久久久久| www.色精品| 国产午夜精品美女毛片视频| 免费观看成人av| 这里只有精品99re| 一区二区三区蜜桃| 99视频一区二区三区| 久久精品人人做人人综合 | 日韩你懂的在线观看| 一区二区三区精品视频| gogogo免费视频观看亚洲一| www国产亚洲精品久久麻豆| 日韩激情中文字幕| 欧美在线观看18| 亚洲啪啪综合av一区二区三区| 国产69精品一区二区亚洲孕妇| 26uuu国产日韩综合| 美女性感视频久久| 欧美一级片在线观看| 舔着乳尖日韩一区| 欧美日韩免费在线视频| 一区二区三区日韩| 91黄色激情网站| 亚洲免费av观看| 色综合久久久久综合体 | 一区二区日韩av| 91网站视频在线观看| 日韩伦理av电影| 97久久精品人人澡人人爽| 日韩电影免费在线看| 欧美专区日韩专区| 亚洲一区二区三区中文字幕 | 欧美一区二区在线免费观看| 偷偷要91色婷婷| 91精品国产色综合久久不卡电影 | 在线成人免费观看| 图片区小说区国产精品视频| 欧美精品乱码久久久久久| 日本午夜精品一区二区三区电影 | 欧洲精品视频在线观看| 亚洲国产精品精华液网站| 欧美女孩性生活视频| 奇米综合一区二区三区精品视频 | 国产精品一区二区免费不卡 | 国产精品美女久久久久高潮| 99久久久无码国产精品| 一区二区三区欧美久久| 精品婷婷伊人一区三区三| 日韩成人一区二区三区在线观看| 欧美成人午夜电影| 国产成人久久精品77777最新版本| 国产午夜精品一区二区 | 国产一区二区在线视频| 日本一区二区在线不卡| 色婷婷av一区| 日本女优在线视频一区二区| 久久综合精品国产一区二区三区| 国产成人久久精品77777最新版本| 一区二区中文字幕在线| 欧美日韩国产高清一区二区三区| 麻豆精品精品国产自在97香蕉| 国产亚洲欧洲997久久综合| 91麻豆精品一区二区三区| 视频一区二区三区入口|