CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Reading mesh from variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2018, 05:51
Default Reading mesh from variable
  #1
New Member
 
Mattias Stridh
Join Date: Mar 2018
Posts: 2
Rep Power: 0
Stridh is on a distinguished road
Hello,
I have a very problem which I am sure has a very simple solution but I don't seem to find it. I have a journal file and in that file I read meshes and journals from another folder. I want to make a variable called path to the folder and only add the file name when I do the reading. What I want to do is

(define path "/home/.../working_folder/")
file/read-mesh (string-append path "my_mesh.msh")
file/read-journal (string-append path "my_journal.jou")

But read-mesh tries to read (string-append...
Same thing if I do

(define path "/home/.../working_folder/")
(define full_path (string-append path "my_mesh.msh"))
file/read-mesh full_path

"Error: File "full_path" not found!"

I am in a Linux environment.

Thanks
Stridh is offline   Reply With Quote

Old   March 25, 2018, 22:50
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Quote:
Originally Posted by Stridh View Post
Hello,
I have a very problem which I am sure has a very simple solution but I don't seem to find it. I have a journal file and in that file I read meshes and journals from another folder. I want to make a variable called path to the folder and only add the file name when I do the reading. What I want to do is

(define path "/home/.../working_folder/")
file/read-mesh (string-append path "my_mesh.msh")
file/read-journal (string-append path "my_journal.jou")

But read-mesh tries to read (string-append...
Same thing if I do

(define path "/home/.../working_folder/")
(define full_path (string-append path "my_mesh.msh"))
file/read-mesh full_path

"Error: File "full_path" not found!"

I am in a Linux environment.

Thanks
there is no macros read-mesh, use read-case instead
you may try to use this function
Code:
(ti-menu-load-string (format #f "file r-c  ~a OK\n" (string-append path "my_mesh.msh")))
best regards
AlexanderZ is offline   Reply With Quote

Old   March 26, 2018, 04:13
Default
  #3
New Member
 
Mattias Stridh
Join Date: Mar 2018
Posts: 2
Rep Power: 0
Stridh is on a distinguished road
Great! Thank you
Stridh is offline   Reply With Quote

Reply


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
[ICEM] Error reading 2D hybrid ICEM mesh into Fluent Kloz ANSYS Meshing & Geometry 1 June 6, 2016 14:45
Cht tutorial in 15 braennstroem OpenFOAM Running, Solving & CFD 197 June 10, 2015 04:02
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09


All times are GMT -4. The time now is 19:14.