openworm / org.geppetto.frontend

Geppetto Java frontend bundle
http://www.geppetto.org/
Other
29 stars 25 forks source link

Dual aspect model #156

Closed borismarin closed 9 years ago

borismarin commented 10 years ago

I'm trying to run https://raw.githubusercontent.com/borismarin/OpenSourceChaos/geppetto_tests/geppetto/peppetto.xml which has two aspects defined (mechanical coupled to jLEMS, and visual to the collada loader). Before openworm/org.geppetto.core@2a50f49029cdd119cb3929e14ecead6b180623f8, I could inspect pend.visual as an object in the console, but no actual 3d scene was displayed. Now, the 3d scene is correctly loaded and displayed, but no plots are loaded and I can't start the simulation (well, I can Simulation.start(); but it has no effect). It seems that the Simulation tree is not being created correctly as well, as I can't do pend.mechanical.SimulationTree.theta as expected.

The above symptoms apply for chrome. In firefox, the plots are loaded but there's still no simulation.

tarelli commented 10 years ago

@jrmartin can you look into this?

jrmartin commented 10 years ago

@tarelli Will do

jrmartin commented 10 years ago

The LEMS visualization tree is not being populated for this model. SimulationTree is also not created for this LEMS model, which is why nothing is seen for mechanical in the scene

tarelli commented 10 years ago

@jrmartin that's correct, the LEMS model has no viz tree so that's ok but it should have a simulation tree (as when you load it on its own)

jrmartin commented 10 years ago

I debugged this issue, problem lies in CheckSteppedSimulator. From the comment on top of class "This visitor checks if all the simulators have stepped Note: This visitor at the moment doesn't take into account that different simulators could have different time steps and in this case the check will have to be more sophisticated" . I think it's time to make it more sophisticated since we are simulating dual aspects now.

tarelli commented 10 years ago

@jrmartin there's no simulator for the collada file (if not a dummy one that does nothing that we should even try to remove) that comment will be relevant in the future but not yet

jrmartin commented 10 years ago

@tarelli Yeah no simulator for Collada, but since there's none for it the way we perform our check in that class made it so no updates were sent to the client. The flag "allStepped" should be set individually for each simulator, instead of having a global one in simulation class CheckSteppedSimulator. One simulator could have steps to consume like LEMs, while Collada has none as it has no simulator, and the latter one sets the global flag "allStepped" to false preventing updates to be send to the client for either simulator.

tarelli commented 10 years ago

@jrmartin it's global on purpose for synchronising the different simulators. Either make the collada simulator always be in a stepped situation (I don't remember how the check works) or remove the collada simulator altogether (an aspect could also have no simulator but that changed during the refactoring).

jrmartin commented 10 years ago

@borismarin It's fix now. Bundles that need pull to work: core, simulation, simulator.jlems and frontend.

jrmartin commented 10 years ago

You can also test it with this simulation. https://raw.githubusercontent.com/openworm/org.geppetto.samples/development/Integration/MultipleSimulators.xml

borismarin commented 10 years ago

Thanks, @jrmartin. Actually, I am still having some difficulties with my pendulum example: now I get the plots right, as well as the 3d visualization from the collada file, but pendulum.mechanical.SimulationTree.theta / p are not getting updated - even though the lines in the plots are!

As for your example, I get the following error

org.geppetto.simulation.visitor.LoadSimulationVisitor

org.geppetto.core.common.GeppettoInitializationException: The simulator for
sample.fluid was not found

thanks!

borismarin commented 10 years ago

BTW, just two pieces of info:

On 15 September 2014 11:46, Bóris Marin borismarin@gmail.com wrote:

Thanks, @jrmartin. Actually, I am still having some difficulties with my pendulum https://raw.githubusercontent.com/borismarin/OpenSourceChaos/geppetto_tests/geppetto/peppetto.xml example: now I get the plots right, as well as the 3d visualization from the collada file, but pendulum.mechanical.SimulationTree.theta / p are not getting updated - even though the lines in the plots are!

As for your https://raw.githubusercontent.com/openworm/org.geppetto.samples/development/Integration/MultipleSimulators.xml , I get the following error


org.geppetto.simulation.visitor.LoadSimulationVisitor

org.geppetto.core.common.GeppettoInitializationException: The simulator for sample.fluid was not found


thanks!

On 14 September 2014 14:11, Jesus M notifications@github.com wrote:

You can also test it with this simulation. https://raw.githubusercontent.com/openworm/org.geppetto.samples/development/Integration/MultipleSimulators.xml

Reply to this email directly or view it on GitHub https://github.com/openworm/org.geppetto.frontend/issues/156#issuecomment-55525099 .

jrmartin commented 10 years ago

@borismarin I see the issue of "pend.mechanical.SimulationTree.theta" not gettind updated while "pend.mechanical.SimulationTree.theta.getValue()" is, but can't make it ccrash on firefox. Are there any other errors displayed?

For the other Simulation I linked, you might be missing the simulator.sph and solver.sph bundles.

borismarin commented 10 years ago

Couldn't find any relevant log messages on firefox, but it might as well be that my old video card is not playing well with webgl. Good to know that it works for the rest of the world! You are right about the missing sph bundles: my same old graphics card can't do opencl....

I can manage with getValue() from my side of the project, so I'll let you focus on more important stuff =)

On 15 September 2014 13:20, Jesus M notifications@github.com wrote:

@borismarin https://github.com/borismarin I see the issue of "pend.mechanical.SimulationTree.theta" not gettind updated while "pend.mechanical.SimulationTree.theta.getValue()" is, but can't make it ccrash on firefox. Are there any other errors displayed?

For the other Simulation I linked, you might be missing the simulator.sph and solver.sph bundles.

Reply to this email directly or view it on GitHub https://github.com/openworm/org.geppetto.frontend/issues/156#issuecomment-55582612 .

gidili commented 10 years ago

@borismarin you can edit solver.sph to do opencl via CPU instead of GPU, there's a constructor that will let you specify that and there are some other checks here. You can try and play with that code and see if you can force CPU use like that if your CPU does opencl!

borismarin commented 10 years ago

thanks @gidili, but no sse3 on my cpu (I have been using a resurrected old server here at UCL - it's superfast for a 10yr old machine, but it lacks some the luxuries from modern times)... guess I'll have to buy a new pc to see liquid particles moving around...

On 15 September 2014 14:58, Giovanni Idili notifications@github.com wrote:

@borismarin https://github.com/borismarin you can edit solver.sph to do opencl via CPU instead of GPU, there's a constructor https://github.com/openworm/org.geppetto.solver.sph/blob/master/src/main/java/org/geppetto/solver/sph/SPHSolverService.java#L203 that will let you specify that and there are some other checks here https://github.com/openworm/org.geppetto.solver.sph/blob/master/src/main/java/org/geppetto/solver/sph/SPHSolverService.java#L220. You can try and play with that code and see if you can force CPU use like that if your CPU does opencl!

Reply to this email directly or view it on GitHub https://github.com/openworm/org.geppetto.frontend/issues/156#issuecomment-55593501 .