MNTable 2D

Asked by Grady

Hello everyone. I have a question about the class MNTable2D. When I run my program I get the following error.

MNTable2D.insert(MNTable2D, NRotSphere)
did not match C++ signature:
insert(MNTable2D {lvalue}, Sphere sphere, unsigned int groupID=0)

I'm confused about what input arguments the insert class is expecting. I'm trying to insert a single particle into MNTable2D. My code for this is below.

mntable = MNTable2D (
   minPoint = minPoint,
   maxPoint = maxPoint,
   gridSize = 2.5,
   numGroups = 10
)

mntable.insert(
  NRotSphere(id=0, posn=Vec3(-xshift+0.5176,yshift+1.9319,0.0), radius=1.0, mass=1.0),
  groupID = 0
  )

Any help would be appreciated. Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
SteffenAbe (s-abe) said :
#1

Hi Grady,

assuming your code fragment is from a gengeo script, not from an ESyS-Particle script, the correct class for a particle would be "Sphere", not "NRotSphere". Also, the vector class in gengeo is called Vector3 , not Vec3. So the correct way to insert a particle into a neighbor table in gengeo would be

s=Sphere(centre=Vector3(-xshift+0.5176,yshift+1.9319,0.0), radius=1.0)
s.setId(0)
mntable.insert(s)

The setId bit isn't really necessary because a newly created sphere is automatically assigned a suitable ID.
N.B. gengeo doesn't know about particle mass - just position & radius.

Steffen

Can you help with this problem?

Provide an answer of your own, or ask Grady for more information if necessary.

To post a message you must log in.