This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D = 1.0; | |
R = D/2.0; | |
H = 4; | |
Ll = 4; | |
Lr = 6; | |
Lil = 2; | |
Lir = 2; | |
Hi = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 | | |
#------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Generate non-uniform discrete velocity using a power law distribution | |
import numpy as np | |
def nu_dv(lmx, MX, xiMax): | |
""" | |
Generate a non-uniform points with a power law distribution | |
Parameter | |
--------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash --login | |
#PBS -N test | |
#PBS -A e283 | |
#PBS -l select=1 | |
#PBS -l walltime=0:20:00 | |
##PBS -m abe | |
#PBS -M [email protected] | |
# Switch to current working directory | |
export PBS_O_WORKDIR=$(readlink -f $PBS_O_WORKDIR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```bash | |
### OpenMPI | |
module load compilers/intel/2018_0 | |
./configure --prefix=/home/appLEIWU/MPI/intel/openmpi/2.1.0 CC=/home/appLEIWU/compiler/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icc CXX=/home/appLEIWU/compiler/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icpc F77=/home/appLEIWU/compiler/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/ifort FC=/home/appLEIWU/compiler/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/ifort | |
make -j 28 | |
sudo make install | |
### HDF5 | |
CC=/home/appLEIWU/MPI/intel/openmpi/2.1.0/bin/mpicc ./configure --enable-parallel --prefix=/home/appLEIWU/tool/HDF5/intel/openmpi/1.8.5-patch1 | |
make -j 28 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Generated by `cat $LHOME/OpenFOAM/OpenFOAM-4.1/etc/bashrc` | |
#LHZHU: Changed based on http://www.archer.ac.uk/documentation/software/openfoam/#4.1 compute | |
#DESC: Let user program compile on /work filesystem | |
#----------------------------------*-sh-*-------------------------------------- | |
# ========= | | |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | |
# \\ / O peration | | |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation | |
# \\/ M anipulation | | |
#------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void data2D(int mm_, double* T_, double* qx_,double* qy_,double* xcoord_, double* ycoord_, double* dx_, double* dy_, int NumMeshx_, int NumMeshy_ ) | |
{ | |
FILE *fp; | |
char fname[1000]; | |
int m1,i,j; | |
int nodes,elements; | |
int index[M][N]; | |
nodes=0; | |
elements=0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// blog : https://zhulianhua.wordpress.com/2018/04/18/c11-variadic-template/ | |
#include <iostream> | |
using namespace std; | |
//递归终止函数 | |
void print() | |
{ | |
cout << "empty" << endl; | |
} | |
//展开函数 |