Commit 2184476c authored by Rémy Mozul's avatar Rémy Mozul

Merge branch 'update_notebooks' into 'master'

[TUTORIALS] update notebooks

See merge request !4
parents ca01a3e3 b4b45315
......@@ -3,6 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -13,7 +15,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"F. Dubois - 2016"
]
......@@ -21,6 +26,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -32,6 +39,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -45,6 +54,8 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -68,6 +79,8 @@
"cell_type": "markdown",
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -81,6 +94,8 @@
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -101,6 +116,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -114,6 +131,8 @@
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -121,17 +140,19 @@
"outputs": [],
"source": [
"# on cree un modele de rigide\n",
"mod = model(name='rigid', type='MECAx', element='Rxx2D', dimension=dim)\n",
"mod = model(name='rigid', physics='MECAx', element='Rxx2D', dimension=dim)\n",
"\n",
"# creations de deux materiaux\n",
"tdur = material(name='TDURx',type='RIGID',density=1000.)\n",
"plex = material(name='PLEXx',type='RIGID',density=100.)\n",
"tdur = material(name='TDURx',materialType='RIGID',density=1000.)\n",
"plex = material(name='PLEXx',materialType='RIGID',density=100.)\n",
"mat.addMaterial(tdur,plex)"
]
},
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -145,6 +166,8 @@
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -165,6 +188,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -178,6 +203,8 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -206,6 +233,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -218,7 +247,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -251,7 +282,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Applying loads"
]
......@@ -260,18 +294,20 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"# predefined : [ ct + amp * cos(omega*t+phi) ] * sgn(rampi + ramp*t) * min(abs(rampi + ramp*t), 1)\n",
"\n",
"up.imposeDrivenDof(component=2, dofty='force',type='predefined',\n",
"up.imposeDrivenDof(component=2, dofty='force',description='predefined',\n",
" ct=10.0, amp=0.0, omega=0.0, phi=0.0, rampi=1.0, ramp=0.0)\n",
"\n",
"# evolution : giving a file containing t,f(t)\n",
"\n",
"right.imposeDrivenDof(component=1,dofty='vlocy',type='evolution',evolutionFile='vx.dat')\n",
"right.imposeDrivenDof(component=1,dofty='vlocy',description='evolution',evolutionFile='vx.dat')\n",
"\n",
"# more details:\n",
"# help(up.imposeDrivenDof)"
......@@ -279,7 +315,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Building an evolution file:"
]
......@@ -288,7 +327,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -313,6 +354,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -326,6 +369,8 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -335,10 +380,10 @@
"# gestion des interactions :\n",
"# * declaration des lois\n",
"# - entre particules\n",
"ldkdk=tact_behav(name='iqsc0',type='IQS_CLB',fric=0.3)\n",
"ldkdk=tact_behav(name='iqsc0',law='IQS_CLB',fric=0.3)\n",
"tacts+=ldkdk\n",
"# - avec les parois\n",
"ldkjc=tact_behav(name='iqsc1',type='IQS_CLB',fric=0.5)\n",
"ldkjc=tact_behav(name='iqsc1',law='IQS_CLB',fric=0.5)\n",
"tacts+=ldkjc\n",
"\n",
"# see possible tact_behav\n",
......@@ -349,7 +394,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Defining see tables"
]
......@@ -358,7 +406,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -378,6 +428,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -391,6 +443,8 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -411,6 +465,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -424,6 +480,8 @@
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -438,7 +496,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"postprocessing"
]
......@@ -447,12 +508,14 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"post = postpro_commands()\n",
"my_command=postpro_command(type='SOLVER INFORMATIONS', step=1)\n",
"my_command=postpro_command(name='SOLVER INFORMATIONS', step=1)\n",
"post.addCommand(my_command)\n",
"#\n",
"writePostpro(commands=post, parts=bodies, path='DATBOX/')\n",
......@@ -462,6 +525,15 @@
"# parameters of 'BODY TRACKING'\n",
"print config.lmgc90dicts.commandOptions['BODY TRACKING']"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
......@@ -481,7 +553,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"version": "2.7.13"
}
},
"nbformat": 4,
......
......@@ -3,6 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -14,6 +16,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -25,6 +29,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -39,6 +45,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -51,7 +59,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -63,7 +73,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Creating a brick generator"
]
......@@ -72,7 +85,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -88,7 +103,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Creating a line of brick"
]
......@@ -97,14 +115,16 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"nb_bricks = 12\n",
"bodies = avatars()\n",
"mat = material(name='PLEXx',type='RIGID',density=2000.)\n",
"mod = model(name='rigid', type='MECAx', element='Rxx2D', dimension=dim)\n",
"mat = material(name='PLEXx',materialType='RIGID',density=2000.)\n",
"mod = model(name='rigid', physics='MECAx', element='Rxx2D', dimension=dim)\n",
"\n",
"for i in xrange(nb_bricks):\n",
" bodies += brick.rigidBrick(center=[i*lx, ly/2.], model=mod, material=mat, color='BLUEx')\n",
......@@ -115,7 +135,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Creating a wall with a window (pouah)"
]
......@@ -124,7 +147,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -136,8 +161,8 @@
"dim = 2\n",
"\n",
"bodies = avatars()\n",
"mat = material(name='PLEXx',type='RIGID',density=2000.)\n",
"mod = model(name='rigid', type='MECAx', element='Rxx2D', dimension=dim)\n",
"mat = material(name='PLEXx',materialType='RIGID',density=2000.)\n",
"mod = model(name='rigid', physics='MECAx', element='Rxx2D', dimension=dim)\n",
"\n",
"# bricks, half-brick, linteau and opening definition\n",
"brick = brick2D('brick', 1.e-1, 5.e-2)\n",
......@@ -201,7 +226,7 @@
"svs = see_tables()\n",
"tacts = tact_behavs()\n",
"\n",
"mut = material(name='TDURx',type='RIGID',density=2500.)\n",
"mut = material(name='TDURx',materialType='RIGID',density=2500.)\n",
"mats.addMaterial(mat,mut)\n",
"\n",
"floor = rigidJonc(axe1=3.e-1, axe2=2.5e-2, center=[2.5e-1, -2.5e-2], \n",
......@@ -216,9 +241,9 @@
" pass\n",
"\n",
"# interactions management :\n",
"lplpl=tact_behav(name='iqsc0',type='IQS_CLB',fric=0.3)\n",
"lplpl=tact_behav(name='iqsc0',law='IQS_CLB',fric=0.3)\n",
"tacts+=lplpl\n",
"lpljc=tact_behav(name='iqsc1',type='IQS_CLB',fric=0.5)\n",
"lpljc=tact_behav(name='iqsc1',law='IQS_CLB',fric=0.5)\n",
"tacts+=lpljc\n",
"svbbbb = see_table(CorpsCandidat='RBDY2',candidat='POLYG', colorCandidat='BLEUx',behav=lplpl,\n",
" CorpsAntagoniste='RBDY2', antagoniste='POLYG',colorAntagoniste='BLEUx',alert=5.e-3)\n",
......@@ -251,6 +276,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -261,7 +288,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Creating a 3D brick generator"
]
......@@ -270,7 +300,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -278,15 +310,18 @@
"lx=0.22\n",
"ly=0.11\n",
"lz=0.06\n",
"mat = material(name='PLEXx',type='RIGID',density=2000.)\n",
"mod = model(name='rigid', type='MECAx', element='Rxx3D', dimension=dim)\n",
"mat = material(name='PLEXx',materialType='RIGID',density=2000.)\n",
"mod = model(name='rigid', physics='MECAx', element='Rxx3D', dimension=dim)\n",
"\n",
"simple_brick = brick3D(name='brique simple', lx=lx, ly=ly, lz=lz)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Creating a wall with a builtin function"
]
......@@ -295,7 +330,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -308,7 +345,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -328,7 +367,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -340,7 +381,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Da Silva le maçon"
]
......@@ -349,7 +393,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
......@@ -367,8 +413,8 @@
"bodies4=copy.deepcopy(bodies3)\n",
"bodies4.translate(dy=9.5*lx)\n",
"\n",
"bodies3.rotate(type='axis', center=numpy.array([5*lx,5*lx,0.]), axis=[0.,0.,1.], alpha=math.pi/2.)\n",
"bodies4.rotate(type='axis', center=numpy.array([5*lx,5*lx,0.]), axis=[0.,0.,1.], alpha=math.pi/2.)\n",
"bodies3.rotate(description='axis', center=numpy.array([5*lx,5*lx,0.]), axis=[0.,0.,1.], alpha=math.pi/2.)\n",
"bodies4.rotate(description='axis', center=numpy.array([5*lx,5*lx,0.]), axis=[0.,0.,1.], alpha=math.pi/2.)\n",
"\n",
"bodies1 += bodies3\n",
"bodies1 += bodies4\n",
......@@ -397,7 +443,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"version": "2.7.13"
}
},
"nbformat": 4,
......
......@@ -3,6 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -14,6 +16,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -25,6 +29,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "fragment"
}
......@@ -39,6 +45,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -50,6 +58,8 @@
{
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "slide"
}
......@@ -63,6 +73,8 @@
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true,
"slideshow": {
"slide_type": "subslide"