-
-
August 17, 2023 at 10:49 am
Aleksandr Zhadkovskii
SubscriberHi!
I'm trying to implement an algorithm that calculates the principal stresses of the model during its solution to assess damage by some simple criterion "real-time". I am trying to use Intel MKL to do so, but I've come across some problems that I'm not sure how to solve.
First, I tried using dhseqr to get eigenvalues and then sorting them as principal stresses. However, for some reason, if a call to this function is presented in a compiled block of code in subprograms, solver is unable to converge even if I'm not using a function with this call (I use usermat.F, and I have different subroutine (say, "subroutine eigvalcalc") to calculate principal stresses, in which I call dhseqr). Even if I don't call eigvalcalc inside usermat.F usermat3d, solution fails to converge. If I comment out the line calling dhseqr solution converges just fine. What could be the problem in this case?
Secondly, I tried calculating eigenvalues myself. Again, to aid in this, I am using intel-provided functions such as dgemm, dnrm2, ddot, e.t.c. A standalone project in VS compiles and runs just fine, but with ANSYS I'm getting an error when linking saying that ansblas_dgemm, ansblas_dnrm2, e.t.c. can not be found by the linker. My understanding is that ANSYS uses a self-provided BLAS library (ansBLAS.lib can indeed be found in the ANSYS directory), and I've seen include-file redefining calls to functions like dnrm2 to ansblas_dnrm2. How can I overcome this and call Intel-provided functions? Or how can I access ANSYS-provided functions?
I am using subroutines with the help of the /UPF command and trying to avoid building custom executable. I also edited the ansupf.bat file to include the /Qmkl argument when calling ifort (like "ifort %COMMACS% %FMACS% %COMSWITCH% %FSWITCH% %MACS64% /Qmkl *.F >>compile.log 2>&1").
Versions of Intel Fortran Compiler and Intel MKL are the last ones at the moment provided in intel oneAPI (2023.2.0).
Thanks in advance.
-
August 21, 2023 at 3:48 pm
David Weed
Ansys EmployeeHi Aleksandr,
Can you specify which version of ANSYS you are using and on what platform (Win/Linux)? Please note that we do not currently support usage of Intel OneAPI for compiling/linking and we also do not recommend modifying the ansupf.bat file.
-
August 21, 2023 at 10:07 pm
Aleksandr Zhadkovskii
SubscriberI’m using 22R1 on Windows. Unfortunately, I have to use one API, as other versions are harder to find nowadays. ansupf.bat has to be slightly adjusted as paths there are for compiler from Parallel Studio, I think.
I rewrote my subroutines to calculate eigenvalues with a simple QR-algorithm while using only Ansys provided subroutines (as vmult, vnorm, e.t.c.); however, I cannot find a subroutine for matrix multiplication, and I believe my subroutine for this and the method itself are kind of slow, so it’s not a perfect solution. Are there any substitutes for Intel MKL libraries? Maybe I can use the ANSYS-provided BLAS-libraries AnsBLAS as I believe they should be similar.
Alternatively, I avoided using a custom executable and tried using only the /UPF-method, but maybe there are variants to get principal stresses in usermat during solution while using custom executable? I’ve seen the ensget function; however, the return (value) of this function was kind of weird, and I was not sure if it was correct.
-
August 24, 2023 at 9:53 pm
David Weed
Ansys EmployeeThe supported IFORT compiler and MS VS versions for 22R1 for Windows:
Microsoft Visual Studio Professional 2019 Version 16.0.22 (including the MS C++ compiler), Intel C++ and Intel Visual FORTRAN 2019 Update 5 (2019.5.281)
For Linux:
Intel 2019.3 Parallel Studio XE (FORTRAN, C, C++) and GCC 8.2.0 (for user programmable features)
We currently don’t support OneAPI and it could produce unexpected results. I know that there were some changes made to the Intel site and it can be difficult to find older versions, but if you have an Intel subscription, you can consider reaching out to their support team.
Regarding the ensget function, this will only work post solution. You may want to try NDSPGT which is valid during the solution. Also, note that NDSPGT may require the common block ansysdef.inc. If you’re on the Windows platform, then you’ll need to use the custom executable method in order to pull information from the common blocks. Using the /UPF method will require the invocation of additional data sharing routines. It’s easier to use a custom exe instead. On the Linux platform, data sharing from the common blocks isn’t an issue, so you may use the /UPF or shared library method with no issue when using NDSPGT.
I’d have to check into BLAS/AnsBLAS libraries to see if they can be used.
-
August 25, 2023 at 9:38 am
Aleksandr Zhadkovskii
SubscriberThanks for the answer!
So that’s why ensget values were bad. I’ll check on how to use subroutines in post, as it’s not crucial whether I’m calculating a criterion during solution or in post.
Regarding the use of the AnsBLAS library, at the end of every solution in ANSYS, the next information is printed:
Compiler: Intel(R) Fortran Compiler Version 19.0.5 (Build: 20190815)
Intel(R) C/C++ Compiler Version 19.0.5 (Build: 20190815)
Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191125
BLAS Library supplied by Intel(R) MKLSo, I believe that BLAS is used at least in some capacity. However, I’m not sure how to call it (due to the error stated in the original post), so I’m looking forward to information considering this!
EDIT: Also, a follow-up question: are there any examples of post-subroutines? I cannot seem to find them.
-
-
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Solver Pivot Warning in Beam Element Model
- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- User manual
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- whether have the difference between using contact and target bodies
- Defining rigid body and contact
- Colors and Mesh Display
-
7690
-
4484
-
2957
-
1435
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.