Skip to content
Snippets Groups Projects
Commit 9534ed0c authored by Rostislav Chudoba's avatar Rostislav Chudoba
Browse files

removed the traitsui

parent db43a321
No related branches found
No related tags found
No related merge requests found
...@@ -4,33 +4,6 @@ from numpy import allclose, arange, eye, linalg, ones, ix_, array, zeros, \ ...@@ -4,33 +4,6 @@ from numpy import allclose, arange, eye, linalg, ones, ix_, array, zeros, \
ones ones
from traits.api import HasTraits, Array, Property, cached_property, Instance, \ from traits.api import HasTraits, Array, Property, cached_property, Instance, \
Delegate, Any Delegate, Any
from traitsui.api \
import View, Item, TabularEditor
from traitsui.tabular_adapter \
import TabularAdapter
#from sys_mtx_assembly import SysMtxAssembly
class ArrayAdapter(TabularAdapter):
columns = Property
def _get_columns(self):
n_columns = getattr(self.object, self.name).shape[1]
cols = [(str(i), i) for i in range(n_columns)]
return [('i', 'index')] + cols
font = 'Courier 10'
alignment = 'right'
format = '%6.2f'
index_text = Property
def _get_index_text(self):
return str(self.row)
tabular_editor = TabularEditor(
adapter=ArrayAdapter())
class DenseMtx(HasTraits): class DenseMtx(HasTraits):
...@@ -65,8 +38,3 @@ class DenseMtx(HasTraits): ...@@ -65,8 +38,3 @@ class DenseMtx(HasTraits):
'''String representation - delegate to matrix''' '''String representation - delegate to matrix'''
return str(self.mtx) return str(self.mtx)
view = View(Item('mtx', editor=tabular_editor, show_label=False),
resizable=True,
scrollable=True,
buttons=['OK', 'Cancel'],
width=1.0, height=0.5)
This diff is collapsed.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
<a id="top"></a> <a id="top"></a>
# **5.2 Pullout behavior governed by damage** # **5.2 Pullout behavior governed by damage**
!!! This notebook is still under editing and and video production !!! This notebook is still under editing and video production
* Define a bond-slip law governed by damage and loading history using unloading. * Define a bond-slip law governed by damage and loading history using unloading.
* What is different in comparison to elastic-plastic models? * What is different in comparison to elastic-plastic models?
* For what materials is unloading to zero realistic? * For what materials is unloading to zero realistic?
* Example of a CFRP behavior * Example of a CFRP behavior
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
%matplotlib widget %matplotlib widget
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
from bmcs_cross_section.pullout import PullOutModel1D from bmcs_cross_section.pullout import PullOutModel1D
po_cfrp = PullOutModel1D(n_e_x=100, w_max=3) # mm po_cfrp = PullOutModel1D(n_e_x=100, w_max=3) # mm
po_cfrp.geometry.L_x=300 # [mm] po_cfrp.geometry.L_x=300 # [mm]
po_cfrp.time_line.step = 0.02 po_cfrp.time_line.step = 0.02
po_cfrp.cross_section.trait_set(A_m=1543, A_f=16.7, P_b=10); po_cfrp.cross_section.trait_set(A_m=1543, A_f=16.7, P_b=10);
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Construct the bond slip model ## Construct the bond slip model
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.material_model='damage' po_cfrp.material_model='damage'
po_cfrp.material_model_.s_max=0.05 po_cfrp.material_model_.s_max=0.05
po_cfrp.material_model_.omega_fn='weibull-CDF' po_cfrp.material_model_.omega_fn='weibull-CDF'
po_cfrp.material_model_.omega_fn_.trait_set(lambda_=0.02) po_cfrp.material_model_.omega_fn_.trait_set(lambda_=0.02)
po_cfrp.material_model_.interact() po_cfrp.material_model_.interact()
``` ```
%% Output %% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.material_model='damage' po_cfrp.material_model='damage'
po_cfrp.material_model_.trait_set(E_b=10000, s_max=.1) po_cfrp.material_model_.trait_set(E_b=10000, s_max=.1)
po_cfrp.material_model_.omega_fn='fracture-energy' po_cfrp.material_model_.omega_fn='fracture-energy'
po_cfrp.material_model_.omega_fn_.trait_set(kappa_0=0.01, G_f=10); po_cfrp.material_model_.omega_fn_.trait_set(kappa_0=0.01, G_f=10);
po_cfrp.material_model_.omega_fn_ po_cfrp.material_model_.omega_fn_
``` ```
%% Output %% Output
$\displaystyle 1 - \begin{cases} 1 & \text{for}\: \kappa < \kappa_{0} \\e^{\frac{\left(\kappa - \kappa_{0}\right) \left(\sqrt{E_{b}} \sqrt{- E_{b} \kappa_{0}^{2} + 4 G_{f}} + E_{b} \kappa_{0}\right)}{E_{b} \kappa_{0}^{2} - 2 G_{f}}} & \text{otherwise} \end{cases}$ $\displaystyle 1 - \begin{cases} 1 & \text{for}\: \kappa < \kappa_{0} \\e^{\frac{\left(\kappa - \kappa_{0}\right) \left(\sqrt{E_{b}} \sqrt{- E_{b} \kappa_{0}^{2} + 4 G_{f}} + E_{b} \kappa_{0}\right)}{E_{b} \kappa_{0}^{2} - 2 G_{f}}} & \text{otherwise} \end{cases}$
<ibvpy.tmodel.mats_damage_fn.GfDamageFn at 0x7f438e188e50> <ibvpy.tmodel.mats_damage_fn.GfDamageFn at 0x7fcd36df0950>
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.material_model_.omega_fn_.interact() po_cfrp.material_model_.omega_fn_.interact()
``` ```
%% Output %% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.material_model_.D_alg = 1 po_cfrp.material_model_.D_alg = 1
po_cfrp.material_model_.interact() po_cfrp.material_model_.interact()
``` ```
%% Output %% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.loading_scenario.profile = 'cyclic-sym-incr' po_cfrp.loading_scenario.profile = 'cyclic-sym-incr'
po_cfrp.loading_scenario.profile_.trait_set(number_of_cycles=3, po_cfrp.loading_scenario.profile_.trait_set(number_of_cycles=3,
unloading_ratio=0.5, unloading_ratio=0.5,
number_of_increments=200); number_of_increments=200);
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
#po_cfrp.loading_scenario.profile = 'monotonic' #po_cfrp.loading_scenario.profile = 'monotonic'
po_cfrp.sim.tloop.k_max=1000 po_cfrp.sim.tloop.k_max=1000
po_cfrp.time_line.step=0.01 po_cfrp.time_line.step=0.01
po_cfrp.trait_set(w_max=0.6); po_cfrp.trait_set(w_max=0.6);
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.reset() po_cfrp.reset()
po_cfrp.sim.run() po_cfrp.sim.run()
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.interact() po_cfrp.interact()
``` ```
%% Output %% Output
Warning: Update progress bar from model - not implemented yet Warning: Update progress bar from model - not implemented yet
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
po_cfrp.material_model_.omega_fn='abaqus' po_cfrp.material_model_.omega_fn='abaqus'
#po_cfrp.material_model_.omega_fn_.trait_set(s_0=0.01, G_f=10); #po_cfrp.material_model_.omega_fn_.trait_set(s_0=0.01, G_f=10);
po_cfrp.material_model_.omega_fn_ po_cfrp.material_model_.omega_fn_
``` ```
%% Output %% Output
$\displaystyle \begin{cases} 0 & \text{for}\: \kappa \leq \kappa_{0} \\1 - \begin{cases} 1 & \text{for}\: \kappa < \kappa_{0} \\\frac{\kappa_{0} \cdot \left(1 - \frac{1 - e^{- \frac{\alpha \left(\kappa - \kappa_{0}\right)}{- \kappa_{0} + \kappa_{u}}}}{1 - e^{- \alpha}}\right)}{\kappa} & \text{for}\: \kappa < \kappa_{u} \\0 & \text{otherwise} \end{cases} & \text{otherwise} \end{cases}$ $\displaystyle \begin{cases} 0 & \text{for}\: \kappa \leq \kappa_{0} \\1 - \begin{cases} 1 & \text{for}\: \kappa < \kappa_{0} \\\frac{\kappa_{0} \cdot \left(1 - \frac{1 - e^{- \frac{\alpha \left(\kappa - \kappa_{0}\right)}{- \kappa_{0} + \kappa_{u}}}}{1 - e^{- \alpha}}\right)}{\kappa} & \text{for}\: \kappa < \kappa_{u} \\0 & \text{otherwise} \end{cases} & \text{otherwise} \end{cases}$
<ibvpy.tmodel.mats_damage_fn.AbaqusDamageFn at 0x7f438e3039a0> <ibvpy.tmodel.mats_damage_fn.AbaqusDamageFn at 0x7f438e3039a0>
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
<div style="background-color:lightgray;text-align:left;width:45%;display:inline-table;"> <img src="../icons/previous.png" alt="Previous trip" width="50" height="50"> <div style="background-color:lightgray;text-align:left;width:45%;display:inline-table;"> <img src="../icons/previous.png" alt="Previous trip" width="50" height="50">
&nbsp; <a href="5_1_Introspect_Damage_Evolution_Damage_initiation.ipynb#top">5.1 Interface behavior governed by damage</a> &nbsp; <a href="5_1_Introspect_Damage_Evolution_Damage_initiation.ipynb#top">5.1 Interface behavior governed by damage</a>
</div><div style="background-color:lightgray;text-align:center;width:10%;display:inline-table;"> <a href="#top"><img src="../icons/compass.png" alt="Compass" width="50" height="50"></a></div><div style="background-color:lightgray;text-align:right;width:45%;display:inline-table;"> </div><div style="background-color:lightgray;text-align:center;width:10%;display:inline-table;"> <a href="#top"><img src="../icons/compass.png" alt="Compass" width="50" height="50"></a></div><div style="background-color:lightgray;text-align:right;width:45%;display:inline-table;">
<a href="../tour6_energy/6_1_energy_dissipation.ipynb#top">6.1 Energy games</a>&nbsp; <img src="../icons/next.png" alt="Previous trip" width="50" height="50"> </div> <a href="../tour6_energy/6_1_energy_dissipation.ipynb#top">6.1 Energy games</a>&nbsp; <img src="../icons/next.png" alt="Previous trip" width="50" height="50"> </div>
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
"cells": [ "cells": [
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [ "source": [
"# 8.3 Damage function within a fininite element solver\n", "# 8.3 Damage function within a fininite element solver\n",
"@todo - this notebook must be updated - currently not running" "@todo - this notebook must be updated - currently not running"
...@@ -13,7 +17,10 @@ ...@@ -13,7 +17,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -29,7 +36,10 @@ ...@@ -29,7 +36,10 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%% md\n"
}
}, },
"source": [ "source": [
"## Define the damage functions\n", "## Define the damage functions\n",
...@@ -44,7 +54,10 @@ ...@@ -44,7 +54,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -60,7 +73,10 @@ ...@@ -60,7 +73,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -74,7 +90,10 @@ ...@@ -74,7 +90,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -86,7 +105,10 @@ ...@@ -86,7 +105,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -102,7 +124,10 @@ ...@@ -102,7 +124,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -115,7 +140,10 @@ ...@@ -115,7 +140,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [] "source": []
...@@ -124,7 +152,10 @@ ...@@ -124,7 +152,10 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%% md\n"
}
}, },
"source": [ "source": [
"## Nonlinear solver" "## Nonlinear solver"
...@@ -135,7 +166,10 @@ ...@@ -135,7 +166,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -196,7 +230,10 @@ ...@@ -196,7 +230,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -208,7 +245,10 @@ ...@@ -208,7 +245,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [] "source": []
...@@ -218,7 +258,10 @@ ...@@ -218,7 +258,10 @@
"execution_count": null, "execution_count": null,
"metadata": { "metadata": {
"deletable": true, "deletable": true,
"editable": true "editable": true,
"pycharm": {
"name": "#%%\n"
}
}, },
"outputs": [], "outputs": [],
"source": [] "source": []
...@@ -245,4 +288,4 @@ ...@@ -245,4 +288,4 @@
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 2
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment