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 Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2019, 08:16
Default using transformPoints in a bash script
  #1
Member
 
Join Date: Jun 2014
Location: Turkey
Posts: 58
Rep Power: 12
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
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
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'.
HPE is offline   Reply With Quote

Old   September 22, 2019, 10:10
Default
  #3
Member
 
Join Date: Jun 2014
Location: Turkey
Posts: 58
Rep Power: 12
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
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
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"
jipai and SimpleSIM like this.
HPE is offline   Reply With Quote

Old   September 22, 2019, 11:22
Default
  #5
Member
 
Join Date: Jun 2014
Location: Turkey
Posts: 58
Rep Power: 12
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


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 35 September 21, 2020 04:27
[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 13:39.