Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calculix-ccx ucrt error (comma instead of dot) #22630

Closed
2 of 6 tasks
3rav opened this issue Nov 23, 2024 · 7 comments · Fixed by #22849
Closed
2 of 6 tasks

calculix-ccx ucrt error (comma instead of dot) #22630

3rav opened this issue Nov 23, 2024 · 7 comments · Fixed by #22849
Labels

Comments

@3rav
Copy link
Contributor

3rav commented Nov 23, 2024

Description / Steps to reproduce the issue

Run this input, and see input.frd

$ ccx -i input

input.inp:

***********************************************************************
*NODE, NSET=Nall
       1,5.000000000000e+01,5.000000000000e+01,0.000000000000e+00
       2,5.000000000000e+01,0.000000000000e+00,0.000000000000e+00
       3,5.000000000000e+01,0.000000000000e+00,5.000000000000e+01
       4,5.000000000000e+01,5.000000000000e+01,5.000000000000e+01
       5,0.000000000000e+00,5.000000000000e+01,0.000000000000e+00
       6,0.000000000000e+00,0.000000000000e+00,0.000000000000e+00
       7,0.000000000000e+00,0.000000000000e+00,5.000000000000e+01
       8,0.000000000000e+00,5.000000000000e+01,5.000000000000e+01
*ELEMENT, TYPE=C3D8, ELSET=Eall
     1,     1,     2,     3,     4,     5,     6,     7,     8
***********************************************************************
*NSET,NSET=Nfix 
1, 2, 5, 6, 
***********************************************************************
*NSET,NSET=Nload 
3, 4, 7, 8, 
***********************************************************************
*BOUNDARY
Nfix, 1,3,,
***********************************************************************
*MATERIAL, NAME=17-4PH_H1025
*ELASTIC
210.e+3, 0.3
*EXPANSION,TYPE=ISO,ZERO=20.
1.2e-5
*SOLID SECTION, ELSET=Eall, MATERIAL=17-4PH_H1025
***********************************************************************
*STEP,NLGEOM=YES
*STATIC,SOLVER=SPOOLES
0.1, 1., 1e-05, 0.1
***********************************************************************
*BOUNDARY
Nload, 3,3,-.8,
***********************************************************************
*NODE FILE
U, NT
*NODE PRINT, NSET=Nfix, TOTALS=ONLY
U
***********************************************************************
*EL FILE
S, E, PEEQ
*END STEP

Expected behavior

Good results (mingw64 and clang 64) from ccx:

    1C
    1UUSER                                                              
    1UDATE              23.november.2024                                
    1UTIME              15:53:33                                        
    1UHOST                                                              
    1UPGM               CalculiX                                        
    1UVERSION           Version 2.22                             
    1UCOMPILETIME       Mon Aug  5 19:15:25 CEST 2024                    
    1UDIR                                                               
    1UDBN                                                               
    1UMAT    117-4PH_H1025                                              
    2C                         29791                                     1
 -1         1 5.00000E+01 5.00000E+01 0.00000E+00
 -1         2 5.00000E+01 4.83333E+01 0.00000E+00
 -1         3 5.00000E+01 4.83333E+01 1.66667E+00
 -1         4 5.00000E+01 5.00000E+01 1.66667E+00

mingw64

Actual behavior

Results (ucrt64) from ccx:

    1C
    1UUSER                                                              
    1UDATE              23.november.2024                                
    1UTIME              15:59:24                                        
    1UHOST                                                              
    1UPGM               CalculiX                                        
    1UVERSION           Version 2.22                             
    1UCOMPILETIME       Mon Aug  5 19:15:25 CEST 2024                    
    1UDIR                                                               
    1UDBN                                                               
    1UMAT    117-4PH_H1025                                              
    2C                         29791                                     1
 -1         1 5,00000E+01 5,00000E+01 0,00000E+00
 -1         2 5,00000E+01 4,83333E+01 0,00000E+00
 -1         3 5,00000E+01 4,83333E+01 1,66667E+00
 -1         4 5,00000E+01 5,00000E+01 1,66667E+00
 -1         5 4,83333E+01 5,00000E+01 0,00000E+00

ucrt64

Verification

Windows Version

MINGW64_NT-10.0-26100

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

no

@3rav 3rav added the bug label Nov 23, 2024
@3rav
Copy link
Contributor Author

3rav commented Dec 20, 2024

ccx output mingw64 (OK):

 increment 1 attempt 1 
 increment size= 1.000000e-02
 sum of previous increments=0.000000e+00
 actual step time=1.000000e-02
 actual total time=1.000000e-02

ccx output ucrt64 (NOK):

 increment 1 attempt 1 
 increment size= 1,000000e-02
 sum of previous increments=0,000000e+00
 actual step time=1,000000e-02
 actual total time=1,000000e-02

So the whole program has a problem with the decimal symbol, not just the stored results.

@lazka, @Biswa96, @MehdiChinoune

I am currently using mingw64 environment but I wanted to switch to recommended ucrt64, but this error is stopping me. Please help me solve this problem, I have no idea why this is happening.

@Biswa96
Copy link
Member

Biswa96 commented Dec 20, 2024

I can not reproduce the issue with ucrt64 environment.

Could you check if the sample code from this URL also reproduces the issue? https://learn.microsoft.com/en-us/cpp/c-runtime-library/set-output-format

@3rav
Copy link
Contributor Author

3rav commented Dec 20, 2024

I can not reproduce the issue with ucrt64 environment.

Could you check if the sample code from this URL also reproduces the issue? https://learn.microsoft.com/en-us/cpp/c-runtime-library/set-output-format

I tested the example on 2 computers now and this error occurs, due to the fact that the example contains only 1 element, the cube is displayed correctly (the graphic above contained over 100 elements), however the output file .frd from the ucrt64 version has commas instead of dots.

    1C
    1UUSER                                                              
    1UDATE              20.december.2024                                
    1UTIME              16:50:44                                        
    1UHOST                                                              
    1UPGM               CalculiX                                        
    1UVERSION           Version 2.22                             
    1UCOMPILETIME       Mon Aug  5 19:15:25 CEST 2024                    
    1UDIR                                                               
    1UDBN                                                               
    1UMAT    117-4PH_H1025                                              
    2C                             8                                     1
 -1         1 5,00000E+01 5,00000E+01 0,00000E+00
 -1         2 5,00000E+01 0,00000E+00 0,00000E+00
 -1         3 5,00000E+01 0,00000E+00 5,00000E+01
 -1         4 5,00000E+01 5,00000E+01 5,00000E+01
 -1         5 0,00000E+00 5,00000E+01 0,00000E+00
 -1         6 0,00000E+00 0,00000E+00 0,00000E+00
 -1         7 0,00000E+00 0,00000E+00 5,00000E+01
 -1         8 0,00000E+00 5,00000E+01 5,00000E+01
 -3
    3C                             1                                     1
 -1         1    1    0    1
 -2         1         2         3         4         5         6         7         8
 -3
    1PSTEP                         1           1           1          
  100CL  101 1,000000000           8                     0    1           1
 -4  DISP        4    1
 -5  D1          1    2    1    0
 -5  D2          1    2    2    0
 -5  D3          1    2    3    0
 -5  ALL         1    2    0    0    1ALL
 -1         1 0,00000E+00 0,00000E+00 0,00000E+00
 -1         2 0,00000E+00 0,00000E+00 0,00000E+00
 -1         3 1,71429E-01-1,71429E-01-8,00000E-01
 -1         4 1,71429E-01 1,71429E-01-8,00000E-01
 -1         5 0,00000E+00 0,00000E+00 0,00000E+00
 -1         6 0,00000E+00 0,00000E+00 0,00000E+00
 -1         7-1,71429E-01-1,71429E-01-8,00000E-01
 -1         8-1,71429E-01 1,71429E-01-8,00000E-01
 -3
    1PSTEP                         2           1           1          
  100CL  101 1,000000000           8                     0    1           1
 -4  STRESS      6    1
 -5  SXX         1    4    1    1
 -5  SYY         1    4    2    2
 -5  SZZ         1    4    3    3
 -5  SXY         1    4    1    2
 -5  SYZ         1    4    2    3
 -5  SZX         1    4    3    1
 -1         1-1,93843E+03-1,93843E+03-4,52292E+03 1,15479E-14 2,76921E+02 2,76921E+02
 -1         2-1,93843E+03-1,93843E+03-4,52292E+03-1,54414E-14-2,76921E+02 2,76921E+02
 -1         3 8,30783E+02 8,30783E+02-2,86140E+03 2,52538E-14-2,76921E+02 2,76921E+02
 -1         4 8,30783E+02 8,30783E+02-2,86140E+03 3,73115E-13 2,76921E+02 2,76921E+02
 -1         5-1,93843E+03-1,93843E+03-4,52292E+03 4,04206E-14 2,76921E+02-2,76921E+02
 -1         6-1,93843E+03-1,93843E+03-4,52292E+03-2,50309E-14-2,76921E+02-2,76921E+02
 -1         7 8,30783E+02 8,30783E+02-2,86140E+03-1,36336E-13-2,76921E+02-2,76921E+02
 -1         8 8,30783E+02 8,30783E+02-2,86140E+03 6,79806E-14 2,76921E+02-2,76921E+02
 -3
    1PSTEP                         3           1           1          
  100CL  101 1,000000000           8                     0    1           1
 -4  TOSTRAIN    6    1
 -5  EXX         1    4    1    1
 -5  EYY         1    4    2    2
 -5  EZZ         1    4    3    3
 -5  EXY         1    4    1    2
 -5  EYZ         1    4    2    3
 -5  EZX         1    4    3    1
 -1         1-1,15749E-07-1,15749E-07-1,59994E-02 7,14869E-20 1,71427E-03 1,71427E-03
 -1         2-1,15749E-07-1,15749E-07-1,59994E-02-9,55898E-20-1,71427E-03 1,71427E-03
 -1         3 6,85698E-03 6,85698E-03-1,59994E-02 1,56333E-19-1,71427E-03 1,71427E-03
 -1         4 6,85698E-03 6,85698E-03-1,59994E-02 2,30976E-18 1,71427E-03 1,71427E-03
 -1         5-1,15749E-07-1,15749E-07-1,59994E-02 2,50223E-19 1,71427E-03-1,71427E-03
 -1         6-1,15749E-07-1,15749E-07-1,59994E-02-1,54953E-19-1,71427E-03-1,71427E-03
 -1         7 6,85698E-03 6,85698E-03-1,59994E-02-8,43985E-19-1,71427E-03-1,71427E-03
 -1         8 6,85698E-03 6,85698E-03-1,59994E-02 4,20832E-19 1,71427E-03-1,71427E-03
 -3
    1PSTEP                         4           1           1          
  100CL  101 1,000000000           8                     0    1           1
 -4  ERROR       1    1
 -5  STR(%)      1    1    0    0
 -1         1 1,12061E+01
 -1         2 1,12061E+01
 -1         3 1,12061E+01
 -1         4 1,12061E+01
 -1         5 1,12061E+01
 -1         6 1,12061E+01
 -1         7 1,12061E+01
 -1         8 1,12061E+01
 -3
 9999

@MehdiChinoune
Copy link
Collaborator

It looks like something to do with your locale default numeric format settings. Try change it to en_US and see if It fixed the issue for you.
https://support.microsoft.com/en-us/office/change-the-windows-regional-settings-to-modify-the-appearance-of-some-data-types-in-access-databases-edf41006-f6e2-4360-bc1b-30e9e8a54989

@3rav
Copy link
Contributor Author

3rav commented Dec 20, 2024

I created a virtual machine (virtualbox Windows 10) to make sure the machine is clean, after changing the decimal separator in the main windows settings from , to . it helped and now it's ok.

However, the mingw64 version does not require such a change, is it possible to achieve this in a different way, globally (so that regardless of the windows settings there will always be .)?

@MehdiChinoune
Copy link
Collaborator

Yes, I could set locale to us or C, I will open a PR for that.

@3rav
Copy link
Contributor Author

3rav commented Dec 20, 2024

Great, thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants