Dear all,

my deal.ii program is called roughly 300 times from a matlab script for the 
purpose of a parameter identification. In essence, given some parameters, 
the matlab script calls deal.ii to compute a displacement field. I exchange 
the data transfer between deal.ii and matlab by reading from and writing 
into files. In particular, I store the parameters in a file with 13 digits 
after the decimal point since there are finite-difference calculations 
involved.
I double-checked that my simulations are deterministic, i.e. the parameters 
at all 300 calls to deal.ii are identical if I re-run the matlab script 
anew. By identical, I mean that all 13 digits coincide.

My deal.ii program has, besides the standard data structures 
(Triangulation, DoFHandler,...), a pointer to a class as member variable. 
This class has a member function, which is called during assembly of the 
linear system to calculate a stress tensor. Within this member function, I 
created a
std::ofstream out_data("/a/path/file.txt")
object and wrote the calculated stress into this file:
out_data<<stress<<std::endl
The point is that I really just write the stress to the file. 
Neither my deal.ii program nor the matlab script read from this file. 
I just created it to have a look at the stress values.

However, after adding 
out_data<<stress<<std::endl 
to the above member function, I observed that the parameters up to the 24th 
call to deal.ii are identical compared to the parameters without having 
this line of code, 
but in the 25th call, some parameters are different at the last three 
digits, i.e. 
the first 10 digits are still identical and the last three differ.
This error sums up in the following calls...
These results are also deterministic: Re-running the matlab script anew 
gives the same false parameters in the 25th call...
If I comment really only the line 
//out_data<<stress<<std::endl 
I obtain again the correct parameters.

Having all that said, is there any reasonable argument as to what could 
cause the program output to be different by just adding ...<<... statement?
Admittedly, I do not know how to debug this further, because there is in 
theory 
nothing to debug if I can trace the differences back to the ...<<... 
statement.

Thank you and best regards
Simon

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/d634e1f9-45b3-4352-b8f1-8cc804de6b95n%40googlegroups.com.

Reply via email to