An error that occurred during the use of multibody dynamics codes
Dear Engineers,
I am trying to control the motion of the geometry, using the code for multi-body dynamics in edem2021.2. The code can be found in the edem coupling interface class, IEDEMCoupling.h. However,when I execute the relevant code, edem will simply exit the situation.
The codes are shown in the following figure.
Note that this error was found in debug mode.
Looking forward to your reply.
Best wishes,
Yong Liu
Answers
-
Seems to be the same as:
https://community.altair.com/community?id=community_question&sys_id=b481ca35dbf60114e8863978f49619de
Take a look at the help in:
C:\Program Files\Altair\2021.2\EDEM2021.2\src\Api\Help\index.html
There you will find the function definitions and required arguments. You aren't passing in enough parameters
bool addLinearTranslationKinematic ( int geomId, double startTime, double endTime, double initialVelocity, double acceleration, double dirnXStart, double dirnXEnd, double dirnYStart, double dirnYEnd, double dirnZStart, double dirnZEnd, bool displayVector, bool loop = false
,double loopInterval = 0.0
,double loopUntilTime = std::numeric_limits< double >().max()
) Richard
0 -
Hi, Richard
Thank you for you reply.
I am so sorry!I have to say that I have passed enough parameters, but I still failed. Can you give an example to express your point of view?For example, it can control this geometry to move in the X direction at a speed of 1m/s.
Yours sincerely,
Yong Liu
0 -
You only have 12 arguments in your function call. The function needs 15. Call the function with (geom.id, 0.0 , 0.0 ... , 0.0) so that you have 14 zeroes. you only have 11 numeric values after your id. I've just tested it with my test case and using 15 values of 0 it will add the kinematic to geometry id 0 successfully.
Once that is working change the values as appropriate.
Richard
0 -
According to your suggestion, I tried again. Obviously, it failed again.
I must mention that it works well in edem 2018, so it's not a matter of code.0 -
In that case I can only assume you are building against a different version of EDEM than the one you are loading. The function works fine when built against the .lib file of 2021.2 and runs without issue for me.
Check that you are linking to 2021.2 and not 2018 and also you have the correct EDEM/lib version in your path, i.e. where the coupling dll is located.
Richard
1 -
Hi Richard!
According to your tips, I've been checking my settings these days. But I have to mention that I still get the experience of failure.
Note that I have checked that I link to 2021.2 instead of other versions. What I notice is that the formal parameters I give should meet the conditions. In the debug mode, some functions can run normally, such as setgeometrymotion. Until the functions of the add.... are run, the program makes an error. The following picture shows the relevant code I use.
I really think it may be a source code problem. I hope you can really help me solve the problem. Thank you again for your patience.
Best Wishes
Yong Liu
0 -
Hi,
Looks like there might be something strange going on with EDEM 2021.2. I'm still building and linking against 2021.2 but when I run my exe with EDEM 2021.2, EDEM crashes. All this time I've running the executable with EDEM 2022 and it's been running fine, even if using the 2021.2 headers and lib file during compilation and linking.
From what I can tell there's nothing wrong with building against 2021.2 but something has clearly changed within EDEM 2022. There's not been an announcement yet but EDEM 2022 is available for download now so I'd maybe try that version to see if it sorts your issue.
Richard
0