mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
test: Refactored transposing of plot data into function bin/tools/RunFunctions::transposeFile()
which simplifies the reactingEulerFoam populationBalance test cases. Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
This commit is contained in:
@ -168,4 +168,31 @@ cloneCase()
|
||||
fi
|
||||
}
|
||||
|
||||
transposeFile()
|
||||
{
|
||||
awk '
|
||||
{
|
||||
for (i = 1; i <= NF; i++)
|
||||
{
|
||||
a[NR, i] = $i
|
||||
}
|
||||
}
|
||||
|
||||
NF > p {p = NF}
|
||||
|
||||
END {
|
||||
for (j = 1; j <= p; j++)
|
||||
{
|
||||
str = a[1,j]
|
||||
|
||||
for(i = 2; i <= NR; i++)
|
||||
{
|
||||
str = str" "a[i,j];
|
||||
}
|
||||
|
||||
print str
|
||||
}
|
||||
}' $1
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user