CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Load Mesh file to C++

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 6, 2008, 01:52
Default Load Mesh file to C++
  #1
ehsan
Guest
 
Posts: n/a
Hi How can i load Mesh file from Gambit to C++ ? with all Node,Element,Boundary !!!
  Reply With Quote

Old   August 6, 2008, 12:58
Default Re: Load Mesh file to C++
  #2
Ahmed
Guest
 
Posts: n/a
save the mesh file in text format (in Gambit it is called nuetral format)
  Reply With Quote

Old   August 8, 2008, 12:28
Default Re: Load Mesh file to C++
  #3
ehsan
Guest
 
Posts: n/a
I know that, but my problem is: how can i read that with C++?? with what operation,function & how ???
  Reply With Quote

Old   August 11, 2008, 02:01
Default Re: Load Mesh file to C++
  #4
Markus Lummer
Guest
 
Posts: n/a
You can use the C++ input stream cin or the usual C-functions.
  Reply With Quote

Old   August 11, 2008, 03:14
Default Re: Load Mesh file to C++
  #5
ehsan
Guest
 
Posts: n/a
can u explain it more ? i read it like this (C++): fstream infile("Grid.txt");

and after that i use two 'for' loop for X&y, but it didn't work !!!
  Reply With Quote

Old   August 11, 2008, 03:18
Default Re: Load Mesh file to C++
  #6
Markus Lummer
Guest
 
Posts: n/a
Try

ifstream infile("Grid.txt");

infile >> x; infile >> y; // etc.
  Reply With Quote

Old   August 15, 2008, 07:29
Default Re: Load Mesh file to C++
  #7
ehsan
Guest
 
Posts: n/a
i found it but iused with

FILE* f; f=fopen("filename"; scanf(f,"r");

it's read one line ...
  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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
2.0.x on Mac OSX niklas OpenFOAM Installation 74 March 28, 2012 16:46
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


All times are GMT -4. The time now is 04:00.