CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

using transformPoints in a bash script

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2019, 08:16
Default using transformPoints in a bash script
  #1
New Member
 
azim turan
Join Date: Jun 2014
Posts: 10
Rep Power: 7
koful is on a distinguished road
Hi everyone.

I would like to ask a "probably" very easy question. I am a little bit newbie at linux bash scripting.

I have a center of mass point "p", which comes from another calculation. How can I use it in tansformPoints command? I tried these different ways below but it does not work...

p="(0 0 0)"
transformPoints -translate '($p)'

p=\'\(\ 0\ 0\ 0\ \)\'
transformPoints -translate $p

trans='transformPoints'\ '-translate'\ \'\(0\ 0\ 0\)\'
$trans

I do not know should I post it at linux forums or openfoam forums.
koful is offline   Reply With Quote

Old   September 22, 2019, 09:04
Default
  #2
HPE
New Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 27
Rep Power: 2
HPE is on a distinguished road
Have you sourced OpenFOAM bashrc before executing the bash script or inside the bash script?

Don't know the error type you get, yet the bash script should be informed regarding the OpenFOAM command 'transformPoints'.
__________________
Kind regards,
HPE
HPE is offline   Reply With Quote

Old   September 22, 2019, 10:10
Default
  #3
New Member
 
azim turan
Join Date: Jun 2014
Posts: 10
Rep Power: 7
koful is on a distinguished road
Quote:
Originally Posted by HPE View Post
Have you sourced OpenFOAM bashrc before executing the bash script or inside the bash script?

Don't know the error type you get, yet the bash script should be informed regarding the OpenFOAM command 'transformPoints'.
Hi. Thank you for your response.

Yes I did. The other commands at my script are working. Like blockMesh or checkMesh. The error I got is:

"--> FOAM FATAL ERROR:
Wrong number of arguments, expected 0 found 2


FOAM exiting"
koful is offline   Reply With Quote

Old   September 22, 2019, 10:30
Default
  #4
HPE
New Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 27
Rep Power: 2
HPE is on a distinguished road
Have a go, if possible:

Code:
#!/bin/sh                                                                                                                                                                                     
cd ${0%/*} || exit 1                        # Run from this directory           
                                                                                
vector="(0 0 20)"                                                               
                                                                                
transformPoints -translate "$vector"
__________________
Kind regards,
HPE
HPE is offline   Reply With Quote

Old   September 22, 2019, 11:22
Default
  #5
New Member
 
azim turan
Join Date: Jun 2014
Posts: 10
Rep Power: 7
koful is on a distinguished road
Quote:
Originally Posted by HPE View Post
Have a go, if possible:

Code:
#!/bin/sh                                                                                                                                                                                     
cd ${0%/*} || exit 1                        # Run from this directory           
                                                                                
vector="(0 0 20)"                                                               
                                                                                
transformPoints -translate "$vector"
Thank you very much sir. It worked.

I tried lots of configurations but seems like I missed this one.

Thanks again, have a nice day.
koful is offline   Reply With Quote

Reply

Tags
bash, meshing, openfoam, scripting, transformpoints

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch scripts Bdew8556 OpenFOAM Running, Solving & CFD 34 May 11, 2019 09:51
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
bash script information FluentStarter STAR-CCM+ 6 January 31, 2017 12:17
CCM+ bash script output format hebeldebel STAR-CCM+ 1 February 20, 2014 08:38
run openfoam with bash script Gosi OpenFOAM 2 April 11, 2013 10:10


All times are GMT -4. The time now is 01:55.