Hi Ricky, A quick google search with the terms "c++, read data from file" might reveal the information you're looking for. Perhaps this website has the answer: http://www.bgsu.edu/departments/compsci/docs/read.html If you're reading data that is all numeric, then you simply pass the information from the ifstream to a variable of type "double" and go on your way. Of course, if you are dealing with point and value data then you'd have to parse the read-in information yourself.
An alternative, if I may suggest, is to generate the random numbers using the rand() function in the <cstdlib> library: http://www.daniweb.com/forums/thread1769.html http://www.daniweb.com/forums/thread114163.html It is possible to bound the values generated by the function. You could also seed the generation of the numbers (using srand() ) so that, although it appears that truely random numbers are generated, you can produce the same set of numbers at will at any occasion. J-P On 18 March 2010 04:53, Ricky Donyina-Ameyaw <[email protected]> wrote: > Hi, > Is there any tutorial which shows how to import a file to deal.ii (eg, > importing a file which contains random numbers to substitite the > permeability tensor of step-21)? I had a look at step-19, but it wasnt all > that helpful for me. Thanks > Ricky > > > > _______________________________________________ > dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii >
_______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
