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

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

?? ptfsf-demo.c

?? The code assumes a two-dimensional computational domain with TMz polarization (i.e., non-zero field
?? C
字號:
/*       * ptfsf-demo: a bare-bones 2D code which demonstrates use of the ptfsf code. * *     The field at four observations points is recorded to a file. *     (If the wrtraw package is installed and used, dumps of the entire *     computational domain are made periodically and these can be used *     to make 2D color maps of the field.) * * Copyright (C) 2004 John B. Schneider * * This code uses the FFTw routines for the Fourier transforms.  See * www.fftw.org for that code if you wish to use that code too. * Otherwise you will have to replace the calls to the FFTw routines * to some other discrete Fourier transform routines. * * To compile this code, you would use something such as: * *  gcc -Wall -O2 -c ptfsf.c  *  gcc -Wall -O2 ptfsf-demo.c -o ptfsf-demo ptfsf.o\ *         -lm -lfftw3 -lfftw3_threads -lpthread  * * For the GNU C compiler the "-Wall" flag turns on all warnings * (always a good idea) and "-O2" gives second-level optimization. * You must ensure the included header files are on the search path. * If you do not want to use the threaded version of FFTw, you may * remove those calls (see the FFTw documentation) and then there is * no need to link to the pthread library (which may not be installed * on some systems). * * If you want timing data reported, add the -DTIMING directive to the * second compile command. * * I have written a suite or routines to generate color-mapped images * of fields.  Part of that suite is the wrtraw function.  Since I'm * not including that here (contact me if you want it), there is a * WRTRAW compiler directive which, if unset, removes all the wrtraw * stuff.  So, you can safely ignore that directive. * ********************************************************************* * This program is free software; you can redistribute it and/or     * * modify it under the terms of the GNU General Public License       * * as published by the Free Software Foundation (FSF) version 2      * * of the License.                                                   * *                                                                   * * This program 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 General Public License for more details.                      * *                                                                   * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software       * * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA         * * 02111-1307, USA.  You may also visit the FSF web site at          * * www.fsf.org.  The license under which this software is publish    * * is available from www.fsf.org/copyleft/gpl.html or                * * www.fsf.org/copyleft/gpl.txt.                                     * ********************************************************************* */ #include <stdio.h>#include <math.h>#include <stdlib.h>#include "ptfsf.h"/* Timing stuff. */#ifdef TIMING  #include <sys/time.h>  #include <sys/resource.h>#endif/* wrtraw stuff */#ifdef WRTRAW#include "wrtraw.h"#endif/* Size of computational domain. */#define LIMX 141#define LIMY 141/* Macros for allocating and accessing arrays */#define Ez(I,J) ez[(I)*(LIMY)+(J)]#define Hx(I,J) hx[(I)*(LIMY-1)+(J)]#define Hy(I,J) hy[(I)*(LIMY)+(J)]#define ALLOC_2D(name,nx,ny,type) { \ name = (type *)calloc((nx)*(ny),sizeof(type)); \ if (!name) { perror("ALLOC_2D"); \              fprintf(stderr,"Allocation failed for " #name "\n"); \              exit(-1); \             }; \ }/* The ptfsf_init() function is passed a time-series function * that takes a single argument (the time step) and returns a double * (the incident field at that time step).  I usually use a Ricker * wavelet function with three arguments: the time-step, the Courant * number, and the points per wavelength at the most energetic * frequency.  To use the usual Ricker function, we pass * ptfsf_init() a wrapper which only has one argument and then * calls the usual Ricker routine with the missing arguments supplied. */double ricker_wrapper(double ntime);double ricker(double time, double cdtds, double ppw);/* global variables -- for the sake of getting the wrapper to work. */double cdtds, // Courant number  ppw;        // points per wavelength at most energetic frequencyint main(){  const double eta=376.7303662;  /* Electric and magnetic fields.  The array memory is allocated as a   * large one-dimensional block, but these arrays are treated as   * two-dimensional things via the macros given above.   */  double *ez, *hx, *hy;  double phi,     // incident angle [degrees]    dteta, doeta; // update equation coefficients  int idum, jdum, // spatial indices (dummy indices)    nend_tfsf,    // time at which incident field assumed to go to zero    nend_total,   // total length of simulation    ntime,        // temporal step    x_ll, y_ll,   // lower-left corner of TFSF region    x_ur, y_ur,   // upper-right corner of TFSF region    x_ref, y_ref; // reference point where incident time series exists  /* observation-point stuff  */  char filnam[80];  FILE *obs_point;  /* wrtraw stuff */#ifdef WRTRAW  img_sequence *images=NULL;  char *basename = "junk";#endif  /* timing stuff */#ifdef TIMING  int old_seconds, old_useconds;    struct rusage tp;#endif  /* Allocate and initialize fields arrays. */  ALLOC_2D(ez,LIMX,LIMY,double);  ALLOC_2D(hx,LIMX,LIMY-1,double);  ALLOC_2D(hy,LIMX-1,LIMY,double);#ifdef WRTRAW  images = wrtraw_open2d(0,LIMX-1,1,			 0,LIMY-1,1,			 LIMX,LIMY,			 basename,ez);  images->verbose = WRTRAW_MAX_INFO;#endif  /* Get user-settable parameters. */  printf("Size of computational domain: %d x %d\n",LIMX,LIMY);  printf("Enter indices for lower-left corner of TF/SF region: ");  scanf("%d %d",&x_ll,&y_ll);  printf("Enter indices for upper-right corner of TF/SF region: ");  scanf("%d %d",&x_ur,&y_ur);  printf("Enter indices for reference point where incident time series\n"	 "  assumed to be given (should be on or in TFSF boundary): ");  scanf("%d %d",&x_ref,&y_ref);  printf("Enter number of time steps overall: ");  scanf("%d",&nend_total);  printf("Enter time step when the TFSF turns off, i.e., the time step\n"	 "  at which the incident field is essentially zero over the TFSF\n"	 "  boundary (should be no larger than %d): ",nend_total);  scanf("%d",&nend_tfsf);  printf("Enter the points per wavelength at peak of Ricker spectrum: ");  scanf("%lf",&ppw);  printf("Enter the incident angle (should be between 0 and 90) [degrees]: ");  scanf("%lf",&phi);  printf("Enter the output file name: ");  scanf("%s",filnam);  obs_point = fopen(filnam,"w");  if (obs_point == NULL) {    fprintf(stderr,	    "Observation point output file failed to open.  Terminating...\n");    exit(-1);  }  /*    * Calculate the needed constants.   * Courant number is set here.   */   cdtds  = 1.0/sqrt(3.0);  doeta  = cdtds/eta;  dteta  = cdtds*eta;      #ifdef TIMING  getrusage(0,&tp);  old_seconds = tp.ru_utime.tv_sec;  old_useconds = tp.ru_utime.tv_usec;#endif   /* Calculate the incident field using the "perfect" TFSF code. */  ptfsf_init(nend_tfsf,    x_ll,  y_ll,       // indices of lower-left corner of TF region    x_ur, y_ur,        // indices of upper-right corner of TF region    x_ref,  y_ref,     // indices of "reference" point    LIMX,  LIMY,       // size of computational domain    phi,               // incident angle [degrees]		          cdtds,             // Courant number    eta,               // characteristic impedance    ez,  hx,  hy,      // field arrays    ricker_wrapper,    // time-stepping function     PTFSF_PROGRESS | PTFSF_INFO | PTFSF_ESTIMATE // flags to control behavior   );#ifdef TIMING  getrusage(0,&tp);  printf("Calculation of incident field took %.3f seconds.\n",	 tp.ru_utime.tv_sec-old_seconds +	 (tp.ru_utime.tv_usec-old_useconds)/1.e6);#endif  printf("Electric field written for these points: "	 "(%d,%d), (%d,%d), (%d,%d)\n",	 x_ll,y_ll,	 (int)(x_ur+x_ll)/2,(int)(y_ur+y_ll)/2,x_ur,y_ur);  /* Do the time stepping. */  for (ntime=0; ntime<nend_total; ntime++) {    if (ntime%10 == 0)      printf("%d...\n",ntime);    /* Calculate electric field. */    for (idum=1; idum<LIMX-1; idum++)      for (jdum=1; jdum<LIMY-1; jdum++)	Ez(idum,jdum) +=	  + dteta*(Hy(idum,jdum)-Hy(idum-1,jdum)                   - (Hx(idum,jdum)-Hx(idum,jdum-1)));    /* Can uncomment the following to throw in a scatterer to make     * sure TFSF really transparent.     */    // idum = LIMX/2;    // for (jdum=y_ll+15; jdum<y_ur-15; jdum++)    //   Ez(idum,jdum) = 0.0;    /* Electric field is correct after this routines is called, i.e.,     * total field in the total-field region and scattered field in     * the scattered-field region.  HOWEVER, the magnetic field is     * not correct until after the magnetic fields have been     * updated.     */    ptfsf_update(ntime);    /* printf value at observations point to a file */    fprintf(obs_point,"%i %g %g %g %g\n",ntime,	    Ez(x_ll,y_ll),	    Ez((int)(x_ur+x_ll)/2,(int)(y_ur+y_ll)/2),	    Ez(x_ur,y_ur),	    Ez(x_ur+5,y_ur+5));    /* Calculate Hx. */    for(idum=0; idum<LIMX; idum++)      for(jdum=0; jdum<LIMY-1; jdum++)	Hx(idum,jdum) -= doeta*(Ez(idum,jdum+1)-Ez(idum,jdum));    /* Calculate Hy. */    for(idum=0; idum<LIMX-1; idum++)      for(jdum=0; jdum<LIMY; jdum++)	Hy(idum,jdum) += doeta*(Ez(idum+1,jdum)-Ez(idum,jdum));            /* generate the output image */#ifdef WRTRAW    if (ntime % 10 == 0)      wrtraw(images);#endif      }#ifdef TIMING  getrusage(0,&tp);  printf("Total run time: %.3f seconds.\n",	 tp.ru_utime.tv_sec + tp.ru_utime.tv_usec/1.e6);#endif  return 0;}/* ------------------------- end of main() --------------------------*//* ######################## ricker_wrapper() ####################### *//* A trivial wrapper to be able to call my usual ricker function with * a single argument. */double ricker_wrapper(double ntime) {  return ricker(ntime,cdtds,ppw);}/* ############################ ricker() ########################### *//* Ricker wavelet. */double ricker(double time,  // time step 	      double cdtds, // Courant number	      double ppw    // points/wavelength at most energetic frequency	      ) {  double arg,    arg_max = 70.0, // arguments beyond this value are assumed to yield zero                    //         this allows us to avoid calling exponential                    //         when result will be effectively zero    delay = 2.0;    // delay = multiple of inverse of most energetic frequency,                    //         i.e., multiple of period at that frequency  arg = pow(M_PI*((cdtds*time)/ppw - delay),2);  if (arg > arg_max) {    return 0.0;  } else {    return (1.0 - 2.0*arg) * exp(-arg);  }}/* ------------------------- end of ricker() ----------------------- */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美系列一区二区| 国产亚洲欧美日韩日本| 精品国产91亚洲一区二区三区婷婷| 欧美精品一区视频| 婷婷夜色潮精品综合在线| 粉嫩一区二区三区性色av| 91麻豆精品国产91久久久更新时间 | 日韩电影在线看| 成人爱爱电影网址| 久久一日本道色综合| 三级在线观看一区二区| 91色porny蝌蚪| 亚洲国产精品精华液2区45| 麻豆国产精品视频| 欧美精品xxxxbbbb| 一区二区三区产品免费精品久久75| 福利一区福利二区| 久久久久久久久伊人| 久久精品国产亚洲aⅴ| 欧美巨大另类极品videosbest| 亚洲精品欧美专区| 色综合一区二区| 亚洲三级小视频| 91丨porny丨首页| 国产精品久久久久久久久久久免费看| 国产麻豆视频一区| 17c精品麻豆一区二区免费| 国产成人免费视频网站高清观看视频 | 不卡一区二区中文字幕| 久久精品一二三| 国产精品一区二区男女羞羞无遮挡| 51午夜精品国产| 日韩二区三区四区| 日韩欧美国产高清| 国产一区二区福利| 国产午夜一区二区三区| 国产精品影视天天线| 国产日韩欧美综合一区| 国产成人免费9x9x人网站视频| 国产性天天综合网| 94-欧美-setu| 亚洲一区二区中文在线| 在线播放日韩导航| 韩国中文字幕2020精品| 国产女人18水真多18精品一级做| 国产不卡免费视频| 亚洲乱码国产乱码精品精98午夜 | 日本视频在线一区| 欧美mv日韩mv亚洲| 成人晚上爱看视频| 樱花影视一区二区| 欧美一级在线免费| 国产精品一二三四| 中文字幕字幕中文在线中不卡视频| 色综合久久六月婷婷中文字幕| 亚洲综合视频在线| 精品成人私密视频| 91免费看视频| 免费欧美日韩国产三级电影| 亚洲精品一区二区三区影院| av福利精品导航| 日韩高清中文字幕一区| 久久久久久久久久久久久夜| 色综合天天综合在线视频| 石原莉奈在线亚洲二区| 国产欧美一区二区精品性色超碰| 91在线porny国产在线看| 日韩国产欧美在线播放| 国产精品久久久久婷婷| 欧美精品乱码久久久久久按摩 | 香蕉成人伊视频在线观看| 日韩欧美视频一区| 91啪九色porn原创视频在线观看| 日本大胆欧美人术艺术动态| 中文字幕av资源一区| 欧美高清激情brazzers| 成人av动漫网站| 美国欧美日韩国产在线播放| 亚洲欧洲韩国日本视频| 欧美mv和日韩mv的网站| 色美美综合视频| 国产高清无密码一区二区三区| 夜夜爽夜夜爽精品视频| 久久精品一区二区三区不卡 | 国产亚洲成aⅴ人片在线观看| 在线观看www91| 国产成人精品影视| 麻豆久久久久久久| 亚洲va韩国va欧美va| 中文字幕日韩欧美一区二区三区| 欧美成人a∨高清免费观看| 日本电影亚洲天堂一区| 成人午夜激情影院| 久久 天天综合| 日韩精品1区2区3区| 亚洲综合小说图片| 亚洲人成7777| 国产精品久久久久桃色tv| 久久久噜噜噜久久中文字幕色伊伊| 91麻豆精品91久久久久久清纯| 99免费精品视频| 国产成人精品亚洲777人妖| 99久久精品免费看国产| 成人午夜av影视| 国产黄色精品视频| 激情五月播播久久久精品| 午夜精品视频一区| 午夜成人免费视频| 午夜在线成人av| 亚洲丶国产丶欧美一区二区三区| 亚洲欧美激情插 | 久久久久久久久蜜桃| 日韩精品一区在线观看| 日韩欧美成人午夜| 日韩欧美一级在线播放| 日韩欧美一区在线| 精品久久久影院| 精品国产一区二区三区久久久蜜月| 在线电影欧美成精品| 欧美精品免费视频| 欧美一区二区免费| 精品国产伦一区二区三区免费| 欧美精品一区二区三区久久久| 日韩免费一区二区| 久久久精品黄色| 国产精品三级视频| 亚洲精品视频在线| 性感美女极品91精品| 日韩精品一二三四| 久久99精品一区二区三区三区| 狠狠色丁香久久婷婷综合丁香| 九色|91porny| www.亚洲色图.com| 欧美无乱码久久久免费午夜一区| 在线成人小视频| 精品久久久久久亚洲综合网| 国产午夜一区二区三区| 国产激情一区二区三区桃花岛亚洲 | 国内精品免费**视频| 懂色av一区二区三区免费观看| 99re免费视频精品全部| 欧美日精品一区视频| 精品国产乱码91久久久久久网站| 国产午夜精品福利| 亚洲午夜免费视频| 久久se精品一区精品二区| 成人app在线观看| 欧美日韩激情一区二区| 久久精品人人做人人综合 | 日韩精品一区在线观看| 国产精品久久久久久久久免费相片| 亚洲精品国产精华液| 麻豆视频观看网址久久| 成人丝袜高跟foot| 91精品欧美综合在线观看最新| 国产午夜亚洲精品理论片色戒| 一卡二卡欧美日韩| 国产精品2024| 欧美日韩国产天堂| 中文字幕中文在线不卡住| 免费看欧美女人艹b| 9久草视频在线视频精品| 日韩一区二区高清| 伊人色综合久久天天| 国产美女视频一区| 欧美日韩精品综合在线| 中文字幕av一区二区三区高 | 玉足女爽爽91| 国产精品一二三四区| 欧美精品少妇一区二区三区| 中文字幕日韩精品一区| 国产一区二区免费看| 欧美日韩国产影片| 亚洲欧美日韩国产成人精品影院 | 久久九九国产精品| 日本va欧美va瓶| 在线观看日韩av先锋影音电影院| 精品成人一区二区三区| 日韩av不卡在线观看| 91福利在线观看| 欧美色成人综合| 国产精品传媒视频| 国产精品亚洲一区二区三区在线 | 亚洲在线视频网站| 成人av在线网站| 久久久久99精品国产片| 精品一区二区综合| 欧美一区二区免费观在线| 亚洲国产精品久久人人爱| 91久久香蕉国产日韩欧美9色| 国产精品视频你懂的| 国产.欧美.日韩| 国产蜜臀av在线一区二区三区| 精品一区二区三区欧美| 欧美成人一区二区三区在线观看| 视频一区中文字幕| 91精品国产91热久久久做人人| 日韩在线a电影| 欧美一区在线视频| 免费欧美在线视频|