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

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

?? ex8.c

?? 一個用來實現偏微分方程中網格的計算庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: ex8.C 2966 2008-08-10 14:28:13Z woutruijter $ *//* The Next Great Finite Element Library. *//* Copyright (C) 2003  Benjamin S. Kirk *//* This library is free software; you can redistribute it and/or *//* modify it under the terms of the GNU Lesser General Public *//* License as published by the Free Software Foundation; either *//* version 2.1 of the License, or (at your option) any later version. *//* This library is distributed in the hope that it will be useful, *//* but WITHOUT ANY WARRANTY; without even the implied warranty of *//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU *//* Lesser General Public License for more details. *//* You should have received a copy of the GNU Lesser General Public *//* License along with this library; if not, write to the Free Software *//* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */ // <h1>Example 8 - The Wave Equation</h1> // // This is the eighth example program. It builds on // the previous example programs.  It introduces the // NewmarkSystem class.  In this example the wave equation // is solved using the time integration scheme provided // by the NewmarkSystem class. // // This example comes with a cylindrical mesh given in the // universal file pipe-mesh.unv. // The mesh contains HEX8 and PRISM6 elements.// C++ include files that we need#include <iostream>#include <fstream>#include <algorithm>#include <stdio.h>#include <math.h>// Basic include file needed for the mesh functionality.#include "libmesh.h"#include "mesh.h"#include "gmv_io.h"#include "vtk_io.h"#include "newmark_system.h"#include "equation_systems.h"// Define the Finite Element object.#include "fe.h"// Define Gauss quadrature rules.#include "quadrature_gauss.h"// Define useful datatypes for finite element#include "dense_matrix.h"#include "dense_vector.h"// Define matrix and vector data types for the global // equation system.  These are base classes,// from which specific implementations, like// the PETSc or LASPACK implementations, are derived.#include "sparse_matrix.h"#include "numeric_vector.h"// Define the DofMap, which handles degree of freedom// indexing.#include "dof_map.h"// The definition of a vertex associated with a Mesh.#include "node.h"// The definition of a geometric element#include "elem.h"// Defines the MeshData class, which allows you to store// data about the mesh when reading in files, etc.#include "mesh_data.h"// Function prototype.  This is the function that will assemble// the linear system for our problem, governed by the linear// wave equation.void assemble_wave(EquationSystems& es,                   const std::string& system_name);// Function Prototype.  This function will be used to apply the// initial conditions.void apply_initial(EquationSystems& es,                   const std::string& system_name);// Function Prototype.  This function imposes// Dirichlet Boundary conditions via the penalty// method after the system is assembled.void fill_dirichlet_bc(EquationSystems& es,                       const std::string& system_name);// The main programint main (int argc, char** argv){  // Initialize Petsc, like in example 2.  LibMeshInit init (argc, argv);#ifdef ENABLE_PARMESH  if (libMesh::processor_id() == 0)    std::cerr << "ERROR: This example directly references\n"              << "all mesh nodes and is incompatible with"              << "ParallelMesh use."              << std::endl;#else  // Check for proper usage.  if (argc < 2)    {      if (libMesh::processor_id() == 0)        std::cerr << "Usage: " << argv[0] << " [meshfile]"                  << std::endl;            libmesh_error();    }    // Tell the user what we are doing.  else     {      std::cout << "Running " << argv[0];            for (int i=1; i<argc; i++)        std::cout << " " << argv[i];            std::cout << std::endl << std::endl;    }  // LasPack solvers don't work so well for this example  // (not sure why).  Print a warning to the user if PETSc  // is not available, or if they are using LasPack solvers.#ifdef HAVE_PETSC  if ((libMesh::on_command_line("--use-laspack")) ||      (libMesh::on_command_line("--disable-petsc")))#endif    {      std::cout << "WARNING! It appears you are using the\n"                << "LasPack solvers.  ex8 is known not to converge\n"                << "using LasPack, but should work OK with PETSc.\n"                << "If possible, download and install the PETSc\n"                << "library from www-unix.mcs.anl.gov/petsc/petsc-2/\n"                << std::endl;    }    // Get the name of the mesh file  // from the command line.  std::string mesh_file = argv[1];  std::cout << "Mesh file is: " << mesh_file << std::endl;  // For now, restrict to dim=3, though this  // may easily be changed, see example 4  const unsigned int dim = 3;  // Create a dim-dimensional mesh.  Mesh mesh (dim);  MeshData mesh_data(mesh);    // Read the meshfile specified in the command line or  // use the internal mesh generator to create a uniform  // grid on an elongated cube.  mesh.read(mesh_file, &mesh_data);     // mesh.build_cube (10, 10, 40,  //                       -1., 1.,  //                       -1., 1.,  //                        0., 4.,  //                        HEX8);  // Print information about the mesh to the screen.  mesh.print_info();  // The node that should be monitored.  const unsigned int result_node = 274;    // Time stepping issues  //  // Note that the total current time is stored as a parameter  // in the \pEquationSystems object.  //  // the time step size  const Real delta_t = .0000625;  // The number of time steps.  unsigned int n_time_steps = 300;    // Create an equation systems object.  EquationSystems equation_systems (mesh);  // Declare the system and its variables.  // Create a NewmarkSystem named "Wave"  equation_systems.add_system<NewmarkSystem> ("Wave");  // Use a handy reference to this system  NewmarkSystem & t_system = equation_systems.get_system<NewmarkSystem> ("Wave");    // Add the variable "p" to "Wave".   "p"  // will be approximated using first-order approximation.  t_system.add_variable("p", FIRST);  // Give the system a pointer to the matrix assembly  // function and the initial condition function defined  // below.  t_system.attach_assemble_function  (assemble_wave);  t_system.attach_init_function      (apply_initial);  // Set the time step size, and optionally the  // Newmark parameters, so that \p NewmarkSystem can   // compute integration constants.  Here we simply use   // pass only the time step and use default values   // for \p alpha=.25  and \p delta=.5.  t_system.set_newmark_parameters(delta_t);  // Set the speed of sound and fluid density  // as \p EquationSystems parameter,  // so that \p assemble_wave() can access it.  equation_systems.parameters.set<Real>("speed")          = 1000.;  equation_systems.parameters.set<Real>("fluid density")  = 1000.;  // Store the current time as an  // \p EquationSystems parameter, so that  // \p fill_dirichlet_bc() can access it.  equation_systems.parameters.set<Real>("time")           = 0.;  // Initialize the data structures for the equation system.  equation_systems.init();  // Prints information about the system to the screen.  equation_systems.print_info();  // A file to store the results at certain nodes.  std::ofstream res_out("pressure_node.res");  // get the dof_numbers for the nodes that  // should be monitored.  const unsigned int res_node_no = result_node;  const Node& res_node = mesh.node(res_node_no-1);  unsigned int dof_no = res_node.dof_number(0,0,0);  // Assemble the time independent system matrices and rhs.  // This function will also compute the effective system matrix  // K~=K+a_0*M+a_1*C and apply user specified initial  // conditions.   t_system.assemble();  // Now solve for each time step.  // For convenience, use a local buffer of the   // current time.  But once this time is updated,  // also update the \p EquationSystems parameter  // Start with t_time = 0 and write a short header  // to the nodal result file  Real t_time = 0.;  res_out << "# pressure at node " << res_node_no << "\n"          << "# time\tpressure\n"          << t_time << "\t" << 0 << std::endl;  for (unsigned int time_step=0; time_step<n_time_steps; time_step++)    {      // Update the time.  Both here and in the      // \p EquationSystems object      t_time += delta_t;      equation_systems.parameters.set<Real>("time")  = t_time;      // Update the rhs.      t_system.update_rhs();      // Impose essential boundary conditions.      // Not that since the matrix is only assembled once,      // the penalty parameter should be added to the matrix      // only in the first time step.  The applied      // boundary conditions may be time-dependent and hence      // the rhs vector is considered in each time step.       if (time_step == 0)        {          // The local function \p fill_dirichlet_bc()          // may also set Dirichlet boundary conditions for the          // matrix.  When you set the flag as shown below,          // the flag will return true.  If you want it to return          // false, simply do not set it.          equation_systems.parameters.set<bool>("Newmark set BC for Matrix") = true;          fill_dirichlet_bc(equation_systems, "Wave");          // unset the flag, so that it returns false          equation_systems.parameters.set<bool>("Newmark set BC for Matrix") = false;        }      else        fill_dirichlet_bc(equation_systems, "Wave");      // Solve the system "Wave".      t_system.solve();      // After solving the system, write the solution      // to a GMV-formatted plot file.      // Do only for a few time steps.      if (time_step == 30 || time_step == 60 ||          time_step == 90 || time_step == 120 )        {          char buf[14];		  if (!libMesh::on_command_line("--vtk")){			  sprintf (buf, "out.%03d.gmv", time_step);	          GMVIO(mesh).write_equation_systems (buf,equation_systems);		  }else{			  // VTK viewers are generally not happy with two dots in a filename			  sprintf (buf, "out_%03d.pvtu", time_step);	          VTKIO(mesh).write_equation_systems (buf,equation_systems);		  }        }      // Update the p, v and a.      t_system.update_u_v_a();      // dof_no may not be local in parallel runs, so we may need a      // global displacement vector      NumericVector<Number> &displacement        = t_system.get_vector("displacement");      std::vector<Number> global_displacement(displacement.size());      displacement.localize(global_displacement);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美日韩一区二区| 91麻豆自制传媒国产之光| 国内外成人在线视频| 不卡区在线中文字幕| 欧美精品日韩精品| 国产亚洲精品福利| 日韩精品高清不卡| 一本色道久久综合亚洲91| 久久日韩精品一区二区五区| 亚洲国产精品麻豆| 9色porny自拍视频一区二区| 精品sm捆绑视频| 日韩av一区二区在线影视| 91美女蜜桃在线| 国产精品理论片在线观看| 久久99日本精品| 91精品国产美女浴室洗澡无遮挡| 中文字幕制服丝袜一区二区三区| 久久精品国产一区二区三区免费看 | 国产精品卡一卡二| 精品系列免费在线观看| 777a∨成人精品桃花网| 亚洲成人你懂的| 欧美天天综合网| 亚洲欧美另类在线| 91在线观看地址| 国产精品国产三级国产aⅴ中文 | 国产成人免费视频一区| 日韩欧美激情在线| 奇米色777欧美一区二区| 精品污污网站免费看| 亚洲免费av高清| 91黄色免费网站| 亚洲在线视频一区| 欧美吞精做爰啪啪高潮| 亚洲一区国产视频| 欧美午夜理伦三级在线观看| 午夜婷婷国产麻豆精品| 欧美日韩精品一区二区三区蜜桃 | 99久久精品国产观看| 国产精品护士白丝一区av| www.日韩在线| 夜夜揉揉日日人人青青一国产精品 | 欧美日韩一级二级| 婷婷中文字幕综合| 日韩一二三区视频| 国内国产精品久久| 中文字幕一区二区三| 91麻豆福利精品推荐| 亚洲国产成人av| 欧美一区二区在线不卡| 美国av一区二区| 国产日韩欧美麻豆| 色88888久久久久久影院按摩| 亚洲图片欧美色图| 日韩欧美一区二区三区在线| 国产精品一二三区| 亚洲欧美一区二区久久| 欧美另类videos死尸| 久久成人18免费观看| 中文字幕乱码亚洲精品一区| 色婷婷精品大视频在线蜜桃视频 | 亚洲精品综合在线| 欧美精品久久天天躁| 国产呦萝稀缺另类资源| 亚洲美女偷拍久久| 欧美一级专区免费大片| 99精品视频在线观看| 婷婷开心激情综合| 中文字幕第一区综合| 欧美日韩大陆一区二区| 福利91精品一区二区三区| 亚洲一区二区三区精品在线| 国产性做久久久久久| 欧美综合一区二区| 懂色av噜噜一区二区三区av| 午夜精品福利一区二区三区av | 国产一区二区三区高清播放| 尤物视频一区二区| 国产清纯在线一区二区www| 欧美午夜精品一区| 不卡av在线网| 久久99热99| 午夜影视日本亚洲欧洲精品| 亚洲国产精品激情在线观看| 日韩一区二区三| 欧洲av在线精品| av成人免费在线观看| 精久久久久久久久久久| 石原莉奈一区二区三区在线观看| 国产精品灌醉下药二区| 精品国内片67194| 正在播放一区二区| 91久久精品网| 91在线云播放| 成人丝袜高跟foot| 国产精品综合一区二区三区| 奇米777欧美一区二区| 亚洲成人免费影院| 亚洲欧美日韩一区二区三区在线观看| 精品国产91乱码一区二区三区| 精品视频全国免费看| 在线观看91视频| 色天天综合色天天久久| 99视频有精品| 99麻豆久久久国产精品免费优播| 国产精品自产自拍| 国产精品一二三四五| 国产一区二区三区四| 久久99国产精品免费网站| 美女一区二区视频| 精品夜夜嗨av一区二区三区| 美女视频黄久久| 久久se精品一区二区| 日本不卡的三区四区五区| 日韩成人一区二区三区在线观看| 亚洲.国产.中文慕字在线| 日韩中文字幕1| 青青草97国产精品免费观看| 青草国产精品久久久久久| 久久av资源站| 国产乱妇无码大片在线观看| 粉嫩av一区二区三区在线播放| 成人18精品视频| 91免费观看视频在线| 日本国产一区二区| 欧美妇女性影城| 精品乱人伦一区二区三区| 久久亚洲综合色一区二区三区 | 国产ts人妖一区二区| 不卡一区中文字幕| 色欧美片视频在线观看| 欧美精品vⅰdeose4hd| 精品久久国产字幕高潮| 国产欧美日韩亚州综合| 亚洲精品大片www| 天堂久久久久va久久久久| av不卡免费电影| 一区二区三区在线免费视频| 亚洲色图都市小说| 亚洲午夜久久久久久久久久久| 日韩精品国产欧美| 国产69精品久久久久777| www.日韩精品| 制服丝袜亚洲播放| 欧美国产在线观看| 亚洲福中文字幕伊人影院| 精品一区二区三区影院在线午夜 | 成人精品免费看| 91福利社在线观看| 2019国产精品| 亚洲欧美一区二区久久| 久久99热国产| 日本久久一区二区三区| 日韩女优电影在线观看| 亚洲私人影院在线观看| 蜜臀久久久99精品久久久久久| 成人国产精品免费网站| 欧美日韩黄色一区二区| 欧美国产一区视频在线观看| 日韩精彩视频在线观看| 成人av在线网| 2021久久国产精品不只是精品| 亚洲国产综合在线| 岛国av在线一区| 日韩免费电影一区| 亚洲午夜精品久久久久久久久| 国产一区二区视频在线播放| 欧美日韩中文字幕精品| 国产女人aaa级久久久级| 视频一区欧美精品| 色婷婷久久久综合中文字幕| 欧美激情资源网| 麻豆精品视频在线观看免费| 欧美少妇xxx| **欧美大码日韩| 国产精品99久久久久久有的能看| 欧美精品日韩综合在线| 亚洲自拍都市欧美小说| 成人动漫视频在线| 久久久久久**毛片大全| 免费在线观看日韩欧美| 欧美三电影在线| 一区二区三区不卡视频在线观看 | 中文字幕免费不卡| 国内欧美视频一区二区| 欧美大黄免费观看| 日韩**一区毛片| 欧美日本高清视频在线观看| 亚洲激情欧美激情| 91色porny蝌蚪| 国产精品三级av| 国产电影一区二区三区| 久久综合99re88久久爱| 紧缚奴在线一区二区三区| 精品国产一区二区亚洲人成毛片| 欧美aⅴ一区二区三区视频| 91麻豆精品91久久久久同性| 天堂蜜桃91精品| 欧美一区二区三区精品|