------------------------------------------------------------ revno: 1846 committer: Bruno Chareyre <bchare...@r1arduina> branch nick: trunk timestamp: Thu 2009-12-03 10:15:32 +0100 message: - fix segfault in test.cpp (testing the triangulation functions) - adapt the collider to state/material modified: extra/triangulation/test.cpp pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp
-- lp:yade https://code.launchpad.net/~yade-dev/yade/trunk Your team Yade developers is subscribed to branch lp:yade. To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'extra/triangulation/test.cpp' --- extra/triangulation/test.cpp 2008-10-24 12:09:44 +0000 +++ extra/triangulation/test.cpp 2009-12-03 09:15:32 +0000 @@ -28,31 +28,31 @@ 0.5000 0.7929 0.5000 0.2071*/ TesselationWrapper T1; -// cout << T1.insert(0 ,0 ,0 ,0.1,6) << endl; -// cout << T1.insert(0 ,0.2 ,0 ,0.1,7) << endl; -// cout << T1.insert(0 ,0 ,0.2 ,0.1,8) << endl; -// cout << T1.insert(0 ,0.2 ,0.2 ,0.1,9) << endl; -// cout << T1.insert(0.2 ,0.01,0 ,0.1,10) << endl; -// cout << T1.insert(0.2 ,0.2 ,0 ,0.1,11) << endl; -// cout << T1.insert(0.2 ,0.2 ,0.2 ,0.1,12) << endl; -// cout << T1.insert(0.2 ,0 ,0.2 ,0.1,13) << endl; -// cout << T1.insert(0.1 ,0.1 ,0.1 ,0.01,14) << endl; + cout << T1.insert(0 ,0 ,0 ,0.1,6) << endl; + cout << T1.insert(0 ,0.2 ,0 ,0.1,7) << endl; + cout << T1.insert(0 ,0 ,0.2 ,0.1,8) << endl; + cout << T1.insert(0 ,0.2 ,0.2 ,0.1,9) << endl; + cout << T1.insert(0.2 ,0.01,0 ,0.1,10) << endl; + cout << T1.insert(0.2 ,0.2 ,0 ,0.1,11) << endl; + cout << T1.insert(0.2 ,0.2 ,0.2 ,0.1,12) << endl; + cout << T1.insert(0.2 ,0 ,0.2 ,0.1,13) << endl; + cout << T1.insert(0.1 ,0.1 ,0.1 ,0.01,14) << endl; cout << T1.insert(0.2071, 0.2071, 0.2071, 0.2071,6) << endl; -// cout << T1.insert(0.7929, 0.2071, 0.7929, 0.2071,7) << endl; -// cout << T1.insert(0.7929, 0.7929, 0.2071, 0.2071,8) << endl; -// cout << T1.insert(0.7929, 0.2071, 0.2071, 0.2071,9) << endl; -// cout << T1.insert(0.2071, 0.2071, 0.7929, 0.2071,10) << endl; -// cout << T1.insert(0.2071, 0.7929, 0.2071, 0.2071,11) << endl; -// cout << T1.insert(0.5000, 0.5000, 0.2071, 0.2071,12) << endl; -// cout << T1.insert(0.5000, 0.5000, 0.7929, 0.2071,13) << endl; -// cout << T1.insert(0.5000, 0.2071, 0.5000, 0.2071,14) << endl; -// -// cout << T1.insert(0.2071, 0.5000, 0.5000, 0.2071,15) << endl; -// -// cout << T1.insert(0.7929, 0.5000, 0.5000, 0.2071,16) << endl; -// -// cout << T1.insert(0.5000, 0.7929, 0.5000, 0.2071,17) << endl; + cout << T1.insert(0.7929, 0.2071, 0.7929, 0.2071,7) << endl; + cout << T1.insert(0.7929, 0.7929, 0.2071, 0.2071,8) << endl; + cout << T1.insert(0.7929, 0.2071, 0.2071, 0.2071,9) << endl; + cout << T1.insert(0.2071, 0.2071, 0.7929, 0.2071,10) << endl; + cout << T1.insert(0.2071, 0.7929, 0.2071, 0.2071,11) << endl; + cout << T1.insert(0.5000, 0.5000, 0.2071, 0.2071,12) << endl; + cout << T1.insert(0.5000, 0.5000, 0.7929, 0.2071,13) << endl; + cout << T1.insert(0.5000, 0.2071, 0.5000, 0.2071,14) << endl; + + cout << T1.insert(0.2071, 0.5000, 0.5000, 0.2071,15) << endl; + + cout << T1.insert(0.7929, 0.5000, 0.5000, 0.2071,16) << endl; + + cout << T1.insert(0.5000, 0.7929, 0.5000, 0.2071,17) << endl; // T1.ComputeVolumes(); @@ -75,5 +75,6 @@ //T1.Compute(); //T1.ComputePorosity(); + return 0; } === modified file 'pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp' --- pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp 2009-12-01 14:56:39 +0000 +++ pkg/common/Engine/StandAloneEngine/PersistentTriangulationCollider.cpp 2009-12-03 09:15:32 +0000 @@ -1,9 +1,6 @@ /************************************************************************* -* Copyright (C) 2004,2007 by -* Olivier Galizzi <[email protected]> -* Bruno Chareyre <[email protected]> -* Václav Šmilauer <[email protected]> -* +* Copyright (C) 2009 by Bruno Chareyre <[email protected]> * +* * * This program is free software; it is licensed under the terms of the * * GNU General Public License v2 or later. See file LICENSE for details. * *************************************************************************/ @@ -16,7 +13,7 @@ #include<utility> #include<vector> #include<yade/pkg-common/InteractingSphere.hpp> -#include<yade/pkg-common/RigidBodyParameters.hpp> +#include<yade/pkg-common/ElasticMat.hpp> #include<yade/extra/TesselationWrapper.h> YADE_REQUIRE_FEATURE(CGAL) @@ -59,8 +56,7 @@ if ( ( *bi )->isDynamic ) {//means "is it a sphere (not a wall)" const InteractingSphere* s = YADE_CAST<InteractingSphere*> ( ( *bi )->interactingGeometry.get() ); - const RigidBodyParameters* p = YADE_CAST<RigidBodyParameters*> ( ( *bi )->physicalParameters.get() ); - Tes->insert ( p->se3.position[0],p->se3.position[1],p->se3.position[2], s->radius, ( *bi )->getId() ); + Tes->insert ( (*bi)->state->pos[0],(*bi)->state->pos[1],(*bi)->state->pos[2], s->radius, ( *bi )->getId() ); } } Tes->AddBoundingPlanes(); @@ -152,5 +148,5 @@ } YADE_PLUGIN((PersistentTriangulationCollider)); -YADE_REQUIRE_FEATURE(PHYSPAR); +
_______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

