Problem building dll in Tutorial 1
Hi!
I am currently trying to build the dll for Tutorial 4, which is the particle replacement to change it for my specific case. When I try to build the original files, I get 24 error messages with the first being in line 127 CReplacementFactory.cpp:
"Klasse "NApiHelpersV3_4_0::CSimple3DVector"" hat keinen Member ""dx"
From the code:
/// Get last particle in the list
CParticleDef NextParticle = ParticleList[thread].back();
//populate data to create particle
strncpy(type, NextParticle.Type, NApi::API_BASIC_STRING_LENGTH);
scale = NextParticle.Scale * arrCPos[CCreate][3];
posX = NextParticle.Position.dx() + (NextParticle.Orientation.dxx()* arrCPos[CCreate][0] + NextParticle.Orientation.dxy() * arrCPos[CCreate][1] + NextParticle.Orientation.dxz()* arrCPos[CCreate][2])* NextParticle.Scale;
So that class does not have a member dx. What could be the reason for the error message?
I do not think there is a link but currently I am using Visual Studio 2022 instead of 2019. It worked for other tutorials though.
Best regards
Answers
-
Hi Johannes,
It looks like you're using a newer version of the API, so you have to update your code accordingly. In this case, the NextParticle. To get the x component of a CSimple3DVector in the new version of the API you should write NextParticle.Position.x instead. Make sure you do this for the 3 components of all CSimple3DVectors in your code.
Best regards,
Renan
0 -
Hi Renan,
thanks for the answer! I just realized it is tutorial number 1, but that does not matter for the question.
I do not understand the different API versions. There are all version from 1.0 to 3.6 installed. The tutorial was written for EDEM 2022.1 and API version 3.4.0, and code is using the namespace 3.4.0, I did not change that. I got EDEM 2023.1 installed. Do I need EDEM 2022.1 to use the Tutorial source files with API version 3.4.0?
I just tried to change the names (.x instead of dx() and .getXX() instead of .xx()) but I only got the next error so it seems it is easier to use the older version than to try to find out what exactly was changed in between the API versions.
Best regards
Johannes
0 -
Hi,
thanks for the help! We changed the code with the new syntax, and we added the function getlargestscale, then it worked.
posX = NextParticle.Position.x + (NextParticle.Orientation.getXX()* arrCPos[CCreate][0] + NextParticle.Orientation.getXY() * arrCPos[CCreate][1] + NextParticle.Orientation.getXZ()* arrCPos[CCreate][2])* NextParticle.Scale;
posY = NextParticle.Position.y + (NextParticle.Orientation.getYX()* arrCPos[CCreate][0] + NextParticle.Orientation.getYY() * arrCPos[CCreate][1] + NextParticle.Orientation.getYZ()* arrCPos[CCreate][2])* NextParticle.Scale;
posZ = NextParticle.Position.z + (NextParticle.Orientation.getZX()* arrCPos[CCreate][0] + NextParticle.Orientation.getZY() * arrCPos[CCreate][1] + NextParticle.Orientation.getZZ()* arrCPos[CCreate][2])* NextParticle.Scale;
velX = NextParticle.Velocity.x;
velY = NextParticle.Velocity.y;
velZ = NextParticle.Velocity.z;angVelX = 0;
angVelY = 0;
angVelZ = 0;orientation[0] = NextParticle.Orientation.getXX();
orientation[1] = NextParticle.Orientation.getXY();
orientation[2] = NextParticle.Orientation.getXZ();
orientation[3] = NextParticle.Orientation.getYX();
orientation[4] = NextParticle.Orientation.getYY();
orientation[5] = NextParticle.Orientation.getYZ();
orientation[6] = NextParticle.Orientation.getZX();
orientation[7] = NextParticle.Orientation.getZY();
orientation[8] = NextParticle.Orientation.getZZ();void CReplacementFactory::getLargestScale(double& scale, char type[NApi::API_BASIC_STRING_LENGTH]) const
{
// Indicate to EDEM the type and scale of the particle that will have the smallest radius
// so that EDEM can compute the Rayleigh time stepstrncpy(type, ParticleCluster.c_str(), NApi::API_BASIC_STRING_LENGTH);
scale = m_minScale;
}0 -
Hi!
Now we got another question. We would like to shrink the particle, which is in our process controlled by temperature. Replacing the particle by a smaller one works. We can simulate the temperature. Our problem is currently, that we cannot read the temperature during simulation. Is there a way to access the temperature, maybe by a function?
Best regards
Johannes
0