← Back to team overview

yade-users team mailing list archive

Re: new 4hedra model help

 

Hello Vaclav

So I have prepared a simple example for you. In latest SVN trunk I have
committed a primitive example of working tetrahedrons. I have also made a video
and put it on the website in videos section :)

This example is the most primitive, that works: interaction between
tetrahedrons is calculated as if tetrahederons were four spheres placed inside
the tetrahederon. Calculating collision of spheres is the simplest solution, so
that's why this example is simplest possible.

You should checkout from the repository (current revision is 1000).
And I have written extensive comments inside files that you will work
with. You should open following files, and read the comments, then
start working with them. Possibly adding few other files, (which is
also indicated in those instructions).

All the instructions are inside .hpp files, read them in following order:

  InteractingMyTetrahedron
  InteractionOfMyTetrahedron
  InteractingMyTetrahedron2AABB

  InteractingMyTetrahedron2InteractingSphere4InteractionOfMyTetrahedron
  InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron

  GLDrawInteractingMyTetrahedron

  Tetrahedron2InteractingMyTetrahedron

  MyTetrahedronLaw

  TetrahedronsTest  (main)



also you will want to look at those files, even though they do not conatain any instructions:

  Tetrahedron

  ElasticBodyParameters
  ElasticBodySimpleRelationship
  SimpleElasticInteraction

and perhaps many others :)


After you read all that, I think that the first thing when you start
working on that will be to fix lines 219 and 224 in TetrahedronsTest,
and observe that tetrahedrons behave a bit more realistically after that.

Then, whatever direction you pick I recommend that you add friction
and shearing force. Because currently without friction to get a
reasonable simulation damping is set to 0.9 ! Whereas in correct
simulations damping should be not used :)


I expect that after you finish your work (or maybe even during your
work) it will be reasonable to rename those files above, so that
their names reflect better what they really are. For instance later
when we add your work to yade's trunk, I want to
%s/MyTetrahedron/FourSpheres/ because that's the correct name. And
add your files under the name that you will decide is the best.

The ./yade-scripts/renameClass* are useful scripts for for renaming
stuff. especially renameClassFirst is useful as a global
search'n'replace of a variable (or class) name.

> Hello,
> 
> can I get some rough guidelines on implementing a brand-new 4hedra 
> model? What is the easiest way to start? Am I correct in the following 
> list of classes to implement?
> 
> First, for the element itself:
>   1. GeometricalModel (done in 
> package-common/..../GeometricalModel/Tetrahedron/Tetrahedron.{cpp,h})
>   2. InteractingGeometry (simple 4hedron as well)

yes, you can make an InteractingGeometry that is a tetrahedron, why
not. It should be much better than my simple example that is using
spheres :)

>   3. BoundingVolume (trivial)
>   4. State (container of internal variables, right?)

Currently state is still not in yade. It is part of future plans.
An important part. That's why it is explained in the manual. So now
State resides inside PhysicalParamaters (which is bad).

>   5. PhysicalParameters (container of physical variables)
 
> Second, for the interaction
>   6. InteractionGeometry (collision detection)
>   7. InteractionPhysics (collision response)
>   8. PhysicalAction (application of the physical response??)


I hope that after you read all those .hpp and .cpp files that I have
listed, everything will be clear. If you have any more questions, just ask.

-- 
# Janek Kozicki
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-users



Follow ups

References