[SOLVED] .frd results different between ASCII and binary formats

Hi,

I’ve encountered some odd behavior and I can’t figure out if it is the fault of CalculiX or my code.

I’ve written some code to read both ASCII and binary .frd files, and I am noticing differences in values between the two formats.

For ASCII results, I am using the *NODE FILE and *EL FILE cards and for binary results, the *NODE OUTPUT and *ELEMENT OUTPUT, respectively. Everything else stays the same.

Running a simple statics job using ASCII results yields consistent results every time - the values are the same every time CalculiX is run as expected.

Running the same job with binary outputs yields varying results each time CalculiX is run. Sometimes the differences are small (<1e-10 units) but sometimes are much larger (>0.001 units). Either way, they are big enough to cause problems and clear discrepancies in results.

I have tried with the latest official build as well as my own compilation with GCC on Windows x64.

Diffing several consecutive ASCII tests only shows differences in the timestamp.

Removing the timestamp from the binary results and diffing them shows differences between runs.

I can’t seem to attach anything other than images, so here is what the input file looks like. The only change is the output cards:

Any clues about what’s going on?

Best,

Tom

You can upload the input file(s) to some hosting website and share the link here.

Ah, right :stuck_out_tongue:

Here is a link to a Google Drive folder with the files:
https://drive.google.com/open?id=1cn7j7gyenAScJJxoZ2xXBUqCkMysdT43&usp=drive_fs

I’ve been looking through frd.c and frdvector.c since that seems to be where the important stuff happens, but so far all looks fine in terms of possible differences between writing both formats.

The difference seems to only be in the displacements, is that right? Stress and strain seem closer/the same just by looking at the contour plots.

If I’m understanding the input file right, it looks like there’s no constraint against rotation about the axis through the two constrained nodes. Just balanced moments. You can’t trust moments to balance exactly so that could explain unpredictable rigid body displacement while stress is the same.

Looking at the deformed view, there is indeed rotation about the X axis in the binary file but not the ascii one. I don’t think this is a real problem. Maybe the slightly different code paths lead to random differences in how the solver copes with a singular matrix.

1 Like

Thanks, that’s a good point.

The differences were coming up in all fields, even in the ERROR field, but were inconsistent between runs.

After adding constraints for axes 1 and 3 on the rotational nodes, it seems to now be delivering consistent results in the binary output, but I will keep an eye for it.

The difference between ASCII and binary outputs now just seems to be a matter of numerical precision in the ASCII file (5 decimal places), so I guess that makes sense.

Looks like operator error in the end :wink: Thanks again!