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

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

?? r2mfile.c

?? 用于2維的射線追蹤
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Ray2mesh : software for geophysicists. * Compute various scores attached to the mesh cells, based on geometric   information that rays bring when the traverse the cell. * * Copyright (C) 2003, St閜hane Genaud and Marc Grunberg * * This tool is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <sys/mman.h>#ifdef USE_MPI#include <mpi.h>#endif#ifdef USE_ZLIB#include <zlib.h>#endif#include <mesh/mesh.h>#include <mesh/cellinfo.h>#include <mesh/layer.h>#include "ray2mesh.h"#include "util.h"#include "r2mfile.h"#include "merge.h"#include "byte_order.h"#ifdef USE_ZLIB#define my_fprintf gzprintf#define my_File    gzFile#define my_fopen   gzopen#define my_fclose  gzclose#define openmode   "wb6f"#else#define my_fprintf fprintf#define my_fopen   fopen#define my_File    FILE#define my_fclose  fclose#define openmode   "w"#endif#ifdef USE_ZLIB#define CHECK_ERR(err, msg) { \    if (err != Z_OK) { \        fprintf(stderr, "%s error: %d\n", msg, err); \	MPI_Abort(MPI_COMM_WORLD, 1); \        exit(1); \    } \}#endif/*#define ZDEBUG *//** \brief return where starts and ends the domain "id" in layer "id"  * *@param m the mesh description  *@param layer_id the layer id *@param domain_id the domain id *@param nb_domain total number of domains  *@param from where the domain id starts *@param to where the domain id ends **/void get_domain_bounds_bis (struct mesh_t *m,			       int layer_id,				       int domain_id,				       int nb_domain,				       int *from,				       int *to){    /** where ends the domain id */    int nb_lon_cell;    int nb_cell, reste;    nb_lon_cell = m->layer[layer_id]->nlon;    nb_cell = nb_lon_cell / nb_domain;    reste = nb_lon_cell % nb_domain;    if (reste == 0) {	*from = domain_id * nb_cell;	*to = *from + nb_cell;	return;    }    if (domain_id < reste) {	nb_cell++;	*from = domain_id * nb_cell;    } else {	*from = reste * (nb_cell + 1) + (domain_id - reste) * nb_cell;    }    *to = *from + nb_cell;}void get_domain_bounds(struct mesh_t *m,			       int layer_id,				       int domain_id,				       int nb_domain,				       int *from,				       int *to){    /** where ends the domain id */    int nb_lon_cell;    int nb_cell, reste;    int virtual_domain_id;    if (domain_id % 2 == 0) {    	virtual_domain_id = domain_id;    } else {    	virtual_domain_id = fmod(domain_id + nb_domain%2, nb_domain );    }    nb_lon_cell = m->layer[layer_id]->nlon;    nb_cell = nb_lon_cell / nb_domain;    reste = nb_lon_cell % nb_domain;    if (reste == 0) {	*from = virtual_domain_id * nb_cell;	*to = *from + nb_cell;	return;    }    if (virtual_domain_id < reste) {	nb_cell++;	*from = virtual_domain_id * nb_cell;    } else {	*from = reste * (nb_cell + 1) + (virtual_domain_id - reste) * nb_cell;    }    *to = *from + nb_cell;}/** \brief return the number of non empty cell in a given domain. * @param c the light mesh @param m the mesh description @param domain the current domain id @param nbprocs number of running  process **/int count_nbcells_in_domain(struct cell_info_t ****c,				    struct mesh_t *m,					    int domain,			    int nbprocs){    int x, y, z;    int nb_lat_cell, nb_lon_cell;    int y_start, y_end;    int nb = 0;    for (z = 0; z < m->nlayers; z++) {	nb_lat_cell = m->layer[z]->nlat;	nb_lon_cell = m->layer[z]->nlon;	get_domain_bounds(m, z, domain, nbprocs, &y_start, &y_end);	for (x = 0; x < nb_lat_cell; x++) {	    for (y = y_start; y < y_end && y < nb_lon_cell; y++) {		if (c[z][x][y] && c[z][x][y]->nitems) {		    nb++;		}	    }	}    }    return (nb);}/** \brief return the number of non empty cell in a given layer  * @param c the light mesh @param m the mesh description @param layer the layer in which to count cells **/int count_nbcells_in_layer(struct cell_info_t ****c,				   struct mesh_t *m,			   int layer){    int x, y, z;    int nb_lat_cell, nb_lon_cell;    int nb_cells = 0;    z = layer;    nb_lat_cell = m->layer[z]->nlat;    nb_lon_cell = m->layer[z]->nlon;    for (x = 0; x < nb_lat_cell; x++) {	for (y = 0; y < nb_lon_cell; y++) {	    if (c[z][x][y] && c[z][x][y]->nitems) {		nb_cells++;	    }	}    }    return (nb_cells);}/* * \brief return the number of non empty cell in the light mesh  * *@param c the light mesh *@param m the mesh description * **/int count_non_empty_cell_in_cellinfo(struct cell_info_t ****c, struct mesh_t *m){    int nb_lat_cell, nb_lon_cell;    int x, y, z;    int nb_cells = 0;    if (!c)	return (0);		/* the mesh has none of its cell traversed */    for (z = 0; z < m->nlayers; z++) {	nb_lat_cell = m->layer[z]->nlat;	nb_lon_cell = m->layer[z]->nlon;	for (x = 0; x < nb_lat_cell; x++) {	    for (y = 0; y < nb_lon_cell; y++) {		if (c[z][x][y] && c[z][x][y]->nitems) {		    nb_cells++;		}	    }	}    }    return (nb_cells);}/** \brief construct a r2m formated file with cell_info data  * * Constructs a r2m formated file, which is a full cell information description. * Returns number of non empties cells in the light mesh. * All non empties cells are printed in the following format,  * * <B>layer cell_x</B>(lat direction) <B>cell_y</B>(long direction) <BR>  * <B>faces hits</B> (6 integers)<BR> * <B>blocks hits</B> (list of non null blocks)<BR> * <B>nb of rays in the cells</B><BR> * <B>rayid latitude longitude depth</B> (first point in the cell) <B>latitude longitude depth</B> (last point in the cell) <B>Length_P Length_S</B><BR> * ...<BR> * <B>rayid ...</B> (nbrays lines)<BR> * * Example : *\verbatim  0 10 14  28 0 0 3 0 0  17 6 22 39 55 26 42 43 59 38 54 45 62 61 63 47 27 11  4  1022 0.092424 -1.445175 2.621287 0.093318 -1.445433 18.345807 16.800429 0.000000  15378 0.090775 -1.441275 10.000000 0.092157 -1.441702 18.906515 12.801157 0.000000  30724 0.095867 -1.441776 16.295813 0.095693 -1.441720 18.622799 2.600095 0.000000  4342 0.094214 -1.441970 19.240258 0.095916 -1.442344 3.566029 25.434061 0.000000 \endverbatim  @param filename where to write the file @param c the light mesh @param m the mesh description @param domain the current domain id @param nbprocs number of running process @param rank current process  **/int make_domain_info_file(char *filename,				   struct cell_info_t ****c,				   struct mesh_t *m,					   int domain,						   int nbprocs,			   int rank){    int x, y, z;    int nb_lat_cell, nb_lon_cell;    int y_start, y_end;    int i;    my_File *fd;    struct cell_info_t *ci;    int nb_cell_total;    int nb_cell_cpt=0;    int nbwrite;#ifdef DEBUG    char *date_stamp;    date_stamp = get_date_stamp();    fprintf(stdout, "[%s] make_domain_info_file() starts\n", date_stamp);    fflush(stdout);    free(date_stamp);#endif    fd = my_fopen(filename, openmode);    if (!fd) {	fprintf(stderr, "[process %d] make_domain_info_file() : can't open %s for writting. Exit !\n", 	        rank, filename);#ifdef USE_MPI        MPI_Abort(MPI_COMM_WORLD, 1);#endif	exit(1);    }     if (!c) {	my_fclose(fd);	return(0);    }    my_fprintf(fd, "# format=r2m, generated by %s v%s, domain=%d/%d, mesh=%s\n",		    PACKAGE, VERSION, domain, nbprocs, m->xml_filename);    nb_cell_total = count_nbcells_in_domain(c, m, domain, nbprocs);#ifdef DEBUG    fprintf(stdout,	    "*** [process %d]  make_domain_info_file domain[%d] nb_cell_total = %d\n",	    rank, domain, nb_cell_total);#endif    nbwrite = my_fprintf(fd, "%d\n", nb_cell_total);    if (nbwrite < 0)  {        fprintf(stderr, "[process %d] make_domain_info_file() : can't write into %s. Exit !\n", 		rank, filename);#ifdef USE_MPI        MPI_Abort(MPI_COMM_WORLD, 1);#endif        exit(1);    }        if (nb_cell_total != 0) {	for (z = 0; z < m->nlayers; z++) {	    nb_lat_cell = m->layer[z]->nlat;	    nb_lon_cell = m->layer[z]->nlon;	    get_domain_bounds(m, z, domain, nbprocs, &y_start, &y_end);	    for (x = 0; x < nb_lat_cell; x++) {		for (y = y_start; y < y_end && y < nb_lon_cell; y++) {		    ci = c[z][x][y];	/* shorthand */		    /* allocated cells with nitems=0 are orphan cells : ignored */		    if (ci == NULL)			continue;		    if (ci->nitems == 0)			continue;		    nb_cell_cpt++;		    /* x y z */		    my_fprintf(fd, "%d %d %d\n", z, x, y);		    /* face hit */		    for (i = 0; i < NB_HIT_FACES; i++)			my_fprintf(fd, "%d ", ci->faces_hit[i]);		    my_fprintf(fd, "\n");		    /* block hit */		    my_fprintf(fd, "%d ", ci->nblocks);		    for (i = 0; i < ci->nblocks; i++)			my_fprintf(fd, "%d ", ci->block_hit[i]);		    my_fprintf(fd, "\n");		    /* items */		    my_fprintf(fd, "%d\n", ci->nitems);		    for (i = 0; i < ci->nitems; i++) {			my_fprintf(fd, "%ld %f %f %f %f %f %f %f %f\n",				   ci->item[i].rayid,				   ci->item[i].in->lat,				   ci->item[i].in->lon,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久夜色精品亚洲| 国产一区在线不卡| 国产日韩欧美制服另类| 日本aⅴ亚洲精品中文乱码| 成人免费一区二区三区视频| 久久久天堂av| 日韩欧美中文字幕公布| 在线国产电影不卡| www.视频一区| 国产精品美女www爽爽爽| 欧美变态tickling挠脚心| 91精品国产麻豆| 欧美一区二区三区成人| 欧美视频日韩视频在线观看| 91麻豆国产福利精品| 天堂成人免费av电影一区| 国产精品视频你懂的| 久久久高清一区二区三区| 久久精品欧美一区二区三区不卡 | 国产一区二区免费看| 免费不卡在线视频| 国产午夜精品一区二区| 欧美国产激情一区二区三区蜜月 | 午夜欧美视频在线观看| 舔着乳尖日韩一区| 久久99精品国产麻豆婷婷洗澡| 久久国产日韩欧美精品| 国产不卡在线视频| 91农村精品一区二区在线| 欧美日韩一区国产| 91麻豆精品国产自产在线| 精品免费一区二区三区| 国产精品久久久久久户外露出| 亚洲欧美另类图片小说| 毛片不卡一区二区| 91香蕉视频mp4| 精品美女被调教视频大全网站| 国产午夜精品美女毛片视频| 亚洲一本大道在线| 国产成人高清在线| 日韩视频在线观看一区二区| 成人欧美一区二区三区在线播放| 亚洲午夜影视影院在线观看| 国产精品美女一区二区| 另类小说综合欧美亚洲| 一本大道av伊人久久综合| 国产福利一区在线| 欧美精品tushy高清| 亚洲图片欧美激情| 国产成人午夜99999| 91精品国产综合久久久久久久| 亚洲三级电影全部在线观看高清| 久久久美女毛片| 激情深爱一区二区| 欧美一区二区三区人| 一区二区三区视频在线观看| 国产成a人亚洲| 国产日韩欧美在线一区| 亚洲成人自拍偷拍| 精品日本一线二线三线不卡| 亚洲午夜国产一区99re久久| av资源网一区| 国产精品成人网| 成人激情av网| 日本一区二区三区久久久久久久久不| 青草av.久久免费一区| 欧美电影在哪看比较好| 亚洲最新视频在线观看| 欧美在线观看18| 亚洲一区免费在线观看| 国产三级一区二区| 懂色av一区二区三区蜜臀| 中文字幕+乱码+中文字幕一区| 成人一区二区三区中文字幕| 国产午夜亚洲精品午夜鲁丝片| 国产成人精品免费在线| 综合久久久久综合| 欧美日韩成人综合在线一区二区| 欧美一区二区三区四区视频| 一区二区三区日韩在线观看| 欧美性感一区二区三区| 视频在线观看国产精品| 91精品在线观看入口| 中文字幕乱码日本亚洲一区二区| 丰满少妇在线播放bd日韩电影| 欧美国产精品中文字幕| 天天综合色天天综合色h| 欧美丰满高潮xxxx喷水动漫| 久久国产尿小便嘘嘘| 亚洲婷婷综合色高清在线| 欧美日韩三级一区二区| 国产麻豆9l精品三级站| 一区二区三区在线看| 久久综合色鬼综合色| 欧美性猛交xxxx黑人交| 夜夜操天天操亚洲| 欧美一卡在线观看| 国产高清精品久久久久| 亚洲不卡在线观看| 国产精品久久久久久久久免费相片| 欧美特级限制片免费在线观看| 国产乱码一区二区三区| 美女一区二区久久| 婷婷夜色潮精品综合在线| 国产精品免费观看视频| 久久人人爽爽爽人久久久| 欧美男同性恋视频网站| 在线观看日韩精品| 99精品久久只有精品| 成人午夜视频福利| 国产资源精品在线观看| 久久99久久久久| 毛片一区二区三区| 亚洲日本在线观看| 欧美日韩一区三区| 色偷偷久久一区二区三区| 国产电影一区二区三区| 国产乱码精品一区二区三区忘忧草| 美女久久久精品| 激情综合色综合久久综合| 热久久免费视频| 欧美视频一区二区三区四区| 在线观看区一区二| 成人亚洲一区二区一| av网站一区二区三区| 91精品国产一区二区三区| 日韩理论片在线| 色天使色偷偷av一区二区| 91久久精品一区二区三区| 在线视频国内自拍亚洲视频| 色婷婷综合五月| 欧美三级乱人伦电影| 亚洲第一成年网| 欧美日韩一级片在线观看| 一本到三区不卡视频| 色猫猫国产区一区二在线视频| 成人午夜电影小说| 欧美亚一区二区| 欧美v日韩v国产v| 亚洲日本成人在线观看| 久久99九九99精品| 成人黄色软件下载| 成人国产免费视频| 在线观看成人小视频| 精品国产在天天线2019| 1024国产精品| 亚洲一区二区三区影院| 经典三级在线一区| 91蜜桃在线观看| wwwwxxxxx欧美| 亚洲综合色噜噜狠狠| 国产精品乡下勾搭老头1| 欧美日韩黄视频| 中文字幕视频一区| 成人黄色在线视频| 国产91精品一区二区麻豆网站 | 欧美极品aⅴ影院| 精品一区二区三区香蕉蜜桃| 色综合久久九月婷婷色综合| 精品国产乱码久久久久久蜜臀| 亚洲大片在线观看| 欧美日韩1234| 亚洲精品欧美激情| 91一区二区在线观看| **欧美大码日韩| 国产成人av电影在线观看| 精品剧情v国产在线观看在线| 秋霞成人午夜伦在线观看| 极品少妇xxxx精品少妇偷拍| 欧美精品在线观看播放| 日韩精品色哟哟| 欧美三级视频在线| 亚洲国产一区二区三区青草影视| 国产成人综合在线观看| 国产精品久久久久久久裸模| 99久久99久久精品国产片果冻 | 日韩精品影音先锋| 视频一区在线视频| 日韩三级电影网址| 美女网站在线免费欧美精品| 91麻豆精品国产91| 精品一区二区三区的国产在线播放 | 国产伦理精品不卡| 欧美精彩视频一区二区三区| 97se亚洲国产综合自在线观| 亚洲成人av电影| 欧美一区二区人人喊爽| 成人av网址在线| 石原莉奈在线亚洲三区| 国产女人aaa级久久久级| 欧美三级中文字幕| 国产成a人无v码亚洲福利| 亚洲精品一区二区三区香蕉| 91日韩精品一区| 久久99国产精品久久99果冻传媒| 777午夜精品免费视频| 精品一区二区三区在线播放视频| 国产欧美日韩不卡| 欧美日韩综合不卡| 国产成人福利片|