parmes / parmec

Particulate media code prototype using ISPC
http://parmes.org/parmec
MIT License
0 stars 0 forks source link

Articulated rigid body dynamics #14

Open tkoziara opened 6 years ago

tkoziara commented 6 years ago

As transpired in #7 it would be useful to include into Parmec implicit rigid links to allow modelling of articulated chains of bodies. This can be done via the same mechanism as in Solfec (general but slow) or by means of a recursive formulation (fast). This issue will explore and lead to a practical implementation of this functionality. Mentioning @bencannell and @stevebrasier who prompted this development.

tkoziara commented 6 years ago

@bencannell @stevebrasier I am thinking of starting with something as simple as the BALL_JOINT command specified below. I will be able to copy some of the Solfec functionality to implement this. It should serve your needs. Do feel free to provide comments/suggestions, while I start looking into this.

jnum = BALL_JOINT (part1, point | part2) • jnum - joint number • part1 - first particle number • point - coincident point (x,y,z) • part2 - optional second particle number; default: not specified (in this case part1 is fixed in space at point)

Create a ball joint between two particles at a coincident point. The joint is modeled as an algebraic constraint, without affecting the stable time step. Any number of joints between any number of particles can be added. A linear system is solved at every time step to calculate joint forces.

bencannell commented 6 years ago

Hi @tkoziara,

Yes this looks appropriate, assuming this can be coupled with the TORSION_SPRING functionality?

tkoziara commented 6 years ago

Yes: joints and springs will be independent functionalities - able to be coupled without restrictions. I am looking into including a suitable linear solver package into parmec now, to serve the related algebra needs. I will start on this following that.

bencannell commented 6 years ago

OK, great, thank you for the update :)

Sorry I haven't tested the current TORSION_SPRING functionality yet. I'll do so this week.

tkoziara commented 6 years ago

Take your time; I will be progressing other things in the meantime:)

tkoziara commented 5 years ago

@bencannell @stevebrasier , fyi, this is now functional: http://parmes.org/blog/parmec_ball_joint.html

bencannell commented 5 years ago

Hi @tkoziara

We have begun testing this. I'm getting the following error when compiling changeset 100711a.

g++ -O2 -Wno-narrowing -DISPC_USE_OMP tasksys.cpp -c -o objs4/tasksys.o g++ -DREAL=4 -Iobjs4 -Iobjs4 -O2 -Wno-narrowing mem.cpp -c -o objs4/mem.o g++ -DREAL=4 -Iobjs4 -Iobjs4 -O2 -Wno-narrowing map.cpp -c -o objs4/map.o g++ -DREAL=4 -Iobjs4 -Iobjs4 -O2 -Wno-narrowing mesh.cpp -c -o objs4/mesh.o g++ -DREAL=4 -Iobjs4 -Iobjs4 -O2 -Wno-narrowing timeseries.cpp -c -o objs4/timeseries.o g++ -DREAL=4 -Iobjs4 -O2 -Wno-narrowing -I. -std=c++11 joints.cpp -c -o objs4/joints.o cc1plus: error: unrecognized command line option "-std=c++11" cc1plus: warning: unrecognized command line option "-Wno-narrowing" make: *** [objs4/joints.o] Error 1

Do you have a similar error?

Thanks,

Ben

tkoziara commented 5 years ago

Hi Ben. Which version of g++ are you using? It does not seem to support C++11, which is needed to compile the joints functionality (a linear solver within it uses it). Tomek

bencannell commented 5 years ago

g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bencannell commented 5 years ago

Which version would you suggest we use?

tkoziara commented 5 years ago

Perhaps try something a little bit higher. See: http://www.gnu.org/software/gcc/projects/cxx-status.html I am using 7.2.0 at the moment.

bencannell commented 5 years ago

Hi @tkoziara,

We've now got a more appropriate version of g++ installed and can successfully compile the updated parmec source code.

I notice that the parmec executable will only run on a single core. Do you observe the same behaviour?

Many thanks,

Ben

tkoziara commented 5 years ago

Not on my laptop - just checked. What's the symptom for you? How are you testing this?

bencannell commented 5 years ago

Hi @tkoziara,

Is it possible to construct a chain of ball joints in which none of the associated particles are fixed in space? We would like to restrain the top of a chain using RESTRAIN and apply motions to this particle.

See attached a modification of your "ball_joint_chain.py" example, ball_joint_chain-original.txt.

When we try and generate an example, the entire chain of particles free falls (although ball joints continue to connect the chain).

What do you think?

Many thanks,

Ben

bencannell commented 5 years ago

Hi @tkoziara,

Is it possible to construct a chain of ball joints in which none of the associated particles are fixed in space? We would like to restrain the top of a chain using RESTRAIN and apply motions to this particle.

See attached a modification of your "ball_joint_chain.py" example, ball_joint_chain-original.txt.

When we try and generate an example, the entire chain of particles free falls (although ball joints continue to connect the chain).

What do you think?

Many thanks,

Ben

Hi @tkoziara,

Any thoughts on the above?

Many thanks,

Ben

tkoziara commented 5 years ago

Ben, I made a correction in the code and this example will now run; For what it's worth, the chain takes a half-swing and then goes unstable - so this functionality needs more work apparently. Do make your own tests and let me know how it works for you; Tomek

bencannell commented 5 years ago

Hi @tkoziara.

Ok great, thank you for looking into this. I'll let you know how our test gets on.

Ben