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

Load Mesh file to C++

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

Reply
 
LinkBack Thread Tools 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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
2.0.x on Mac OSX niklas OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 74 March 28, 2012 16:46
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12: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 18:36.