smdogroup / tacs

Finite-element library for analysis and adjoint-based gradient evaluation
Apache License 2.0
108 stars 75 forks source link

Fixing errors caused by `icpx` compilation #316

Closed A-CGray closed 5 months ago

A-CGray commented 5 months ago

Compiling TACS with the new intel icpx compiler surfaced some new errors, one in element_tests/test_pressure_2d and another in integration_tests/test_thermoelast_linquad_element_2d.py. Changes made:

Example of TACSPressure2d issue:

Before fix:

Testing residual consistency of addJacobian method for element TACSPressure2D.
Max Err: 5.2003e+00 in component 0.
Max REr: 1.7875e+00 in component 0.
The difference between addResidual and addJacobian residuals is
Val[   ]                  Analytic               Approximate                Rel. Error                Abs. Error
res[  0]   -8.1096044075844116e+00   -2.9092966201960104e+00    1.7874794035398276e+00    5.2003077873884012e+00
res[  1]   -6.6968190566401757e+00   -2.4024640498279082e+00    1.7874794035398274e+00    4.2943550068122676e+00
res[  2]    1.8409218189066476e+00   -2.9092966201960104e+00    1.6327721299118061e+00    4.7502184391026585e+00
res[  3]    1.5202122938461484e+00   -2.4024640498279082e+00    1.6327721299118059e+00    3.9226763436740564e+00
res[  4]    4.5008934828574299e-01    0.0000000000000000e+00                         -    4.5008934828574299e-01
res[  5]    3.7167866313821141e-01    0.0000000000000000e+00                         -    3.7167866313821141e-01

After fix:

Testing residual consistency of addJacobian method for element TACSPressure2D.
Max Err: 0.0000e+00 in component 0.
Max REr: 0.0000e+00 in component 0.
The difference between addResidual and addJacobian residuals is
Val[   ]                  Analytic               Approximate                Rel. Error                Abs. Error
res[  0]   -2.9092966201960104e+00   -2.9092966201960104e+00    0.0000000000000000e+00    0.0000000000000000e+00
res[  1]   -2.4024640498279082e+00   -2.4024640498279082e+00    0.0000000000000000e+00    0.0000000000000000e+00
res[  2]   -2.9092966201960104e+00   -2.9092966201960104e+00    0.0000000000000000e+00    0.0000000000000000e+00
res[  3]   -2.4024640498279082e+00   -2.4024640498279082e+00    0.0000000000000000e+00    0.0000000000000000e+00
res[  4]    0.0000000000000000e+00    0.0000000000000000e+00                         -    0.0000000000000000e+00
res[  5]    0.0000000000000000e+00    0.0000000000000000e+00                         -    0.0000000000000000e+00