###Matlab 绘图教程
- 简单帮助用
help
命令, 如 查看contourf
的用法可以用help contourf
。 - 详细帮助用
doc
命令, 如查看plot
的用法可以用doc contourf
####一个比较完全的示例
##Make build dir | |
mkdir ~/build/gcc | |
cd ~/build/gcc | |
##Download packages | |
wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2 | |
wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2 | |
wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz | |
wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.14.tar.bz2 |
#include <vector> | |
class pwlInterp2 | |
{ | |
//priviate | |
private: | |
std::vector<double> xd, yd, zd; | |
int find_posizition(std::vector<double> xxd, double xi ) | |
{ |
从Gambit里面画好网格后,周期边界设为wall类型,导出网格,然后运行 FluentMeshToFoam
,转换成OpenFOAM 里面内部使用的格式。
更改constant/polyMesh/boundary
文件中对应的周期patch,即从wall
类型改为cyclic
, 如下:
right
{
type cyclic;
inGroups 1(cyclic);
nFaces 20;
startFace 5572;
// matchTolerance 1;
/* | |
*construct M from c | |
*refer to D'Humières, Dominique Ginzburg, Irina Krafczyk, Manfred Lallemand, Pierre Luo, Li-Shi | |
2012 | |
*/ | |
#include <stdio.h> | |
#define Q 19 |
#!/usr/bin/python | |
import numpy as np | |
from numpy import * | |
L = 1.0 | |
N = 60; | |
dx = L/N; | |
x = (arange(N) + 0.5)*dx | |
y = (arange(N) + 0.5)*dx |
"""This file contains code for use with "Think Stats", | |
Copyright 2016 Lianhua Zhu | |
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html | |
""" | |
import sys | |
import gzip | |
import os | |
import argparse |
if( ( fp=fopen(fname,"w"))==NULL) {printf(" File Open Error\n");exit(1);} | |
fprintf(fp,"TITLE=%s\n","Cavity_3D"); | |
fprintf(fp,"Variables=%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s \n","X","Y","Z","RHO","Ux","Uy","Uz","Temperature","qx","qy","qz"); | |
fprintf(fp,"Zone I=%d, J=%d, K=%d, DATAPACKING=BLOCK, VARLOCATION=([4,5,6,7,8,9,10,11]=CELLCENTERED) \n",(M),(N),(Q)); |