Skip to main content
FluidEarth Portal Header version 3

FluidEarth Portal

Go Search
  
FluidEarth Portal > FluidEarth Discussions > How to read data from files and write data to files > How to read data from files and write data to files?  

FluidEarth Discussions: How to read data from files and write data to files?

Body

Hi Andy,
 
attached a renamed zip file containing a trivial c# example model that reads data from a file called fileIN.txt during initialisation and writes data to a file called fileOUT.txt during compute. i have commented the bits you need to look out for with '//GRG:', so if you search on that across the engine.cs file you will see what i am doing.
 
the model omi, xml and input text file are in /bin/data/ and should work without recompiling.

...the caveats!! 
 
1. please be aware i am not a c# programmer - this works, but may not be a terribly intelligent way of doing things.
 
2. i would suggest that there are likely to be many different ways of doing this kind of thing, and the attached is only an example to get you going; i would recommend you search msdn, codeproject or another online dev resource to find out what other (and most probably better) ways of doing this exist.
 
but other than that, i hope this gets you going.
 
good luck,
 
gordon

From: ABarkwith
Posted: 13 April 2011 13:52
Subject: How to read data from files and write data to files?

Hi,

 

How would you do I/O files for c# projects in FluidEarth?

 

Andy

Attachments
CSharpTest.zipRENAME    
Content Type: Message
Created at 14/04/2011 09:09  by GGlasgow 
Last modified at 14/04/2011 09:09  by GGlasgow