Creating User Libraries > Directory Structure for Template-Based Products

www.kxcad.net Home > CAE Index > MSC Software Index > Adams MD R2 Index


Your Ad Here

Directory Structure for Template-Based Products
To create libraries and binaries for template-based products, you need to have the proper directory structure. An example of the structure of a site location for Adams/Car with two different platform libraries (SGI and HP) is shown next.
The process for creating the directory structure varies by platform.
UNIX
To help you create binaries and libraries for the template-based products, Adams/Car, Adams/Driveline, the MD Adams Toolbar creates a directory structure for you as you create libraries and binaries. For each platform for which you create a library or binary, the Toolbar creates a different subdirectory in which to store the library or binary.
For the private location, by default, MD Adams Toolbar uses the directory that it creates when you first run a template-based product. You can also specify its location as explained in Template-Based Product Preferences. You must have permission to write to the directories. If you do not have write permission, the product returns an error.
Windows
Before creating a site library, you need to create a site directory and specify its location, as explained in the online help for your template-based product. If you are creating a private library, Adams/Car, and Adams/Driveline, uses the private directory that it creates when you first run the product. You must have permission to write to the directories. If you do not have write permission, the product returns an error.
The product stores the binaries and libraries in the directory at the same level.
Debugging User Libraries
Debugging on UNIX
You can choose to create the user library in debug mode. Running a user library in debug mode invokes the debug utility, a system-level program, that steps you through the subroutines or isolates parts of them. The debug utility helps you detect and locate any problems in the user-written subroutines.
Debugging on Windows
To debug an Adams/Solver user library:
1.
adamsmdr2 cr-user y user.f -n mysolver.dll
Make sure the .f extension is lowercase.
2.
Run the library file in debug mode as explained in Running Adams/Solver. From the command window, you would enter:
adamsmdr2 ru-user mysolver.dll user.acf
Microsoft Visual Studio.Net automatically starts up.
3.
In MS Visual Studio, from Solution Explorer, right-click on mysolver.dll, and then select Properties.
4.
From the Command pull-down menu, select Browse. Browse for:
install_dir/solver/win32/solver.exe
5.
Set the working directory to the location where the .acf, .dll, and .adm files are located.
6.
Set the command argument to user.acf and then select Apply.
7.
Open user.f and set a breakpoint on a line in your user subroutine.
8.
Debug -> Start
 
Note:  
A command window appears, showing Adams/Solver initialization commands. The program execution then halts in the debugger at the breakpoint that you've specified.
To debug an Adams/View interface library:
adamsmdr2 aview cr-user y user.c -n myview.dll
adamsmdr2 aview ru-u i myview.dll -n
install_dir/aview/win32/aview.exe
Your Ad Here