初学者在Linux命令窗口(终端)敲命令时,肯定觉得通过输入一串一串的字符的方式来控制计算是效率很低。 但是Linux命令解释器(Shell)是有很多快捷键的,熟练掌握可以极大的提高操作效率。 下面列出最常用的快捷键,这还不是完全版。
- 命令行快捷键:
- 常用:
- Ctrl L :清屏
- 常用:
- Ctrl M :等效于回车
#LHZHU: Changed based on http://www.archer.ac.uk/documentation/software/openfoam/#4.1 compute | |
#DESC: Let user program compile on /work filesystem | |
#NOTE: should export CRAYPE_LINK_TYPE=dynamic to compile it, as Archer default use static link | |
#----------------------------------*-sh-*-------------------------------------- | |
# ========= | | |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | |
# \\ / O peration | | |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation | |
# \\/ M anipulation | | |
#------------------------------------------------------------------------------ |
import numpy as np | |
import matplotlib.image as mpimg | |
def rgb2gray(rgb): | |
''' Convert rgb to gray ''' | |
return np.dot(rgb[...,:3], [0.299, 0.587, 0.114]) | |
def gray2bin(gray): | |
''' Convert gray to binary (0,1)''' | |
#return (gray>0.5).astype('uint8') |
from numpy import * | |
#filename = "data.txt" | |
datadir = "Tr0.8_Kn0.1/GH_16_16_16/" | |
filename = datadir+"creep3d.dat" | |
NX = 40 | |
NZ = 40 | |
NY = 80 |
D = 1.0; | |
R = D/2.0; | |
H = 4; | |
Ll = 4; | |
Lr = 6; | |
Lil = 2; | |
Lir = 2; | |
Hi = 2; |
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)); |
"""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 |
#!/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 |
/* | |
*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 |