Author Topic: FEAPpv in batch mode  (Read 7664 times)

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
FEAPpv in batch mode
« on: December 06, 2012, 02:40:27 PM »
Hello,
I wanted to use FEAP in optimization analysis. For this purpose I want to run it in batch mode with no interactive entering for input file name. I am executing the command in Matlab as:

!feappv31-64bit.exe -iItruss.dat

The graphics interactive screen still comes up and it does not seem to recognize that I even provided the input file name using: -iIfilename, as it is asking for input file name. Is it possible to run the program from command prompt without resorting to the graphics window?

I only have the executable version of the program and do not yet have fortran compiler or visual studio.

Thanks for your help.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2647
Re: FEAPpv in batch mode
« Reply #1 on: December 06, 2012, 03:43:53 PM »
This feature is not supported by feappv.  You can modify source to implement how you want to execute the code and inputs.

towersys.eu

  • New Member
  • *
  • Posts: 1
Re: FEAPpv in batch mode
« Reply #2 on: April 26, 2015, 08:45:03 AM »
Hi there,
better late than never:

You may be able to create a wrapper script that uses input redirection:
On a "un*x" system create a file
/usr/local/bin/feap-runner.sh

with the following content
#!/bin/bash

# first argument from command line is INPUT
INPUT=shift

# the feappv executable must be on the path
FEAPPV=$(which feappv)



# create the file, the input is read from
TMP="/tmp/feap-input-$$.txt"

# put the input (you would type by keyboard) in the file
echo "$INPUT" > $TMP
# enter
echo "" >> $TMP
# enter
echo "" >> $TMP
# enter
echo "" >> $TMP
# confirm with y
echo "y" >> $TMP

# remove the defaults file
if [ -f feapname ] ; then
  rm feapname
fi

"$FEAPPV" < "$TMP"

rm "$TMP"
# EOF

make it runnable
chmod 755 /usr/local/bin/feap-runner.sh

and run it within the input file as argument:
/usr/local/bin/feap-runner.sh Iblock

The wrapper script should be usable from mathlab or wherever you need it. On windows you should be able to write a .bat file that does the same ...

Cheers,
Henrik