diff --git a/templates/CP2K/8.2/data.CP2K.arm.gpu.config b/templates/CP2K/8.2/data.CP2K.arm.gpu.config index d2314db8402cd4ca3557bdb6e6825cdb8c1354ad..06a32f613bf5c447c26e7e9ec243b26713883235 100644 --- a/templates/CP2K/8.2/data.CP2K.arm.gpu.config +++ b/templates/CP2K/8.2/data.CP2K.arm.gpu.config @@ -1,95 +1,95 @@ -[SERVER] -11.11.11.11 - -[DOWNLOAD] -cp2k/8.2 https://github.com/cp2k/cp2k/releases/download/v8.2.0/cp2k-8.2.tar.bz2 - -[DEPENDENCY] -./jarvis -install kgcc/9.3.1 com -module purge -module use ./software/modulefiles -module load kgcc9/9.3.1 -export CC=`which gcc` -export CXX=`which g++` -export FC=`which gfortran` -./jarvis -install openmpi/4.1.2 gcc -module load openmpi4/4.1.2 -./jarvis -install gmp/6.2.0 gcc -./jarvis -install boost/1.72.0 gcc -./jarvis -install libint/2.6.0 gcc+mpi -./jarvis -install fftw/3.3.8 gcc+mpi -./jarvis -install openblas/0.3.18 gcc -module load openblas/0.3.18 -./jarvis -install scalapack/2.1.0 gcc+mpi -./jarvis -install spglib/1.16.0 gcc -./jarvis -install libxc/5.1.4 gcc -./jarvis -install gsl/2.6 gcc -module load gsl/2.6 -./jarvis -install plumed/2.6.2 gcc+mpi -./jarvis -install libvori/21.04.12 gcc -#release CP2K -tar -jxvf downloads/cp2k-8.2.tar.bz2 - -[ENV] -module purge -module load kgcc9/9.3.1 -module load openmpi4/4.1.2 -module load gsl/2.6 - -[APP] -app_name = CP2K -build_dir = ${JARVIS_ROOT}/cp2k-8.2/ -binary_dir = ${JARVIS_ROOT}/cp2k-8.2/exe/local-cuda/ -case_dir = ${JARVIS_ROOT}/cp2k-8.2/benchmarks/QS/ - -[BUILD] -make -j 128 ARCH=local-cuda VERSION=psmp - -[CLEAN] -make -j 128 ARCH=local-cuda VERSION=psmp clean - -[RUN] -run = numactl -C 0-63 mpirun --allow-run-as-root -x CUDA_VISIBLE_DEVICES=0,1 -np 64 -x OMP_NUM_THREADS=1 -binary = cp2k.psmp H2O-256.inp -nodes = 1 - -[BATCH] -#!/bin/bash - -logfile=cp2k.H2O-256.inp.log - -nvidia-smi -pm 1 -nvidia-smi -ac 1215,1410 - -echo 3 > /proc/sys/vm/drop_caches -echo "===run 32C*GPU===" >> $logfile -mpirun -np 32 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 - -echo 3 > /proc/sys/vm/drop_caches -echo "===run 32C*2GPU===" >> $logfile -mpirun -np 32 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0,1 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 - - -echo 3 > /proc/sys/vm/drop_caches -echo "===run 64C*GPU===" >> $logfile -mpirun -np 64 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 - -echo 3 > /proc/sys/vm/drop_caches -echo "===run 64C*2GPU===" >> $logfile -mpirun -np 32 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0,1 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 - - -echo 3 > /proc/sys/vm/drop_caches -echo "===run 128C*GPU===" >> $logfile -mpirun -np 128 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 - -echo 3 > /proc/sys/vm/drop_caches -echo "===run 128C*2GPU===" >> $logfile -mpirun -np 128 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0,1 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 - - - - - - - +[SERVER] +11.11.11.11 + +[DOWNLOAD] +cp2k/8.2 https://github.com/cp2k/cp2k/releases/download/v8.2.0/cp2k-8.2.tar.bz2 + +[DEPENDENCY] +./jarvis -install kgcc/9.3.1 com +module purge +module use ./software/modulefiles +module load kgcc9/9.3.1 +export CC=`which gcc` +export CXX=`which g++` +export FC=`which gfortran` +./jarvis -install openmpi/4.1.2 gcc +module load openmpi4/4.1.2 +./jarvis -install gmp/6.2.0 gcc +./jarvis -install boost/1.72.0 gcc +./jarvis -install libint/2.6.0 gcc+mpi +./jarvis -install fftw/3.3.8 gcc+mpi +./jarvis -install openblas/0.3.18 gcc +module load openblas/0.3.18 +./jarvis -install scalapack/2.1.0 gcc+mpi +./jarvis -install spglib/1.16.0 gcc +./jarvis -install libxc/5.1.4 gcc +./jarvis -install gsl/2.6 gcc +module load gsl/2.6 +./jarvis -install plumed/2.6.2 gcc+mpi +./jarvis -install libvori/21.04.12 gcc +#release CP2K +tar -jxvf downloads/cp2k-8.2.tar.bz2 + +[ENV] +module purge +module load kgcc9/9.3.1 +module load openmpi4/4.1.2 +module load gsl/2.6 + +[APP] +app_name = CP2K +build_dir = ${JARVIS_ROOT}/cp2k-8.2/ +binary_dir = ${JARVIS_ROOT}/cp2k-8.2/exe/local-cuda/ +case_dir = ${JARVIS_ROOT}/cp2k-8.2/benchmarks/QS/ + +[BUILD] +make -j 128 ARCH=local-cuda VERSION=psmp + +[CLEAN] +make -j 128 ARCH=local-cuda VERSION=psmp clean + +[RUN] +run = numactl -C 0-63 mpirun --allow-run-as-root -x CUDA_VISIBLE_DEVICES=0,1 -np 64 -x OMP_NUM_THREADS=1 +binary = cp2k.psmp H2O-256.inp +nodes = 1 + +[BATCH] +#!/bin/bash + +logfile=cp2k.H2O-256.inp.log + +nvidia-smi -pm 1 +nvidia-smi -ac 1215,1410 + +echo 3 > /proc/sys/vm/drop_caches +echo "===run 32C*GPU===" >> $logfile +mpirun -np 32 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 + +echo 3 > /proc/sys/vm/drop_caches +echo "===run 32C*2GPU===" >> $logfile +mpirun -np 32 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0,1 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 + + +echo 3 > /proc/sys/vm/drop_caches +echo "===run 64C*GPU===" >> $logfile +mpirun -np 64 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 + +echo 3 > /proc/sys/vm/drop_caches +echo "===run 64C*2GPU===" >> $logfile +mpirun -np 32 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0,1 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 + + +echo 3 > /proc/sys/vm/drop_caches +echo "===run 128C*GPU===" >> $logfile +mpirun -np 128 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 + +echo 3 > /proc/sys/vm/drop_caches +echo "===run 128C*2GPU===" >> $logfile +mpirun -np 128 -genv OMP_NUM_THREADS=1 -genv CUDA_VISIBLE_DEVICES=0,1 exe/local-cuda/cp2k.psmp benchmarks/QS/H2O-256.inp > cp2k.H2O-256.inp.log >> $logfile 2>&1 + + + + + + + diff --git a/templates/amber/20/FAQ.md b/templates/amber/20/FAQ.md new file mode 100644 index 0000000000000000000000000000000000000000..4c02528e7b5cc4cd5cd3d697e000d53511ce7b8d --- /dev/null +++ b/templates/amber/20/FAQ.md @@ -0,0 +1,8 @@ +Q: nvc-Error-Unknown switch: -fwrapv + +A: Amber目前不支持使用nvc编译器 + +Q: cannot find -llmpe/cannot find -lvt.mpi/-lvt-hyb/-lvt.ompi + +A:加载错误的openMPI库导致,实际应该要加载编译器对应的MPI库 + diff --git a/templates/amber/20/data.amber.arm.gpu.config b/templates/amber/20/data.amber.arm.gpu.config index af5dc2f328ad8bce1acdcd5a6bde059b291f1fd8..d8cab946e8ac018d7462c41c7993bec43e82b76f 100644 --- a/templates/amber/20/data.amber.arm.gpu.config +++ b/templates/amber/20/data.amber.arm.gpu.config @@ -1,33 +1,52 @@ -[SERVER] -11.11.11.11 - -[ENV] -# add gcc ompi -module use /opt/modulefile -module add gcc-9.3.1 openmpi-4.1.1 -# add cuda -export CUDA_INCLUDE_DIRS=/usr/local/cuda/include -export CUDA_CUDART_LIBRARY=/usr/local/cuda/lib64/libcudart.so -export CUDA_HOME=/usr/local/cuda -export PATH=$CUDA_HOME/bin:$PATH -export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH -export C_INCLUDE_PATH=$CUDA_HOME/include:$C_INCLUDE_PATH -export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH - -[APP] -app_name = Amber -build_dir = /home/amber20_src/build/ -binary_dir = /home/amber20/bin/ -case_dir = /home/amber_case/ - -[BUILD] -./run_cmake -make -j 96 install - -[CLEAN] -./clean_build - -[RUN] -run = mpirun -mca btl ^vader,tcp,openib,uct -np 2 -binary = pmemd.cuda_SPFP.MPI -O -i mdinOPT.GPU -o mdout -p Cellulose.prmtop -c Cellulose.inpcrd && cat mdout +[SERVER] +1.1.1.1 + +[DOWNLOAD] +kgcc/9.3.1 https://mirrors.huaweicloud.com/kunpeng/archive/compiler/kunpeng_gcc/gcc-9.3.1-2021.03-aarch64-linux.tar.gz + +[DEPENDENCY] +./jarvis -install kgcc/9.3.1 com +module purge +module use ./software/modulefiles +module load kgcc9/9.3.1 +module load openmpi4/4.1.2 +#test if mpi is normal +./jarvis -bench mpi + +[ENV] +# add gcc ompi +module purge +module use ./software/modulefiles +module load kgcc9/9.3.1 +module load openmpi4/4.1.2 +# add cuda +export CUDA_INCLUDE_DIRS=/usr/local/cuda/include +export CUDA_CUDART_LIBRARY=/usr/local/cuda/lib64/libcudart.so +export CUDA_HOME=/usr/local/cuda +export PATH=$CUDA_HOME/bin:$PATH +export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH +export C_INCLUDE_PATH=$CUDA_HOME/include:$C_INCLUDE_PATH +export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH + +[APP] +app_name = Amber +build_dir = /home/fang/HPCRunner-master/amber20_src/build/ +binary_dir = /home/fang/HPCRunner-master/amber20/bin/ +case_dir = /home/fang/HPCRunner-master/workloads/Amber/Cellulose/ + +[BUILD] +sed -i 's/-DMPI=FALSE/-DMPI=TRUE/g' run_cmake +sed -i 's/-DCUDA=FALSE/-DCUDA=TRUE/g' run_cmake +sed -i 's/-DINSTALL_TESTS=TRUE/-DINSTALL_TESTS=FALSE/g' run_cmake +sed -i 's/-DDOWNLOAD_MINICONDA=TRUE/-DDOWNLOAD_MINICONDA=FALSE/g' run_cmake +sed -i 's/-DMINICONDA_USE_PY3=TRUE/-DMINICONDA_USE_PY3=FALSE/g' run_cmake +./run_cmake +make -j 96 install + +[CLEAN] +./clean_build + +[RUN] +run = +binary = pmemd.cuda_SPFP.MPI -O -i mdinOPT.GPU -o mdout -p Cellulose.prmtop -c Cellulose.inpcrd && cat mdout nodes = 1 \ No newline at end of file diff --git a/templates/qe/6.8/data.qe.arm.cpu.config b/templates/qe/6.8/data.qe.arm.cpu.config index bbe0749e04a9b100d0969a80344fb49321f8b24d..6269205ac47d448246cd4ad25900e6956b95f421 100644 --- a/templates/qe/6.8/data.qe.arm.cpu.config +++ b/templates/qe/6.8/data.qe.arm.cpu.config @@ -1,37 +1,37 @@ -[SERVER] -11.11.11.11 - -[DEPENDENCY] -./jarvis -install kgcc/9.3.1 com -module use ./software/modulefiles -module load kgcc9 -./jarvis -install hmpi/1.1.0/gcc gcc -module load hmpi1/1.1.0 -./jarvis -install kml/1.4.0/gcc gcc - -[ENV] -source /etc/profile -module use ./software/modulefiles -module load kgcc9 -module load hmpi1/1.1.0 -export BLAS_LIBS="-L/usr/local/kml/lib/kblas/omp -lkblas" -export LAPACK_LIBS="-L/usr/local/kml/lib/ -lklapack_full" - -[APP] -app_name = QE -build_dir = /tmp/q-e-qe-6.8/ -binary_dir = /tmp/q-e-qe-6.8/bin/ -case_dir = /tmp/qe-large/ - -[BUILD] -./configure F90=gfortran F77=gfortran MPIF90=mpifort MPIF77=mpifort CC=mpicc FCFLAGS="-O3" CFLAGS="-O3" --with-scalapack=no --enable-openmp -make -j 96 pwall -make install - -[CLEAN] -make clean - -[RUN] -run = mpirun --allow-run-as-root -mca btl ^vader,tcp,openib,uct -np 128 -binary = pw.x -nk 8 -input scf.in +[SERVER] +11.11.11.11 + +[DEPENDENCY] +./jarvis -install kgcc/9.3.1 com +module use ./software/modulefiles +module load kgcc9 +./jarvis -install hmpi/1.1.0/gcc gcc +module load hmpi1/1.1.0 +./jarvis -install kml/1.4.0/gcc gcc + +[ENV] +source /etc/profile +module use ./software/modulefiles +module load kgcc9 +module load hmpi1/1.1.0 +export BLAS_LIBS="-L/usr/local/kml/lib/kblas/omp -lkblas" +export LAPACK_LIBS="-L/usr/local/kml/lib/ -lklapack_full" + +[APP] +app_name = QE +build_dir = /tmp/q-e-qe-6.8/ +binary_dir = /tmp/q-e-qe-6.8/bin/ +case_dir = /tmp/qe-large/ + +[BUILD] +./configure F90=gfortran F77=gfortran MPIF90=mpifort MPIF77=mpifort CC=mpicc FCFLAGS="-O3" CFLAGS="-O3" --with-scalapack=no --enable-openmp +make -j 96 pwall +make install + +[CLEAN] +make clean + +[RUN] +run = mpirun --allow-run-as-root -mca btl ^vader,tcp,openib,uct -np 128 +binary = pw.x -nk 8 -input scf.in nodes = 1 \ No newline at end of file diff --git a/templates/qe/6.8/data.qe.arm.gpu.config b/templates/qe/6.8/data.qe.arm.gpu.config index 60b78c182f58ef19bb66d11afff73d970b41f476..af12c74f2a1a65f74f51d3369ea31cfd173e2a99 100644 --- a/templates/qe/6.8/data.qe.arm.gpu.config +++ b/templates/qe/6.8/data.qe.arm.gpu.config @@ -1,38 +1,65 @@ -[SERVER] -11.11.11.11 - -[ENV] -# add gcc/mpi -export BLAS_LIBS="-I/home/HPCRunner-master/software/arm/gcc/openblas-0.3.18/include -L/home/HPCRunner-master/software/arm/gcc/openblas-0.3.18/lib/ -lopenblas" -export LAPACK_LIBS="-L/home/HPCRunner-master/software/arm/gcc/openblas-0.3.18/lib/ -lopenblas" -#export SCALAPACK_LIBS="-lgfortran -L/home/HPCRunner-master/software/arm/gcc/scalapack-2.1.0/ -lscalapack" -export FFT_LIBS="-I/home/HPCRunner-master/software/arm/gcc/fftw-3.3.8/FFTW/include/ -L/home/HPCRunner-master/software/arm/gcc/fftw-3.3.8/FFTW/lib/ -lfftw3 -lfftw3_omp" -export LD_LIBRARY_PATH=/home/HPCRunner-master/software/arm/gcc/openblas-0.3.18/lib/:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_aarch64/21.9/comm_libs/openmpi4/openmpi-4.0.5/lib/:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_aarch64/21.9/compilers/lib/:$LD_LIBRARY_PATH -module purge -module use modules -module load compiler/kgcc - -module use /opt/nvidia/hpc_sdk/modulefiles/ -module load nvhpc/21.9 - -[APP] -app_name = QE -build_dir = /home/HPCRunner-master/q-e-qe-6.8/ -binary_dir = /home/HPCRunner-master/q-e-qe-6.8/bin/ -case_dir = /home/HPCRunner-master/qe-large/ - -[BUILD] -./configure --with-cuda=yes --with-cuda-runtime=11.4 --with-cuda-cc=80 --enable-openmp --with-scalapack=no -echo DFLAGS += -D__GPU_MPI -D__FFTW3 >> make.inc -echo LD_LIBS += -lcurand >> make.inc -make pw -j 64 - -[CLEAN] -make clean - -[RUN] -run = mpirun --allow-run-as-root -mca btl ^vader,tcp,openib,uct -np 4 -x OMP_NUM_THREADS=1 -binary = pw.x -nk 4 -input ausurf.in -nodes = 1 \ No newline at end of file +[SERVER] +11.11.11.11 + +[DOWNLOAD] +kgcc/9.3.1 https://mirrors.huaweicloud.com/kunpeng/archive/compiler/kunpeng_gcc/gcc-9.3.1-2021.03-aarch64-linux.tar.gz + +[DEPENDENCY] +set -x +set -e +./jarvis -install kgcc/9.3.1 com +module purge +module use ./software/modulefiles +module load kgcc9/9.3.1 +export CC=`which gcc` +export CXX=`which g++` +export FC=`which gfortran` +./jarvis -install openblas/0.3.18 gcc + +[ENV] +module purge +module use /opt/nvidia/hpc_sdk/modulefiles/ +module load nvhpc/21.9 + +module use ./software/modulefiles +module load kgcc9/9.3.1 +module load openblas/0.3.18 +# add BLAS\Lapack +export BLAS_LIBS="-L${JARVIS_ROOT}/software/libs/kgcc9/openblas/0.3.18/lib/ -lopenblas" +export LAPACK_LIBS="-L${JARVIS_ROOT}/software/libs/kgcc9/openblas/0.3.18/lib/ -lopenblas" + +[APP] +app_name = QE +build_dir = ${JARVIS_ROOT}/q-e-qe-6.8/ +binary_dir = ${JARVIS_ROOT}/q-e-qe-6.8/bin/ +case_dir = ${JARVIS_ROOT}/workloads/QE/qe-large/ + +[BUILD] +set -x +set -e +# install devicexlib +cd external +rm -rf devxlib/* +tar xzf devicexlib-master.tar.gz -C devxlib --strip-components=1 +cd devxlib +./configure FC=pgf90 CC=pgcc --with-cuda=no --with-cuda-cc=80 --with-cuda-runtime= --disable-parallel --enable-cuda-env-check=no +make all +cd ../../ +./configure --with-cuda=yes --with-cuda-runtime=11.4 --with-cuda-cc=80 --enable-openmp --with-scalapack=no +echo DFLAGS += -D__GPU_MPI >> make.inc +echo LD_LIBS += -lcurand >> make.inc +make pw -j 64 + +[CLEAN] +make clean + +[RUN] +run = mpirun --allow-run-as-root -np 2 -x OMP_NUM_THREADS=1 +binary = pw.x -nk 2 -input scf.in +nodes = 1 + +[PERF] +kperf = --spe --uncore +perf = +nsys = -y 5s -d 100s +ncu = --target-processes all --launch-skip 71434 --launch-count 1 \ No newline at end of file diff --git a/templates/qe/6.8/data.qe.x86.gpu.config b/templates/qe/6.8/data.qe.x86.gpu.config new file mode 100644 index 0000000000000000000000000000000000000000..73aa0e7762d2da3fcc5074ca295e5221e343bc49 --- /dev/null +++ b/templates/qe/6.8/data.qe.x86.gpu.config @@ -0,0 +1,37 @@ +[SERVER] +11.11.11.11 + +[ENV] +module purge +module use /opt/nvidia/hpc_sdk/modulefiles/ +module load nvhpc/21.9 + +[APP] +app_name = QE +build_dir = /home/fang/HPCRunner-master/q-e-qe-6.8/ +binary_dir = /home/fang/HPCRunner-master/q-e-qe-6.8/bin/ +case_dir = /home/fang/HPCRunner-master/workloads/QE/qe-large/ + +[BUILD] +set -x +set -e +# install devicexlib +cd external +rm -rf devxlib/* +tar xzf devicexlib-master.tar.gz -C devxlib --strip-components=1 +cd devxlib +./configure FC=pgf90 CC=pgcc --with-cuda=no --with-cuda-cc=80 --with-cuda-runtime= --disable-parallel --enable-cuda-env-check=no +make all +cd ../../ +./configure FCFLAGS="-O3" CFLAGS="-O3" --with-cuda=/usr/local/cuda --with-cuda-runtime=11.4 --with-cuda-cc=80 --enable-openmp --with-scalapack=no LIBS="-L/opt/nvidia/hpc_sdk/Linux_x86_64/21.9/math_libs/lib64 -L$CUDA_HOME/lib64/stubs" +echo DFLAGS += -D__GPU_MPI >> make.inc +echo LD_LIBS += -lcurand >> make.inc +make pw -j + +[CLEAN] +make clean + +[RUN] +run = mpirun --allow-run-as-root -n 1 +binary = pw.x -input scf.in +nodes = 1 \ No newline at end of file diff --git a/tunning/OPENFOAM/v1912/0002-cavity512-position.patch b/tunning/OPENFOAM/v1912/0002-cavity512-position.patch new file mode 100644 index 0000000000000000000000000000000000000000..4472ec1368410ec202b4dd4f716f965e617faea1 --- /dev/null +++ b/tunning/OPENFOAM/v1912/0002-cavity512-position.patch @@ -0,0 +1,191 @@ +From 73bbf8e70b2256eb1ada5ec0df71c342aa999678 Mon Sep 17 00:00:00 2001 +From: yuankun +Date: Tue, 19 Apr 2022 09:43:43 +0800 +Subject: [PATCH 2/6] cavity512 position + +--- + OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/T | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/U | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/Urel | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/cellDist | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/p | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/zoneID | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0/T | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0/U | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0/Urel | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0/p | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/0/zoneID | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/Allrun | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/constant/SRFProperties | 0 + .../foam_run/{ => cavity512}/constant/manualDecomposition | 0 + .../foam_run/{ => cavity512}/constant/polyMesh/boundary | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/faces | 0 + .../foam_run/{ => cavity512}/constant/polyMesh/neighbour | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/owner | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/points | 0 + .../foam_run/{ => cavity512}/constant/thermophysicalProperties | 0 + .../foam_run/{ => cavity512}/constant/transportProperties | 0 + .../foam_run/{ => cavity512}/constant/turbulenceProperties | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/run | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/PDRblockMeshDict | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/blockMeshDict | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/controlDict | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/decomposeParDict | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/fvSchemes | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/fvSolution | 0 + OpenFOAM-v1912/foam_run/{ => cavity512}/system/setFieldsDict | 0 + 30 files changed, 0 insertions(+), 0 deletions(-) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/T (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/U (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/Urel (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/cellDist (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/p (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0.orig/zoneID (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0/T (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0/U (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0/Urel (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0/p (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/0/zoneID (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/Allrun (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/SRFProperties (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/manualDecomposition (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/boundary (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/faces (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/neighbour (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/owner (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/polyMesh/points (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/thermophysicalProperties (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/transportProperties (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/constant/turbulenceProperties (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/run (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/PDRblockMeshDict (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/blockMeshDict (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/controlDict (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/decomposeParDict (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/fvSchemes (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/fvSolution (100%) + rename OpenFOAM-v1912/foam_run/{ => cavity512}/system/setFieldsDict (100%) + +diff --git a/OpenFOAM-v1912/foam_run/0.orig/T b/OpenFOAM-v1912/foam_run/cavity512/0.orig/T +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0.orig/T +rename to OpenFOAM-v1912/foam_run/cavity512/0.orig/T +diff --git a/OpenFOAM-v1912/foam_run/0.orig/U b/OpenFOAM-v1912/foam_run/cavity512/0.orig/U +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0.orig/U +rename to OpenFOAM-v1912/foam_run/cavity512/0.orig/U +diff --git a/OpenFOAM-v1912/foam_run/0.orig/Urel b/OpenFOAM-v1912/foam_run/cavity512/0.orig/Urel +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0.orig/Urel +rename to OpenFOAM-v1912/foam_run/cavity512/0.orig/Urel +diff --git a/OpenFOAM-v1912/foam_run/0.orig/cellDist b/OpenFOAM-v1912/foam_run/cavity512/0.orig/cellDist +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0.orig/cellDist +rename to OpenFOAM-v1912/foam_run/cavity512/0.orig/cellDist +diff --git a/OpenFOAM-v1912/foam_run/0.orig/p b/OpenFOAM-v1912/foam_run/cavity512/0.orig/p +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0.orig/p +rename to OpenFOAM-v1912/foam_run/cavity512/0.orig/p +diff --git a/OpenFOAM-v1912/foam_run/0.orig/zoneID b/OpenFOAM-v1912/foam_run/cavity512/0.orig/zoneID +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0.orig/zoneID +rename to OpenFOAM-v1912/foam_run/cavity512/0.orig/zoneID +diff --git a/OpenFOAM-v1912/foam_run/0/T b/OpenFOAM-v1912/foam_run/cavity512/0/T +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0/T +rename to OpenFOAM-v1912/foam_run/cavity512/0/T +diff --git a/OpenFOAM-v1912/foam_run/0/U b/OpenFOAM-v1912/foam_run/cavity512/0/U +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0/U +rename to OpenFOAM-v1912/foam_run/cavity512/0/U +diff --git a/OpenFOAM-v1912/foam_run/0/Urel b/OpenFOAM-v1912/foam_run/cavity512/0/Urel +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0/Urel +rename to OpenFOAM-v1912/foam_run/cavity512/0/Urel +diff --git a/OpenFOAM-v1912/foam_run/0/p b/OpenFOAM-v1912/foam_run/cavity512/0/p +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0/p +rename to OpenFOAM-v1912/foam_run/cavity512/0/p +diff --git a/OpenFOAM-v1912/foam_run/0/zoneID b/OpenFOAM-v1912/foam_run/cavity512/0/zoneID +similarity index 100% +rename from OpenFOAM-v1912/foam_run/0/zoneID +rename to OpenFOAM-v1912/foam_run/cavity512/0/zoneID +diff --git a/OpenFOAM-v1912/foam_run/Allrun b/OpenFOAM-v1912/foam_run/cavity512/Allrun +similarity index 100% +rename from OpenFOAM-v1912/foam_run/Allrun +rename to OpenFOAM-v1912/foam_run/cavity512/Allrun +diff --git a/OpenFOAM-v1912/foam_run/constant/SRFProperties b/OpenFOAM-v1912/foam_run/cavity512/constant/SRFProperties +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/SRFProperties +rename to OpenFOAM-v1912/foam_run/cavity512/constant/SRFProperties +diff --git a/OpenFOAM-v1912/foam_run/constant/manualDecomposition b/OpenFOAM-v1912/foam_run/cavity512/constant/manualDecomposition +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/manualDecomposition +rename to OpenFOAM-v1912/foam_run/cavity512/constant/manualDecomposition +diff --git a/OpenFOAM-v1912/foam_run/constant/polyMesh/boundary b/OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/boundary +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/polyMesh/boundary +rename to OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/boundary +diff --git a/OpenFOAM-v1912/foam_run/constant/polyMesh/faces b/OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/faces +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/polyMesh/faces +rename to OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/faces +diff --git a/OpenFOAM-v1912/foam_run/constant/polyMesh/neighbour b/OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/neighbour +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/polyMesh/neighbour +rename to OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/neighbour +diff --git a/OpenFOAM-v1912/foam_run/constant/polyMesh/owner b/OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/owner +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/polyMesh/owner +rename to OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/owner +diff --git a/OpenFOAM-v1912/foam_run/constant/polyMesh/points b/OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/points +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/polyMesh/points +rename to OpenFOAM-v1912/foam_run/cavity512/constant/polyMesh/points +diff --git a/OpenFOAM-v1912/foam_run/constant/thermophysicalProperties b/OpenFOAM-v1912/foam_run/cavity512/constant/thermophysicalProperties +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/thermophysicalProperties +rename to OpenFOAM-v1912/foam_run/cavity512/constant/thermophysicalProperties +diff --git a/OpenFOAM-v1912/foam_run/constant/transportProperties b/OpenFOAM-v1912/foam_run/cavity512/constant/transportProperties +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/transportProperties +rename to OpenFOAM-v1912/foam_run/cavity512/constant/transportProperties +diff --git a/OpenFOAM-v1912/foam_run/constant/turbulenceProperties b/OpenFOAM-v1912/foam_run/cavity512/constant/turbulenceProperties +similarity index 100% +rename from OpenFOAM-v1912/foam_run/constant/turbulenceProperties +rename to OpenFOAM-v1912/foam_run/cavity512/constant/turbulenceProperties +diff --git a/OpenFOAM-v1912/foam_run/run b/OpenFOAM-v1912/foam_run/cavity512/run +similarity index 100% +rename from OpenFOAM-v1912/foam_run/run +rename to OpenFOAM-v1912/foam_run/cavity512/run +diff --git a/OpenFOAM-v1912/foam_run/system/PDRblockMeshDict b/OpenFOAM-v1912/foam_run/cavity512/system/PDRblockMeshDict +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/PDRblockMeshDict +rename to OpenFOAM-v1912/foam_run/cavity512/system/PDRblockMeshDict +diff --git a/OpenFOAM-v1912/foam_run/system/blockMeshDict b/OpenFOAM-v1912/foam_run/cavity512/system/blockMeshDict +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/blockMeshDict +rename to OpenFOAM-v1912/foam_run/cavity512/system/blockMeshDict +diff --git a/OpenFOAM-v1912/foam_run/system/controlDict b/OpenFOAM-v1912/foam_run/cavity512/system/controlDict +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/controlDict +rename to OpenFOAM-v1912/foam_run/cavity512/system/controlDict +diff --git a/OpenFOAM-v1912/foam_run/system/decomposeParDict b/OpenFOAM-v1912/foam_run/cavity512/system/decomposeParDict +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/decomposeParDict +rename to OpenFOAM-v1912/foam_run/cavity512/system/decomposeParDict +diff --git a/OpenFOAM-v1912/foam_run/system/fvSchemes b/OpenFOAM-v1912/foam_run/cavity512/system/fvSchemes +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/fvSchemes +rename to OpenFOAM-v1912/foam_run/cavity512/system/fvSchemes +diff --git a/OpenFOAM-v1912/foam_run/system/fvSolution b/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/fvSolution +rename to OpenFOAM-v1912/foam_run/cavity512/system/fvSolution +diff --git a/OpenFOAM-v1912/foam_run/system/setFieldsDict b/OpenFOAM-v1912/foam_run/cavity512/system/setFieldsDict +similarity index 100% +rename from OpenFOAM-v1912/foam_run/system/setFieldsDict +rename to OpenFOAM-v1912/foam_run/cavity512/system/setFieldsDict +-- +2.18.2 + diff --git a/tunning/OPENFOAM/v1912/0003-sparse-solver-modification.patch b/tunning/OPENFOAM/v1912/0003-sparse-solver-modification.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c0934d5c470d2b9033b9b19fd68f1a06aa985df --- /dev/null +++ b/tunning/OPENFOAM/v1912/0003-sparse-solver-modification.patch @@ -0,0 +1,99 @@ +From efe88723c1d86ac47a4e9a65879012408e5bfffb Mon Sep 17 00:00:00 2001 +From: yuankun +Date: Tue, 19 Apr 2022 09:45:06 +0800 +Subject: [PATCH 3/6] sparse solver modification + +--- + .../foam_run/cavity512/system/fvSolution | 66 +++++++++---------- + 1 file changed, 33 insertions(+), 33 deletions(-) + +diff --git a/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution b/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution +index bd26ae7c..64ec5887 100755 +--- a/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution ++++ b/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution +@@ -17,49 +17,49 @@ FoamFile + + solvers + { ++// p ++// { ++// solver PCG; ++// // preconditioner mySSOR; ++// preconditioner FDIC; ++// tolerance 1e-10; ++// relTol 5e-6; ++// } ++ ++// U ++// { ++// solver smoothSolver; ++// smoother symGaussSeidel; ++// tolerance 1e-9; ++// relTol 0; ++// } + p + { + solver PCG; +-// preconditioner mySSOR; +- preconditioner FDIC; ++ preconditioner ++ { ++ preconditioner GAMG; ++ nVcycles 1; ++ // tolerance 1e-06; ++ // relTol 0; ++ smoother DIC;//GaussSeidel; ++ nCellsInCoarsestLevel 16; ++ mergeLevels 2; ++ nPreSweeps 1; ++ // directSolveCoarsest yes; ++ } + tolerance 1e-10; + relTol 5e-6; ++ ++ // maxIter 0; + } + ++ + U + { +- solver smoothSolver; +- smoother symGaussSeidel; +- tolerance 1e-9; +- relTol 0; ++ solver PBiCGStab; ++ preconditioner DILU; + } +- // p +- // { +- // solver PCG; +- // preconditioner +- // { +- // preconditioner GAMG; +- // nVcycles 1; +- // // tolerance 1e-06; +- // // relTol 0; +- // smoother DIC;//GaussSeidel; +- // nCellsInCoarsestLevel 16; +- // mergeLevels 2; +- // nPreSweeps 1; +- // // directSolveCoarsest yes; +- // } +- // tolerance 1e-10; +- // relTol 5e-6; +- +- // // maxIter 0; +- // } +- +- +- // U +- // { +- // solver PBiCGStab; +- // preconditioner DILU; +- // } + pFinal + { + $p; +-- +2.18.2 + diff --git a/tunning/OPENFOAM/v1912/0004-symGS-rm-useless-code.patch b/tunning/OPENFOAM/v1912/0004-symGS-rm-useless-code.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0fd0a194f80b30f7e4a5d055bc2be4372c9b02a --- /dev/null +++ b/tunning/OPENFOAM/v1912/0004-symGS-rm-useless-code.patch @@ -0,0 +1,33 @@ +From 44d46a2b1f75c9b8d9a3a72f17b904623ea6963a Mon Sep 17 00:00:00 2001 +From: yuankun +Date: Tue, 19 Apr 2022 09:50:30 +0800 +Subject: [PATCH 4/6] symGS rm useless code + +--- + .../smoothers/symGaussSeidel/symGaussSeidelSmoother.C | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/smoothers/symGaussSeidel/symGaussSeidelSmoother.C b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/smoothers/symGaussSeidel/symGaussSeidelSmoother.C +index 00bc5c90..4b24ae20 100644 +--- a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/smoothers/symGaussSeidel/symGaussSeidelSmoother.C ++++ b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/smoothers/symGaussSeidel/symGaussSeidelSmoother.C +@@ -186,11 +186,11 @@ void Foam::symGaussSeidelSmoother::smooth + // Finish psi for this cell + psii /= diagPtr[celli]; + +- // Distribute the neighbour side using psi for this cell +- for (label facei=fStart; facei +Date: Tue, 19 Apr 2022 10:01:17 +0800 +Subject: [PATCH 5/6] PCG parallel improve and new parameter + +--- + .../foam_run/cavity512/system/fvSolution | 3 +- + .../matrices/lduMatrix/lduMatrix/lduMatrix.H | 7 ++ + .../lduMatrix/lduMatrix/lduMatrixSolver.C | 16 ++- + .../lduMatrix/solvers/GAMG/GAMGSolverSolve.C | 16 ++- + .../matrices/lduMatrix/solvers/PCG/PCG.C | 115 ++++++++++++++++++ + .../matrices/lduMatrix/solvers/PCG/PCG.H | 7 +- + 6 files changed, 160 insertions(+), 4 deletions(-) + +diff --git a/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution b/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution +index 64ec5887..93fe8661 100755 +--- a/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution ++++ b/OpenFOAM-v1912/foam_run/cavity512/system/fvSolution +@@ -40,7 +40,8 @@ solvers + { + preconditioner GAMG; + nVcycles 1; +- // tolerance 1e-06; ++ Coarsestalgorithm new; ++ tolerance 6e-07; + // relTol 0; + smoother DIC;//GaussSeidel; + nCellsInCoarsestLevel 16; +diff --git a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +index 46b77b6f..2da95c8d 100644 +--- a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H ++++ b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +@@ -270,6 +270,13 @@ public: + const direction cmpt=0 + ) const; + ++ virtual solverPerformance scalarSolve1 ++ ( ++ solveScalarField& psi, ++ const solveScalarField& source, ++ const direction cmpt=0 ++ ) const; ++ + //- Return the matrix norm used to normalise the residual for the + //- stopping criterion + solveScalarField::cmptType normFactor +diff --git a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +index 79096142..5affe2b2 100644 +--- a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C ++++ b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixSolver.C +@@ -191,7 +191,21 @@ Foam::solverPerformance Foam::lduMatrix::solver::scalarSolve + cmpt + ); + } +- ++Foam::solverPerformance Foam::lduMatrix::solver::scalarSolve1 ++( ++ solveScalarField& psi, ++ const solveScalarField& source, ++ const direction cmpt ++) const ++{ ++ PrecisionAdaptor tpsi_s(psi); ++ return scalarSolve1 ++ ( ++ tpsi_s.ref(), ++ ConstPrecisionAdaptor(source)(), ++ cmpt ++ ); ++} + + Foam::solveScalarField::cmptType Foam::lduMatrix::solver::normFactor + ( +diff --git a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C +index a8d1dbf1..b7812881 100644 +--- a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C ++++ b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverSolve.C +@@ -694,6 +694,20 @@ void Foam::GAMGSolver::solveCoarsestLevel + else + { + coarsestCorrField = 0; ++ word xxx("original"); ++ controlDict_.readIfPresent("Coarsestalgorithm",xxx); ++ ++ const solverPerformance coarseSolverPerf; ++ if (xxx=="new"){ ++ const solverPerformance coarseSolverPerf ++ ( ++ coarsestSolverPtr_->scalarSolve1 ++ ( ++ coarsestCorrField, ++ coarsestSource ++ ) ++ ); ++ }else{ + const solverPerformance coarseSolverPerf + ( + coarsestSolverPtr_->scalarSolve +@@ -702,7 +716,7 @@ void Foam::GAMGSolver::solveCoarsestLevel + coarsestSource + ) + ); +- ++ } + if (debug) + { + coarseSolverPerf.print(Info.masterStream(coarseComm)); +diff --git a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C +index e4802499..fb1fe8b4 100644 +--- a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C ++++ b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C +@@ -209,8 +209,123 @@ Foam::solverPerformance Foam::PCG::scalarSolve + return solverPerf; + } + ++Foam::solverPerformance Foam::PCG::scalarSolve1 ++( ++ solveScalarField& psi, ++ const solveScalarField& source, ++ const direction cmpt ++) const ++{ ++ // dictionary dict1; ++ // dict1.add(word("solver"), string("PCG")); ++ // dict1.add(word("preconditioner"), string("FDIC")); ++ // dict1.add(word("tolerance"), 1e-05); ++ // dict1.add(word("relTol"), 0); ++ label max_ite(tolerance_*1e8); // ++ ++ // --- Setup class containing solver performance data ++ solverPerformance solverPerf ++ ( ++ lduMatrix::preconditioner::getName(controlDict_) + typeName, ++ fieldName_ ++ ); ++ ++ label nCells = psi.size(); ++ solveScalar* __restrict__ psiPtr = psi.begin(); ++ ++ ++ solveScalarField pA(nCells); ++ solveScalar* __restrict__ pAPtr = pA.begin(); ++ solveScalarField wA(nCells); ++ solveScalar* __restrict__ wAPtr = wA.begin(); ++ ++ solveScalar wArA = solverPerf.great_; ++ ++ solveScalar wArAold = wArA; ++ ++ // --- Calculate A.psi ++ matrix_.Amul(wA, psi, interfaceBouCoeffs_, interfaces_, cmpt); ++ ++ // --- Calculate initial residual field ++ solveScalarField rA(source - wA); ++ solveScalar* __restrict__ rAPtr = rA.begin(); ++ ++ matrix().setResidualField ++ ( ++ ConstPrecisionAdaptor(rA)(), ++ fieldName_, ++ false ++ ); ++ ++ // --- Check convergence, solve if not converged ++ ++ // --- Select and construct the preconditioner ++ autoPtr preconPtr = ++ lduMatrix::preconditioner::New ++ ( ++ *this, ++ controlDict_ ++ ); ++ solveScalar beta; ++ for (label cell=0; cellprecondition(wA, rA, cmpt); ++ ++ // --- Update search directions: ++ wArA = gSumProd(wA, rA, matrix().mesh().comm()); ++ ++ ++ beta = wArA/wArAold; ++ ++ for (label cell=0; cell(rA)(), ++ fieldName_, ++ false ++ ); ++ ++ return solverPerf; ++} ++ + Foam::solverPerformance Foam::PCG::solve + ( + scalarField& psi_s, +diff --git a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H +index 416dc43f..39a81649 100644 +--- a/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H ++++ b/OpenFOAM-v1912/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.H +@@ -99,7 +99,12 @@ public: + const solveScalarField& source, + const direction cmpt=0 + ) const; +- ++ virtual solverPerformance scalarSolve1 ++ ( ++ solveScalarField& psi, ++ const solveScalarField& source, ++ const direction cmpt=0 ++ ) const; + //- Solve the matrix with this solver + virtual solverPerformance solve + ( +-- +2.18.2 + diff --git a/tunning/OPENFOAM/v1912/0006-Compile-Related-files-loss-due-to-OpenFOAM-gitignore.patch b/tunning/OPENFOAM/v1912/0006-Compile-Related-files-loss-due-to-OpenFOAM-gitignore.patch new file mode 100644 index 0000000000000000000000000000000000000000..581a24eb11b7088517debb99a9c3f874e06b96a9 --- /dev/null +++ b/tunning/OPENFOAM/v1912/0006-Compile-Related-files-loss-due-to-OpenFOAM-gitignore.patch @@ -0,0 +1,756 @@ +From c4654fe3a5ce8aeefeb1c300d56c0c1034b761db Mon Sep 17 00:00:00 2001 +From: yuankun +Date: Sun, 24 Apr 2022 16:02:43 +0800 +Subject: [PATCH 6/6] Compile Related files loss due to OpenFOAM gitignore + +--- + .../adios/src/adiosFoam/core/adiosCore.C | 76 +++++++ + .../adios/src/adiosFoam/core/adiosCore.H | 105 +++++++++ + .../src/fileFormats/vtk/core/foamVtkCore.C | 142 ++++++++++++ + .../src/fileFormats/vtk/core/foamVtkCore.H | 202 ++++++++++++++++++ + .../src/fileFormats/vtk/core/foamVtkPTraits.C | 76 +++++++ + .../src/fileFormats/vtk/core/foamVtkPTraits.H | 96 +++++++++ + 6 files changed, 697 insertions(+) + create mode 100644 OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.C + create mode 100644 OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.H + create mode 100644 OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.C + create mode 100644 OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.H + create mode 100644 OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.C + create mode 100644 OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.H + +diff --git a/OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.C b/OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.C +new file mode 100644 +index 00000000..063e87fb +--- /dev/null ++++ b/OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.C +@@ -0,0 +1,76 @@ ++/*---------------------------------------------------------------------------*\ ++ ========= | ++ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ++ \\ / O peration | ++ \\ / A nd | www.openfoam.com ++ \\/ M anipulation | ++------------------------------------------------------------------------------- ++ Copyright (C) 2016-2019 OpenCFD Ltd. ++------------------------------------------------------------------------------- ++License ++ This file is part of OpenFOAM. ++ ++ OpenFOAM is free software: you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ OpenFOAM 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 General Public License ++ for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with OpenFOAM. If not, see . ++ ++\*---------------------------------------------------------------------------*/ ++ ++#include "adiosCore.H" ++#include "Pstream.H" ++ ++// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // ++ ++int Foam::adiosFoam::adiosCore::debug(0); ++ ++unsigned Foam::adiosFoam::adiosCore::refCount_ = 0; ++ ++Foam::DynamicList Foam::adiosFoam::adiosCore::transfer_; ++ ++ ++// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // ++ ++Foam::adiosFoam::adiosCore::adiosCore() ++{ ++ if (refCount_ == 0) ++ { ++ // First one in ++ ++ transfer_.reserve(4096); ++ ++ // Initialize MPI as required - needed for ADIOS ++ UPstream::initNull(); ++ } ++ ++ ++refCount_; ++} ++ ++ ++// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // ++ ++Foam::adiosFoam::adiosCore::~adiosCore() ++{ ++ if (refCount_ == 1) ++ { ++ // Last one out ++ ++ // Cleanup transfer buffer ++ transfer_.clearStorage(); ++ ++ // OpenFOAM will cleanup and finalize MPI ++ } ++ ++ --refCount_; ++} ++ ++ ++// ************************************************************************* // +diff --git a/OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.H b/OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.H +new file mode 100644 +index 00000000..34eed23f +--- /dev/null ++++ b/OpenFOAM-v1912/modules/adios/src/adiosFoam/core/adiosCore.H +@@ -0,0 +1,105 @@ ++/*---------------------------------------------------------------------------*\ ++ ========= | ++ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ++ \\ / O peration | ++ \\ / A nd | www.openfoam.com ++ \\/ M anipulation | ++------------------------------------------------------------------------------- ++ Copyright (C) 2016-2019 OpenCFD Ltd. ++------------------------------------------------------------------------------- ++License ++ This file is part of OpenFOAM. ++ ++ OpenFOAM is free software: you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ OpenFOAM 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 General Public License ++ for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with OpenFOAM. If not, see . ++ ++Class ++ Foam::adiosFoam::adiosCore ++ ++Description ++ Core routines for starting/stopping ADIOS for OpenFOAM. ++ ++SourceFiles ++ adiosCore.C ++ ++\*---------------------------------------------------------------------------*/ ++ ++#ifndef adiosCore_H ++#define adiosCore_H ++ ++#include "adios2.h" ++#include "adiosFoam.H" ++#include "DynamicList.H" ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++namespace Foam ++{ ++namespace adiosFoam ++{ ++ ++/*---------------------------------------------------------------------------*\ ++ Class adiosCore Declaration ++\*---------------------------------------------------------------------------*/ ++ ++class adiosCore ++{ ++ // Private Data ++ ++ //- Global reference count for handling MPI_init and transfer buffers ++ static unsigned refCount_; ++ ++ ++protected: ++ ++ // Protected Data ++ ++ //- Buffer for reading/writing (streamed) content to/from ADIOS files ++ static DynamicList transfer_; ++ ++ ++public: ++ ++ //- Debug flag ++ static int debug; ++ ++ ++ // Constructors ++ ++ //- Construct null ++ adiosCore(); ++ ++ ++ //- Destructor ++ virtual ~adiosCore(); ++ ++ ++ // Member Functions ++ ++ //- Buffer for reading/writing (streamed) content to/from ADIOS files. ++ // Also used when reading/writing dissimilar content. ++ inline static DynamicList& transferBuffer() ++ { ++ return transfer_; ++ } ++}; ++ ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++} // End namespace adiosFoam ++} // End namespace Foam ++ ++#endif ++ ++// ************************************************************************* // +diff --git a/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.C b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.C +new file mode 100644 +index 00000000..14f832fe +--- /dev/null ++++ b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.C +@@ -0,0 +1,142 @@ ++/*---------------------------------------------------------------------------*\ ++ ========= | ++ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ++ \\ / O peration | ++ \\ / A nd | www.openfoam.com ++ \\/ M anipulation | ++------------------------------------------------------------------------------- ++ Copyright (C) 2017-2018 OpenCFD Ltd. ++------------------------------------------------------------------------------- ++License ++ This file is part of OpenFOAM. ++ ++ OpenFOAM is free software: you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ OpenFOAM 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 General Public License ++ for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with OpenFOAM. If not, see . ++ ++\*---------------------------------------------------------------------------*/ ++ ++#include "foamVtkCore.H" ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++const Foam::Enum ++< ++ Foam::vtk::fileTag ++> ++Foam::vtk::fileExtension ++({ ++ { fileTag::POLY_DATA, "vtp" }, ++ { fileTag::UNSTRUCTURED_GRID, "vtu" }, ++ { fileTag::MULTI_BLOCK, "vtm" }, ++ // { fileTag::COLLECTION, "pvd" }, ++}); ++ ++ ++const Foam::Enum ++< ++ Foam::vtk::fileTag ++> ++Foam::vtk::fileContentVersions ++({ ++ { fileTag::POLY_DATA, "0.1" }, ++ { fileTag::UNSTRUCTURED_GRID, "0.1" }, ++ { fileTag::MULTI_BLOCK, "1.0" }, ++ // { fileTag::COLLECTION, "0.1" }, ++}); ++ ++ ++const Foam::Enum ++< ++ Foam::vtk::fileTag ++> ++Foam::vtk::fileTagNames ++({ ++ { fileTag::VTK_FILE, "VTKFile" }, ++ { fileTag::DATA_ARRAY, "DataArray" }, ++ { fileTag::BLOCK, "Block" }, ++ { fileTag::PIECE, "Piece" }, ++ { fileTag::DATA_SET, "DataSet" }, ++ { fileTag::POINTS, "Points" }, ++ { fileTag::CELLS, "Cells" }, ++ { fileTag::POLYS, "Polys" }, ++ { fileTag::VERTS, "Verts" }, ++ { fileTag::LINES, "Lines" }, ++ { fileTag::CELL_DATA, "CellData" }, ++ { fileTag::POINT_DATA, "PointData" }, ++ { fileTag::FIELD_DATA, "FieldData" }, ++ { fileTag::POLY_DATA, "PolyData" }, ++ { fileTag::UNSTRUCTURED_GRID, "UnstructuredGrid" }, ++ { fileTag::MULTI_BLOCK, "vtkMultiBlockDataSet" }, ++ // { fileTag::COLLECTION, "Collection" }, ++}); ++ ++ ++const Foam::Enum ++< ++ Foam::vtk::fileAttr ++> ++Foam::vtk::fileAttrNames ++({ ++ { fileAttr::OFFSET, "offset" }, ++ { fileAttr::NUMBER_OF_COMPONENTS, "NumberOfComponents" }, ++ { fileAttr::NUMBER_OF_TUPLES, "NumberOfTuples" }, ++ { fileAttr::NUMBER_OF_POINTS, "NumberOfPoints" }, ++ { fileAttr::NUMBER_OF_CELLS, "NumberOfCells" }, ++ { fileAttr::NUMBER_OF_POLYS, "NumberOfPolys" }, ++ { fileAttr::NUMBER_OF_VERTS, "NumberOfVerts" }, ++ { fileAttr::NUMBER_OF_LINES, "NumberOfLines" }, ++}); ++ ++ ++const Foam::Enum ++< ++ Foam::vtk::dataArrayAttr ++> ++Foam::vtk::dataArrayAttrNames ++({ ++ { dataArrayAttr::POINTS, "Points" }, ++ { dataArrayAttr::OFFSETS, "offsets" }, ++ { dataArrayAttr::CONNECTIVITY, "connectivity" }, ++ { dataArrayAttr::TYPES, "types" }, ++ { dataArrayAttr::FACES, "faces" }, ++ { dataArrayAttr::FACEOFFSETS, "faceoffsets" }, ++}); ++ ++ ++// Legacy ++ ++const Foam::word Foam::vtk::legacy::fileExtension("vtk"); ++ ++const Foam::Enum ++< ++ Foam::vtk::fileTag ++> ++Foam::vtk::legacy::contentNames ++({ ++ { vtk::fileTag::POLY_DATA, "POLYDATA" }, ++ { vtk::fileTag::UNSTRUCTURED_GRID, "UNSTRUCTURED_GRID" }, ++}); ++ ++ ++const Foam::Enum ++< ++ Foam::vtk::fileTag ++> ++Foam::vtk::legacy::dataTypeNames ++({ ++ { vtk::fileTag::CELL_DATA, "CELL_DATA" }, ++ { vtk::fileTag::POINT_DATA, "POINT_DATA" }, ++}); ++ ++ ++// ************************************************************************* // +diff --git a/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.H b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.H +new file mode 100644 +index 00000000..3025d659 +--- /dev/null ++++ b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkCore.H +@@ -0,0 +1,202 @@ ++/*---------------------------------------------------------------------------*\ ++ ========= | ++ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ++ \\ / O peration | ++ \\ / A nd | www.openfoam.com ++ \\/ M anipulation | ++------------------------------------------------------------------------------- ++ Copyright (C) 2016-2018 OpenCFD Ltd. ++------------------------------------------------------------------------------- ++License ++ This file is part of OpenFOAM. ++ ++ OpenFOAM is free software: you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ OpenFOAM 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 General Public License ++ for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with OpenFOAM. If not, see . ++ ++Namespace ++ Foam::vtk ++ ++Description ++ Namespace for handling VTK input/output. ++ ++SourceFiles ++ foamVtkCore.C ++ ++\*---------------------------------------------------------------------------*/ ++ ++#ifndef foamVtkCore_H ++#define foamVtkCore_H ++ ++#include ++#include "Enum.H" ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++namespace Foam ++{ ++namespace vtk ++{ ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++ // Enumerations ++ ++ //- The context when outputting a VTK file (XML or legacy). ++ enum OutputContext ++ { ++ INLINE, // fileExtension; ++ ++ //- Version string for some vtk XML file content types ++ extern const Foam::Enum fileContentVersions; ++ ++ //- Strings corresponding to the vtk XML tags ++ extern const Foam::Enum fileTagNames; ++ ++ //- Some common XML attributes for vtk files ++ enum class fileAttr ++ { ++ OFFSET, //!< "offset" ++ NUMBER_OF_COMPONENTS, //!< "NumberOfComponents" ++ NUMBER_OF_TUPLES, //!< "NumberOfTuples" ++ NUMBER_OF_POINTS, //!< "NumberOfPoints" ++ NUMBER_OF_CELLS, //!< "NumberOfCells" ++ NUMBER_OF_POLYS, //!< "NumberOfPolys" ++ NUMBER_OF_VERTS, //!< "NumberOfVerts" ++ NUMBER_OF_LINES, //!< "NumberOfLines" ++ }; ++ ++ //- Strings corresponding to the vtk XML attributes ++ extern const Foam::Enum fileAttrNames; ++ ++ //- Some common names for XML DataArray entries ++ enum class dataArrayAttr ++ { ++ POINTS, //!< "Points" ++ OFFSETS, //!< "offsets" ++ CONNECTIVITY, //!< "connectivity" ++ TYPES, //!< "types" ++ FACES, //!< "faces" ++ FACEOFFSETS, //!< "faceoffsets" ++ }; ++ ++ //- Strings corresponding to the vtk XML DataArray attributes ++ extern const Foam::Enum dataArrayAttrNames; ++ ++ ++/*---------------------------------------------------------------------------*\ ++ Namespace legacy ++\*---------------------------------------------------------------------------*/ ++ ++namespace legacy ++{ ++ ++ //- Legacy file extension ("vtk") ++ extern const word fileExtension; ++ ++ //- Legacy content names (POLYDATA, UNSTRUCTURED_GRID) ++ extern const Foam::Enum contentNames; ++ ++ //- Legacy data type names (CELL_DATA, POINT_DATA) ++ extern const Foam::Enum dataTypeNames; ++ ++} // End namespace legacy ++ ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++} // End namespace vtk ++ ++} // End namespace Foam ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++#endif ++ ++// ************************************************************************* // +diff --git a/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.C b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.C +new file mode 100644 +index 00000000..b2e0fc4f +--- /dev/null ++++ b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.C +@@ -0,0 +1,76 @@ ++/*---------------------------------------------------------------------------*\ ++ ========= | ++ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ++ \\ / O peration | ++ \\ / A nd | www.openfoam.com ++ \\/ M anipulation | ++------------------------------------------------------------------------------- ++ Copyright (C) 2016-2018 OpenCFD Ltd. ++------------------------------------------------------------------------------- ++License ++ This file is part of OpenFOAM. ++ ++ OpenFOAM is free software: you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ OpenFOAM 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 General Public License ++ for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with OpenFOAM. If not, see . ++ ++\*---------------------------------------------------------------------------*/ ++ ++#include "foamVtkPTraits.H" ++#include "endian.H" ++ ++// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // ++ ++template<> ++const char* const ++Foam::vtkPTraits::typeName = "UInt8"; ++ ++template<> ++const char * const ++Foam::vtkPTraits::typeName = "Int32"; ++ ++template<> ++const char * const ++Foam::vtkPTraits::typeName = "UInt32"; ++ ++template<> ++const char * const ++Foam::vtkPTraits::typeName = "Int64"; ++ ++template<> ++const char * const ++Foam::vtkPTraits::typeName = "UInt64"; ++ ++template<> ++const char * const ++Foam::vtkPTraits::typeName = "Float32"; ++ ++template<> ++const char * const ++Foam::vtkPTraits::typeName = "Float64"; ++ ++#ifdef WM_LITTLE_ENDIAN ++template<> ++const char* const ++Foam::vtkPTraits::typeName = "LittleEndian"; ++#else ++template<> ++const char* const ++Foam::vtkPTraits::typeName = "BigEndian"; ++#endif ++ ++template<> ++const char* const ++Foam::vtkPTraits::typeName = "String"; ++ ++ ++// ************************************************************************* // +diff --git a/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.H b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.H +new file mode 100644 +index 00000000..0953a3cf +--- /dev/null ++++ b/OpenFOAM-v1912/src/fileFormats/vtk/core/foamVtkPTraits.H +@@ -0,0 +1,96 @@ ++/*---------------------------------------------------------------------------*\ ++ ========= | ++ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox ++ \\ / O peration | ++ \\ / A nd | www.openfoam.com ++ \\/ M anipulation | ++------------------------------------------------------------------------------- ++ Copyright (C) 2016-2018 OpenCFD Ltd. ++------------------------------------------------------------------------------- ++License ++ This file is part of OpenFOAM. ++ ++ OpenFOAM is free software: you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ OpenFOAM 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 General Public License ++ for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with OpenFOAM. If not, see . ++ ++Class ++ Foam::vtkPTraits ++ ++Description ++ Names for VTK primitive types. ++ ++\*---------------------------------------------------------------------------*/ ++ ++#ifndef foamVtkPTraits_H ++#define foamVtkPTraits_H ++ ++#include ++#include ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++namespace Foam ++{ ++ ++// Forward declarations ++class endian; ++ ++/*---------------------------------------------------------------------------*\ ++ Class vtkPTraits Declaration ++\*---------------------------------------------------------------------------*/ ++ ++template ++struct vtkPTraits ++{ ++ // Static data members ++ static const char* const typeName; ++}; ++ ++ ++template<> ++const char* const vtkPTraits::typeName; // UInt8 ++ ++template<> ++const char* const vtkPTraits::typeName; // Int32 ++ ++template<> ++const char* const vtkPTraits::typeName; // UInt32 ++ ++template<> ++const char* const vtkPTraits::typeName; // Int64 ++ ++template<> ++const char* const vtkPTraits::typeName; // UInt64 ++ ++template<> ++const char* const vtkPTraits::typeName; // Float32 ++ ++template<> ++const char* const vtkPTraits::typeName; // Float64 ++ ++template<> ++const char* const vtkPTraits::typeName; // (Big|Little)Endian ++ ++template<> ++const char* const vtkPTraits::typeName; // String ++ ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++} // End namespace Foam ++ ++// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ++ ++#endif ++ ++// ************************************************************************* // +-- +2.18.2 +