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, \
ones
from traits.api import HasTraits, Array, Property, cached_property, Instance, \
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):
......@@ -65,8 +38,3 @@ class DenseMtx(HasTraits):
'''String representation - delegate to matrix'''
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:
<a id="top"></a>
# **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.
* What is different in comparison to elastic-plastic models?
* For what materials is unloading to zero realistic?
* Example of a CFRP behavior
%% Cell type:code id: tags:
``` python
%matplotlib widget
import matplotlib.pyplot as plt
import numpy as np
from bmcs_cross_section.pullout import PullOutModel1D
po_cfrp = PullOutModel1D(n_e_x=100, w_max=3) # mm
po_cfrp.geometry.L_x=300 # [mm]
po_cfrp.time_line.step = 0.02
po_cfrp.cross_section.trait_set(A_m=1543, A_f=16.7, P_b=10);
```
%% Cell type:markdown id: tags:
## Construct the bond slip model
%% Cell type:code id: tags:
``` python
po_cfrp.material_model='damage'
po_cfrp.material_model_.s_max=0.05
po_cfrp.material_model_.omega_fn='weibull-CDF'
po_cfrp.material_model_.omega_fn_.trait_set(lambda_=0.02)
po_cfrp.material_model_.interact()
```
%% Output
%% Cell type:code id: tags:
``` python
po_cfrp.material_model='damage'
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_.trait_set(kappa_0=0.01, G_f=10);
po_cfrp.material_model_.omega_fn_
```
%% 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}$
<ibvpy.tmodel.mats_damage_fn.GfDamageFn at 0x7f438e188e50>
<ibvpy.tmodel.mats_damage_fn.GfDamageFn at 0x7fcd36df0950>
%% Cell type:code id: tags:
``` python
po_cfrp.material_model_.omega_fn_.interact()
```
%% Output
%% Cell type:code id: tags:
``` python
po_cfrp.material_model_.D_alg = 1
po_cfrp.material_model_.interact()
```
%% Output
%% Cell type:code id: tags:
``` python
po_cfrp.loading_scenario.profile = 'cyclic-sym-incr'
po_cfrp.loading_scenario.profile_.trait_set(number_of_cycles=3,
unloading_ratio=0.5,
number_of_increments=200);
```
%% Cell type:code id: tags:
``` python
#po_cfrp.loading_scenario.profile = 'monotonic'
po_cfrp.sim.tloop.k_max=1000
po_cfrp.time_line.step=0.01
po_cfrp.trait_set(w_max=0.6);
```
%% Cell type:code id: tags:
``` python
po_cfrp.reset()
po_cfrp.sim.run()
```
%% Cell type:code id: tags:
``` python
po_cfrp.interact()
```
%% Output
Warning: Update progress bar from model - not implemented yet
%% Cell type:code id: tags:
``` python
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_
```
%% 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}$
<ibvpy.tmodel.mats_damage_fn.AbaqusDamageFn at 0x7f438e3039a0>
%% 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">
&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;">
<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:
``` python
```
......
......@@ -2,7 +2,11 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# 8.3 Damage function within a fininite element solver\n",
"@todo - this notebook must be updated - currently not running"
......@@ -13,7 +17,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -29,7 +36,10 @@
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Define the damage functions\n",
......@@ -44,7 +54,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -60,7 +73,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -74,7 +90,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -86,7 +105,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -102,7 +124,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -115,7 +140,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
......@@ -124,7 +152,10 @@
"cell_type": "markdown",
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## Nonlinear solver"
......@@ -135,7 +166,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -196,7 +230,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
......@@ -208,7 +245,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
......@@ -218,7 +258,10 @@
"execution_count": null,
"metadata": {
"deletable": true,
"editable": true
"editable": true,
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
......@@ -245,4 +288,4 @@
},
"nbformat": 4,
"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