Commit 1625d0c8 authored by florez's avatar florez
Browse files

mesh file update

parent 1a242214
%% 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],
array([[0., 0., 0.],
[0., 0., 0.],
[0., 0., 0.],
...,
[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]])
[0., 0., 0.],
[0., 0., 0.],
[0., 0., 0.]])
%% 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 source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
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