Commit bef0e4ff authored by florez's avatar florez
Browse files

some other thing

parent 937f99dd
paraview/
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import akantu as aka"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c1339e28-e6b1-4155-b25e-f3b848025838",
"metadata": {},
"outputs": [],
"source": [
"material_file = \"\"\"\n",
"material elastic [\n",
" name = steel\n",
" rho = 1 # density\n",
" E = 1 # young's modulus\n",
" nu = 0.3 # poisson's ratio\n",
"]\"\"\"\n",
"# writing the material file\n",
"open('material.dat', 'w').write(material_file)\n",
"#reading the material file\n",
"material_file = 'material.dat'\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "30c1bb68-80b2-41ea-9aa6-a08daf741c9b",
"metadata": {},
"outputs": [],
"source": [
"mesh = aka.Mesh(3)\n",
"mesh.read('cyl_02.msh')\n",
"\n",
"model = aka.SolidMechanicsModel(mesh)\n",
"model.initFull(_analysis_method=aka._static)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "23cdc1b2-692e-4457-a454-89d49722e94a",
"metadata": {},
"outputs": [],
"source": [
"mesh.createBoundaryGroupFromGeometry()\n",
"aka.parseInput(material_file)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "a1d797dd-c63c-4b8b-9aaa-5d00947a414a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" [0.00000000e+00, 0.00000000e+00, 1.00506689e-05],\n",
" [0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" ...,\n",
" [0.00000000e+00, 0.00000000e+00, 2.04378535e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.01312308e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"for dir in [aka._x, aka._y, aka._z]:\n",
" model.applyBC(aka.FixedValue(0, dir), \"bottom\")\n",
"\n",
"# trac = np.eye(3)\n",
"trac = [0, 0, 1]\n",
"model.applyBC(aka.FromTraction(trac), \"top\")\n",
"np.set_printoptions(threshold=10)\n",
"model.getExternalForce()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "e26678ea-2a60-44fb-8956-6ce84db4174f",
"metadata": {},
"outputs": [
{
"ename": "Exception",
"evalue": "akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-68da59902414>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msolver\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"convergence_type\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maka\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSolveConvergenceCriteria\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresidual\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msolveStep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mException\u001b[0m: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]"
]
}
],
"source": [
"solver = model.getNonLinearSolver()\n",
"solver.set(\"max_iterations\", 2)\n",
"solver.set(\"threshold\", 1e-10)\n",
"solver.set(\"convergence_type\", aka.SolveConvergenceCriteria.residual)\n",
"\n",
"model.solveStep()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc tags:
``` python
import numpy as np
import akantu as aka
```
%% Cell type:code id:c1339e28-e6b1-4155-b25e-f3b848025838 tags:
``` python
material_file = """
material elastic [
name = steel
rho = 1 # density
E = 1 # young's modulus
nu = 0.3 # poisson's ratio
]"""
# writing the material file
open('material.dat', 'w').write(material_file)
#reading the material file
material_file = 'material.dat'
```
%% Cell type:code id:30c1bb68-80b2-41ea-9aa6-a08daf741c9b tags:
``` python
mesh = aka.Mesh(3)
mesh.read('cyl_02.msh')
model = aka.SolidMechanicsModel(mesh)
model.initFull(_analysis_method=aka._static)
```
%% Cell type:code id:23cdc1b2-692e-4457-a454-89d49722e94a tags:
``` python
mesh.createBoundaryGroupFromGeometry()
aka.parseInput(material_file)
```
%% Cell type:code id:a1d797dd-c63c-4b8b-9aaa-5d00947a414a tags:
``` python
for dir in [aka._x, aka._y, aka._z]:
model.applyBC(aka.FixedValue(0, dir), "bottom")
# trac = np.eye(3)
trac = [0, 0, 1]
model.applyBC(aka.FromTraction(trac), "top")
np.set_printoptions(threshold=10)
model.getExternalForce()
```
%%%% Output: execute_result
array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[0.00000000e+00, 0.00000000e+00, 1.00506689e-05],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
...,
[0.00000000e+00, 0.00000000e+00, 2.04378535e-03],
[0.00000000e+00, 0.00000000e+00, 2.01312308e-03],
[0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])
%% Cell type:code id:e26678ea-2a60-44fb-8956-6ce84db4174f tags:
``` python
solver = model.getNonLinearSolver()
solver.set("max_iterations", 2)
solver.set("threshold", 1e-10)
solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
model.solveStep()
```
%%%% Output: error
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-6-68da59902414> in <module>
4 solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
5
----> 6 model.solveStep()
Exception: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]
......@@ -28,19 +28,18 @@
"# writing the material file\n",
"open('material.dat', 'w').write(material_file)\n",
"#reading the material file\n",
"material_file = 'material.dat'\n",
"aka.parseInput(material_file)"
"material_file = 'material.dat'\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "e70a5ac5-9f8e-4cd7-af1d-931ccb725052",
"execution_count": 3,
"id": "30c1bb68-80b2-41ea-9aa6-a08daf741c9b",
"metadata": {},
"outputs": [],
"source": [
"mesh = aka.Mesh(3)\n",
"mesh.read('cyl_01.msh')\n",
"mesh.read('cyl_02.msh')\n",
"\n",
"model = aka.SolidMechanicsModel(mesh)\n",
"model.initFull(_analysis_method=aka._static)"
......@@ -48,8 +47,52 @@
},
{
"cell_type": "code",
"execution_count": 19,
"id": "18ffad89-ec5f-41ae-9705-21ba5ac967d6",
"execution_count": 4,
"id": "23cdc1b2-692e-4457-a454-89d49722e94a",
"metadata": {},
"outputs": [],
"source": [
"mesh.createBoundaryGroupFromGeometry()\n",
"aka.parseInput(material_file)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "a1d797dd-c63c-4b8b-9aaa-5d00947a414a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" [0.00000000e+00, 0.00000000e+00, 1.00506689e-05],\n",
" [0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" ...,\n",
" [0.00000000e+00, 0.00000000e+00, 2.04378535e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.01312308e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"for dir in [aka._x, aka._y, aka._z]:\n",
" model.applyBC(aka.FixedValue(0, dir), \"bottom\")\n",
"\n",
"# trac = np.eye(3)\n",
"trac = [0, 0, 1]\n",
"model.applyBC(aka.FromTraction(trac), \"top\")\n",
"model.getExternalForce()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "e26678ea-2a60-44fb-8956-6ce84db4174f",
"metadata": {},
"outputs": [
{
......@@ -59,17 +102,16 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-19-52b1c10eaa2d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mapplyBC\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maka\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mFromTraction\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrac\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"top\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msolveStep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<ipython-input-6-68da59902414>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msolver\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"convergence_type\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maka\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSolveConvergenceCriteria\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresidual\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msolveStep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mException\u001b[0m: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]"
]
}
],
"source": [
"for dir in [aka._x, aka._y, aka._z]:\n",
" model.applyBC(aka.FixedValue(0, dir), \"bottom\")\n",
"\n",
"trac = [0, 0, 1]\n",
"model.applyBC(aka.FromTraction(trac), \"top\")\n",
"solver = model.getNonLinearSolver()\n",
"solver.set(\"max_iterations\", 2)\n",
"solver.set(\"threshold\", 1e-10)\n",
"solver.set(\"convergence_type\", aka.SolveConvergenceCriteria.residual)\n",
"\n",
"model.solveStep()"
]
......
%% Cell type:code id:59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc tags:
``` python
import numpy as np
import akantu as aka
```
%% Cell type:code id:c1339e28-e6b1-4155-b25e-f3b848025838 tags:
``` python
material_file = """
material elastic [
name = steel
rho = 1 # density
E = 1 # young's modulus
nu = 0.3 # poisson's ratio
]"""
# writing the material file
open('material.dat', 'w').write(material_file)
#reading the material file
material_file = 'material.dat'
aka.parseInput(material_file)
```
%% Cell type:code id:e70a5ac5-9f8e-4cd7-af1d-931ccb725052 tags:
%% Cell type:code id:30c1bb68-80b2-41ea-9aa6-a08daf741c9b tags:
``` python
mesh = aka.Mesh(3)
mesh.read('cyl_01.msh')
mesh.read('cyl_02.msh')
model = aka.SolidMechanicsModel(mesh)
model.initFull(_analysis_method=aka._static)
```
%% Cell type:code id:18ffad89-ec5f-41ae-9705-21ba5ac967d6 tags:
%% Cell type:code id:23cdc1b2-692e-4457-a454-89d49722e94a tags:
``` python
mesh.createBoundaryGroupFromGeometry()
aka.parseInput(material_file)
```
%% Cell type:code id:a1d797dd-c63c-4b8b-9aaa-5d00947a414a tags:
``` python
for dir in [aka._x, aka._y, aka._z]:
model.applyBC(aka.FixedValue(0, dir), "bottom")
# trac = np.eye(3)
trac = [0, 0, 1]
model.applyBC(aka.FromTraction(trac), "top")
model.getExternalForce()
```
%%%% Output: execute_result
array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[0.00000000e+00, 0.00000000e+00, 1.00506689e-05],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
...,
[0.00000000e+00, 0.00000000e+00, 2.04378535e-03],
[0.00000000e+00, 0.00000000e+00, 2.01312308e-03],
[0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])
%% Cell type:code id:e26678ea-2a60-44fb-8956-6ce84db4174f tags:
``` python
solver = model.getNonLinearSolver()
solver.set("max_iterations", 2)
solver.set("threshold", 1e-10)
solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
model.solveStep()
```
%%%% Output: error
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-19-52b1c10eaa2d> in <module>
5 model.applyBC(aka.FromTraction(trac), "top")
6
----> 7 model.solveStep()
<ipython-input-6-68da59902414> in <module>
4 solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
5
----> 6 model.solveStep()
Exception: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]
......
SetFactory("OpenCASCADE");
Point(1) = {0, 0, 0};
Point(2) = {0, .5, 0};
Circle(1) = {0,0,0,0.5,0,2*Pi};
Curve Loop(2) = {1};
Plane Surface(1) = {2};
Extrude {0, 0, 1} {
Surface{1};
}
Physical Surface("bottom") = {1};
Physical Surface("top") = {3};
Physical Surface("surface") = {2};
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import akantu as aka"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "c1339e28-e6b1-4155-b25e-f3b848025838",
"metadata": {},
"outputs": [],
"source": [
"material_file = \"\"\"\n",
"material elastic [\n",
" name = steel\n",
" rho = 1 # density\n",
" E = 1 # young's modulus\n",
" nu = 0.3 # poisson's ratio\n",
"]\"\"\"\n",
"# writing the material file\n",
"open('material.dat', 'w').write(material_file)\n",
"#reading the material file\n",
"material_file = 'material.dat'\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "30c1bb68-80b2-41ea-9aa6-a08daf741c9b",
"metadata": {},
"outputs": [],
"source": [
"mesh = aka.Mesh(3)\n",
"mesh.read('cyl_02.msh')\n",
"\n",
"model = aka.SolidMechanicsModel(mesh)\n",
"model.initFull(_analysis_method=aka._static)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "23cdc1b2-692e-4457-a454-89d49722e94a",
"metadata": {},
"outputs": [],
"source": [
"mesh.createBoundaryGroupFromGeometry()\n",
"aka.parseInput(material_file)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "a1d797dd-c63c-4b8b-9aaa-5d00947a414a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" [0.00000000e+00, 0.00000000e+00, 1.00506689e-05],\n",
" [0.00000000e+00, 0.00000000e+00, 0.00000000e+00],\n",
" ...,\n",
" [0.00000000e+00, 0.00000000e+00, 2.04378535e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.01312308e-03],\n",
" [0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"for dir in [aka._x, aka._y, aka._z]:\n",
" model.applyBC(aka.FixedValue(0, dir), \"bottom\")\n",
"\n",
"# trac = np.eye(3)\n",
"trac = [0, 0, 1]\n",
"model.applyBC(aka.FromTraction(trac), \"top\")\n",
"np.set_printoptions(threshold=10)\n",
"model.getExternalForce()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "e26678ea-2a60-44fb-8956-6ce84db4174f",
"metadata": {},
"outputs": [
{
"ename": "Exception",
"evalue": "akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-6-68da59902414>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msolver\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"convergence_type\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maka\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSolveConvergenceCriteria\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresidual\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msolveStep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mException\u001b[0m: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]"
]
}
],
"source": [
"solver = model.getNonLinearSolver()\n",
"solver.set(\"max_iterations\", 2)\n",
"solver.set(\"threshold\", 1e-10)\n",
"solver.set(\"convergence_type\", aka.SolveConvergenceCriteria.residual)\n",
"\n",
"model.solveStep()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
%% Cell type:code id:59a9f2d7-aadb-4d96-9b19-0cfcf7c950dc tags:
``` python
import numpy as np
import akantu as aka
```
%% Cell type:code id:c1339e28-e6b1-4155-b25e-f3b848025838 tags:
``` python
material_file = """
material elastic [
name = steel
rho = 1 # density
E = 1 # young's modulus
nu = 0.3 # poisson's ratio
]"""
# writing the material file
open('material.dat', 'w').write(material_file)
#reading the material file
material_file = 'material.dat'
```
%% Cell type:code id:30c1bb68-80b2-41ea-9aa6-a08daf741c9b tags:
``` python
mesh = aka.Mesh(3)
mesh.read('cyl_02.msh')
model = aka.SolidMechanicsModel(mesh)
model.initFull(_analysis_method=aka._static)
```
%% Cell type:code id:23cdc1b2-692e-4457-a454-89d49722e94a tags:
``` python
mesh.createBoundaryGroupFromGeometry()
aka.parseInput(material_file)
```
%% Cell type:code id:a1d797dd-c63c-4b8b-9aaa-5d00947a414a tags:
``` python
for dir in [aka._x, aka._y, aka._z]:
model.applyBC(aka.FixedValue(0, dir), "bottom")
# trac = np.eye(3)
trac = [0, 0, 1]
model.applyBC(aka.FromTraction(trac), "top")
np.set_printoptions(threshold=10)
model.getExternalForce()
```
%%%% Output: execute_result
array([[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
[0.00000000e+00, 0.00000000e+00, 1.00506689e-05],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00],
...,
[0.00000000e+00, 0.00000000e+00, 2.04378535e-03],
[0.00000000e+00, 0.00000000e+00, 2.01312308e-03],
[0.00000000e+00, 0.00000000e+00, 2.40760514e-03]])
%% Cell type:code id:e26678ea-2a60-44fb-8956-6ce84db4174f tags:
``` python
solver = model.getNonLinearSolver()
solver.set("max_iterations", 2)
solver.set("threshold", 1e-10)
solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
model.solveStep()
```
%%%% Output: error
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-6-68da59902414> in <module>
4 solver.set("convergence_type", aka.SolveConvergenceCriteria.residual)
5
----> 6 model.solveStep()
Exception: akantu::debug::CriticalError : Error in mumps during solve process, check mumps user guide INFO(1) = -3 [/tmp/app/spack-stage/spack-stage-akantu-master-t5tv2fws2j5an4dr4sqytng27g7b3fyr/spack-src/src/solver/sparse_solver_mumps.cc:445]
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment