Compile the UDF
Hello guys,
I have got a trouble while using AcuSolve cmd prompt to compile the UDF file.
To be more precise, i am doing an AcuSolve tutorial ACU-4002: sloshing of water in a tank.
There was a step:
<?xml version="1.0" encoding="UTF-8"?>
I have follow the intructions but the cmd prompt have an error like below:
while:
'C:\Users\ducho\Desktop\multiphase' is my working directory for this case and it has already contained 'gravity.c' file (copied from AcuSolve tutorials-model files)
I also searched for more help on AcuSolve user-define function manunal but didnt found.
So can you guys help me out?
appreciate any help. Thank you!
Find more posts tagged with
Try just typing
acuMakeDll
and return, without adding '-src gravity.c' - and see which errors are returned. As mentioned, you do need to have a compiler installed. It seems Visual Studio Community is the latest free version from Microsoft.
AcuSolve installation does not have a C/C++ Compiler. So you would need to install a compiler seprately and then link the compiler to AcuSolve.
Windows system would probably work well with Microsoft Visual Studio.
Linux systems generally have GCC preinstalled.
Thank you guys,
I have found the issue.
My computer didn't have any C/C++ compiler.
Altair university also has a post about this problem.
Share to others who have faced problem like me : https://altairuniversity.com/11523-acusolve-search-for-installed-compiler-tips-tricks/
Hello:
I have encountered some problems in learning acusolve acu-4002, and I have been unable to run gravity.c file. My compiler software has been installed (VS2013), and the environment configuration has been completed according to the relevant information (Figure 1). However, the following problem was encountered in operation (Figure 2). The gravity. obj file cannot be found, nor can the. Dll file be generated.
I also tried to run gravity. C program separately in VS2013, but I also found many errors. (Fig. 3)
1. error LNK2019: Unparsable external symbol _udfCheckNumUsrVals, which is referenced in function _usrGravity
2. error LNK1120: Three unresolved external commands
3. IntelliSense: Undefined identifier 'Integer'
4. IntelliSense: Undefined identifier 'String'
5. IntelliSense: Undefined identifier 'Void'
6. IntelliSense: Undefined identifier 'Real'
I hope you can help me. Thank you very much.
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Hello guys,
I have got a trouble while using AcuSolve cmd prompt to compile the UDF file.
To be more precise, i am doing an AcuSolve tutorial ACU-4002: sloshing of water in a tank.
There was a step:
<?xml version="1.0" encoding="UTF-8"?>
![]()
I have follow the intructions but the cmd prompt have an error like below:
<?xml version="1.0" encoding="UTF-8"?>
![]()
while:
'C:\Users\ducho\Desktop\multiphase' is my working directory for this case and it has already contained 'gravity.c' file (copied from AcuSolve tutorials-model files)
I also searched for more help on AcuSolve user-define function manunal but didnt found.
So can you guys help me out?
appreciate any help. Thank you!
Hello,
'C: Users ducho Desktop multiphase' Is this your working file?
How is this set up? When I open my acusolve CMD prompt, default d: Document, do you know how to set it to the current working folder?
You don't post the image of the compile attempt where it actually shows errors. Please use the AcuSolve Command Prompt and go into the directory where the gravity.c user function resides. Then issue the command, maybe first without any options - just:
acuMakeDll
and see what happens.
Thank you very much
I have a few questions to ask you.
Question 1:
Interface for starting acusolve Cmd prompt
Default d:\ Documents>
Is that right?
If not, how do I modify the path?
Do I need to set the path of the model folder?
You don't post the image of the compile attempt where it actually shows errors. Please use the AcuSolve Command Prompt and go into the directory where the gravity.c user function resides. Then issue the command, maybe first without any options - just:
acuMakeDll
and see what happens.
Question 2
Enter only acuMakeDll to display the following information
You don't post the image of the compile attempt where it actually shows errors. Please use the AcuSolve Command Prompt and go into the directory where the gravity.c user function resides. Then issue the command, maybe first without any options - just:
acuMakeDll
and see what happens.
Question 3
Header files: acusim.h and udf.h
Source file: gravity.c
Running in VS2013, the following errors occurred:
Error LNK2019: Unparsable external symbol udfGetUsrVals, which is quoted in the function usrGravity as Documents ACU4002_Sloshing Tank Console Application 3 Console Application 3 Console Application 3 y. obj
Error 4 LNK1120: Three unresolved external commands Documents ACU4002_Sloshing Tank Console Application 3 x64 Debug Console Application 3.dll
After searching for information on the Internet, I found that some people said that the reason for this problem was the lack of library files (.lib/.dll).
I hope you can help me. Thank you very much./emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
You need to go into the directory where the C code user-function is on your machine.
The compiler itself as you've shown in the Window above will not be aware of the libraries in the AcuSolve installation. But when you are in the AcuSolve Command Prompt, the appropriate paths are set (PATH, LD_LIBRARY_PATH, etc), and the necessary libraries are available to acuMakeDll.
You need to go into the directory where the C code user-function is on your machine.
The compiler itself as you've shown in the Window above will not be aware of the libraries in the AcuSolve installation. But when you are in the AcuSolve Command Prompt, the appropriate paths are set (PATH, LD_LIBRARY_PATH, etc), and the necessary libraries are available to acuMakeDll.
Thank you very much, but I still don't know what to do.
What commands do I need to enter before I can enter the directory where the user functions in C code are located?
What libraries are necessary for ACUMAKEDLL to use? I found libabd. lib, libcci. lib, libeco. lib, libfrm. lib only in the installation directory of acusolve. But he doesn't seem to be what acuMakeDll needs.
I attach the relevant library files, header files and C programs that may be needed in the running of the program.
In udf.h file, only some functions are declared, but the program how these functions work is not given. But I can't find the relevant documents.
I hope you can help me see where this problem appears.
You need to go into the directory where the C code user-function is on your machine.
The compiler itself as you've shown in the Window above will not be aware of the libraries in the AcuSolve installation. But when you are in the AcuSolve Command Prompt, the appropriate paths are set (PATH, LD_LIBRARY_PATH, etc), and the necessary libraries are available to acuMakeDll.
You need to go into the directory where the C code user-function is on your machine.
The compiler itself as you've shown in the Window above will not be aware of the libraries in the AcuSolve installation. But when you are in the AcuSolve Command Prompt, the appropriate paths are set (PATH, LD_LIBRARY_PATH, etc), and the necessary libraries are available to acuMakeDll.
I've just solved the problem of how to set up a working directory, but I'm still prompted that the gravity. obj file can't be found in the working directory.
But the display shows that libusr.dll has been created
Looks like you should be good to go, since the dll was created.
Thanks for your help
I recently used UDF to define motion, and I found a program for rotating translational motion in the official help document, but when I ran it, it made some errors, showing grid divergence, but I've increased the number of grids near objects, and it's still not getting better.
Please help me again. Thank you very much.
Severe mesh distortion; must reduce time increment
acuSolve: Max error ref. coord. = 4.804283e-004 -6.017617e-005 -1.802330e-005
acuSolve: Max error curr. coord. = 4.804267e-004 -6.000000e-005 -1.802330e-005
acuSolve: Worst elem. has nodes = 398 7450 7451 11222
acuSolve: Severe mesh distortion; mesh not fully updated
I try to compile the sample of SampleVisual. I do it as follow:
1 Create a empty dll in VC6.0
2 Add files SampleVisual.cpp and rc and all need headfiles
When I compile the project, it report that file SampleVisual.rh not find. I can not find the file in sdk.
Would you like to tell me how to compile that? Thanks.
AcuSolve installation does not have a C/C++ Compiler. So you would need to install a compiler seprately and then link the compiler to AcuSolve.
Windows system would probably work well with Microsoft Visual Studio.
Linux systems generally have GCC preinstalled.