python API ray hit test (not the ray sensor from game API)

well… is there some way to make ray hit tests? I am not talking about setting up an object with an associated ray-sensor within blender.

All I want to do is to send a ray through a scene from within a normal python script and get eventual hits with objects and materials as well as a vector to where they occured.

I am trying to implement something like a CFD code within blender for testing purposes, and whether its feasible or not… They nice thing in blender is its easy handling of 3D-models compared with most CFD packages. But I don’t want to reenvent the wheel all by myself…

yes, I wrote some util functions in BPyMesh that give the face and point hit,
see ./scripts/bpymodules/BPyMesh.py, this is used for the weight paint gradient script.