From c1b2dfb509382c05b00b12d86c572b7e8e29f8fe Mon Sep 17 00:00:00 2001 From: Martin Beaudoin Date: Fri, 5 Jul 2013 08:50:12 -0700 Subject: [PATCH] Add command-line option '-nativeReader' to paraFoam --- bin/paraFoam | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/bin/paraFoam b/bin/paraFoam index 21f4411e9..5459de2f1 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #------------------------------------------------------------------------------ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox @@ -38,7 +38,8 @@ usage: ${0##*/} [OPTION] options: -case dir specify alternative case directory -region name specify mesh region name - -touch only create the .OpenFOAM file + -touch only create the .OpenFOAM or .foam file + -nativeReader use the paraview native reader for OpenFOAM * start paraview $ParaView_VERSION with the OpenFOAM libraries @@ -46,7 +47,7 @@ USAGE exit 1 } -unset regionName touchOnly +unset regionName touchOnly useNativeReader # parse options while [ "$#" -gt 0 ] @@ -69,6 +70,10 @@ do touchOnly=true shift ;; + -nativeReader) + useNativeReader=true + shift + ;; *) usage "unknown option/argument: '$*'" ;; @@ -77,12 +82,24 @@ done # get a sensible caseName caseName=${PWD##*/} -caseFile="$caseName.OpenFOAM" + +if [ -n "$useNativeReader" ] +then + caseFile="$caseName.foam" +else + caseFile="$caseName.OpenFOAM" +fi + fvControls="system" if [ -n "$regionName" ] then - caseFile="$caseName{$regionName}.OpenFOAM" + if [ -n "$useNativeReader" ] + then + caseFile="$caseName{$regionName}.foam" + else + caseFile="$caseName{$regionName}.OpenFOAM" + fi fvControls="$fvControls/$regionName" fi