Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

A U T O D E S I G N T U T O R I A L C O N T E N T S

Linux Solver Documentation

Supporting SUSE 64-Bit Enterprise Desktop Linux


L I N U X D O C U M E N T A T I O N C O N T E N T S

Copyright © 2021 FunctionBay, Inc. All rights reserved


User and training documentation from FunctionBay, Inc. is subjected to the copyright laws of the Republic of Korea
and other countries and is provided under a license agreement that restricts copying, disclosure, and use of such
documentation. FunctionBay, Inc. hereby grants to the licensed user the right to make copies in printed from of this
documentation if provided on software media, but only for internal/personal use and in accordance with the license
agreement under which the applicable software is licensed. Any copy made shall include the FunctionBay, Inc.
copyright notice and any other proprietary notice provided by FunctionBay, Inc. This documentation may not be
disclosed, transferred, modified, or reduced to any form, including electronic media, or transmitted or made publicly
available by any means without the prior written consent of FunctionBay, Inc. and no authorization is granted to
make copies for such purpose.

Information described herein is furnished for general information only, is subjected to change without notice, and
should not be construed as a warranty or commitment by FunctionBay, Inc. FunctionBay, Inc. assumes no
responsibility or liability for any errors or inaccuracies that may appear in this document.

The software described in this document is provided under written license agreement, contains
valuable trade secrets and proprietary information, and is protected by the copyright laws of the
Republic of Korea and other countries. UNAUTHORIZED USE OF SOFTWARE OR ITS
DOCUMENTATION CAN RESULT IN CIVIL DAMAGES AND CRIMINAL
PROSECUTION.

Registered Trademarks of FunctionBay, Inc. or Subsidiary


RecurDyn™ is a registered trademark of FunctionBay, Inc.

RecurDyn™/SOLVER, RecurDyn™/MODELER, RecurDyn™/PROCESSNET, RecurDyn™/ACOUSTICS,


RecurDyn™/AUTODESIGN, RecurDyn™/COLINK, RecurDyn™/DURABILITY, RecurDyn™/FFLEX,
RecurDyn™/RFLEX, RecurDyn™/RFLEXGEN, RecurDyn™/LINEAR, RecurDyn™/EHD(Styer),
RecurDyn™/ECFD_EHD, RecurDyn™/CONTROL, RecurDyn™/MESHINTERFACE, RecurDyn™/PARTICLES,
RecurDyn™/PARTICLEWORKS, RecurDyn™/ETEMPLATE, RecurDyn™/BEARING, RecurDyn™/SPRING,
RecurDyn™/TIRE, RecurDyn™/TRACK_HM, RecurDyn™/TRACK_LM, RecurDyn™/CHAIN, RecurDyn™/MTT2D,
RecurDyn™/MTT3D, RecurDyn™/BELT, RecurDyn™/R2R2D, RecurDyn™/HAT, RecurDyn™/CRANK,
RecurDyn™/PISTON, RecurDyn™/VALVE, RecurDyn™/TIMINGCHAIN, RecurDyn™/ENGINE, RecurDyn™/GEAR
are trademarks of FunctionBay, Inc.

Third-Party Trademarks
Windows and Windows NT are registered trademarks of Microsoft Corporation.

ProENGINEER and ProMECHANICA are registered trademarks of PTC Corp. Unigraphics and I-
DEAS are registered trademark of UGS Corp. SolidWorks is a registered trademark of SolidWorks Corp.
AutoCAD is a registered trademark of Autodesk, Inc.

CADAM and CATIA are registered trademark of Dassault Systems. FLEXlm is a registered trademark of GLOBEtrotter
Software, Inc. All other brand or product names are trademarks or registered trademarks of their respective holders.

Edition Note
These documents describe the release information of RecurDyn™ V9R5.

2
L I N U X D O C U M E N T A T I O N C O N T E N T S

Table of Contents
Installation ............................................................................................ 4
Objective .......................................................................................................4
System Requirements ...................................................................................4
Supported Linux Versions .............................................................................4
Supported Products ......................................................................................5
Installation Process .......................................................................................7
Other Installation Processes .........................................................................7
Licensing .............................................................................................. 9
Objective .......................................................................................................9
The RecurDyn License File ...........................................................................9
Defining the license path information ............................................................9
Node-Locked Licensing ...............................................................................10
License Server Setup ..................................................................................10
Running a Simulation ......................................................................... 13
Objective .....................................................................................................13
Creating the Input Files ...............................................................................13
Execute the RecurDyn Solver .....................................................................16
Multi-Core Processing .................................................................................16
Plot Data ............................................................................................ 18
Objective .....................................................................................................18
Creating the RPLT File ................................................................................18
RPLT File Format ........................................................................................18
User Subroutines ............................................................................... 20
Preparing and Compiling .............................................................................20
Using ...........................................................................................................21
Troubleshooting ................................................................................. 22
Licensing Error Codes .................................................................................22
RecurDyn Solver Error Codes .....................................................................24
RPLT File Conversion Code ............................................................... 25
Code Listing ................................................................................................25

3
L I N U X D O C U M E N T A T I O N C O N T E N T S

1
Chapter

Installation
Objective
This chapter presents the various aspects of installing and updating the RecurDyn Linux solver.

System Requirements
The RecurDyn Linux solver supports computers with Intel or AMD processors that are running
on the SUSE 64-Bit Enterprise Linux.

You must be logged in as a super-user in order to install or update the RecurDyn Linux Solver into
the recommended top-level directories. However, this documentation will also provide instructions
for a local install and usage in your local directories for testing or evaluation purposes that do not
require super-user privileges.

Supported Linux Versions


Red Hat Enterprise Linux Server 4.8 kernel 2.6.9-89
Red Hat Enterprise Linux Server 5.8 kernel 2.6.18-308
Red Hat Enterprise Linux Server 6.3 kernel 2.6.32-279
Red Hat Enterprise Linux Client 7.3 kernel 3.10.0-514
Red Hat Enterprise Linux Server 7.3 kernel 3.10.0-514
Red Hat Enterprise Linux Client 7.4 kernel 3.100-693
Red Hat Enterprise Linux Server 7.4 kernel 3.100-693
Red Hat Enterprise Linux Client 7.5 kernel 3.100-862
Red Hat Enterprise Linux Server 7.5 kernel 3.100-862
SUSE Linux Enterprise Server 10 SP1 kernel 2.6.16.46-0.12
SUSE Linux Enterprise Server 11 SP2 kernel 3.0.13-0.27
SUSE Linux Enterprise Server 12 SP3 kernel 4.4.73-5

4
L I N U X D O C U M E N T A T I O N I N S T A L L A T I O N

Supported Products

RecurDyn
Product Linux
x86_x64
RecurDyn/Modeler
Professional RecurDyn/Solver V
RecurDyn/ProcessNet
RecurDyn/Acoustics
RecurDyn/AutoDesign
RecurDyn/Bearing V
RecurDyn/Belt V
RecurDyn/Chain V
RecurDyn/CoLink V
RecurDyn/Control V
RecurDyn/Crank V
RecurDyn/DriveTrain
RecurDyn/Durability
RecurDyn/EHD (MEHD)
RecurDyn/EHD V
RecurDyn/Engine V
RecurDyn/eTemplate
Toolkit
RecurDyn/FFlex V
RecurDyn/Gear V
RecurDyn/HAT V
RecurDyn/Linear V
RecurDyn/Mesher
RecurDyn/MTT2D V
RecurDyn/MTT3D V
RecurDyn/Piston V
RecurDyn/R2R2D V
RecurDyn/RFlex V
RecurDyn/RFlexGen
RecurDyn/SPI V
RecurDyn/Spring V
RecurDyn/Tire (GTire except MFTire) V

5
L I N U X D O C U M E N T A T I O N I N S T A L L A T I O N

RecurDyn/Tire (MFTire)
RecurDyn/TimingChain V
RecurDyn/Track_HM V
RecurDyn/Track_LM V
RecurDyn/TSG
RecurDyn/Valve V
RecurDyn/Vibration Shape

 In the case of RecurDyn/Control, only Simulink Host Mode is supported.

6
L I N U X D O C U M E N T A T I O N I N S T A L L A T I O N

Installation Process
A temporary directory is created to hold the installation file (.rpm file). After the installation
process the files are placed in /opt/functionbay. This type of installation will be referred to as
a formal installation in the remainder of this document.

To create a temporary directory

1. Log in as superuser

2. Type the following on the Linux console:

cd /tmp/

mkdir rdsolver

To load and install the RecurDyn Solver

1. Move the RecurDyn Solver installation file from the media to the temporary directory

cp rdsolver-***.x86_64.rpm /tmp/rdsolver/

2. Change to the temporary directory and run the installation utility:

cd /tmp/rdsolver/

rpm -ivh rdsolver-***.x86_64.rpm

Note 1)

There may be some warning messages about a user that does not exist. This is because the user who
“owns” the installation files does not exist on your computer. Please ignore these messages.
Note 2)

The rpm command will unload the RecurDyn Solver package to the directory /opt/functionbay,
which it first creates. The license setup process will refer to this same directory. If security restrictions
prevent the installation of the RecurDyn Solver at a top level directory, then the combination of the
rpm2cpio and cpio command can be used to place the files in a local directory:
rpm2cpio rdsolver-***.x86_64.rpm | cpio -idmv

This directory structure of opt/functionbay is created within the local directory where the above
command was executed. This type of installation will be referred to as an informal installation in the
remainder of this document.

Other Installation Processes


To upgrade a current installation

1. Follow the instructions for an initial installation, as given above, up to the invoking of the
RPM command

2. Type the following modified rpm command on the Linux console with the current
RecurDyn Solver installation file:

7
L I N U X D O C U M E N T A T I O N I N S T A L L A T I O N

rpm -Uvh rdsolver-***.x86_64.rpm

To install to temporary directory instead of the default directory

1. Follow the instructions for an initial installation, as given above, up to the invoking of the
RPM command.

2. Type the following modified rpm command on the Linux console with the current
RecurDyn Solver installation file:

rpm -ivh --prefix=/temporary directory/rdsolver-


***.x86_64.rpm

To uninstall the current installation

1. Move to the installation directory.

cd /opt/functionbay

2. Uninstall RecurDyn Solver:

rpm -e rdsolver

8
2
Chapter

Licensing
Objective
Learn how to set up the licensing needed to use the RecurDyn Solver on Linux. Note that the
licensing on Unix is similar to the licensing on Windows. Therefore the RecurDyn Installation
Manual for Windows is a useful reference for the Linux user.

The RecurDyn License File


You should first obtain a license file from their RecurDyn distributor. The physical address of the
network (LAN) card and the computer host name are necessary to generate a license file. On Linux
the physical address can be shown by using the command ‘ifconfig’.

Defining the license path information


An environment variable, FBLMD_LICENSE_FILE, is defined so that the RecurDyn licensing
knows where to find a license file or a license server. The environment variable can be defined by the
user in an appropriate manner according to the Linux shell being used. Another option is to place the
environment variable definition in a special file that is checked by the licensing utility (FLEXnet).
The name of the file is .flexlmrc and it should be located in your home directory.

1. Use a text editor to create the flexlmrc file. One method is to use the vi editor, as follows
(where userName is your user account name):

vi /home/userName/.flexlmrc

2. For a node-locked license enter the following into the file in order to define an
environmental variable that defines the license file location:

FBLMD_LICENSE_FILE = /opt/functionbay/License.dat

3. For a client installation enter the following into the file in order to define an environmental
variable that defines the license server location:

FBLMD_LICENSE_FILE = port_number@hostname

Note: The use of the .flexlmrc file may disturb the use of other software that also uses the
FLEXnet licensing softwre may be some warning messages about a user that does not
exist. This is because the user who “owns” the installation files does not exist on your
computer. Please ignore these messages.

9
L I N U X D O C U M E N T A T I O N L I C E N S I N G

Note: If you use a redundant license, separate each port_number@hostname entry with a
comma (typically there are three license servers with a redundant license).

Note: The licensing will not work correctly if your .flexlmrc file has one or several extra spaces
behind the phrase port_number@hostname.

Node-Locked Licensing
You need to place the license file in an accessible and secure location and set up the environment
variable so that the license file can be found. With a formal installation, this document assumes that
the license file is placed in the /opt/functionbay directory. With an information installation, it is
assumed that the license is installed in the /opt/functionbay directory under your home directory
(as created with the rpmcpio command described in the installation chapter). Pick from the following
two sections according type of installation that you have.

To place the license file in a location for a formal installation

1. Log in as superuser

2. Type the following on the Linux console:

cp License.dat /opt/functionbay

3. Log out as superuser

To place the license file in a location for an informal installation

1. Copy the license file into the opt/functionbay directory under your home directory

cd

cp License.dat /opt/functionbay

License Server Setup


The following files are necessary to setup the RecurDyn License Server on Linux and should be
obtained from your RecurDyn distributor.

1. fblmd

2. lmgrd

3. lmutil

To set up the license server, formal installation

1. Log in as superuser

2. Create a license server working directory by typing in the following on the Linux console:

mkdir /opt/functionbay/RD_License

3. Copy the license server files listed above into the license server working directory.

10
L I N U X D O C U M E N T A T I O N L I C E N S I N G

4. In the case where the account does not automatically set the files for execution, the Linux
command ‘chmod’ should be used as follows:

chmod +rx fblmd lmgrd lmutil

5. Log out as superuser

To set up the license server, informal installation

1. Create a license server working directory by typing in the following on the Linux console:

cd

mkdir opt/functionbay/RD_License

2. Copy the license server files listed above into the license server working directory.

3. In the case where the account does not automatically set the files for execution, the Linux
command ‘chmod’ should be used as follows:

chmod +rx fblmd lmgrd lmutil

To start the RecurDyn license server

The general form of the command is:

lmgrd –c [license file name] –l [log file name]

1. You should type the following from the working directory of the license server:

./lmgrd –c license.dat –l recurdyn.log

If there is no error, you can use any text editor to see the contents of log file.

Note: If you use a redundant license, repeat the license server installation for each server
computer (typically there are three license servers with a redundant license).

Note: Flexlm goes looking for the MAC address on the Ethernet interface named "eth0"
and if it doesn't find it, it returns an empty or blank hostid. If you go to the
directory where the devices are mapped -- could be /etc/config or /etc/iftab or
/etc/udev and rename eth1 to eth0, then it should work. One way you may be able
to rename the interface from "eth1" to "eth0" is to use the Linux "Network"
Administration GUI tool (you'll need the root password). In the window that
appears you would select on the "Hardware" tab to display a dialog that shows all
the interfaces. Select the row with the eth1 device and click on the Edit button. In
the dialog box that appears you should see a field that allows you to rename
interface to eth0. Just follow through on OK clicking and saving as indicated. A
reboot may not be needed, but probably should be done to insure the change is
persistent.

11
L I N U X D O C U M E N T A T I O N L I C E N S I N G

Note: If you use a Linux environment with x64, you need to install addtitional LSB library. If
you do not do any additional installation, the following error occurs. “/lib64/ld-lsb-x86-
64.so.3: bad ELF interpreter” The solution is as follows. yum -y install redhat-lsb

To stop the RecurDyn license server

The general form of the command is:

lmutil lmdown –c [license file name]

1. You should type the following from the working directory of the license server:

./lmutil lmdown –c license.dat

2. The following will appear:

Port@Host Vendors

1) 27000@[host_name] fblmd

Are you sure <y/n>?

3. You should type the letter y in order to confirm the shutdown.

y
4. FLEXnet License Server shut down

To set up the Client installations

Once the RecurDyn license server is installed and started, the RecurDyn Solver can be installed on
each Client computer according to the instructions in Chapter 1.

For the client licensing, an environment variable must be defined for each client as was explained
earlier in this chapter under the section: Defining the license path information, near the beginning of this
chapter.

12
3
Chapter

Running a Simulation
Objective
Learn how to obtain the input files from the RecurDyn user interface and how to run the RecurDyn
solver with them.

Creating the Input Files


Three files are needed.

▪ The rmd (RecurDyn Model Data) file contains the model data in an ascii (text) format.

▪ The rss (RecurDyn Scenario Script) file is a text file that contains information about
running the simulation. Documentation about setting up a RecurDyn scenario is
contained in the standard RecurDyn documentation (look under Professional >
Menu&Tools > Menu Bar Users Guide > Analysis commands).

All three of these files are created using the RecurDyn graphical user interface on a Windows-
based computer.

13
L I N U X D O C U M E N T A T I O N R U N N I N G A S I M U L A T I O N

To create the rmd file

1. Open up your model within the RecurDyn graphical user interface on


a Windows-based computer.

2. Select the File menu and select the Export option, as shown in the
figure.

3. Use the pull-down


menu as needed to set
the Save as type: field
to be RecurDyn Solver
Data File (*.rmd).

4. Adjust the File name as


desired. Make sure that
there are no spaces or
special characters in
the file name, other
than the underscore (_)
character.:

14
L I N U X D O C U M E N T A T I O N R U N N I N G A S I M U L A T I O N

To create the rss file

1. Select the Analysis menu and


select the Scenario File
option, as shown in the figure.

Follow the steps below in order to


fill in the Scenario Analysis dialog box and write out the RSS file.

2. Click on the Create button in order


to create a line in the Scenario Editor
Field.

3. Use the pull-down menu on the left


side below the Scenario Editor
window to select the Simulation
option.

4. Use the pull-down menu on the right


side below the Scenario Editor
window to select the Dynamic
option.

5. Type in the desired time duration of


the simulation in the Endtime field.
In this example an end time of 13 is
entered.

6. Type in the desired number of steps


(or animation frames) in the Step
field. In this example 400 is entered.

7. Click on the Load button and the dialog box should appear as shown in the figure.

8. Click on the Export button.

9. Adjust the File name as desired.


Make sure that there are no
spaces or special characters in
the file name, other than the
underscore (_) character.

10. Click on the Save button to


create the RSS file.

15
L I N U X D O C U M E N T A T I O N R U N N I N G A S I M U L A T I O N

Execute the RecurDyn Solver


The RecurDyn Linux Solver is ready to run once the three inputs files are created and moved to
a working directory on the Linux computer.

To invoke the RecurDyn Linux Solver

First, set up the environment variable that is needed for the RecurDyn Solver to find its libraries in
the installation directory, regardless of the local directory that the RecurDyn Linux Solver is run
from. Then invoke the solver.

1. Type the following on the Linux console:

export PATH=/opt/functionbay/V9R3/:$PATH
export LD_LIBRARY_PATH=/opt/functionbay/V9R3/:$LD_LIBRARY_PATH
export RD_INSTALL_PATH=/opt/functionbay/V9R3
export FBLMD_LICENSE_FILE=11800@server

2. Type the following on the Linux console:

rdsolver rmd_file rss_file

Note: An alternate form of executing the solver is to use a *.rcf file. The *.rcf file is simply the
*.rss file with the name of the *.rmd file added to the first line. An example *.rcf file is:
Model_1.rmd
SIM/DYN, END = 5, STEP = 100
STOP”
The form of executing the RecurDyn solver with the *.rcf file is:
rdsolver rcf_file

Note: In summary, given the instructions in the previous chapter and this chapter, the
following lines (adapted to your installation) are sufficient to set up your environment to
run the RecurDyn solver:
export LD_LIBRARY_PATH=/opt/functionbay/:$LD_LIBRARY_PATH
export PATH=/opt/functionbay/:$PATH
export FBLMD_LICENSE_FILE=28000@server

The first line sets up the path variable for the solver libraries. The second line defines the
path to the solver executable. The third line defines the appropriate licensing information
(according to the information provided in the previous chapter.
These lines can be placed in a text file (could be named Setup_RecurDyn), and the
text file made executable (chmod +x Setup_RecurDyn). This file could be run
once each time you logs into the Linux system, and the RecurDyn Solver would be
ready to execute with the rdsolver command.

Multi-Core Processing
Versions V7R4 and later of the RecurDyn Linux Solver have capabilities to run a simulation
using multiple processor cores. Note that the multi-processing is only implemented with the

16
L I N U X D O C U M E N T A T I O N R U N N I N G A S I M U L A T I O N

following toolkits at V7R4: FFlex, MTT3D, Track, Belt, and Chain. Therefore you should
check which toolkits are supported in your version of RecurDyn before using this function.

To invoke the Multi-Processing Option

First, edit the *.rmd file (for example vi *.rmd) and search for the string “NUM_THREAD”. You
will find a block of data in the *.rmd file as shown below:
!============================= SOLVEROPTION ===========================
!
SOLVEROPTION /
, TIMEOFFSET = 0.000000
, TOLERANCEIF = 1e-008
, INITIALVELOCITY = RELATIVE
, NUM_THREAD = 4

Change number of threads (number of cores to be used) by adjusting the number after the
“NUM_THREAD” variable. Note that RecurDyn V7R4 supports a maximum of 4 cores.

Second, set up an environmental variable, OMP_NUM_THREADS, that requests the same


number of threads, using a command such as:
export OMP_NUM_THREADS=4

Note that the actual command is different each type of Linux shell that may be used.

To confirm the Multi-Processing Setup

The RecurDyn message file (*.msg) that is output with each simulation will contain some feedback
about the number of threads that were actually used in the simulation. To see the information, edit
the *.msg file (for example vi *.msg) and search for the string “Thread”. You will find a block of data
in the *.msg file as shown below:
*** Four Threads Used.

17
4
Chapter

Plot Data
Objective
In this chapter, you will learn how to extract data from the rplt file.

Creating the RPLT File


This file is generated automatically after RecurDyn Dynamic analysis. The contents of the file is determined
by the RPLH file that is input into the RecurDyn Solver.

RPLT File Format


The RPLT file consists of:

▪ The Header part (File information, Entity Name, Tree information), and

▪ The Data part (Real Data)

Sample RPLT file header format

The header contains the same list of information that is contained in the
database window within the RecurDyn plot environment, as shown in the
figure on the right.

The table below shows the arrangement of the header data in the RPLT file.

18
L I N U X D O C U M E N T A T I O N P L O T D A T A

Int iVer Int Int iVerRPLT Int Int


CString CString CString CString CString
CString “Test1” Int iLoop : 3 CString “TIME” Int iLoop : 0 Int iDimensionType
CString “Bodies” Int iLoop : 1 CString “Body1” Int iLoop : 26 CString “Pos_TM”
Int ILoop : -3 Int DimensionType CString “Pos_TX” Int iLoop : 0 Int iDimensionType

ILoop : the number subnodes of current node.


Eg: “Test1” node has 3 subnodes : “TIME, Bodies, Joints”
“Bodies” node has 1 subnode : “Body1”
“Body1” node has 26 subnode : “Pos_TM, Pos_TX, …”
“Pos_TX” node has 0 subnode

A special rule is applied to the ILoop value for magnitude values The value of iLoop
“Pos_TM”, “Vel_TM”, “Vel_RM”, “Acc_TM”, “Acc_RM” is –3, because the
magnitude values are calculated as magnitude of next 3 double value. For example, a
value such as Pos_TM is a magnitude that is calculated by taking the square root of the
sum of the squares of Pos_TX, Pos_TY, and Pos_TZ.

iDimensionType : the unit type of current node.


iDimensionType is available only if iLoop <= 0

Sample RPLT Data Content and Structure

The Data section of the RPLT file is stored after Header section. The value of each item that is listed
in the header section is provided in order for each output time step. The number of output time steps
is equal to the number of Steps multiplied by the Plot Multiplier Factor (if available).

The table below provides an example of the data section of the RPLT file. Please note that the data
section consists of only data. The first column, the RPLT Step number and the first row, Entity
namesare provided only to enhance the readability of the table. All of the data values are stored as
double precision real numbers (8-bytes)

RPLT TIME …
Pos_TX Pos_TY Pos_TZ Pos_PSI Pos_THETA Pos_PHI Pos_YAW
Step
1 0 150 0 0 0 0 0 0 …
2 0.050145 145.4133 -3.96735 0 -0.65374 0 0 -0.65374 …
3 0.100321 131.5009 -15.4602 0 -2.59912 0 0 -2.59912 …
4 0.151521 107.3276 -33.647 0 -5.86055 0 0 -5.86055 …
5 0.200673 74.30016 -55.2575 0 -10.1163 0 0 -10.1163 …
6 0.253921 27.6217 -80.3003 0 -15.8289 0 0 -15.8289 …
7 0.303073 -24.8939 -101.834 0 -21.9504 0 0 -21.9504 …
… … … … … … … … … …

Sample code for reading in the RPLT file is provided in Appendix A.

19
5
Chapter

User Subroutines
Preparing and Compiling
To prepare a user subroutine

The source code for the user subroutines is very similar between Windows and Linux. 2. The example axial
force routine below shows the modifications for using the user subroutines for Linux. The include file is set
to be SYSCAL_LN.H for C++ routines and is set to SYSCAL_LN.F for Fortran subroutines. There are
also changes to the subroutine declaration statement, as shown in the example code.
//#include "stdafx.h"
//#include "DllFunc.h"
#include "SYSCAL_LN.H"

//C_API void __cdecl axial_force


extern "C" void axial_force
(double time, double upar[], int npar, int jflag, int iflag, double* result)
{
using namespace rd_syscall;
// Parameter Information
// time: Simulation time of RD/Solver
// upar: Parameters defined by user
// npar: Number of user parameters
// jflag: When RD/Solver evaluates a Jacobian, the flag is true.
// iflag: When RD/Solver initializes arraies, the flag is true.
// result: Returned value

// User statement
// Local Variable Definition
int mkid[3], errflg, akispl_id;
int usp3,usp4;
double usp2;
double disp, value[3];

// Assign Impact Parameters


mkid[0] = (int) upar[0];
mkid[1] = (int) upar[1];
mkid[2] = (int) upar[2];
akispl_id = (int) upar[3];

usp3 = 3;
usp2 = 0.0;
usp4 = 0;

// Call the Auxiliary subroutines for Calculation


sysfnc("DX", mkid, &usp3, &disp, &errflg);

20
L I N U X D O C U M E N T A T I O N U S E R S U B R O U T I N E

rd_akispl(&disp, &usp2, &akispl_id, &usp4, value, &errflg);

// Assign the Returned Value


*result = value[0];

To compile a user subroutine

A Makefile can be created with the following text:

#ifort -fPIC -shared -o axial_force.so axial_force.for


#gfortran -fPIC -shared -o axial_force.so axial_force.for
#g++ -fPIC -shared -o axial_force.so DllFunc_LN.cpp
g++ -fPIC -shared -o axial_force.so DllFunc_LN.cpp

One of the compile command lines in the Makefile should be uncommented, according to the language of
the user subroutine and according to the compiler that is available. Note that:

▪ If you use a g++, make sure that the files DllFunc_LN.cpp and SYSCAL_LN.H are located in the
local directory with the Makefile.

▪ If you use a Fortran, make sure that the files axial_force.for and SYSCAL_LN.F are located in the
local directory with the Makefile.

You need to execute the make command (with your Makefile ) in order to compile your file.

Using
After compiling, you will get a *.so file. Your model will use the *.so file to access the user subroutine. Before
running the RecurDyn solver:

▪ Make sure that the *.so file is located in the same working directory as the *.rmd file.

▪ Checking that the user subroutine name (and path) in the *.rmd file matches the name and location
of the *.so file

You are not prepare to execute the RecurDyn Solver with the custom user subroutine.

Thank you for using the RecurDyn Linux Solver

21
6
Chapter

Troubleshooting
There are two types of error codes. One type is the licensing error codes that are produced
by the FLEMlm license manager software that is used in the RecurDyn Solver. Another type
is the errors that are output by the RecurDyn solver code that are not related to licensing.
The tables below provides explanations for the various error codes

Licensing Error Codes


Error Code Description -18 License server does not support this feature.
-1 Cannot find license file. -19 Error in select system call.
-2 Invalid license file syntax. -21 License file does not support this version.
-3 No server for this feature. -22 Feature checkin failure detected at license
-4 Licensed number of users already reached. server.
-5 No such feature exists. -23 License server temporarily busy (new server
-6 No TCP/IP port number in license file and connecting).
FLEXlm service does not exist. (pre-v6 only) -24 Users are queued for this feature.
-7 No socket connection to license manager -25 License server does not support this version
service. of this feature.
-8 Invalid (inconsistent) license key or -26 Request for more licenses than this feature
signature. The license key/signature and data supports.
for the feature do not match. This usually -29 Cannot find ethernet device.
happens when a license file has been altered. -30 Cannot read license file.
-9 Invalid host. The hostid of this system does -31 Feature start date is in the future.
not match the hostid specified in the license -32 No such attribute.
file. -33 Bad encryption handshake with daemon.
-10 Feature has expired. -34 Clock difference too large between client and
-11 Invalid date format in license file. server.
-12 Invalid returned data from license server. -35 In the queue for this feature.
-13 No SERVER lines in license file. -36 Feature database corrupted in daemon.
-14 Cannot find SERVER host name in network -37 Duplicate selection mismatch for this feature.
database. The lookup for the host name on Obsolete with v8.0+ vendor daemon.
the SERVER line in the license file failed. -38 User/host on EXCLUDE list for feature.
This often happens when NIS or DNS or the -39 User/host not on INCLUDE list for feature.
hosts file is incorrect. Workaround: Use IP -40 Cannot locate dynamic memory.
address (e.g., 123.456.789.123) instead of -41 Feature was never checked out.
host name. -42 Invalid parameter.
-15 Cannot connect to license server. The server -47 Clock setting check not available in daemon.
(lmgrd) has not been started yet, or the -52 FLEXlm vendor daemon did not respond
wrong port@host or license file is being within timeout interval.
used, or the TCP/IP port or host name in the -53 Checkout request rejected by vendor-defined
license file has been changed. checkout filter.
-16 Cannot read data from license server. -54 No FEATURESET line in license file.
-17 Cannot write data to license server. Error Code Description
Error Code Description -55 Incorrect FEATURESET line in license file.

22
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

-56 Cannot compute FEATURESET data from -99 The decimal format license is typed
license file. incorrectly.
-571 socket() call failed. -100 Cannot remove a linger license.
-59 Message checksum failure. -101 All licenses are reserved for others. The
-60 Server message checksum failure. system administrator has reserved all the
-61 Cannot read license file data from server. licenses for others. Reservations are made in
-62 Network software (TCP/IP) not available. the options file. The server must be restarted
-63 You are not a license administrator. for options file changes to take effect.
-64 lmremove request before the minimum -102 A FLEXid borrow error occurred.
lmremove interval. -103 Terminal Server remote client not allowed.
-67 No licenses to borrow. -104 Cannot borrow that long.
-68 License BORROW support not enabled. -106 License server out of network connections.
-69 FLOAT_OK can’t run standalone on The vendor daemon can't handle any more
SERVER. users. See the debug log for further
-71 Invalid TZ environment variable. information.
-73 Local checkout filter rejected request. -110 Dongle not attached, or can’t read dongle.
-74 Attempt to read beyond end of license file Either the hardware dongle is unattached, or
path. the necessary software driver for this dongle
-751 SYS$SETIMR call failed (VMS). type is not installed.
-76 Internal FLEXlm error—please report to -112 Missing dongle driver. In order to read the
Macrovision. dongle hostid, the correct driver must be
-77 Bad version number must be floating-point installed. These drivers are available at
number with no letters. www.macrovision.com or from your
-82 Invalid PACKAGE line in license file. software vendor.
-83 FLEXlm version of client newer than server. -113 Two FLEXlock checkouts attempted. Only
-84 USER_BASED license has no specified one checkout is allowed with FLEXlock-
users - see server log. enabled applications.
-85 License server doesn’t support this request. -114 SIGN= keyword required, but missing from
-87 Checkout exceeds MAX specified in options license. This is probably because the license
file. is older than the application. You need to
-88 System clock has been set back. obtain a SIGN= version of this license from
-89 This platform not authorized by license. your vendor.
-90 Future license file format or misspelling in -115 Error in Public Key package.
license file. The file was issued for a later -116 CRO not supported for this platform.
version of FLEXlm than this program -117 BORROW failed.
understands. -118 BORROW period has expired.
-91 ENCRYPTION_SEEDS are non-unique. -119 lmdown and lmreread must be run on license
-92 Feature removed during lmreread, or wrong server machine.
SERVER line hostid. -120 Cannot lmdown the server when licenses are
-93 This feature is available in a different license borrowed.
pool. This is a warning condition. The server -121 FLOAT_OK license must have exactly one
has pooled one or more INCREMENT lines dongle hostid.
into a single pool, and the request was made -122 Unable to delete local borrow info.
on an INCREMENT line that has been -123 Support for returning a borrowed license
pooled. early is not enabled. The vendor must have
-94 Attempt to generate license with enabled support for this feature in the vendor
incompatible attributes. daemon. Contact the vendor for further
-95 Network connect to this_host failed. Change details.
this_host on the SERVER line in the license -124 An error occurred while returning a
file to the actual host name. borrowed license to the server.
-96 Server machine is down or not responding. -125 Attempt to checkout just a PACKAGE. Need
See the system administrator about starting to also checkout a feature.
the server, or make sure that you’re referring -126 Error initializing a composite hostid.
to the right host (see LM_LICENSE_FILE -127 A hostid needed for the composite hostid is
environment variable). missing or invalid.
-97 The desired vendor daemon is down. 1) -128 Error, borrowed license doesn't match any
Check the lmgrd log file, or 2) Try lmreread. known server license.
-98 This FEATURE line can’t be converted to
decimal format.
Error Code Description

23
RecurDyn Solver Error Codes
0: "Successful end"
-2: "There is no rcf file."
-3: "There is no rss file."
-6: "Fail to load RDSolver.lib."
-10: "Fail to convert a RMD file."
-20: "Fail to simulate a model."

Thank you for using the RecurDyn Linux Solver

24
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

A
Appendix

RPLT File Conversion Code


Code Listing
The text below is a listing of the source code for a general C program for reading in a
RecurDyn rplt file and outputting a text file.

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;

static std::vector<string> m_arrTitle; // Array of data titles for


header row in .csv file
static int iRealDataNumber; // Number of data fields in each time step
(number of columns in .csv file

// readLong() reads the long data type from the RPLT files.
long readLong(std::ifstream& inputfile)
{
long base = 0;
inputfile.read((char*)&base, sizeof(long));
return base;

/* Uncomment and use this code if the byte order needs to be


reversed.
long base = 0;
inputfile.read((char*)&base, sizeof(long));
long reverse =
((base & 0x000000FF) << 24) |
((base & 0x0000FF00) << 8) |
((base & 0x00FF0000) >> 8) |
((base & 0xFF000000) >> 24);
return reverse;
*/
}

// readString() reads strings from the RPLT files.


string readString(std::ifstream& inputfile)
{
char c;
int length = 0;

// Read in unknown leading characters


for (int i = 0; i < 3; i++)

25
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

{
inputfile.read(&c, sizeof(char));
}

// Read in length of string


inputfile.read((char*)&c, sizeof(char));
length = int(c);
string output (length, ' ');

// Read in each character followed by unneeded null character


for (int i = 0; i < length; i++)
{
inputfile.read(&c, sizeof(char));
output[i] = c;
inputfile.read(&c, sizeof(char));
}

return output;
}

// ConvertHeadRecursive() reads in header entities from the RPLT files.


void ConvertHeadRecursive(std::ifstream& inputfile, std::ofstream&
outputfile, int& iStep)
{
iStep++;
long lLoop = 0, lDimensionType = 0;
string strDimensionUserDefine = "";
string strElem = "";

string strEntity = readString(inputfile);

lLoop = readLong(inputfile);

// If lLoop is not greater than 0, get Dimension Type.


if(lLoop <= 0)
{
lDimensionType = readLong(inputfile);

// If Dimension Type is User Defined (-1), get


strDimensionUserDefine.
if(lDimensionType == -1)
{
strDimensionUserDefine = readString(inputfile);
}

// If lLoop is 0, this node has no sub nodes. And it has a


data.
if(lLoop == 0)
{
m_arrTitle.push_back(strEntity);
iRealDataNumber++;
iStep--;
return;
}
}

// If lLoop is greater than 0, it means the number of sub nodes.


for(long i = 0; i < lLoop; i++)
{
ConvertHeadRecursive(inputfile, outputfile, iStep);
}

26
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

iStep--;
}

// ConvertRPLH() extracts the initial the RPLT header information


(version,
// units), and calls ConvertHeadRecursive() to go through the nested data
// titles.
void ConvertRPLH(std::ifstream& inputfile, std::ofstream& outputfile)
{
long lVer, lVerOfRPLT;
string strTemp;
string m_strUnitForce;
string m_strUnitMass;
string m_strUnitLength;
string m_strUnitTime;
string m_strUnitAngle;

lVer = readLong(inputfile); // Get version.

if (lVer < 1)
{
std::cout << "Version must be at least 1: program will exit."
<< std::endl;
system("pause");
return;
}

readLong(inputfile); // Skip over reserved field.


lVerOfRPLT = readLong(inputfile); // Get RPLT version.
readLong(inputfile); // Skip over reserved field.
readLong(inputfile); // Skip over reserved field.

m_strUnitForce = readString(inputfile);
m_strUnitMass = readString(inputfile);
m_strUnitLength = readString(inputfile);
m_strUnitTime = readString(inputfile);
m_strUnitAngle = readString(inputfile);

iRealDataNumber = 0;

int iStep = 0;

ConvertHeadRecursive(inputfile, outputfile, iStep);

return;
}

// ConvertDataToText() writes extracted RPLT header and data rows to .csv


file
void ConvertDataToText(std::ifstream& inputfile, std::ofstream&
outputfile)
{
unsigned long long ullCurrent = 0;
ullCurrent = inputfile.tellg();
inputfile.seekg(0, ios::end);
unsigned long long ullSize = inputfile.tellg();
inputfile.seekg(ullCurrent);

size_t iSizeOfDouble = sizeof(double);


size_t iSizeOfDataOf1Frame = iRealDataNumber*iSizeOfDouble;
unsigned long long ullNoOfFrame = (ullSize -
ullCurrent)/iSizeOfDataOf1Frame;

27
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

string strLine = "";


string strTmp = "";
int nSize = m_arrTitle.size();
strLine = m_arrTitle[0];

for(int nCount = 1; nCount < nSize; nCount++)


{
strTmp.clear();
strTmp = ", " + m_arrTitle[nCount];
strLine.append(strTmp);
}
strLine.append("\n");
outputfile << strLine;

double* pData = new double[nSize];


for (int i = 0; i<ullNoOfFrame ; ++i)
{
inputfile.read((char*)pData, iSizeOfDataOf1Frame);

strLine.clear();
char temp[50];
sprintf(temp, "%.10g", pData[0]);
strLine.append(temp);

for(int nCount = 1; nCount < nSize; nCount++)


{
strTmp.clear();
char temp[50];
sprintf(temp, ", %.10g", pData[nCount]);
strLine.append(temp);
}
strLine.append("\n");
outputfile << strLine;
strLine.clear();
strTmp.clear();
}
}

int main() {
// program constants
const int MAXFILENAME = 256;

// Program variables
char strTemp[MAXFILENAME];
std::ifstream * inputfile = NULL;
std::ofstream * outputfile = NULL;

// Prompt user for input filename


std::cout << "Please enter the RPLT filename:" << std::endl;
std::cin.getline(strTemp, MAXFILENAME);
string infilename = strTemp;

// Form output filename as <input filename (without extension)>.csv


int dotIndex = infilename.find_last_of('.');
string outfilename = infilename.substr(0, dotIndex) + ".csv";
std::cout << "outfilename = " << outfilename << std::endl;

// Try to open files

inputfile = new std::ifstream((char*)&infilename);


outputfile = new std::ofstream((char*)&outfilename);

28
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

// Could hardcode filenames as shown below if desired


//inputfile = new std::ifstream("C:\\Documents and
Settings\\Nelson\\My
Documents\\RD_TechSupport\\TARDEC\\ConvertRPLTFile\\TestFiles\\Test1.rplt"
, std::ios::binary);
//outputfile = new std::ofstream("C:\\Documents and
Settings\\Nelson\\My
Documents\\RD_TechSupport\\TARDEC\\ConvertRPLTFile\\TestFiles\\myTest1.csv
", std::ios::out);

if (*inputfile && *outputfile) {


std::cout << "File found..." << std::endl;
}
else {
std::cout << "File not found: program will exit." <<
std::endl;
system("pause");
return 0;
}

// Convert the RPLT header information


ConvertRPLH(*inputfile, *outputfile);

// Write out header row and data rows to .csv file


ConvertDataToText(*inputfile, *outputfile);

// Cleanup
inputfile->close();
outputfile->close();

return 0;
}

29
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

FLEXlm Error Codes

Error Code Description -39 User/host not on INCLUDE list for feature.
-1 Cannot find license file. -40 Cannot locate dynamic memory.
-2 Invalid license file syntax. -41 Feature was never checked out.
-3 No server for this feature. -42 Invalid parameter.
-4 Licensed number of users already reached. -47 Clock setting check not available in daemon.
-5 No such feature exists. -52 FLEXlm vendor daemon did not respond
-6 No TCP/IP port number in license file and within timeout interval.
FLEXlm service does not exist. (pre-v6 only) -53 Checkout request rejected by vendor-defined
-7 No socket connection to license manager checkout filter.
service. -54 No FEATURESET line in license file.
-8 Invalid (inconsistent) license key or -55 Incorrect FEATURESET line in license file.
signature. The license key/signature and data -56 Cannot compute FEATURESET data from
for the feature do not match. This usually license file.
happens when a license file has been altered. -571 socket() call failed.
-9 Invalid host. The hostid of this system does -59 Message checksum failure.
not match the hostid specified in the license -60 Server message checksum failure.
file. -61 Cannot read license file data from server.
-10 Feature has expired. -62 Network software (TCP/IP) not available.
-11 Invalid date format in license file. -63 You are not a license administrator.
-12 Invalid returned data from license server. -64 lmremove request before the minimum
-13 No SERVER lines in license file. lmremove interval.
-14 Cannot find SERVER host name in network -67 No licenses to borrow.
database. The lookup for the host name on -68 License BORROW support not enabled.
the SERVER line in the license file failed. -69 FLOAT_OK can’t run standalone on
This often happens when NIS or DNS or the SERVER.
hosts file is incorrect. Workaround: Use IP -71 Invalid TZ environment variable.
address (e.g., 123.456.789.123) instead of -73 Local checkout filter rejected request.
host name. -74 Attempt to read beyond end of license file
-15 Cannot connect to license server. The server path.
(lmgrd) has not been started yet, or the -751 SYS$SETIMR call failed (VMS).
wrong port@host or license file is being -76 Internal FLEXlm error—please report to
used, or the TCP/IP port or host name in the Macrovision.
license file has been changed. -77 Bad version number must be floating-point
-16 Cannot read data from license server. number with no letters.
-17 Cannot write data to license server. -82 Invalid PACKAGE line in license file.
-18 License server does not support this feature. -83 FLEXlm version of client newer than server.
-19 Error in select system call. -84 USER_BASED license has no specified
-21 License file does not support this version. users - see server log.
-22 Feature checkin failure detected at license -85 License server doesn’t support this request.
server. -87 Checkout exceeds MAX specified in options
-23 License server temporarily busy (new server file.
connecting). -88 System clock has been set back.
-24 Users are queued for this feature. -89 This platform not authorized by license.
-25 License server does not support this version -90 Future license file format or misspelling in
of this feature. license file. The file was issued for a later
-26 Request for more licenses than this feature version of FLEXlm than this program
supports. understands.
-29 Cannot find ethernet device. -91 ENCRYPTION_SEEDS are non-unique.
-30 Cannot read license file. -92 Feature removed during lmreread, or wrong
-31 Feature start date is in the future. SERVER line hostid.
-32 No such attribute. -93 This feature is available in a different license
-33 Bad encryption handshake with daemon. pool. This is a warning condition. The server
-34 Clock difference too large between client and has pooled one or more INCREMENT lines
server. into a single pool, and the request was made
-35 In the queue for this feature. on an INCREMENT line that has been
-36 Feature database corrupted in daemon. pooled.
-37 Duplicate selection mismatch for this feature. -94 Attempt to generate license with
Obsolete with v8.0+ vendor daemon. incompatible attributes.
-38 User/host on EXCLUDE list for feature.

30
L I N U X D O C U M E N T A T I O N R P L T F I L E C O N V E R S I O N C O D E

-95 Network connect to this_host failed. Change www.macrovision.com or from your


this_host on the SERVER line in the license software vendor.
file to the actual host name. -113 Two FLEXlock checkouts attempted. Only
-96 Server machine is down or not responding. one checkout is allowed with FLEXlock-
See the system administrator about starting enabled applications.
the server, or make sure that you’re referring -114 SIGN= keyword required, but missing from
to the right host (see LM_LICENSE_FILE license. This is probably because the license
environment variable). is older than the application. You need to
-97 The desired vendor daemon is down. 1) obtain a SIGN= version of this license from
Check the lmgrd log file, or 2) Try lmreread. your vendor.
-98 This FEATURE line can’t be converted to -115 Error in Public Key package.
decimal format. -116 CRO not supported for this platform.
-99 The decimal format license is typed -117 BORROW failed.
incorrectly. -118 BORROW period has expired.
-100 Cannot remove a linger license. -119 lmdown and lmreread must be run on license
-101 All licenses are reserved for others. The server machine.
system administrator has reserved all the -120 Cannot lmdown the server when licenses are
licenses for others. Reservations are made in borrowed.
the options file. The server must be restarted -121 FLOAT_OK license must have exactly one
for options file changes to take effect. dongle hostid.
-102 A FLEXid borrow error occurred. -122 Unable to delete local borrow info.
-103 Terminal Server remote client not allowed. -123 Support for returning a borrowed license
-104 Cannot borrow that long. early is not enabled. The vendor must have
-106 License server out of network connections. enabled support for this feature in the vendor
The vendor daemon can't handle any more daemon. Contact the vendor for further
users. See the debug log for further details.
information. -124 An error occurred while returning a
-110 Dongle not attached, or can’t read dongle. borrowed license to the server.
Either the hardware dongle is unattached, or -125 Attempt to checkout just a PACKAGE. Need
the necessary software driver for this dongle to also checkout a feature.
type is not installed. -126 Error initializing a composite hostid.
-112 Missing dongle driver. In order to read the -127 A hostid needed for the composite hostid is
dongle hostid, the correct driver must be missing or invalid.
installed. These drivers are available at -128 Error, borrowed license doesn't match any
known server license.

31

You might also like