⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fortran.c

📁 一个用来实现偏微分方程中网格的计算库
💻 C
字号:
/* * Copyright 1997, Regents of the University of Minnesota * * fortran.c * * This file contains code for the fortran to C interface * * Started 8/19/97 * George * * $Id: fortran.c 2501 2007-11-20 02:33:29Z benkirk $ * */#include <metis.h>/************************************************************************** This function changes the numbering to start from 0 instead of 1**************************************************************************/void Change2CNumbering(int nvtxs, idxtype *xadj, idxtype *adjncy){  int i, nedges;  for (i=0; i<=nvtxs; i++)    xadj[i]--;  nedges = xadj[nvtxs];  for (i=0; i<nedges; i++)    adjncy[i]--;}/************************************************************************** This function changes the numbering to start from 1 instead of 0**************************************************************************/void Change2FNumbering(int nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vector){  int i, nedges;  for (i=0; i<nvtxs; i++)    vector[i]++;  nedges = xadj[nvtxs];  for (i=0; i<nedges; i++)    adjncy[i]++;  for (i=0; i<=nvtxs; i++)    xadj[i]++;}/************************************************************************** This function changes the numbering to start from 1 instead of 0**************************************************************************/void Change2FNumbering2(int nvtxs, idxtype *xadj, idxtype *adjncy){  int i, nedges;  nedges = xadj[nvtxs];  for (i=0; i<nedges; i++)    adjncy[i]++;  for (i=0; i<=nvtxs; i++)    xadj[i]++;}/************************************************************************** This function changes the numbering to start from 1 instead of 0**************************************************************************/void Change2FNumberingOrder(int nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *v1, idxtype *v2){  int i, nedges;  for (i=0; i<nvtxs; i++) {    v1[i]++;    v2[i]++;  }  nedges = xadj[nvtxs];  for (i=0; i<nedges; i++)    adjncy[i]++;  for (i=0; i<=nvtxs; i++)    xadj[i]++;}/************************************************************************** This function changes the numbering to start from 0 instead of 1**************************************************************************/void ChangeMesh2CNumbering(int n, idxtype *mesh){  int i;  for (i=0; i<n; i++)    mesh[i]--;}/************************************************************************** This function changes the numbering to start from 1 instead of 0**************************************************************************/void ChangeMesh2FNumbering(int n, idxtype *mesh, int nvtxs, idxtype *xadj, idxtype *adjncy){  int i, nedges;  for (i=0; i<n; i++)    mesh[i]++;  nedges = xadj[nvtxs];  for (i=0; i<nedges; i++)    adjncy[i]++;  for (i=0; i<=nvtxs; i++)    xadj[i]++;}/************************************************************************** This function changes the numbering to start from 1 instead of 0**************************************************************************/void ChangeMesh2FNumbering2(int n, idxtype *mesh, int ne, int nn, idxtype *epart, idxtype *npart){  int i, nedges;  for (i=0; i<n; i++)    mesh[i]++;  for (i=0; i<ne; i++)    epart[i]++;  for (i=0; i<nn; i++)    npart[i]++;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -