yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00945
[svn] r1662 - in trunk: examples/dynamic_simulation_tests gui/qt3 pkg/dem pkg/dem/Engine/EngineUnit
Author: sega
Date: 2009-02-09 21:50:44 +0100 (Mon, 09 Feb 2009)
New Revision: 1662
Added:
trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.cpp
trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp
Modified:
trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py
trunk/gui/qt3/QtGeneratedSimulationPlayer.ui
trunk/gui/qt3/QtSimulationPlayer.cpp
trunk/gui/qt3/QtSimulationPlayer.hpp
trunk/pkg/dem/SConscript
Log:
1. Convert SimpleViscoelasticContactLaw to ConstitutiveLaw engine unit (Spheres_Viscoelastic_SimpleViscoelasticContactLaw).
2. SimulatonPlayer have now Display tab as one in SimulationController.
Modified: trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py
===================================================================
--- trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/examples/dynamic_simulation_tests/ringSimpleViscoelastic.py 2009-02-09 20:50:44 UTC (rev 1662)
@@ -28,10 +28,7 @@
z = cylinderOrigin[2]+h*2*sphereRadius
s=utils.sphere_v2([x,y*cos(cylinderSlope)+z*sin(cylinderSlope),z*cos(cylinderSlope)-y*sin(cylinderSlope)],sphereRadius,density=Density,physicalParameters=["SimpleViscoelasticBodyParameters",{'frictionAngle':frictionAngle}])
p=utils.getViscoelasticFromSpheresInteraction(s.phys['mass'],tc,en,es)
- s.phys['kn']=p['kn']
- s.phys['cn']=p['cn']
- s.phys['ks']=p['ks']
- s.phys['cs']=p['cs']
+ s.phys['kn'],s.phys['cn'],s.phys['ks'],s.phys['cs']=p['kn'],p['cn'],p['ks'],p['cs']
o.bodies.append(s)
spheresCount+=1
return spheresCount
@@ -52,19 +49,29 @@
## Engines
o.engines=[
+
StandAloneEngine('PhysicalActionContainerReseter'),
+
MetaEngine('BoundingVolumeMetaEngine',[
EngineUnit('InteractingSphere2AABB'),
EngineUnit('InteractingFacet2AABB'),
EngineUnit('MetaInteractingGeometry2AABB')
]),
+
StandAloneEngine('PersistentSAPCollider'),
+
MetaEngine('InteractionGeometryMetaEngine',[
EngineUnit('InteractingSphere2InteractingSphere4SpheresContactGeometry'),
EngineUnit('InteractingFacet2InteractingSphere4SpheresContactGeometry')
]),
+
MetaEngine('InteractionPhysicsMetaEngine',[EngineUnit('SimpleViscoelasticRelationships')]),
- StandAloneEngine('SimpleViscoelasticContactLaw'),
+
+ ## Constitutive law
+ MetaEngine('ConstitutiveLawDispatcher',[EngineUnit('Spheres_Viscoelastic_SimpleViscoelasticContactLaw')]),
+ ## or InteractionSolver
+ #StandAloneEngine('SimpleViscoelasticContactLaw'),
+
DeusExMachina('GravityEngine',{'gravity':[0,-9.81,0]}),
## Cundall damping must been disabled!
@@ -80,7 +87,7 @@
if b.shape.name=='Sphere':
b.phys['blockedDOFs']=4 # blocked movement along Z
-o.dt=2e-5
+o.dt=0.2*tc
o.saveTmp('init');
Modified: trunk/gui/qt3/QtGeneratedSimulationPlayer.ui
===================================================================
--- trunk/gui/qt3/QtGeneratedSimulationPlayer.ui 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/gui/qt3/QtGeneratedSimulationPlayer.ui 2009-02-09 20:50:44 UTC (rev 1662)
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>306</width>
- <height>271</height>
+ <width>362</width>
+ <height>430</height>
</rect>
</property>
<property name="sizePolicy">
@@ -43,69 +43,15 @@
<property name="frameShadow">
<enum>Raised</enum>
</property>
- <grid>
+ <vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="spacing">
<number>0</number>
</property>
- <widget class="QLayoutWidget" row="1" column="0">
+ <widget class="QTabWidget">
<property name="name">
- <cstring>layout5</cstring>
- </property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QPushButton" row="0" column="3">
- <property name="name">
- <cstring>pbReset</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="pixmap">
- <pixmap>image0</pixmap>
- </property>
- </widget>
- <widget class="QPushButton" row="0" column="2">
- <property name="name">
- <cstring>pbPause</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="pixmap">
- <pixmap>image1</pixmap>
- </property>
- </widget>
- <widget class="QPushButton" row="0" column="1">
- <property name="name">
- <cstring>pbStep</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="pixmap">
- <pixmap>image2</pixmap>
- </property>
- </widget>
- <widget class="QPushButton" row="0" column="0">
- <property name="name">
- <cstring>pbPlay</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="pixmap">
- <pixmap>image3</pixmap>
- </property>
- </widget>
- </grid>
- </widget>
- <widget class="QTabWidget" row="0" column="0">
- <property name="name">
<cstring>tabWidget5</cstring>
</property>
<property name="margin">
@@ -194,7 +140,7 @@
<string></string>
</property>
<property name="pixmap">
- <pixmap>image4</pixmap>
+ <pixmap>image0</pixmap>
</property>
</widget>
<widget class="QLineEdit" row="0" column="0" rowspan="1" colspan="2">
@@ -314,7 +260,7 @@
<string></string>
</property>
<property name="pixmap">
- <pixmap>image4</pixmap>
+ <pixmap>image0</pixmap>
</property>
</widget>
</grid>
@@ -509,7 +455,7 @@
<string></string>
</property>
<property name="pixmap">
- <pixmap>image4</pixmap>
+ <pixmap>image0</pixmap>
</property>
</widget>
<widget class="QLineEdit" row="1" column="1" rowspan="1" colspan="2">
@@ -650,7 +596,7 @@
<string></string>
</property>
<property name="pixmap">
- <pixmap>image0</pixmap>
+ <pixmap>image1</pixmap>
</property>
</widget>
</hbox>
@@ -681,24 +627,40 @@
<cstring>TabPage</cstring>
</property>
<attribute name="title">
- <string>View</string>
+ <string>Display</string>
</attribute>
- <widget class="QCheckBox">
+ <vbox>
<property name="name">
- <cstring>cbBodyWire</cstring>
+ <cstring>unnamed</cstring>
</property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>10</y>
- <width>229</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>Body wire</string>
- </property>
- </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>scrollViewOutsideFrame</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>5</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pbApply</cstring>
+ </property>
+ <property name="text">
+ <string>Apply</string>
+ </property>
+ </widget>
+ </vbox>
</widget>
<widget class="QWidget">
<property name="name">
@@ -754,25 +716,79 @@
</grid>
</widget>
</widget>
- </grid>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="0" column="3">
+ <property name="name">
+ <cstring>pbReset</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image1</pixmap>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>pbPause</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image2</pixmap>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>pbStep</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image3</pixmap>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>pbPlay</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image4</pixmap>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
</widget>
</grid>
</widget>
<images>
<image name="image0">
- <data format="PNG" length="305">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000000f849444154388db5943b12823010863f1f95158de839b0f5021ec00bd8702b8f2117e0326ab38d54385a844748086c66f49f49917d7c2cc966412501e4a38b85a536b081abc01350c9405e0dc882cd831701600daca6539340ae57a9a44d2533c069b9bf7f77f605706e96ad83922fb5a9b25bb9e5a3b7ab2559183880c6744b7bcbf201b945248eaafdf2c6b25d7f05b555fe03fafc07741b8790fdf092c7a1c7c8c2bcf8165a59b64b24d48eb739737d1a92e44e5ee6064cbc2815b06e3dcea4f19e6181e9db12d3155bcc195e80d330b49f5a2e34c51f2a1aed207904a01d5c314f017843b2768d810191ac31e3ad1af75319bf0f04f8024c83732f0a67978c0000000049454e44ae426082</data>
+ <data format="PNG" length="892">89504e470d0a1a0a0000000d4948445200000018000000180806000000e0773df800000343494441544889ed95cf6f146518c73f5d5a8b96a5ab6de84230b6b02858b134023d28743de8414d6a8c7f01ff801aaf24c24d2f0ac6709693f1a0f5e4c5c42e8907f560a736c4d616322dd275b7753bdb617766f6fdf17898e9b26db798102f263ec924cfccfbe4f3fd3ecffb2403ffc743c408f00e3099493fbafefc338704986a53370e7c909c6dd6f46e2fea68c92780cfcf9d3e92397f26c7f8991ce363c748a552bcffe1249f5e2f5c023ce0cdde7d7bf3e74e1fe5a5178ef0daf967393cd0cbb52f7ee0e2d56f2f0197771398aafc319b4ffbdfd3914a01202288152a5e8deb5fff8888f0e2e810c3b92cc65a8cb1186dd0da50a9d6197dfb6307186d15e86c7df1aa1efb3ac03434d65aac8d018fa4e0c25b679b40dfafa38dc1688bd686a8a1d0da72b03f7daab8e64f259dbe0b2cb50a384b6595ef4f871863304630d6a055ecb01d501bc37a790d43378ff53dc5b5cfae706ae444fe9bafbee4bd8b571de072ab80e7380ec363d0084394d2281d0b6c07d6ea0d0e0c8d923994e3f8cbc364d25d1094e347cde3955c0077fb880a9ee761f61cc6f7570942454369362a1eb55a83fd0347c9648f317af669b2d9be045882!
fa34d40191982250f8690ea0b0e30e5cd7258a0ee0fb012b772b3c79f2154e8e3d4736fb440c0bca102d4269710b50442059082b961b3fcf7bc0d27601d7755d3a7bdee0aefb1df90b1f9131b720b809c5c4e12633015a2b8858ac3548b214337377009c765bb404201d5d74f6f493e98e60b5747f5d45106b6390c430b1a6b96db1806171b9d81ccf8e1101186bd9d3bd1fa915b15a379dd90420d292b7f9eefcb6bc85b745c07166101106064fa0c27be830481c9b16973be156ee9f19ad77efa05aad22081beb1542df60a260db185af264f69bc2c618b4d6fcba50dcbd03e2dd1ddcdb9326dc28b5779d8063a0a1d1d0440d451429eefc59e5e6ad32c08ddd054406b343c78956969b176713874a1b948a6161a49873d798febd84b350667671955aa80ac0950775c0bd0d9f747f1f4150472b4d4369c22886ce2dad313d5f6266a1cceced55af1628279977a1d5f503051e3f98a3abd3e216ffe297f9620c5c2c737ba5ead502b5092b0033ed80ff149f4c4cbc2eafe6c704580726897f3e230f03db2dc6ff6de07f3bfe067d9f88db21915f870000000049454e44ae426082</data>
</image>
<image name="image1">
- <data format="PNG" length="113">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000003849444154388d633c76ec1803b50113d54da495a12cd804adacb4fe23f38f1dbbc6488c1c0c0c1def8f1a3a6ae8a8a123d350c6915df203007bf20ccfb0566fcb0000000049454e44ae426082</data>
+ <data format="PNG" length="305">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000000f849444154388db5943b12823010863f1f95158de839b0f5021ec00bd8702b8f2117e0326ab38d54385a844748086c66f49f49917d7c2cc966412501e4a38b85a536b081abc01350c9405e0dc882cd831701600daca6539340ae57a9a44d2533c069b9bf7f77f605706e96ad83922fb5a9b25bb9e5a3b7ab2559183880c6744b7bcbf201b945248eaafdf2c6b25d7f05b555fe03fafc07741b8790fdf092c7a1c7c8c2bcf8165a59b64b24d48eb739737d1a92e44e5ee6064cbc2815b06e3dcea4f19e6181e9db12d3155bcc195e80d330b49f5a2e34c51f2a1aed207904a01d5c314f017843b2768d810191ac31e3ad1af75319bf0f04f8024c83732f0a67978c0000000049454e44ae426082</data>
</image>
<image name="image2">
- <data format="PNG" length="255">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000000c649444154388db594d90a83400c458f0bd28542feff9ffa2f81822fadda87d176d4319d14bd20e38470b22a1c2fbd8ce7109e8fbdf050caf9555ad07bc2cf051d9db50679cdb30310176cd298690a98d2e4a37506340b5847bebdd5e7320f0840b778b7a0b99265f02ee9b68e660d4acb34683d4cb3e10b3569b30e7c073e80abfced72819ea86a0fd49014c0754f68153e6f79ec053d8743dad8e818943c41e3fb1e7b3a0b60fe13fe819e4037d62bc8b3a7004d6883adcc4cf516cedf4007942ad3ef38bd01af6e31af98932e9f0000000049454e44ae426082</data>
+ <data format="PNG" length="113">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000003849444154388d633c76ec1803b50113d54da495a12cd804adacb4fe23f38f1dbbc6488c1c0c0c1def8f1a3a6ae8a8a123d350c6915df203007bf20ccfb0566fcb0000000049454e44ae426082</data>
</image>
<image name="image3">
- <data format="PNG" length="160">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000006749444154388dadccd10d80300c03d1947118a1fbcb23b00e2c4013dbc9fd9ef4168098eecae6def73b8eba70893a3085aa308d2ab084b2b08c32b08556b08d66700b3dc16d1478d628fa07b6d01368a31968a11528a30c28a12c48a30a48a12a58a20e1811f101d3512a7c38fee1ac0000000049454e44ae426082</data>
+ <data format="PNG" length="255">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000000c649444154388db594d90a83400c458f0bd28542feff9ffa2f81822fadda87d176d4319d14bd20e38470b22a1c2fbd8ce7109e8fbdf050caf9555ad07bc2cf051d9db50679cdb30310176cd298690a98d2e4a37506340b5847bebdd5e7320f0840b778b7a0b99265f02ee9b68e660d4acb34683d4cb3e10b3569b30e7c073e80abfced72819ea86a0fd49014c0754f68153e6f79ec053d8743dad8e818943c41e3fb1e7b3a0b60fe13fe819e4037d62bc8b3a7004d6883adcc4cf516cedf4007942ad3ef38bd01af6e31af98932e9f0000000049454e44ae426082</data>
</image>
<image name="image4">
- <data format="PNG" length="892">89504e470d0a1a0a0000000d4948445200000018000000180806000000e0773df800000343494441544889ed95cf6f146518c73f5d5a8b96a5ab6de84230b6b02858b134023d28743de8414d6a8c7f01ff801aaf24c24d2f0ac6709693f1a0f5e4c5c42e8907f560a736c4d616322dd275b7753bdb617766f6fdf17898e9b26db798102f263ec924cfccfbe4f3fd3ecffb2403ffc743c408f00e3099493fbafefc338704986a53370e7c909c6dd6f46e2fea68c92780cfcf9d3e92397f26c7f8991ce363c748a552bcffe1249f5e2f5c023ce0cdde7d7bf3e74e1fe5a5178ef0daf967393cd0cbb52f7ee0e2d56f2f0197771398aafc319b4ffbdfd3914a01202288152a5e8deb5fff8888f0e2e810c3b92cc65a8cb1186dd0da50a9d6197dfb6307186d15e86c7df1aa1efb3ac03434d65aac8d018fa4e0c25b679b40dfafa38dc1688bd686a8a1d0da72b03f7daab8e64f259dbe0b2cb50a384b6595ef4f871863304630d6a055ecb01d501bc37a790d43378ff53dc5b5cfae706ae444fe9bafbee4bd8b571de072ab80e7380ec363d0084394d2281d0b6c07d6ea0d0e0c8d923994e3f8cbc364d25d1094e347cde3955c0077fb880a9ee761f61cc6f7570942454369362a1eb55a83fd0347c9648f317af669b2d9be045882!
fa34d40191982250f8690ea0b0e30e5cd7258a0ee0fb012b772b3c79f2154e8e3d4736fb440c0bca102d4269710b50442059082b961b3fcf7bc0d27601d7755d3a7bdee0aefb1df90b1f9131b720b809c5c4e12633015a2b8858ac3548b214337377009c765bb404201d5d74f6f493e98e60b5747f5d45106b6390c430b1a6b96db1806171b9d81ccf8e1101186bd9d3bd1fa915b15a379dd90420d292b7f9eefcb6bc85b745c07166101106064fa0c27be830481c9b16973be156ee9f19ad77efa05aad22081beb1542df60a260db185af264f69bc2c618b4d6fcba50dcbd03e2dd1ddcdb9326dc28b5779d8063a0a1d1d0440d451429eefc59e5e6ad32c08ddd054406b343c78956969b176713874a1b948a6161a49873d798febd84b350667671955aa80ac0950775c0bd0d9f747f1f4150472b4d4369c22886ce2dad313d5f6266a1cceced55af1628279977a1d5f503051e3f98a3abd3e216ffe297f9620c5c2c737ba5ead502b5092b0033ed80ff149f4c4cbc2eafe6c704580726897f3e230f03db2dc6ff6de07f3bfe067d9f88db21915f870000000049454e44ae426082</data>
+ <data format="PNG" length="160">89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000006749444154388dadccd10d80300c03d1947118a1fbcb23b00e2c4013dbc9fd9ef4168098eecae6def73b8eba70893a3085aa308d2ab084b2b08c32b08556b08d66700b3dc16d1478d628fa07b6d01368a31968a11528a30c28a12c48a30a48a12a58a20e1811f101d3512a7c38fee1ac0000000049454e44ae426082</data>
</image>
</images>
<connections>
@@ -837,16 +853,16 @@
<slot>pbInputDirectoryClicked()</slot>
</connection>
<connection>
- <sender>cbBodyWire</sender>
- <signal>toggled(bool)</signal>
+ <sender>pbRefreshFilters</sender>
+ <signal>clicked()</signal>
<receiver>QtGeneratedSimulationPlayer</receiver>
- <slot>cbBodyWireToggled(bool)</slot>
+ <slot>pbRefreshFiltersClicked()</slot>
</connection>
<connection>
- <sender>pbRefreshFilters</sender>
+ <sender>pbApply</sender>
<signal>clicked()</signal>
<receiver>QtGeneratedSimulationPlayer</receiver>
- <slot>pbRefreshFiltersClicked()</slot>
+ <slot>pbApplyClicked()</slot>
</connection>
</connections>
<signals>
@@ -865,6 +881,7 @@
<slot>cbAllowFiltrationToggled(bool)</slot>
<slot>cbBodyWireToggled(bool)</slot>
<slot>pbRefreshFiltersClicked()</slot>
+ <slot>pbApplyClicked()</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
</UI>
Modified: trunk/gui/qt3/QtSimulationPlayer.cpp
===================================================================
--- trunk/gui/qt3/QtSimulationPlayer.cpp 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/gui/qt3/QtSimulationPlayer.cpp 2009-02-09 20:50:44 UTC (rev 1662)
@@ -33,6 +33,22 @@
glSimulationPlayerViewer->simPlayer=this;
leInputConfigFile->setText(Omega::instance().getSimulationFileName());
enableControls(false);
+
+ scrollViewFrame = new QFrame();
+ scrollViewLayout = new QVBoxLayout( scrollViewOutsideFrame, 0, 0, "scrollViewLayout");
+ scrollView = new QScrollView( scrollViewOutsideFrame, "scrollView" );
+ scrollView->setVScrollBarMode(QScrollView::Auto);
+ scrollView->setHScrollBarMode(QScrollView::Auto);
+ scrollViewLayout->addWidget(scrollView);
+ scrollView->show();
+ guiGen.setResizeHeight(true);
+ guiGen.setResizeWidth(true);
+ guiGen.setShift(10,30);
+ guiGen.setShowButtons(false);
+ QSize s = scrollView->size();
+ scrollViewFrame->resize(s.width(),s.height());
+ guiGen.buildGUI(YadeQtMainWindow::self->renderer,scrollViewFrame);
+ scrollView->addChild(scrollViewFrame);
}
QtSimulationPlayer::~QtSimulationPlayer(){
if(glSimulationPlayerViewer) delete glSimulationPlayerViewer;
@@ -44,9 +60,13 @@
void QtSimulationPlayer::cbSaveSnapShotsToggled(bool b){ glSimulationPlayerViewer->saveSnapShots=b;}
void QtSimulationPlayer::cbAllowFiltrationToggled(bool b){ FilterEngine::isFiltrationActivated=b; }
void QtSimulationPlayer::pbRefreshFiltersClicked(){ glSimulationPlayerViewer->refreshFilters(); }
-void QtSimulationPlayer::cbBodyWireToggled(bool b){ glSimulationPlayerViewer->bodyWire(b); }
void QtSimulationPlayer::closeEvent(QCloseEvent *e){ QtGeneratedSimulationPlayer::closeEvent(e); emit closeSignal(); }
+void QtSimulationPlayer::pbApplyClicked()
+{
+ guiGen.deserialize(YadeQtMainWindow::self->renderer);
+ YadeQtMainWindow::self->redrawAll(true);
+}
void QtSimulationPlayer::pbInputConfigFileClicked(){
string selectedFilter;
Modified: trunk/gui/qt3/QtSimulationPlayer.hpp
===================================================================
--- trunk/gui/qt3/QtSimulationPlayer.hpp 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/gui/qt3/QtSimulationPlayer.hpp 2009-02-09 20:50:44 UTC (rev 1662)
@@ -10,7 +10,11 @@
#include<yade/core/Omega.hpp>
#include<yade/lib-factory/Factorable.hpp>
+#include<yade/lib-serialization-qt/QtGUIGenerator.hpp>
#include <QtGeneratedSimulationPlayer.h>
+#include<qlayout.h>
+#include<qframe.h>
+#include<qscrollview.h>
class GLSimulationPlayerViewer;
@@ -27,6 +31,11 @@
private:
void setParameters();
+ QScrollView * scrollView;
+ QFrame * scrollViewFrame;
+ QVBoxLayout* scrollViewLayout;
+ QtGUIGenerator guiGen;
+
public slots:
virtual void pbInputDirectoryClicked();
virtual void pbLoadClicked();
@@ -39,12 +48,12 @@
virtual void pbPauseClicked();
virtual void pbStepClicked();
virtual void pbResetClicked();
+
+ virtual void pbApplyClicked();
virtual void cbAllowFiltrationToggled(bool b);
virtual void pbRefreshFiltersClicked();
- virtual void cbBodyWireToggled(bool b);
-
protected:
void closeEvent(QCloseEvent *);
virtual void keyPressEvent(QKeyEvent *);
Added: trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.cpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.cpp 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.cpp 2009-02-09 20:50:44 UTC (rev 1662)
@@ -0,0 +1,74 @@
+/*************************************************************************
+* Copyright (C) 2009 by Sergei Dorofeenko *
+* sega@xxxxxxxxxxxxxxxx *
+* *
+* 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. *
+*************************************************************************/
+
+#include"Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp"
+#include<yade/pkg-dem/SpheresContactGeometry.hpp>
+#include<yade/pkg-dem/ViscoelasticInteraction.hpp>
+#include<yade/pkg-common/RigidBodyParameters.hpp>
+YADE_PLUGIN("Spheres_Viscoelastic_SimpleViscoelasticContactLaw");
+
+void Spheres_Viscoelastic_SimpleViscoelasticContactLaw::go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody){
+
+ SpheresContactGeometry* geom=static_cast<SpheresContactGeometry*>(_geom.get());
+ ViscoelasticInteraction* phys=static_cast<ViscoelasticInteraction*>(_phys.get());
+
+ int id1 = I->getId1();
+ int id2 = I->getId2();
+
+ shared_ptr<BodyContainer>& bodies = rootBody->bodies;
+
+ RigidBodyParameters* de1 = YADE_CAST<RigidBodyParameters*>((*bodies)[id1]->physicalParameters.get());
+ RigidBodyParameters* de2 = YADE_CAST<RigidBodyParameters*>((*bodies)[id2]->physicalParameters.get());
+
+ bool isDynamic1 = (*bodies)[id1]->isDynamic;
+ bool isDynamic2 = (*bodies)[id2]->isDynamic;
+
+ Vector3r& shearForce = phys->shearForce;
+ if (I->isNew) shearForce=Vector3r(0,0,0);
+
+ Real dt = Omega::instance().getTimeStep();
+
+ Vector3r axis = phys->prevNormal.Cross(geom->normal);
+ shearForce -= shearForce.Cross(axis);
+ Vector3r summaryAngularVelocity(0,0,0);
+ if (isDynamic1) summaryAngularVelocity += de1->angularVelocity;
+ if (isDynamic2) summaryAngularVelocity += de2->angularVelocity;
+ Real angle = dt*0.5*geom->normal.Dot(summaryAngularVelocity);
+ axis = angle*geom->normal;
+ shearForce -= shearForce.Cross(axis);
+
+ Vector3r x = geom->contactPoint;
+ Vector3r c1x = (x - de1->se3.position);
+ Vector3r c2x = (x - de2->se3.position);
+ /// The following definition of c1x and c2x is to avoid "granular ratcheting"
+ /// (see F. ALONSO-MARROQUIN, R. GARCIA-ROJO, H.J. HERRMANN,
+ /// "Micro-mechanical investigation of granular ratcheting, in Cyclic Behaviour of Soils and Liquefaction Phenomena",
+ /// ed. T. Triantafyllidis (Balklema, London, 2004), p. 3-10 - and a lot more papers from the same authors)
+ Vector3r _c1x_ = (isDynamic1) ? geom->radius1*geom->normal : x - de1->zeroPoint;
+ Vector3r _c2x_ = (isDynamic2) ? -geom->radius2*geom->normal : x - de2->zeroPoint;
+ Vector3r relativeVelocity = (de2->velocity+de2->angularVelocity.Cross(_c2x_)) - (de1->velocity+de1->angularVelocity.Cross(_c1x_));
+ Real normalVelocity = geom->normal.Dot(relativeVelocity);
+ Vector3r shearVelocity = relativeVelocity-normalVelocity*geom->normal;
+ shearForce -= (phys->ks*dt+phys->cs)*shearVelocity;
+
+ phys->normalForce = ( phys->kn * std::max(geom->penetrationDepth,(Real) 0) - phys->cn * normalVelocity ) * geom->normal;
+ phys->prevNormal = geom->normal;
+
+ Real maxFs = phys->normalForce.SquaredLength() * std::pow(phys->tangensOfFrictionAngle,2);
+ if( shearForce.SquaredLength() > maxFs )
+ {
+ maxFs = Mathr::Sqrt(maxFs) / shearForce.Length();
+ shearForce *= maxFs;
+ }
+
+ Vector3r f = phys->normalForce + shearForce;
+ bodyForce (id1,rootBody) -= f;
+ bodyForce (id2,rootBody) += f;
+ bodyTorque(id1,rootBody) -= c1x.Cross(f);
+ bodyTorque(id2,rootBody) += c2x.Cross(f);
+}
Added: trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp
===================================================================
--- trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/pkg/dem/Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.hpp 2009-02-09 20:50:44 UTC (rev 1662)
@@ -0,0 +1,24 @@
+/*************************************************************************
+* Copyright (C) 2009 by Sergei Dorofeenko *
+* sega@xxxxxxxxxxxxxxxx *
+* *
+* 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. *
+*************************************************************************/
+
+#pragma once
+
+#include<yade/pkg-common/ConstitutiveLaw.hpp>
+
+/// This class provides linear viscoelastic contact model
+class Spheres_Viscoelastic_SimpleViscoelasticContactLaw : public ConstitutiveLaw
+{
+ public :
+ virtual void go(shared_ptr<InteractionGeometry>&, shared_ptr<InteractionPhysics>&, Interaction*, MetaBody*);
+ NEEDS_BEX("Force","Momentum");
+ FUNCTOR2D(SpheresContactGeometry,ViscoelasticInteraction);
+ REGISTER_CLASS_AND_BASE(Spheres_Viscoelastic_SimpleViscoelasticContactLaw,ConstitutiveLaw);
+};
+REGISTER_SERIALIZABLE(Spheres_Viscoelastic_SimpleViscoelasticContactLaw);
+
+
Modified: trunk/pkg/dem/SConscript
===================================================================
--- trunk/pkg/dem/SConscript 2009-02-09 17:03:36 UTC (rev 1661)
+++ trunk/pkg/dem/SConscript 2009-02-09 20:50:44 UTC (rev 1662)
@@ -1196,6 +1196,10 @@
env.SharedLibrary('ef2_Spheres_NormalShear_ElasticFrictionalLaw',
['Engine/EngineUnit/ef2_Spheres_NormalShear_ElasticFrictionalLaw.cpp'],
LIBS=env['LIBS']+['ConstitutiveLawDispatcher','NormalShearInteractions','SpheresContactGeometry']),
+
+ env.SharedLibrary('Spheres_Viscoelastic_SimpleViscoelasticContactLaw',
+ ['Engine/EngineUnit/Spheres_Viscoelastic_SimpleViscoelasticContactLaw.cpp'],
+ LIBS=env['LIBS']+['ConstitutiveLawDispatcher','ViscoelasticInteraction','SpheresContactGeometry','RigidBodyParameters']),
#env.SharedLibrary('MicroMacroAnalyser',
#['Engine/StandAloneEngine/MicroMacroAnalyser.cpp'],