|
[Sponsors] |
[blockMesh] A script for combining two blockMeshDict |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 26, 2009, 16:05 |
A script for combining two blockMeshDict
|
#1 |
New Member
Yingfeng Shen
Join Date: Mar 2009
Location: Finland
Posts: 8
Rep Power: 17 |
Sometimes I need to combine two blockMeshDict to create multi zone mesh or more complicated geometry. The vertex index in one of the dictionary has to be increased before you can copy and paste the text. Here is a short script I would like to share. Please feel free to improve and add more functionalities.
##/usr/bin/bash # ./BlockMeshInc blockMeshDictUpper 100 # if [ $# -eq 0 ]; then echo 'Increase the point index of a BlockMeshDict for combining with another' echo 'usage: BlockMeshInc blockMeshDict number' exit 1 fi sed -e 's/(\([0-9]\)/( \1/' -e 's/\([0-9]\))/\1 )/' $1 | \ awk -v N=$2 \ ' BEGIN {} {if ($1=="hex") print "\t",$1,$2,$3+N,$4+N,$5+N,$6+N,$7+N,$8+N,$9+N,$10+ N,$11,$12,$13,$14,$15,$16,$17,$18} {if ($1=="arc") print "\t",$1,$2+N,$3+N,$4,$5,$6,$7,$8} {if ($1=="(" && $6 ==")") print "\t\t",$1,$2+N,$3+N,$4+N,$5+N,$6} {if (NF==1 && $1!=");" || $1!=");" && $1!="(" && $1!="hex" && $1!="arc") print $0} {if ($1=="(" && $5==")") print $0} {if ($1==");") print $1} END {} |
|
Tags |
blockmeshdict, combining, merging |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] ICEM CFD Replay Script Command | ANSYS_Newbie | ANSYS Meshing & Geometry | 2 | June 12, 2019 17:58 |
[ICEM] Script: problems with face names | Maweil | ANSYS Meshing & Geometry | 3 | April 16, 2019 09:10 |
Split connectors at their intersection | FOUAD12 | Pointwise & Gridgen | 3 | October 8, 2018 10:42 |
[Workbench] Run ICEM Script in Workbench Script | MIZOR | ANSYS Meshing & Geometry | 9 | April 4, 2018 07:45 |
CentFOAM Python Script Installation: Error | socon009 | OpenFOAM Installation | 2 | May 26, 2012 09:36 |