← Back to team overview

yade-dev team mailing list archive

new PhysicalAction

 

Hello!
I have created a new PhysicalAction <- Teleportation (and the engines) in order to feed back particles left the simulation space.
However, runtime error arose:

...
DEBUG yade.PhysicalActionContainerInitializer pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp:48 action: allNames after sort and unique:
DEBUG yade.PhysicalActionContainerInitializer pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp:48 action: Force
DEBUG yade.PhysicalActionContainerInitializer pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp:48 action: Momentum
DEBUG yade.PhysicalActionContainerInitializer pkg/common/Engine/StandAloneEngine/PhysicalActionContainerInitializer.cpp:48 action: Teleportation
DEBUG yade.Omega core/Omega.cpp:342 loadSimulation: Simulation loaded
yade: /usr/local/include/boost/shared_ptr.hpp:315: T* boost::shared_ptr<T>::operator->() const [with T = PhysicalAction]: Adoption verification `px != 0' failed.
SIGSEGV/SIGABRT handler called; gdb batch file is `/home/sega/.yade-trunk/gdb_crash_batch-pid27822'
GNU gdb 6.5
...

I spent some research and discovered that class Force have ClassIndex 0, class Momentum have ClassIndex 1 but class Teleportation have ClassIndex 3 (need 2???).
Because of this, there are problems in the class PhysicalActionVectorVector:

function PhysicalActionVectorVector::find(...):

93	for( unsigned int j = 0 ; j < actionTypesSize ; ++j )
94		physicalActions[i][j] = actionTypesResetted[j]->clone();

since

actionTypesResetted[0] is Force
actionTypesResetted[1] is Momentum
actionTypesResetted[2] is NULL
actionTypesResetted[3] is Teleportation

I tried to fix it:

93	for( unsigned int j = 0 ; j < actionTypesSize ; ++j )
94		if (actionTypesResetted[j]) physicalActions[i][j] = actionTypesResetted[j]->clone();

and uncomment line 48:

48	if(*vi) // FIXME ?? do not check - all fields are NOT empty.
49			(*vi)->reset();

But the problem persists elsewhere, as the error is not lost...

Best regards, Sergei D.


_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev



Follow ups