Files
JuliaFEM.jl/notebooks/2015-06-25-elasticity-solver-example.ipynb
T
2015-08-10 23:01:44 +03:00

2877 lines
138 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Solving elasticity problems using JuliaFEM\n",
"\n",
"Author(s): Jukka Aho\n",
"\n",
"**Abstract**: A workflow to solve typical elasticity problem. This document also tries to give some quidelines how to develop JuliaFEM."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Bottom-up design\n",
"\n",
"We go piece by piece starting from something simple and going up to more complicated programming model."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Design principle 1*: we introduce new ideas using Notebooks."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Design principle 2*: we use ``Logging``. Forget ``println``."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"Logger(root,DEBUG,Pipe(open, 0 bytes waiting),root)"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using Logging\n",
"Logging.configure(level=DEBUG)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Design principle 3*: we write docstrings using [numpy style](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt).\n",
"\n",
"*Design principle 4*: we don't use greek characters in code which is implemented to JuliaFEM. In notebooks they are ok.\n",
"\n",
"*Design principle 5*: we use 4 space indentation like in Python.\n",
"\n",
"First we write some elementary functions to calculate stiffness matrix."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"calc_local_matrices! (generic function with 1 method)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\"\n",
"Calculate local tangent stiffness matrix and residual force vector\n",
"R = T - F for elasticity problem.\n",
"\n",
"Parameters\n",
"----------\n",
"X : Element coordinates\n",
"u : Displacement field\n",
"R : Residual force vector\n",
"K : Tangent stiffness matrix\n",
"basis : Basis functions\n",
"dbasis : Derivative of basis functions\n",
"lambda : Material parameter\n",
"mu : Material parameter\n",
"ipoints : integration points\n",
"iweights : integration weights\n",
"\n",
"Returns\n",
"-------\n",
"None\n",
"\n",
"Notes\n",
"-----\n",
"If material parameters are given in list, they are interpolated to gauss\n",
"points using shape functions.\n",
"\n",
"Examples\n",
"--------\n",
"\n",
"\"\"\"\n",
"function calc_local_matrices!(X, u, R, K, basis, dbasis, lambda_, mu_, ipoints, iweights)\n",
" dim, nnodes = size(X)\n",
" I = eye(dim)\n",
" R[:,:] = 0.0\n",
" K[:,:] = 0.0\n",
"\n",
" dF = zeros(dim, dim)\n",
"\n",
" for m = 1:length(iweights)\n",
" w = iweights[m]\n",
" xi = ipoints[m, :]\n",
" # calculate material parameters\n",
" lambda = typeof(lambda_) == Float64 ? lambda_ : dot(lambda_, basis(xi))\n",
" mu = typeof(mu_) == Float64 ? mu_ : dot(mu_, basis(xi))\n",
" Jt = X*dbasis(xi)\n",
" detJ = det(Jt)\n",
" dbasisdX = dbasis(xi)*inv(Jt)\n",
"\n",
" gradu = u*dbasisdX\n",
" F = I + gradu # Deformation gradient\n",
" E = 1/2*(gradu' + gradu + gradu'*gradu) # Green-Lagrange strain tensor\n",
" S = lambda*trace(E)*I + 2*mu*E # PK2 stress tensor\n",
" P = F*S # PK1 stress tensor\n",
"\n",
" R[:,:] += w*P*dbasisdX'*detJ\n",
"\n",
" for p = 1:nnodes\n",
" for i = 1:dim\n",
" dF[:,:] = 0.0\n",
" dF[i,:] = dbasisdX[p,:]\n",
" dE = 1/2*(F'*dF + dF'*F)\n",
" dS = lambda*trace(dE)*I + 2*mu*dE\n",
" dP = dF*S + F*dS\n",
" for q = 1:nnodes\n",
" for j = 1:dim\n",
" K[dim*(p-1)+i,dim*(q-1)+j] += w*(dP[j,:]*dbasisdX[q,:]')[1]*detJ\n",
" end\n",
" end\n",
" end\n",
" end\n",
"\n",
" end\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Design principle 6*: we test our code. We use FactCheck for testing."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"using FactCheck"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"test solve one element model\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 19:18:44:DEBUG:root:Converged in 6 iterations.\n",
"10-Aug 19:18:45:DEBUG:root:solution vector: \n",
" [0.0 -0.39914506095474317 -0.07228582695592449 0.0\n",
" 0.0 -2.1779892317073504 -2.222244754401764 0.0]\n",
"10-Aug 19:18:45:DEBUG:root:norm of u: 3.1292483947150043\n",
"10-Aug 19:18:45:DEBUG:root:Converged in 6 iterations.\n",
"10-Aug 19:18:45:DEBUG:root:solution vector: \n",
" [0.0 0.7433248532717793 1.0485210147234858 0.0\n",
" 0.0 -2.085766534304891 -1.9606633242166027 0.0]\n",
"10-Aug 19:18:45:DEBUG:root:norm of u: 3.129248394715006\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2 facts verified.\n"
]
},
{
"data": {
"text/plain": [
"delayed_handler (generic function with 4 methods)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"facts(\"test solve one element model\") do\n",
" X = [0.0 0.0; 10.0 0.0; 10.0 1.0; 0.0 1.0]'\n",
" F = [0 0; 0 0; 0 -2; 0 0]'\n",
"\n",
" # Material properties\n",
" E = 90\n",
" nu = 0.25\n",
" mu = E/(2*(1+nu))\n",
" la = E*nu/((1+nu)*(1-2*nu))\n",
" la = 2*la*mu/(la + 2*mu)\n",
"\n",
" u = zeros(2, 4)\n",
" du = zeros(2, 4)\n",
" R = zeros(2, 4)\n",
" K = zeros(8, 8)\n",
"\n",
" basis(xi) = [\n",
" (1-xi[1])*(1-xi[2])/4\n",
" (1+xi[1])*(1-xi[2])/4\n",
" (1+xi[1])*(1+xi[2])/4\n",
" (1-xi[1])*(1+xi[2])/4]\n",
"\n",
" dbasis(xi) = [-(1-xi[2])/4.0 -(1-xi[1])/4.0\n",
" (1-xi[2])/4.0 -(1+xi[1])/4.0\n",
" (1+xi[2])/4.0 (1+xi[1])/4.0\n",
" -(1+xi[2])/4.0 (1-xi[1])/4.0]\n",
"\n",
" ipoints = 1/sqrt(3)*[-1 -1; 1 -1; 1 1; -1 1]\n",
" iweights = [1, 1, 1, 1]\n",
" free_dofs = [3, 4, 5, 6]\n",
"\n",
" for i=1:10\n",
" calc_local_matrices!(X, u, R, K, basis, dbasis, la, mu, ipoints, iweights)\n",
" du[free_dofs] = K[free_dofs, free_dofs] \\ -(R - F)[free_dofs]\n",
" u += du\n",
" if norm(du) < 1.0e-9\n",
" Logging.debug(\"Converged in $i iterations.\")\n",
" break\n",
" end\n",
" end\n",
"\n",
" # Tested against Elmer solution\n",
" Logging.debug(\"solution vector: \\n $u\")\n",
" @fact u[2, 3] => roughly(-2.222244754401764)\n",
" norm1 = norm(u)\n",
" Logging.debug(\"norm of u: $(norm(u))\")\n",
"\n",
" # We rotate model a bit and make sure that L2 norm is same\n",
" phi = 30/180*pi\n",
" rmat = [\n",
" cos(phi) -sin(phi)\n",
" sin(phi) cos(phi)]\n",
" X = rmat*X\n",
" F = rmat*F\n",
" u = zeros(2, 4)\n",
" for i=1:10\n",
" calc_local_matrices!(X, u, R, K, basis, dbasis, la, mu, ipoints, iweights)\n",
" du[free_dofs] = K[free_dofs, free_dofs] \\ -(R - F)[free_dofs]\n",
" u += du\n",
" if norm(du) < 1.0e-9\n",
" Logging.debug(\"Converged in $i iterations.\")\n",
" break\n",
" end\n",
" end\n",
" Logging.debug(\"solution vector: \\n $u\")\n",
" Logging.debug(\"norm of u: $(norm(u))\")\n",
" @fact norm(u) => roughly(norm1) \n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"One element solutions are not particularly interesting so next step is to create function that assembles global matrix from local matrices. Some data types:"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"#type Node\n",
"# id :: Int\n",
"# #elements :: Array{Int64, 1}\n",
"#end"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"type Element\n",
" id :: Int\n",
" node_ids :: Array{Int64, 1}\n",
" coordinates :: Array{Float64, 2}\n",
" attributes :: Dict{ASCIIString, Any}\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"type Assembly\n",
" # LHS\n",
" I :: Array{Int64, 1}\n",
" J :: Array{Int64, 1}\n",
" A :: Array{Float64, 1}\n",
" # RHS\n",
" i :: Array{Int64, 1}\n",
" b :: Array{Float64, 1}\n",
" # global dofs for each element\n",
" gdofs :: Dict{Int64, Array{Int64, 1}}\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"get_integration_scheme (generic function with 2 methods)"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\"\n",
"Return shape functions and their derivatives for a element.\n",
"\n",
"Parameters\n",
"----------\n",
"element::Element\n",
"\n",
"Returns\n",
"-------\n",
"tuple (basis, dbasis)\n",
"\"\"\"\n",
"function get_shape_functions(el::Element)\n",
" ndim, nnodes = size(el.coordinates)\n",
" #Logging.debug(\"ndim = $ndim, nnodes=$nnodes\")\n",
" if (nnodes == 4) & (ndim == 2)\n",
" basis(xi) = [\n",
" (1-xi[1])*(1-xi[2])/4\n",
" (1+xi[1])*(1-xi[2])/4\n",
" (1+xi[1])*(1+xi[2])/4\n",
" (1-xi[1])*(1+xi[2])/4]\n",
" dbasis(xi) = [-(1-xi[2])/4.0 -(1-xi[1])/4.0\n",
" (1-xi[2])/4.0 -(1+xi[1])/4.0\n",
" (1+xi[2])/4.0 (1+xi[1])/4.0\n",
" -(1+xi[2])/4.0 (1-xi[1])/4.0]\n",
" return basis, dbasis\n",
" elseif (nnodes == 10) & (ndim == 3)\n",
" basis(xi) = [(xi[1] + xi[2] + xi[3] - 1)*(2*xi[1] + 2*xi[2] + 2*xi[3] - 1)\n",
" -xi[1]*(-2*xi[1] + 1)\n",
" -xi[2]*(-2*xi[2] + 1)\n",
" -xi[3]*(-2*xi[3] + 1)\n",
" 4*xi[1]*(-xi[1] - xi[2] - xi[3] + 1)\n",
" 4*xi[1]*xi[2]\n",
" 4*xi[2]*(-xi[1] - xi[2] - xi[3] + 1)\n",
" 4*xi[1]*xi[3]\n",
" 4*xi[2]*xi[3]\n",
" 4*xi[3]*(-xi[1] - xi[2] - xi[3] + 1)]\n",
"\n",
" dbasis(xi) = [\n",
" 4*xi[1] + 4*xi[2] + 4*xi[3] - 3 4*xi[1] + 4*xi[2] + 4*xi[3] - 3 4*xi[1] + 4*xi[2] + 4*xi[3] - 3\n",
" 4*xi[1] - 1 0 0\n",
" 0 4*xi[2] - 1 0\n",
" 0 0 4*xi[3] - 1\n",
" -8*xi[1] - 4*xi[2] - 4*xi[3] + 4 -4*xi[1] -4*xi[1]\n",
" 4*xi[2] 4*xi[1] 0\n",
" -4*xi[2] -4*xi[1] - 8*xi[2] - 4*xi[3] + 4 -4*xi[2]\n",
" 4*xi[3] 0 4*xi[1]\n",
" 0 4*xi[3] 4*xi[2]\n",
" -4*xi[3] -4*xi[3] -4*xi[1] - 4*xi[2] - 8*xi[3] + 4]\n",
" return basis, dbasis\n",
" end\n",
" throw(\"Unknown function space, ndim=$ndim, nnodes=$nnodes\")\n",
"end\n",
"\n",
"\"\"\"\n",
"\"\"\"\n",
"function get_integration_scheme(el::Element, order=2)\n",
" ndim, nnodes = size(el.coordinates)\n",
" if (nnodes == 4) & (order == 2) & (ndim == 2)\n",
" ipoints = 1/sqrt(3)*[-1 -1; 1 -1; 1 1; -1 1]\n",
" iweights = [1, 1, 1, 1]\n",
" return ipoints, iweights\n",
" elseif (nnodes == 10) & (order == 2) & (ndim == 3) # c3d10\n",
" # from code aster documentation\n",
" a = 1/20*(5-sqrt(5))\n",
" b = 1/20*(5+3*sqrt(5))\n",
" ipoints = [a a a; a a b; a b a; b a a]\n",
" iweights = 1/24*[1 1 1 1]\n",
" return ipoints, iweights\n",
" end\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"assemble_element! (generic function with 2 methods)"
]
},
"execution_count": 79,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function assemble_element!(ass::Assembly, el::Element, io=2)\n",
"\n",
" # Material properties\n",
" E = el.attributes[\"Young\"]\n",
" nu = el.attributes[\"Poisson\"]\n",
" mu = E/(2*(1+nu))\n",
" la = E*nu/((1+nu)*(1-2*nu))\n",
" la = 2*la*mu/(la + 2*mu)\n",
"\n",
" dofs = prod(size(el.coordinates))\n",
" X = el.coordinates\n",
" u = el.attributes[\"displacement\"]\n",
" R = el.attributes[\"displacement nodal force\"]\n",
" K = el.attributes[\"displacement tangent stiffness\"]\n",
"\n",
" gdofs = ass.gdofs[el.id]\n",
" Logging.debug(\"Assemble element to gdofs $gdofs\")\n",
" basis, dbasis = get_shape_functions(el)\n",
" ipoints, iweights = get_integration_scheme(el, io)\n",
" calc_local_matrices!(X, u, R, K, basis, dbasis, la, mu, ipoints, iweights)\n",
"\n",
" for i=1:dofs\n",
" for j=1:dofs\n",
" push!(ass.I, gdofs[i])\n",
" push!(ass.J, gdofs[j])\n",
" push!(ass.A, K[i,j])\n",
" end\n",
" push!(ass.i, gdofs[i])\n",
" push!(ass.b, R[i])\n",
" end\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Time to test again. From last test we know that correct solution is\n",
"\n",
" [0.0 -0.39914506095474317 -0.07228582695592449 0.0\n",
" 0.0 -2.1779892317073504 -2.222244754401764 0.0]\n",
"\n",
"This time we assemble global stiffness matrix in different order, 2 3 4 1"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"one element assembly\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 21:03:06:DEBUG:root:Adding nodes to array\n",
"10-Aug 21:03:06:DEBUG:root:Creating elements\n",
"10-Aug 21:03:06:DEBUG:root:Starting iteration 1\n",
"10-Aug 21:03:06:DEBUG:root:Assembling\n",
"10-Aug 21:03:06:DEBUG:root:Solution norm = 3.090022136728999\n",
"10-Aug 21:03:06:DEBUG:root:Starting iteration 2\n",
"10-Aug 21:03:06:DEBUG:root:Assembling\n",
"10-Aug 21:03:06:DEBUG:root:Solution norm = 0.3212131602153504\n",
"10-Aug 21:03:06:DEBUG:root:Starting iteration 3\n",
"10-Aug 21:03:06:DEBUG:root:Assembling\n",
"10-Aug 21:03:06:DEBUG:root:Solution norm = 0.040431781940005365\n",
"10-Aug 21:03:06:DEBUG:root:Starting iteration 4\n",
"10-Aug 21:03:06:DEBUG:root:Assembling\n",
"10-Aug 21:03:06:DEBUG:root:Solution norm = 0.0009291101052064257\n",
"10-Aug 21:03:06:DEBUG:root:Starting iteration 5\n",
"10-Aug 21:03:06:DEBUG:root:Assembling\n",
"10-Aug 21:03:06:DEBUG:root:Solution norm = 1.5638899025378415e-7\n",
"10-Aug 21:03:06:DEBUG:root:Starting iteration 6\n",
"10-Aug 21:03:06:DEBUG:root:Assembling\n",
"10-Aug 21:03:06:DEBUG:root:Solution norm = 1.0355045356935844e-14\n",
"10-Aug 21:03:06:DEBUG:root:Converged in 6 iterations.\n",
"10-Aug 21:03:06:DEBUG:root:Displacement of element = \n",
"[-0.39914506095474334 -0.07228582695592464 0.0 0.0\n",
" -2.1779892317073504 -2.222244754401764 0.0 0.0]\n"
]
},
{
"data": {
"text/plain": [
"delayed_handler (generic function with 4 methods)"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 fact verified.\n"
]
}
],
"source": [
"facts(\"one element assembly\") do\n",
" # Create model\n",
" #Logging.debug(\"Creating nodes\")\n",
" #n1 = Node(1)\n",
" #n2 = Node(2)\n",
" #n3 = Node(3)\n",
" #n4 = Node(4)\n",
" Logging.debug(\"Adding nodes to array\")\n",
" #nodes = [n1.id, n2.id, n3.id, n4.id]\n",
" node_ids = [1, 2, 3, 4]\n",
" coordinates = [10.0 0.0; 10.0 1.0; 0.0 1.0; 0.0 0.0]'\n",
" attributes = Dict(\"Young\" => 90, \"Poisson\" => 0.25)\n",
" Logging.debug(\"Creating elements\")\n",
" el = Element(1, node_ids, coordinates, attributes)\n",
"\n",
" # Initialize elements ready for solution\n",
" el.attributes[\"displacement\"] = zeros(2, 4)\n",
" el.attributes[\"displacement nodal force\"] = zeros(2, 4)\n",
" el.attributes[\"displacement tangent stiffness\"] = zeros(8, 8)\n",
"\n",
" for i=1:10\n",
" Logging.debug(\"Starting iteration $i\")\n",
" ass = Assembly(Int64[], Int64[], Float64[], Int64[], Float64[], Dict{Int64,Array{Int64,1}}())\n",
" ass.gdofs[el.id] = [1, 2, 3, 4, 5, 6, 7, 8]\n",
" Logging.debug(\"Assembling\")\n",
" assemble_element!(ass, el)\n",
"\n",
" # Boundary conditions\n",
" F = [0 0; 0 -2; 0 0; 0 0]'\n",
" F = reshape(F, prod(size(F)))\n",
" free_dofs = [1, 2, 3, 4]\n",
"\n",
" # solution\n",
" K = sparse(ass.I, ass.J, ass.A)\n",
" R = full(sparsevec(ass.i, ass.b))\n",
" R = R - F\n",
" du = zeros(8) # must be determined from ass\n",
" du[free_dofs] = K[free_dofs, free_dofs] \\ -R[free_dofs]\n",
"\n",
" Logging.debug(\"Solution norm = $(norm(du))\")\n",
"\n",
" # update solution back to elements\n",
" eldu = du[ass.gdofs[el.id]]\n",
" eldu = reshape(eldu, (2, round(Int, length(eldu)/2)))\n",
" el.attributes[\"displacement\"] += eldu\n",
" if norm(du) < 1.0e-9\n",
" Logging.debug(\"Converged in $i iterations.\")\n",
" break\n",
" end\n",
" end\n",
" disp = el.attributes[\"displacement\"]\n",
" Logging.debug(\"Displacement of element = \\n$disp\")\n",
" @fact norm(disp) => roughly(3.1292483947150043)\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Seems to be working. But we still need to handle boundary conditions more \"cleverly\" and generalize assembly to several elements (which is not problem).\n",
"\n",
"First of all, essential boundary conditions are nothing more than equality constraints saying that value for some degree of freedom is fixed. Elimination is just a special case when this value equals to zero. There is couple of different strategies to handle essential boundary conditions. One option is to force them using Lagrange multipliers which can also be used to create all kind of kinematic constraints also. (For example, contact can be considered as a kinematic constraint.) Another option is to manipulate matrix such a way that constraint is satisfied.\n",
"\n",
"Because we are now going \"bottom-up\", we develop something extremely simple that however deals with the problem:"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"type BC\n",
" dofs :: Array{Int64, 1}\n",
" values :: Array{Float64, 1}\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"solve one element problem\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:49:DEBUG:root:Creating nodes\n",
"10-Aug 22:55:49:DEBUG:root:Creating elements\n",
"10-Aug 22:55:49:INFO:root:create_ldof2gdofmap: dofs per node: 2\n",
"10-Aug 22:55:49:DEBUG:root:Dict(4=>[7,8],2=>[3,4],3=>[5,6],1=>[1,2])\n",
"10-Aug 22:55:50:INFO:root:solve!: dofs per node: 2\n",
"10-Aug 22:55:50:DEBUG:root:Problem size = 8\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 1\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,5,6,7,8]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Element stiffness matrix\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 5 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 6 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 12\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 3.0900221367289444\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 2\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,5,6,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 5 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 6 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 12\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 0.32121316021534363\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 3\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,5,6,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 5 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 6 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 12\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 0.04043178194002483\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 4\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 123.2 -15.0 -118.4 -03.0 -61.6 15.0 56.8 03.0\n",
" -15.0 321.2 03.0 -319.4 15.0 -160.6 -03.0 158.8\n",
" -118.4 03.0 123.2 15.0 56.8 -03.0 -61.6 -15.0\n",
" -03.0 -319.4 15.0 321.2 03.0 158.8 -15.0 -160.6\n",
" -61.6 15.0 56.8 03.0 123.2 -15.0 -118.4 -03.0\n",
" 15.0 -160.6 -03.0 158.8 -15.0 321.2 03.0 -319.4\n",
" 56.8 -03.0 -61.6 -15.0 -118.4 03.0 123.2 15.0\n",
" 03.0 158.8 -15.0 -160.6 -03.0 -319.4 15.0 321.2\n",
"Array(Float64,(12,12)) 12x12 Array{Float64,2}:\n",
" 123.2 -15.0 -118.4 -03.0 -61.6 15.0 56.8 03.0 0.0 0.0 0.0 0.0\n",
" -15.0 321.2 03.0 -319.4 15.0 -160.6 -03.0 158.8 0.0 0.0 0.0 0.0\n",
" -118.4 03.0 123.2 15.0 56.8 -03.0 -61.6 -15.0 0.0 0.0 0.0 0.0\n",
" -03.0 -319.4 15.0 321.2 03.0 158.8 -15.0 -160.6 0.0 0.0 0.0 0.0\n",
" -61.6 15.0 56.8 03.0 123.2 -15.0 -118.4 -03.0 1.0 0.0 0.0 0.0\n",
" 15.0 -160.6 -03.0 158.8 -15.0 321.2 03.0 -319.4 0.0 1.0 0.0 0.0\n",
" 56.8 -03.0 -61.6 -15.0 -118.4 03.0 123.2 15.0 0.0 0.0 1.0 0.0\n",
" 03.0 158.8 -15.0 -160.6 -03.0 -319.4 15.0 321.2 0.0 0.0 0.0 1.0\n",
" 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,12)) 1x12 Array{Float64,2}:\n",
" 0.0 0.0 0.0 02.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 147.61 36.88 -149.16 -55.03 -66.97 1.91 68.52 16.24\n",
" 36.88 343.08 -48.76 -334.42 1.81 -174.07 10.06 165.4 \n",
" -149.16 -48.76 160.72 65.4 63.17 10.41 -74.73 -27.06\n",
" -55.03 -334.42 65.4 330.06 16.65 163.39 -27.02 -159.04\n",
" -66.97 1.81 63.17 16.65 128.11 -15.44 -124.3 -3.03\n",
" 1.91 -174.07 10.41 163.39 -15.44 338.21 3.11 -327.53\n",
" 68.52 10.06 -74.73 -27.02 -124.3 3.11 130.51 13.85\n",
" 16.24 165.4 -27.06 -159.04 -3.03 -327.53 13.85 321.16\n",
"Array(Float64,(12,12)) 12x12 Array{Float64,2}:\n",
" 147.6 36.9 -149.2 -55.0 -67.0 1.9 68.5 16.2 0.0 0.0 0.0 0.0\n",
" 36.9 343.1 -48.8 -334.4 1.8 -174.1 10.1 165.4 0.0 0.0 0.0 0.0\n",
" -149.2 -48.8 160.7 65.4 63.2 10.4 -74.7 -27.1 0.0 0.0 0.0 0.0\n",
" -55.0 -334.4 65.4 330.1 16.7 163.4 -27.0 -159.0 0.0 0.0 0.0 0.0\n",
" -67.0 1.8 63.2 16.7 128.1 -15.4 -124.3 -03.0 1.0 0.0 0.0 0.0\n",
" 1.9 -174.1 10.4 163.4 -15.4 338.2 3.1 -327.5 0.0 1.0 0.0 0.0\n",
" 68.5 10.1 -74.7 -27.0 -124.3 3.1 130.5 13.8 0.0 0.0 1.0 0.0\n",
" 16.2 165.4 -27.1 -159.0 -03.0 -327.5 13.8 321.2 0.0 0.0 0.0 1.0\n",
" 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,12)) 1x12 Array{Float64,2}:\n",
" -2.3 -15.7 05.0 15.2 -20.2 12.2 17.5 -9.6 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 131.01 35.45 -132.72 -52.73 -60.29 1.77 62.0 15.51\n",
" 35.45 313.79 -46.75 -305.49 1.71 -163.9 9.58 155.6 \n",
" -132.72 -46.75 143.74 62.55 56.75 10.12 -67.77 -25.93\n",
" -52.73 -305.49 62.55 301.12 16.11 153.51 -25.93 -149.13\n",
" -60.29 1.71 56.75 16.11 117.72 -14.75 -114.18 -3.07\n",
" 1.77 -163.9 10.12 153.51 -14.75 327.07 2.86 -316.69\n",
" 62.0 9.58 -67.77 -25.93 -114.18 2.86 119.94 13.49\n",
" 15.51 155.6 -25.93 -149.13 -3.07 -316.69 13.49 310.22\n",
"Array(Float64,(12,12)) 12x12 Array{Float64,2}:\n",
" 131.0 35.4 -132.7 -52.7 -60.3 1.8 62.0 15.5 0.0 0.0 0.0 0.0\n",
" 35.4 313.8 -46.7 -305.5 1.7 -163.9 9.6 155.6 0.0 0.0 0.0 0.0\n",
" -132.7 -46.7 143.7 62.6 56.7 10.1 -67.8 -25.9 0.0 0.0 0.0 0.0\n",
" -52.7 -305.5 62.6 301.1 16.1 153.5 -25.9 -149.1 0.0 0.0 0.0 0.0\n",
" -60.3 1.7 56.7 16.1 117.7 -14.8 -114.2 -3.1 1.0 0.0 0.0 0.0\n",
" 1.8 -163.9 10.1 153.5 -14.8 327.1 2.9 -316.7 0.0 1.0 0.0 0.0\n",
" 62.0 9.6 -67.8 -25.9 -114.2 2.9 119.9 13.5 0.0 0.0 1.0 0.0\n",
" 15.5 155.6 -25.9 -149.1 -3.1 -316.7 13.5 310.2 0.0 0.0 0.0 1.0\n",
" 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,12)) 1x12 Array{Float64,2}:\n",
" -0.0 -0.6 0.1 0.6 -19.7 3.2 19.6 -1.1 0.0 0.0 0.0 0.0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,5,6,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 5 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 6 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 12\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 0.0009291101052060104\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 5\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,5,6,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 5 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 6 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 12\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 1.563889898905983e-7\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 6\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,5,6,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 5 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 6 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 12\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 1.2782462771683917e-14\n",
"10-Aug 22:55:50:DEBUG:root:Converged in 6 iterations.\n",
"10-Aug 22:55:50:DEBUG:root:Displacement of element = \n",
"[-0.3991450609547439 -0.07228582695592495 0.0 0.0\n",
" -2.1779892317073513 -2.2222447544017654 0.0 0.0]\n",
"10-Aug 22:55:50:DEBUG:root:Creating elements\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 130.66 36.04 -132.46 -53.26 -60.05 1.58 61.86 15.64\n",
" 36.04 312.24 -47.29 -303.89 1.52 -163.43 9.73 155.09\n",
" -132.46 -47.29 143.55 63.02 56.54 10.29 -67.63 -26.02\n",
" -53.26 -303.89 63.02 299.46 16.27 152.96 -26.02 -148.53\n",
" -60.05 1.52 56.54 16.27 117.21 -14.68 -113.7 -3.11\n",
" 1.58 -163.43 10.29 152.96 -14.68 326.61 2.81 -316.14\n",
" 61.86 9.73 -67.63 -26.02 -113.7 2.81 119.47 13.49\n",
" 15.64 155.09 -26.02 -148.53 -3.11 -316.14 13.49 309.58\n",
"Array(Float64,(12,12)) 12x12 Array{Float64,2}:\n",
" 130.7 36.0 -132.5 -53.3 -60.1 1.6 61.9 15.6 0.0 0.0 0.0 0.0\n",
" 36.0 312.2 -47.3 -303.9 1.5 -163.4 9.7 155.1 0.0 0.0 0.0 0.0\n",
" -132.5 -47.3 143.5 63.0 56.5 10.3 -67.6 -26.0 0.0 0.0 0.0 0.0\n",
" -53.3 -303.9 63.0 299.5 16.3 153.0 -26.0 -148.5 0.0 0.0 0.0 0.0\n",
" -60.1 1.5 56.5 16.3 117.2 -14.7 -113.7 -3.1 1.0 0.0 0.0 0.0\n",
" 1.6 -163.4 10.3 153.0 -14.7 326.6 2.8 -316.1 0.0 1.0 0.0 0.0\n",
" 61.9 9.7 -67.6 -26.0 -113.7 2.8 119.5 13.5 0.0 0.0 1.0 0.0\n",
" 15.6 155.1 -26.0 -148.5 -3.1 -316.1 13.5 309.6 0.0 0.0 0.0 1.0\n",
" 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,12)) 1x12 Array{Float64,2}:\n",
" 0.0 -0.0 -0.0 0.0 -19.9 2.8 19.9 -0.8 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 130.66 36.06 -132.47 -53.28 -60.05 1.57 61.86 15.64\n",
" 36.06 312.22 -47.3 -303.88 1.51 -163.43 9.73 155.08\n",
" -132.47 -47.3 143.56 63.03 56.54 10.29 -67.63 -26.02\n",
" -53.28 -303.88 63.03 299.44 16.27 152.96 -26.02 -148.52\n",
" -60.05 1.51 56.54 16.27 117.21 -14.67 -113.69 -3.11\n",
" 1.57 -163.43 10.29 152.96 -14.67 326.61 2.81 -316.14\n",
" 61.86 9.73 -67.63 -26.02 -113.69 2.81 119.46 13.49\n",
" 15.64 155.08 -26.02 -148.52 -3.11 -316.14 13.49 309.58\n",
"Array(Float64,(12,12)) 12x12 Array{Float64,2}:\n",
" 130.7 36.1 -132.5 -53.3 -60.1 1.6 61.9 15.6 0.0 0.0 0.0 0.0\n",
" 36.1 312.2 -47.3 -303.9 1.5 -163.4 9.7 155.1 0.0 0.0 0.0 0.0\n",
" -132.5 -47.3 143.6 63.0 56.5 10.3 -67.6 -26.0 0.0 0.0 0.0 0.0\n",
" -53.3 -303.9 63.0 299.4 16.3 153.0 -26.0 -148.5 0.0 0.0 0.0 0.0\n",
" -60.1 1.5 56.5 16.3 117.2 -14.7 -113.7 -3.1 1.0 0.0 0.0 0.0\n",
" 1.6 -163.4 10.3 153.0 -14.7 326.6 2.8 -316.1 0.0 1.0 0.0 0.0\n",
" 61.9 9.7 -67.6 -26.0 -113.7 2.8 119.5 13.5 0.0 0.0 1.0 0.0\n",
" 15.6 155.1 -26.0 -148.5 -3.1 -316.1 13.5 309.6 0.0 0.0 0.0 1.0\n",
" 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,12)) 1x12 Array{Float64,2}:\n",
" 0.0 -0.0 0.0 0.0 -19.9 2.8 19.9 -0.8 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 130.66 36.06 -132.47 -53.28 -60.05 1.57 61.86 15.64\n",
" 36.06 312.22 -47.3 -303.88 1.51 -163.43 9.73 155.08\n",
" -132.47 -47.3 143.56 63.03 56.54 10.29 -67.63 -26.02\n",
" -53.28 -303.88 63.03 299.44 16.27 152.96 -26.02 -148.52\n",
" -60.05 1.51 56.54 16.27 117.21 -14.67 -113.69 -3.11\n",
" 1.57 -163.43 10.29 152.96 -14.67 326.61 2.81 -316.14\n",
" 61.86 9.73 -67.63 -26.02 -113.69 2.81 119.46 13.49\n",
" 15.64 155.08 -26.02 -148.52 -3.11 -316.14 13.49 309.58\n",
"Array(Float64,(12,12)) 12x12 Array{Float64,2}:\n",
" 130.7 36.1 -132.5 -53.3 -60.1 1.6 61.9 15.6 0.0 0.0 0.0 0.0\n",
" 36.1 312.2 -47.3 -303.9 1.5 -163.4 9.7 155.1 0.0 0.0 0.0 0.0\n",
" -132.5 -47.3 143.6 63.0 56.5 10.3 -67.6 -26.0 0.0 0.0 0.0 0.0\n",
" -53.3 -303.9 63.0 299.4 16.3 153.0 -26.0 -148.5 0.0 0.0 0.0 0.0\n",
" -60.1 1.5 56.5 16.3 117.2 -14.7 -113.7 -3.1 1.0 0.0 0.0 0.0\n",
" 1.6 -163.4 10.3 153.0 -14.7 326.6 2.8 -316.1 0.0 1.0 0.0 0.0\n",
" 61.9 9.7 -67.6 -26.0 -113.7 2.8 119.5 13.5 0.0 0.0 1.0 0.0\n",
" 15.6 155.1 -26.0 -148.5 -3.1 -316.1 13.5 309.6 0.0 0.0 0.0 1.0\n",
" 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,12)) 1x12 Array{Float64,2}:\n",
" 0.0 -0.0 -0.0 0.0 -19.9 2.8 19.9 -0.8 0.0 0.0 0.0 0.0\n",
"1 fact verified.\n",
"solve two element problem\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:50:INFO:root:create_ldof2gdofmap: dofs per node: 2\n",
"10-Aug 22:55:50:DEBUG:root:Dict(4=>[7,8],2=>[3,4],3=>[5,6],5=>[9,10],6=>[11,12],1=>[1,2])\n",
"10-Aug 22:55:50:INFO:root:solve!: dofs per node: 2\n",
"10-Aug 22:55:50:DEBUG:root:Problem size = 12\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 1\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 16\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 12.031677381267034\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 2\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 16\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 8.151050361276255\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 3\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 66.4 15.0 23.6 -03.0 -33.2 -15.0 -56.8 03.0\n",
" 15.0 162.4 03.0 77.6 -15.0 -81.2 -03.0 -158.8\n",
" 23.6 03.0 66.4 -15.0 -56.8 -03.0 -33.2 15.0\n",
" -03.0 77.6 -15.0 162.4 03.0 -158.8 15.0 -81.2\n",
" -33.2 -15.0 -56.8 03.0 66.4 15.0 23.6 -03.0\n",
" -15.0 -81.2 -03.0 -158.8 15.0 162.4 03.0 77.6\n",
" -56.8 -03.0 -33.2 15.0 23.6 03.0 66.4 -15.0\n",
" 03.0 -158.8 15.0 -81.2 -03.0 77.6 -15.0 162.4\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 66.4 15.0 23.6 -03.0 -33.2 -15.0 -56.8 03.0\n",
" 15.0 162.4 03.0 77.6 -15.0 -81.2 -03.0 -158.8\n",
" 23.6 03.0 66.4 -15.0 -56.8 -03.0 -33.2 15.0\n",
" -03.0 77.6 -15.0 162.4 03.0 -158.8 15.0 -81.2\n",
" -33.2 -15.0 -56.8 03.0 66.4 15.0 23.6 -03.0\n",
" -15.0 -81.2 -03.0 -158.8 15.0 162.4 03.0 77.6\n",
" -56.8 -03.0 -33.2 15.0 23.6 03.0 66.4 -15.0\n",
" 03.0 -158.8 15.0 -81.2 -03.0 77.6 -15.0 162.4\n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}:\n",
" 66.4 15.0 23.6 -03.0 0.0 0.0 -56.8 03.0 -33.2 -15.0 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 15.0 162.4 03.0 77.6 0.0 0.0 -03.0 -158.8 -15.0 -81.2 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 23.6 03.0 132.8 0.0 23.6 -03.0 -33.2 15.0 -113.6 0.0 -33.2 -15.0 0.0 0.0 0.0 0.0\n",
" -03.0 77.6 0.0 324.8 03.0 77.6 15.0 -81.2 0.0 -317.6 -15.0 -81.2 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 23.6 03.0 66.4 -15.0 0.0 0.0 -33.2 15.0 -56.8 -03.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -03.0 77.6 -15.0 162.4 0.0 0.0 15.0 -81.2 03.0 -158.8 0.0 0.0 0.0 0.0\n",
" -56.8 -03.0 -33.2 15.0 0.0 0.0 66.4 -15.0 23.6 03.0 0.0 0.0 0.0 0.0 1.0 0.0\n",
" 03.0 -158.8 15.0 -81.2 0.0 0.0 -15.0 162.4 -03.0 77.6 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -33.2 -15.0 -113.6 0.0 -33.2 15.0 23.6 -03.0 132.8 0.0 23.6 03.0 0.0 0.0 0.0 0.0\n",
" -15.0 -81.2 0.0 -317.6 15.0 -81.2 03.0 77.6 0.0 324.8 -03.0 77.6 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -33.2 -15.0 -56.8 03.0 0.0 0.0 23.6 -03.0 66.4 15.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -15.0 -81.2 -03.0 -158.8 0.0 0.0 03.0 77.6 15.0 162.4 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 02.0 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 520.78 72.26 330.9 62.7 -397.04 -45.87 -454.64 -89.09\n",
" 72.26 461.85 83.07 254.3 -47.57 -243.98 -107.75 -472.18\n",
" 330.9 83.07 874.92 211.87 -895.33 -206.2 -310.49 -88.74\n",
" 62.7 254.3 211.87 708.11 -183.65 -617.73 -90.92 -344.68\n",
" -397.04 -47.57 -895.33 -183.65 983.14 157.73 309.22 73.49\n",
" -45.87 -243.98 -206.2 -617.73 157.73 615.62 94.34 246.08\n",
" -454.64 -107.75 -310.49 -90.92 309.22 94.34 455.91 104.34\n",
" -89.09 -472.18 -88.74 -344.68 73.49 246.08 104.34 570.77\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 520.78 72.26 330.9 62.7 -397.04 -45.87 -454.64 -89.09\n",
" 72.26 461.85 83.07 254.3 -47.57 -243.98 -107.75 -472.18\n",
" 330.9 83.07 874.92 211.87 -895.33 -206.2 -310.49 -88.74\n",
" 62.7 254.3 211.87 708.11 -183.65 -617.73 -90.92 -344.68\n",
" -397.04 -47.57 -895.33 -183.65 983.14 157.73 309.22 73.49\n",
" -45.87 -243.98 -206.2 -617.73 157.73 615.62 94.34 246.08\n",
" -454.64 -107.75 -310.49 -90.92 309.22 94.34 455.91 104.34\n",
" -89.09 -472.18 -88.74 -344.68 73.49 246.08 104.34 570.77\n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}:\n",
" 520.8 72.3 330.9 62.7 0.0 0.0 -454.6 -89.1 -397.0 -45.9 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 72.3 461.9 83.1 254.3 0.0 0.0 -107.8 -472.2 -47.6 -244.0 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 330.9 83.1 1395.7 284.1 330.9 62.7 -310.5 -88.7 -1350.0 -295.3 -397.0 -45.9 0.0 0.0 0.0 0.0\n",
" 62.7 254.3 284.1 1170.0 83.1 254.3 -90.9 -344.7 -291.4 -1089.9 -47.6 -244.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 330.9 83.1 874.9 211.9 0.0 0.0 -310.5 -88.7 -895.3 -206.2 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 62.7 254.3 211.9 708.1 0.0 0.0 -90.9 -344.7 -183.7 -617.7 0.0 0.0 0.0 0.0\n",
" -454.6 -107.8 -310.5 -90.9 0.0 0.0 455.9 104.3 309.2 94.3 0.0 0.0 0.0 0.0 1.0 0.0\n",
" -89.1 -472.2 -88.7 -344.7 0.0 0.0 104.3 570.8 73.5 246.1 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -397.0 -47.6 -1350.0 -291.4 -310.5 -90.9 309.2 73.5 1439.1 262.1 309.2 94.3 0.0 0.0 0.0 0.0\n",
" -45.9 -244.0 -295.3 -1089.9 -88.7 -344.7 94.3 246.1 262.1 1186.4 73.5 246.1 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -397.0 -47.6 -895.3 -183.7 0.0 0.0 309.2 73.5 983.1 157.7 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -45.9 -244.0 -206.2 -617.7 0.0 0.0 94.3 246.1 157.7 615.6 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" -453.5 -212.6 -1168.0 -759.0 -714.5 -546.4 300.0 466.2 1168.0 759.0 868.1 294.8 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 43.42 28.69 48.59 17.79 -57.52 -15.59 -34.48 -30.89\n",
" 28.69 51.46 22.52 33.82 -15.89 -22.99 -35.32 -62.29\n",
" 48.59 22.52 142.25 54.77 -152.3 -53.31 -38.54 -23.98\n",
" 17.79 33.82 54.77 88.5 -48.04 -72.78 -24.51 -49.53\n",
" -57.52 -15.89 -152.3 -48.04 168.56 42.6 41.26 21.33\n",
" -15.59 -22.99 -53.31 -72.78 42.6 67.46 26.29 28.32\n",
" -34.48 -35.32 -38.54 -24.51 41.26 26.29 31.77 33.54\n",
" -30.89 -62.29 -23.98 -49.53 21.33 28.32 33.54 83.5 \n",
"Element stiffness matrix\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 16\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 3.886954756970209\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 4\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 16\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 2.9651628976855293\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 5\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 16\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 43.42 28.69 48.59 17.79 -57.52 -15.59 -34.48 -30.89\n",
" 28.69 51.46 22.52 33.82 -15.89 -22.99 -35.32 -62.29\n",
" 48.59 22.52 142.25 54.77 -152.3 -53.31 -38.54 -23.98\n",
" 17.79 33.82 54.77 88.5 -48.04 -72.78 -24.51 -49.53\n",
" -57.52 -15.89 -152.3 -48.04 168.56 42.6 41.26 21.33\n",
" -15.59 -22.99 -53.31 -72.78 42.6 67.46 26.29 28.32\n",
" -34.48 -35.32 -38.54 -24.51 41.26 26.29 31.77 33.54\n",
" -30.89 -62.29 -23.98 -49.53 21.33 28.32 33.54 83.5 \n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}:\n",
" 43.4 28.7 48.6 17.8 0.0 0.0 -34.5 -30.9 -57.5 -15.6 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 28.7 51.5 22.5 33.8 0.0 0.0 -35.3 -62.3 -15.9 -23.0 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 48.6 22.5 185.7 83.5 48.6 17.8 -38.5 -24.0 -186.8 -84.2 -57.5 -15.6 0.0 0.0 0.0 0.0\n",
" 17.8 33.8 83.5 140.0 22.5 33.8 -24.5 -49.5 -83.4 -135.1 -15.9 -23.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 48.6 22.5 142.2 54.8 0.0 0.0 -38.5 -24.0 -152.3 -53.3 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 17.8 33.8 54.8 88.5 0.0 0.0 -24.5 -49.5 -48.0 -72.8 0.0 0.0 0.0 0.0\n",
" -34.5 -35.3 -38.5 -24.5 0.0 0.0 31.8 33.5 41.3 26.3 0.0 0.0 0.0 0.0 1.0 0.0\n",
" -30.9 -62.3 -24.0 -49.5 0.0 0.0 33.5 83.5 21.3 28.3 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -57.5 -15.9 -186.8 -83.4 -38.5 -24.5 41.3 21.3 200.3 76.1 41.3 26.3 0.0 0.0 0.0 0.0\n",
" -15.6 -23.0 -84.2 -135.1 -24.0 -49.5 26.3 28.3 76.1 151.0 21.3 28.3 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -57.5 -15.9 -152.3 -48.0 0.0 0.0 41.3 21.3 168.6 42.6 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -15.6 -23.0 -53.3 -72.8 0.0 0.0 26.3 28.3 42.6 67.5 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" 27.5 08.5 22.1 17.8 -5.4 9.3 -21.6 -15.8 -22.1 -17.8 -0.5 -0.0 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 116.19 1.61 71.4 10.34 -89.72 1.21 -97.86 -13.16\n",
" 1.61 96.17 17.73 49.31 0.67 -49.8 -20.01 -95.68\n",
" 71.4 17.73 191.45 46.09 -197.12 -40.75 -65.73 -23.07\n",
" 10.34 49.31 46.09 167.18 -32.77 -134.57 -23.66 -81.92\n",
" -89.72 0.67 -197.12 -32.77 219.04 18.96 67.81 13.14\n",
" 1.21 -49.8 -40.75 -134.57 18.96 135.27 20.58 49.1 \n",
" -97.86 -20.01 -65.73 -23.66 67.81 20.58 95.78 23.09\n",
" -13.16 -95.68 -23.07 -81.92 13.14 49.1 23.09 128.5 \n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 116.19 1.61 71.4 10.34 -89.72 1.21 -97.86 -13.16\n",
" 1.61 96.17 17.73 49.31 0.67 -49.8 -20.01 -95.68\n",
" 71.4 17.73 191.45 46.09 -197.12 -40.75 -65.73 -23.07\n",
" 10.34 49.31 46.09 167.18 -32.77 -134.57 -23.66 -81.92\n",
" -89.72 0.67 -197.12 -32.77 219.04 18.96 67.81 13.14\n",
" 1.21 -49.8 -40.75 -134.57 18.96 135.27 20.58 49.1 \n",
" -97.86 -20.01 -65.73 -23.66 67.81 20.58 95.78 23.09\n",
" -13.16 -95.68 -23.07 -81.92 13.14 49.1 23.09 128.5 \n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}:\n",
" 116.2 1.6 71.4 10.3 0.0 0.0 -97.9 -13.2 -89.7 1.2 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 1.6 96.2 17.7 49.3 0.0 0.0 -20.0 -95.7 0.7 -49.8 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 71.4 17.7 307.6 47.7 71.4 10.3 -65.7 -23.1 -295.0 -53.9 -89.7 1.2 0.0 0.0 0.0 0.0\n",
" 10.3 49.3 47.7 263.4 17.7 49.3 -23.7 -81.9 -52.8 -230.3 0.7 -49.8 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 71.4 17.7 191.5 46.1 0.0 0.0 -65.7 -23.1 -197.1 -40.8 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 10.3 49.3 46.1 167.2 0.0 0.0 -23.7 -81.9 -32.8 -134.6 0.0 0.0 0.0 0.0\n",
" -97.9 -20.0 -65.7 -23.7 0.0 0.0 95.8 23.1 67.8 20.6 0.0 0.0 0.0 0.0 1.0 0.0\n",
" -13.2 -95.7 -23.1 -81.9 0.0 0.0 23.1 128.5 13.1 49.1 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -89.7 0.7 -295.0 -52.8 -65.7 -23.7 67.8 13.1 314.8 42.0 67.8 20.6 0.0 0.0 0.0 0.0\n",
" 1.2 -49.8 -53.9 -230.3 -23.1 -81.9 20.6 49.1 42.0 263.8 13.1 49.1 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -89.7 0.7 -197.1 -32.8 0.0 0.0 67.8 13.1 219.0 19.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 1.2 -49.8 -40.8 -134.6 0.0 0.0 20.6 49.1 19.0 135.3 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" -02.5 8.8 -27.7 -26.3 -25.2 -35.2 -10.3 26.0 27.7 26.3 38.0 2.3 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 80.58 18.37 53.97 14.28 -64.27 -7.29 -70.28 -25.36\n",
" 18.37 29.48 19.23 20.58 -7.58 -16.78 -30.02 -33.28\n",
" 53.97 19.23 139.54 47.2 -146.69 -42.11 -46.81 -24.33\n",
" 14.28 20.58 47.2 74.51 -36.82 -59.55 -24.66 -35.54\n",
" -64.27 -7.58 -146.69 -36.82 159.26 28.44 51.7 15.96\n",
" -7.29 -16.78 -42.11 -59.55 28.44 56.47 20.96 19.86\n",
" -70.28 -30.02 -46.81 -24.66 51.7 20.96 65.39 33.72\n",
" -25.36 -33.28 -24.33 -35.54 15.96 19.86 33.72 48.96\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 80.58 18.37 53.97 14.28 -64.27 -7.29 -70.28 -25.36\n",
" 18.37 29.48 19.23 20.58 -7.58 -16.78 -30.02 -33.28\n",
" 53.97 19.23 139.54 47.2 -146.69 -42.11 -46.81 -24.33\n",
" 14.28 20.58 47.2 74.51 -36.82 -59.55 -24.66 -35.54\n",
" -64.27 -7.58 -146.69 -36.82 159.26 28.44 51.7 15.96\n",
" -7.29 -16.78 -42.11 -59.55 28.44 56.47 20.96 19.86\n",
" -70.28 -30.02 -46.81 -24.66 51.7 20.96 65.39 33.72\n",
" -25.36 -33.28 -24.33 -35.54 15.96 19.86 33.72 48.96\n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 2.638889456564507\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 6\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n",
"10-Aug 22:55:50:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:50:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:50:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:50:DEBUG:root:Solving system of equations. Total size = 16\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:nothing\n",
"10-Aug 22:55:50:DEBUG:root:Solution norm = 2.5846689771724556\n",
"10-Aug 22:55:50:DEBUG:root:Starting iteration 7\n",
"10-Aug 22:55:50:DEBUG:root:Assembling\n",
"10-Aug 22:55:50:DEBUG:root:Assemble element to gdofs [1,2,3,4,9,10,7,8]\n",
"10-Aug 22:55:51:DEBUG:root:Assemble element to gdofs [3,4,5,6,11,12,9,10]\n",
"10-Aug 22:55:51:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 22:55:51:DEBUG:root:dof 1 => 0.0\n",
"10-Aug 22:55:51:DEBUG:root:dof 2 => 0.0\n",
"10-Aug 22:55:51:DEBUG:root:dof 7 => 0.0\n",
"10-Aug 22:55:51:DEBUG:root:dof 8 => 0.0\n",
"10-Aug 22:55:51:DEBUG:root:Added 4 Lagrange multipliers to model\n",
"10-Aug 22:55:51:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 22:55:51:DEBUG:root:Solving system of equations. Total size = 16\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
":\n",
" 80.6 18.4 54.0 14.3 0.0 0.0 -70.3 -25.4 -64.3 -7.3 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 18.4 29.5 19.2 20.6 0.0 0.0 -30.0 -33.3 -7.6 -16.8 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 54.0 19.2 220.1 65.6 54.0 14.3 -46.8 -24.3 -217.0 -67.5 -64.3 -7.3 0.0 0.0 0.0 0.0\n",
" 14.3 20.6 65.6 104.0 19.2 20.6 -24.7 -35.5 -66.8 -92.8 -7.6 -16.8 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 54.0 19.2 139.5 47.2 0.0 0.0 -46.8 -24.3 -146.7 -42.1 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 14.3 20.6 47.2 74.5 0.0 0.0 -24.7 -35.5 -36.8 -59.6 0.0 0.0 0.0 0.0\n",
" -70.3 -30.0 -46.8 -24.7 0.0 0.0 65.4 33.7 51.7 21.0 0.0 0.0 0.0 0.0 1.0 0.0\n",
" -25.4 -33.3 -24.3 -35.5 0.0 0.0 33.7 49.0 16.0 19.9 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -64.3 -7.6 -217.0 -66.8 -46.8 -24.7 51.7 16.0 224.7 62.2 51.7 21.0 0.0 0.0 0.0 0.0\n",
" -7.3 -16.8 -67.5 -92.8 -24.3 -35.5 21.0 19.9 62.2 105.4 16.0 19.9 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -64.3 -7.6 -146.7 -36.8 0.0 0.0 51.7 16.0 159.3 28.4 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -7.3 -16.8 -42.1 -59.6 0.0 0.0 21.0 19.9 28.4 56.5 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" 28.6 5.9 32.9 14.7 4.3 8.7 -24.6 -14.9 -32.9 -14.7 -8.3 2.2 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 138.24 6.59 72.3 13.02 -91.67 -1.46 -118.87 -18.14\n",
" 6.59 95.68 20.35 47.41 -1.83 -47.79 -25.11 -95.3 \n",
" 72.3 20.35 177.29 48.61 -182.78 -43.91 -66.81 -25.05\n",
" 13.02 47.41 48.61 159.72 -36.21 -128.01 -25.42 -79.12\n",
" -91.67 -1.83 -182.78 -36.21 203.7 23.62 70.75 14.42\n",
" -1.46 -47.79 -43.91 -128.01 23.62 126.88 21.75 48.93\n",
" -118.87 -25.11 -66.81 -25.42 70.75 21.75 114.93 28.77\n",
" -18.14 -95.3 -25.05 -79.12 14.42 48.93 28.77 125.49\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 138.24 6.59 72.3 13.02 -91.67 -1.46 -118.87 -18.14\n",
" 6.59 95.68 20.35 47.41 -1.83 -47.79 -25.11 -95.3 \n",
" 72.3 20.35 177.29 48.61 -182.78 -43.91 -66.81 -25.05\n",
" 13.02 47.41 48.61 159.72 -36.21 -128.01 -25.42 -79.12\n",
" -91.67 -1.83 -182.78 -36.21 203.7 23.62 70.75 14.42\n",
" -1.46 -47.79 -43.91 -128.01 23.62 126.88 21.75 48.93\n",
" -118.87 -25.11 -66.81 -25.42 70.75 21.75 114.93 28.77\n",
" -18.14 -95.3 -25.05 -79.12 14.42 48.93 28.77 125.49\n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}:\n",
" 138.2 6.6 72.3 13.0 0.0 0.0 -118.9 -18.1 -91.7 -1.5 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 6.6 95.7 20.3 47.4 0.0 0.0 -25.1 -95.3 -1.8 -47.8 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 72.3 20.3 315.5 55.2 72.3 13.0 -66.8 -25.0 -301.6 -62.1 -91.7 -1.5 0.0 0.0 0.0 0.0\n",
" 13.0 47.4 55.2 255.4 20.3 47.4 -25.4 -79.1 -61.3 -223.3 -1.8 -47.8 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 72.3 20.3 177.3 48.6 0.0 0.0 -66.8 -25.0 -182.8 -43.9 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 13.0 47.4 48.6 159.7 0.0 0.0 -25.4 -79.1 -36.2 -128.0 0.0 0.0 0.0 0.0\n",
" -118.9 -25.1 -66.8 -25.4 0.0 0.0 114.9 28.8 70.7 21.8 0.0 0.0 0.0 0.0 1.0 0.0\n",
" -18.1 -95.3 -25.0 -79.1 0.0 0.0 28.8 125.5 14.4 48.9 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -91.7 -1.8 -301.6 -61.3 -66.8 -25.4 70.7 14.4 318.6 52.4 70.7 21.8 0.0 0.0 0.0 0.0\n",
" -1.5 -47.8 -62.1 -223.3 -25.0 -79.1 21.8 48.9 52.4 252.4 14.4 48.9 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -91.7 -1.8 -182.8 -36.2 0.0 0.0 70.7 14.4 203.7 23.6 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -1.5 -47.8 -43.9 -128.0 0.0 0.0 21.8 48.9 23.6 126.9 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" -06.5 7.6 -25.7 -24.5 -19.1 -32.0 -4.1 20.8 25.7 24.5 29.7 5.7 0.0 0.0 0.0 0.0\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 105.18 18.96 58.01 14.76 -69.33 -6.94 -93.85 -26.77\n",
" 18.96 36.86 19.89 21.5 -7.13 -18.68 -31.72 -39.68\n",
" 58.01 19.89 135.28 46.75 -141.88 -41.41 -51.41 -25.23\n",
" 14.76 21.5 46.75 74.5 -36.07 -59.09 -25.44 -36.91\n",
" -69.33 -7.13 -141.88 -36.07 154.31 27.5 56.9 15.7 \n",
" -6.94 -18.68 -41.41 -59.09 27.5 56.13 20.86 21.65\n",
" -93.85 -31.72 -51.41 -25.44 56.9 20.86 88.36 36.3 \n",
" -26.77 -39.68 -25.23 -36.91 15.7 21.65 36.3 54.93\n",
"Element stiffness matrix\n",
"Array(Float64,(8,8)) 8x8 Array{Float64,2}:\n",
" 105.18 18.96 58.01 14.76 -69.33 -6.94 -93.85 -26.77\n",
" 18.96 36.86 19.89 21.5 -7.13 -18.68 -31.72 -39.68\n",
" 58.01 19.89 135.28 46.75 -141.88 -41.41 -51.41 -25.23\n",
" 14.76 21.5 46.75 74.5 -36.07 -59.09 -25.44 -36.91\n",
" -69.33 -7.13 -141.88 -36.07 154.31 27.5 56.9 15.7 \n",
" -6.94 -18.68 -41.41 -59.09 27.5 56.13 20.86 21.65\n",
" -93.85 -31.72 -51.41 -25.44 56.9 20.86 88.36 36.3 \n",
" -26.77 -39.68 -25.23 -36.91 15.7 21.65 36.3 54.93\n",
"Array(Float64,(16,16)) 16x16 Array{Float64,2}:\n",
" 105.2 19.0 58.0 14.8 0.0 0.0 -93.9 -26.8 -69.3 -6.9 0.0 0.0 1.0 0.0 0.0 0.0\n",
" 19.0 36.9 19.9 21.5 0.0 0.0 -31.7 -39.7 -7.1 -18.7 0.0 0.0 0.0 1.0 0.0 0.0\n",
" 58.0 19.9 240.5 65.7 58.0 14.8 -51.4 -25.2 -235.7 -68.2 -69.3 -6.9 0.0 0.0 0.0 0.0\n",
" 14.8 21.5 65.7 111.4 19.9 21.5 -25.4 -36.9 -67.8 -98.8 -7.1 -18.7 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 58.0 19.9 135.3 46.7 0.0 0.0 -51.4 -25.2 -141.9 -41.4 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 14.8 21.5 46.7 74.5 0.0 0.0 -25.4 -36.9 -36.1 -59.1 0.0 0.0 0.0 0.0\n",
" -93.9 -31.7 -51.4 -25.4 0.0 0.0 88.4 36.3 56.9 20.9 0.0 0.0 0.0 0.0 1.0 0.0\n",
" -26.8 -39.7 -25.2 -36.9 0.0 0.0 36.3 54.9 15.7 21.6 0.0 0.0 0.0 0.0 0.0 1.0\n",
" -69.3 -7.1 -235.7 -67.8 -51.4 -25.4 56.9 15.7 242.7 63.8 56.9 20.9 0.0 0.0 0.0 0.0\n",
" -6.9 -18.7 -68.2 -98.8 -25.2 -36.9 20.9 21.6 63.8 111.1 15.7 21.6 0.0 0.0 0.0 0.0\n",
" 0.0 "
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 22:55:51:DEBUG:root:nothing\n",
"10-Aug 22:55:51:DEBUG:root:nothing\n",
"10-Aug 22:55:51:DEBUG:root:Solution norm = 2.4116101594574446\n",
"10-Aug 22:55:51:DEBUG:root:Displacement of element = \n",
"[-3.0265017801117513 -5.464687844270099 -4.5022205763589715 -2.2188310526354926\n",
" -1.2759688848713764 -6.757003969576785 -7.2218353000897295 -1.8649226742660745]\n"
]
},
{
"data": {
"text/plain": [
"delayed_handler (generic function with 4 methods)"
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.0 -69.3 -7.1 -141.9 -36.1 0.0 0.0 56.9 15.7 154.3 27.5 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 -6.9 -18.7 -41.4 -59.1 0.0 0.0 20.9 21.6 27.5 56.1 0.0 0.0 0.0 0.0\n",
" 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
" 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n",
"Array(Float64,(1,16)) 1x16 Array{Float64,2}:\n",
" 22.9 4.1 28.6 11.8 5.6 7.6 -19.5 -12.4 -28.6 -11.8 -09.0 2.6 0.0 0.0 0.0 0.0\n",
"0 facts verified.\n"
]
}
],
"source": [
"\"\"\"\n",
"Create local dof to global dof mapping for given elements\n",
"\"\"\"\n",
"function create_ldof2gdofmap(elements; ndofs=2)\n",
" Logging.info(\"create_ldof2gdofmap: dofs per node: $ndofs\")\n",
"\n",
" all_node_ids = Int64[]\n",
" for el in elements\n",
" eldim, elnodes = size(el.coordinates)\n",
" for nid in el.node_ids\n",
" push!(all_node_ids, nid)\n",
" end\n",
" end\n",
" all_node_ids = unique(all_node_ids)\n",
" sort!(all_node_ids)\n",
"\n",
" # Assign global dof for each node\n",
" pdim = 1\n",
" ngdofs = Dict{Int64, Array{Int64,1}}()\n",
" for nid in all_node_ids\n",
" ngdofs[nid] = collect(pdim:pdim+ndofs-1)\n",
" pdim += ndofs\n",
" end\n",
"\n",
" return ngdofs\n",
"end\n",
"\n",
"function solve!(elements, dofmap, neumann_bcs, dirichlet_bcs; ndofs=2, max_iterations=10)\n",
" \n",
" Logging.info(\"solve!: dofs per node: $ndofs\")\n",
" pdim = length(dofmap)*ndofs\n",
" Logging.debug(\"Problem size = $pdim\")\n",
"\n",
" # Initialize elements ready for solution\n",
" for el in elements\n",
" eldim, elnodes = size(el.coordinates)\n",
" el.attributes[\"displacement\"] = zeros(ndofs, elnodes)\n",
" el.attributes[\"displacement nodal force\"] = zeros(ndofs, elnodes)\n",
" el.attributes[\"displacement tangent stiffness\"] = zeros(ndofs*elnodes, ndofs*elnodes)\n",
" end\n",
"\n",
" # Assign global dofs for elements\n",
" gdofs = Dict{Int64, Array{Int64,1}}()\n",
" for el in elements\n",
" gdofs[el.id] = Int64[]\n",
" for nid in el.node_ids\n",
" for ndof in dofmap[nid]\n",
" push!(gdofs[el.id], ndof)\n",
" end\n",
" end\n",
" end\n",
"\n",
" ass = Assembly(Int64[], Int64[], Float64[], Int64[], Float64[], gdofs)\n",
"\n",
" for iter=1:max_iterations\n",
" Logging.debug(\"Starting iteration $iter\")\n",
" ass.I = []\n",
" ass.J = []\n",
" ass.A = []\n",
" ass.i = []\n",
" ass.b = []\n",
" \n",
" Logging.debug(\"Assembling\")\n",
" for el in elements\n",
" assemble_element!(ass, el)\n",
" println(\"Element stiffness matrix\")\n",
" dump(round(el.attributes[\"displacement tangent stiffness\"], 2))\n",
" end\n",
"\n",
" Logging.debug(\"Adding Dirichlet boundary conditions\")\n",
" # Dirichlet boundary conditions\n",
" i = 1\n",
" for bc in dirichlet_bcs\n",
" for (dof, val) in zip(bc.dofs, bc.values)\n",
" Logging.debug(\"dof $dof => $val\")\n",
" push!(ass.I, dof)\n",
" push!(ass.J, pdim+i)\n",
" push!(ass.A, 1)\n",
" push!(ass.I, pdim+i)\n",
" push!(ass.J, dof)\n",
" push!(ass.A, 1)\n",
" push!(ass.i, pdim+i)\n",
" push!(ass.b, 0)\n",
" i += 1\n",
" end\n",
" end\n",
" i -= 1\n",
" Logging.debug(\"Added $i Lagrange multipliers to model\")\n",
"\n",
" Logging.debug(\"Adding Neumann boundary conditions\")\n",
" F = zeros(pdim+i)\n",
" # Neumann boundary conditions\n",
" for bc in neumann_bcs\n",
" for (dof, val) in zip(bc.dofs, bc.values)\n",
" F[dof] += val\n",
" end\n",
" end\n",
"\n",
" Logging.debug(\"Solving system of equations. Total size = $(pdim+i)\")\n",
" # solution\n",
" K = sparse(ass.I, ass.J, ass.A)\n",
" R = full(sparsevec(ass.i, ass.b))\n",
" R = R - F\n",
" Logging.debug(dump(round(full(K), 1)))\n",
" #print_matrix(full(K))\n",
" Logging.debug(dump(round(R', 1)))\n",
"\n",
" du = K \\ -R\n",
"\n",
" solnorm = norm(du[1:pdim])\n",
" Logging.debug(\"Solution norm = $solnorm\")\n",
"\n",
" # update solution back to elements\n",
" for el in elements\n",
"\n",
" eldu = du[ass.gdofs[el.id]]\n",
" eldu = reshape(eldu, (ndofs, round(Int, length(eldu)/ndofs)))\n",
" el.attributes[\"displacement\"] += eldu\n",
" end\n",
" if solnorm < 1.0e-9\n",
" Logging.debug(\"Converged in $iter iterations.\")\n",
" break\n",
" end\n",
" end\n",
"\n",
"end\n",
"\n",
"ENV[\"COLUMNS\"] = 160\n",
"\n",
"facts(\"solve one element problem\") do\n",
" # Create model\n",
" Logging.debug(\"Creating nodes\")\n",
" node_ids = [1, 2, 3, 4]\n",
" coordinates = [10.0 0.0; 10.0 1.0; 0.0 1.0; 0.0 0.0]'\n",
" attributes = Dict(\"Young\" => 90, \"Poisson\" => 0.25)\n",
" Logging.debug(\"Creating elements\")\n",
" el = Element(1, node_ids, coordinates, attributes)\n",
" elements = [el]\n",
" dofmap = create_ldof2gdofmap(elements)\n",
" Logging.debug(dofmap)\n",
" # Boundary conditions\n",
" # here we want to create nodal force for third dof, that is, node id 2, second dof\n",
" bc1 = BC([dofmap[2][2]], [-2.0])\n",
" # dirichlet bc, set dx=dy=0 on support\n",
" bc2 = BC([dofmap[3][1], dofmap[3][2], dofmap[4][1], dofmap[4][2]], [0.0, 0.0, 0.0, 0.0])\n",
" solve!(elements, dofmap, [bc1], [bc2]; max_iterations=7)\n",
" disp = elements[1].attributes[\"displacement\"]\n",
" Logging.debug(\"Displacement of element = \\n$disp\")\n",
" @fact norm(disp) => roughly(3.1292483947150043)\n",
"end\n",
"\n",
"facts(\"solve two element problem\") do\n",
" # Create model\n",
" attributes = Dict(\"Young\" => 90, \"Poisson\" => 0.25)\n",
"\n",
" Logging.debug(\"Creating elements\")\n",
" nids1 = [1, 2, 5, 4]\n",
" coords1 = [0.0 0.0; 5.0 0.0; 5.0 1.0; 0.0 1.0]'\n",
" el1 = Element(1, nids1, coords1, attributes)\n",
" nids2 = [2, 3, 6, 5]\n",
" coords2 = [5.0 0.0; 10.0 0.0; 10.0 1.0; 5.0 1.0]'\n",
" el2 = Element(2, nids2, coords2, attributes)\n",
" elements = [el1, el2]\n",
"\n",
" dofmap = create_ldof2gdofmap(elements)\n",
" Logging.debug(dofmap)\n",
" # Boundary conditions\n",
" # here we want to create nodal force for third dof, that is, node id 2, second dof\n",
" bc1 = BC([dofmap[6][2]], [-2.0])\n",
" # dirichlet bc, set dx=dy=0 on support\n",
" bc2 = BC([dofmap[1][1], dofmap[1][2], dofmap[4][1], dofmap[4][2]], [0.0, 0.0, 0.0, 0.0])\n",
" solve!(elements, dofmap, [bc1], [bc2]; max_iterations=7)\n",
" disp = elements[2].attributes[\"displacement\"]\n",
" Logging.debug(\"Displacement of element = \\n$disp\")\n",
" #@fact norm(disp) => roughly(3.1292483947150043)\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Top-down design\n",
"\n",
"Next we see this problem from \"other direction\", by parsing ABAQUS .inp file and making 3d simulation."
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"1x1 sparse matrix with 1 Float64 entries:\n",
"\t[1, 1] = 2.0"
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sparse([1, 1], [1, 1], [1.0, 1.0])"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 20:59:55:INFO:root:Registered handlers: Any[\"ELEMENT\",\"NODE\",\"NSET\"]\n",
"10-Aug 20:59:55:DEBUG:root:Found NODE section\n",
"10-Aug 20:59:56:DEBUG:root:Found ELEMENT section\n",
"10-Aug 20:59:57:DEBUG:root:120 elements found\n",
"10-Aug 20:59:57:INFO:root:Creating ELSET Body1\n",
"10-Aug 20:59:57:DEBUG:root:Found NSET section\n",
"10-Aug 20:59:57:DEBUG:root:Creating node set SUPPORT\n",
"10-Aug 20:59:57:DEBUG:root:Found NSET section\n",
"10-Aug 20:59:57:DEBUG:root:Creating node set LOAD\n",
"10-Aug 20:59:57:DEBUG:root:Found NSET section\n",
"10-Aug 20:59:57:DEBUG:root:Creating node set TOP\n"
]
},
{
"data": {
"text/plain": [
"Dict{Any,Any} with 4 entries:\n",
" \"nodes\" => Dict{Any,Any}(288=>[97.5,7.5,10.0],11=>[92.5,2.5,5.0],134=>[45.…\n",
" \"elements\" => Dict{Any,Any}(68=>[71,144,149,198,51,150,57,43,50,214],2=>[204,…\n",
" \"elsets\" => Dict{Any,Any}(\"Body1\"=>[1,2,3,4,5,6,7,8,9,10 … 111,112,113,11…\n",
" \"nsets\" => Dict{Any,Any}(\"LOAD\"=>[82,84,87,179,197,246,249,256,257],\"SUPPO…"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using JuliaFEM.abaqus_reader\n",
"fid = open(\"../geometry/3d_beam/palkki.inp\")\n",
"model = JuliaFEM.abaqus_reader.parse_abaqus(fid)\n",
"close(fid)\n",
"model"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"solve 3d elasticity problem\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"10-Aug 21:16:13:DEBUG:root:Creating elements\n",
"10-Aug 21:16:13:INFO:root:dofs per node: 3\n",
"10-Aug 21:16:13:INFO:root:dofs per node: 3\n",
"10-Aug 21:16:13:DEBUG:root:Problem size = 894\n",
"10-Aug 21:16:13:DEBUG:root:Starting iteration 1\n",
"10-Aug 21:16:13:DEBUG:root:Assembling\n",
"10-Aug 21:16:15:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 21:16:15:DEBUG:root:Added 27 Lagrange multipliers to model\n",
"10-Aug 21:16:15:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 21:16:15:DEBUG:root:Solving system of equations. Total size = 921\n",
"10-Aug 21:16:15:DEBUG:root:Solution norm = 0.2429242363684311\n",
"10-Aug 21:16:15:DEBUG:root:Starting iteration 2\n",
"10-Aug 21:16:15:DEBUG:root:Assembling\n",
"10-Aug 21:16:16:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 21:16:16:DEBUG:root:Added 27 Lagrange multipliers to model\n",
"10-Aug 21:16:16:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 21:16:16:DEBUG:root:Solving system of equations. Total size = 921\n",
"10-Aug 21:16:16:DEBUG:root:Solution norm = 0.220339941648292\n",
"10-Aug 21:16:16:DEBUG:root:Starting iteration 3\n",
"10-Aug 21:16:16:DEBUG:root:Assembling\n",
"10-Aug 21:16:17:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 21:16:17:DEBUG:root:Added 27 Lagrange multipliers to model\n",
"10-Aug 21:16:17:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 21:16:17:DEBUG:root:Solving system of equations. Total size = 921\n",
"10-Aug 21:16:18:DEBUG:root:Solution norm = 31.956186974599095\n",
"10-Aug 21:16:18:DEBUG:root:Starting iteration 4\n",
"10-Aug 21:16:18:DEBUG:root:Assembling\n",
"10-Aug 21:16:19:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 21:16:19:DEBUG:root:Added 27 Lagrange multipliers to model\n",
"10-Aug 21:16:19:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 21:16:19:DEBUG:root:Solving system of equations. Total size = 921\n",
"10-Aug 21:16:19:DEBUG:root:Solution norm = 411.4719431105651\n",
"10-Aug 21:16:19:DEBUG:root:Starting iteration 5\n",
"10-Aug 21:16:19:DEBUG:root:Assembling\n",
"10-Aug 21:16:21:DEBUG:root:Adding Dirichlet boundary conditions\n",
"10-Aug 21:16:21:DEBUG:root:Added 27 Lagrange multipliers to model\n",
"10-Aug 21:16:21:DEBUG:root:Adding Neumann boundary conditions\n",
"10-Aug 21:16:21:DEBUG:root:Solving system of equations. Total size = 921\n",
"10-Aug 21:16:21:DEBUG:root:Solution norm = 7077.644216187514\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"0 facts verified.\n"
]
},
{
"data": {
"text/plain": [
"delayed_handler (generic function with 4 methods)"
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"facts(\"solve 3d elasticity problem\") do\n",
"\n",
" attributes = Dict(\"Young\" => 90, \"Poisson\" => 0.25)\n",
"\n",
" Logging.debug(\"Creating elements\")\n",
" elements = Element[]\n",
" coordinates = zeros(3, 10)\n",
" for (elid, node_ids) in model[\"elements\"]\n",
" for (i, nid) in enumerate(node_ids)\n",
" coordinates[:,i] = model[\"nodes\"][nid]\n",
" end\n",
" el = Element(elid, node_ids, coordinates, attributes)\n",
" push!(elements, el)\n",
" end\n",
"\n",
" # create \"dofmap\" so that we know how to assemble global stiffness matrix\n",
" dofmap = create_ldof2gdofmap(elements; ndofs=3)\n",
"\n",
" # Boundary conditions\n",
"\n",
" # dirichlet bc, set dx=dy=dz for all nodes in set SUPPORT\n",
" bc_support = BC(Int64[], Float64[])\n",
" for nid in model[\"nsets\"][\"SUPPORT\"]\n",
" for i=1:3\n",
" push!(bc_support.dofs, dofmap[nid][i])\n",
" push!(bc_support.values, 0.0)\n",
" end\n",
" end\n",
"\n",
" # force boundary condition, put -1 to 2nd dof for each node in set LOAD\n",
" bc_load = BC(Int64[], Float64[])\n",
" for nid in model[\"nsets\"][\"LOAD\"]\n",
" push!(bc_load.dofs, dofmap[nid][2])\n",
" push!(bc_load.values, -0.1)\n",
" end\n",
"\n",
" #solve!(elements, [bc1], [bc2]; max_iterations=7)\n",
" neumann_bcs = [bc_load]\n",
" dirichlet_bcs = [bc_support]\n",
" # ndofs = dimension of unknown field in nodes\n",
" solve!(elements, dofmap, neumann_bcs, dirichlet_bcs; ndofs=3, max_iterations=5)\n",
"# disp = elements[1].attributes[\"displacement\"]\n",
"# Logging.debug(\"Displacement of element = \\n$disp\")\n",
"# @fact norm(disp) => roughly(3.1292483947150043)\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<Xdmf xmlns:xi=\"http://www.w3.org/2001/XInclude\" Version=\"2.1\">\n",
" <Domain>\n",
" <Grid CollectionType=\"Temporal\" GridType=\"Collection\" Name=\"Collection\">\n",
" <Geometry Type=\"None\"/>\n",
" <Topology Dimensions=\"0\" Type=\"NoTopology\"/>\n",
" <Grid Name=\"Grid\">\n",
" <Time Value=\"0\"/>\n",
" <Geometry Type=\"XYZ\">\n",
" <DataItem DataType=\"Float\" Dimensions=\"12\" Format=\"XML\" Precision=\"4\">0.0 0.0 0.0 10.0 0.0 0.0 10.0 1.0 0.0 0.0 1.0 0.0</DataItem>\n",
" </Geometry>\n",
" <Topology Dimensions=\"1\" Type=\"Mixed\">\n",
" <DataItem DataType=\"Int\" Dimensions=\"5\" Format=\"XML\" Precision=\"4\">5 0 1 2 3</DataItem>\n",
" </Topology>\n",
" <Attribute Center=\"Node\" Name=\"Displacement\" Type=\"Vector\">\n",
" <DataItem DataType=\"Float\" Dimensions=\"12\" Format=\"XML\" Precision=\"4\">0.0 0.0 0.0 -0.3991450609547433 -2.17798923170735 0.0 -0.07228582695592455 -2.222244754401764 0.0 0.0 0.0 0.0</DataItem>\n",
" </Attribute>\n",
" </Grid>\n",
" </Grid>\n",
" </Domain>\n",
"</Xdmf>\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: int(x) is deprecated, use Int(x) instead.\n"
]
},
{
"data": {
"text/plain": [
"1015"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" in depwarn at /Applications/Julia-0.4.0-dev-539c818c4e.app/Contents/Resources/julia/lib/julia/sys.dylib\n",
" in int at deprecated.jl:49\n",
" in save_file at /Users/jukka/.julia/v0.4/LightXML/src/document.jl:108\n",
" in xdmf_save_model at /Users/jukka/.julia/v0.4/JuliaFEM/src/xdmf.jl:106\n",
" in include_string at loading.jl:99\n",
" in execute_request_0x535c5df2 at /Users/jukka/.julia/v0.4/IJulia/src/execute_request.jl:157\n",
" in eventloop at /Users/jukka/.julia/v0.4/IJulia/src/IJulia.jl:123\n",
" in anonymous at task.jl:365\n",
"while loading In[4], in expression starting on line 7\n"
]
}
],
"source": [
"xdoc, model = JuliaFEM.xdmf.xdmf_new_model()\n",
"temporal_collection = JuliaFEM.xdmf.xdmf_new_temporal_collection(model)\n",
"grid = JuliaFEM.xdmf.xdmf_new_grid(temporal_collection; time=0)\n",
"JuliaFEM.xdmf.xdmf_new_mesh(grid, X3d, elmap2)\n",
"JuliaFEM.xdmf.xdmf_new_field(grid, \"Displacement\", \"nodes\", u3d)\n",
"print(xdoc)\n",
"JuliaFEM.xdmf.xdmf_save_model(xdoc, \"/tmp/foo.xmf\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## 3d beam with quadratic elements"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"10x120 Array{Int64,2}:\n",
" 243 204 259 145 96 96 236 285 … 217 69 154 179 203 96 259\n",
" 240 199 70 175 88 101 88 179 216 144 114 91 204 267 199\n",
" 191 175 69 199 236 164 285 178 278 78 278 178 259 95 204\n",
" 117 130 130 130 178 97 178 83 155 71 218 83 199 97 130\n",
" 245 207 265 177 141 102 290 12 219 146 20 181 206 268 39\n",
" 242 208 72 208 290 171 289 182 … 282 152 280 180 263 272 207\n",
" 244 209 5 202 291 9 287 11 33 79 32 182 262 98 263\n",
" 1 3 6 174 7 99 237 13 224 74 223 14 205 99 6\n",
" 2 4 132 176 8 103 8 14 225 51 284 93 207 24 4\n",
" 196 176 134 4 237 10 11 15 17 80 283 15 39 100 3"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nnodes = length(model[\"nodes\"])\n",
"nelements = length(model[\"elements\"])\n",
"dim = 3\n",
"E = 90\n",
"nu = 0.25\n",
"mu = E/(2*(1+nu))\n",
"la = E*nu/((1+nu)*(1-2*nu))\n",
"\n",
"X = zeros(dim, nnodes)\n",
"u = zeros(dim, nnodes)\n",
"du = zeros(dim, nnodes)\n",
"elmap = zeros(Int, 10, nelements)\n",
"nodalloads = zeros(3, nnodes)\n",
"dirichletbc = NaN*ones(3, nnodes)\n",
"la = la*ones(1, nnodes)\n",
"mu = mu*ones(1, nnodes)\n",
"\n",
"# calculate permutation which maps node ids to matrix indices\n",
"perm = Dict()\n",
"for (j, k) in enumerate(keys(model[\"nodes\"]))\n",
" perm[k] = j\n",
"end\n",
"\n",
"for j=1:nnodes\n",
" #X[:,j] = model[\"nodes\"][perm[j]]\n",
" X[:,j] = model[\"nodes\"][j]\n",
"end\n",
"\n",
"for (j, k) in enumerate(keys(model[\"elements\"]))\n",
" #node_ids = model[\"elements\"][j]\n",
" elmap[:,j] = model[\"elements\"][j]\n",
" #for l=1:10\n",
" # elmap[l, j] = perm[node_ids[l]]\n",
" #end\n",
"end\n",
"\n",
"elmap"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"3x298 Array{Float64,2}:\n",
" NaN NaN NaN NaN NaN NaN NaN NaN … NaN NaN NaN NaN NaN NaN NaN\n",
" NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN\n",
" NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Handle dirichlet boundaries on SUPPORT\n",
"for j in model[\"nsets\"][\"SUPPORT\"]\n",
" #dirichletbc[perm[j]] = 0.0\n",
" dirichletbc[j] = 0.0\n",
"end\n",
"dirichletbc"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Shape functions and integration points"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add point force to LOAD nodeset"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"9-element Array{Int64,1}:\n",
" 82\n",
" 84\n",
" 87\n",
" 179\n",
" 197\n",
" 246\n",
" 249\n",
" 256\n",
" 257"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"model[\"nsets\"][\"LOAD\"]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[100.0,10.0,0.0]\n"
]
}
],
"source": [
"#nodalloads[3, perm[82]] = -0.06\n",
"nodalloads[3, 82] = -50.0\n",
"println(model[\"nodes\"][82])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"iteration 1, norm = 93.13879357262775\n",
"iteration 2, norm = 14.241640589907869\n",
"iteration 3, norm = 2.3999534862146534\n",
"iteration 4, norm = 0.8191634532858331\n",
"iteration 5, norm = 0.08574651168344295\n",
"iteration 6, norm = 0.00032306479346201524\n",
"iteration 7, norm = 8.052462405199464e-9\n",
"iteration 8, norm = 3.0878906643174355e-14\n"
]
},
{
"data": {
"text/plain": [
"3x298 Array{Float64,2}:\n",
" -0.0479657 -0.0483971 -0.0497284 … -0.0155295 -0.0150513 -0.0462958\n",
" -0.474054 -0.418817 -0.254176 -0.229641 -0.283098 -0.694379 \n",
" 0.232677 0.198051 0.0948355 0.128246 0.162511 0.371043 "
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Converged\n"
]
}
],
"source": [
"u = zeros(dim, nnodes)\n",
"du = zeros(dim, nnodes)\n",
"\n",
"for i=1:10\n",
" JuliaFEM.elasticity_solver.solve_elasticity_increment!(X, u, du, elmap, nodalloads, dirichletbc,\n",
" la, mu, Ntet, dNtet, ipoints, iweights)\n",
" u += du\n",
" println(\"iteration $i, norm = $(norm(du))\")\n",
" if norm(du) < 1.0e-9\n",
" println(\"Converged\")\n",
" break\n",
" end\n",
"end\n",
"u"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"15.449170689704438"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"maximum(abs(u))"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(10,120)"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"size(elmap)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"120"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nelements"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"11x120 Array{Int64,2}:\n",
" 38 38 38 38 38 38 38 38 … 38 38 38 38 38 38 38\n",
" 243 204 259 145 96 96 236 285 217 69 154 179 203 96 259\n",
" 240 199 70 175 88 101 88 179 216 144 114 91 204 267 199\n",
" 191 175 69 199 236 164 285 178 278 78 278 178 259 95 204\n",
" 117 130 130 130 178 97 178 83 155 71 218 83 199 97 130\n",
" 245 207 265 177 141 102 290 12 … 219 146 20 181 206 268 39\n",
" 242 208 72 208 290 171 289 182 282 152 280 180 263 272 207\n",
" 244 209 5 202 291 9 287 11 33 79 32 182 262 98 263\n",
" 1 3 6 174 7 99 237 13 224 74 223 14 205 99 6\n",
" 2 4 132 176 8 103 8 14 225 51 284 93 207 24 4\n",
" 196 176 134 4 237 10 11 15 … 17 80 283 15 39 100 3"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"elcodes = 0x0026*ones(Int, nelements)\n",
"elmap2 = [elcodes'\n",
" elmap]"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: int(x) is deprecated, use Int(x) instead.\n"
]
},
{
"data": {
"text/plain": [
"9568"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" in depwarn at /Applications/Julia-0.4.0-dev-539c818c4e.app/Contents/Resources/julia/lib/julia/sys.dylib\n",
" in int at deprecated.jl:49\n",
" in save_file at /Users/jukka/.julia/v0.4/LightXML/src/document.jl:108\n",
" in xdmf_save_model at /Users/jukka/.julia/v0.4/JuliaFEM/src/xdmf.jl:140\n",
" in include_string at loading.jl:99\n",
" in execute_request_0x535c5df2 at /Users/jukka/.julia/v0.4/IJulia/src/execute_request.jl:157\n",
" in eventloop at /Users/jukka/.julia/v0.4/IJulia/src/IJulia.jl:123\n",
" in anonymous at task.jl:365\n",
"while loading In[17], in expression starting on line 7\n"
]
}
],
"source": [
"xdoc, xmodel = JuliaFEM.xdmf.xdmf_new_model()\n",
"temporal_collection = JuliaFEM.xdmf.xdmf_new_temporal_collection(xmodel)\n",
"grid = JuliaFEM.xdmf.xdmf_new_grid(temporal_collection; time=0)\n",
"JuliaFEM.xdmf.xdmf_new_mesh(grid, X, elmap2)\n",
"#JuliaFEM.xdmf.xdmf_new_field(grid, \"Displacement\", \"nodes\", u)\n",
"#print(xdoc)\n",
"JuliaFEM.xdmf.xdmf_save_model(xdoc, \"/tmp/foo3d2.xmf\")"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"10x2 Array{Int64,2}:\n",
" 243 145\n",
" 240 199\n",
" 191 69\n",
" 117 130\n",
" 245 202\n",
" 242 47\n",
" 244 148\n",
" 1 174\n",
" 2 4\n",
" 196 134"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"elmap[:,[1, 101]]"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"3x10 Array{Float64,2}:\n",
" 20.0 30.0 20.0 20.0 25.0 25.0 20.0 20.0 25.0 20.0\n",
" 0.0 0.0 0.0 10.0 0.0 0.0 0.0 5.0 5.0 5.0\n",
" 10.0 10.0 0.0 0.0 10.0 5.0 5.0 5.0 5.0 0.0"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"tmp = elmap[:,[1]]\n",
"tmp = reshape(tmp, length(tmp))\n",
"X[:, tmp]"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"11x1 Array{Int64,2}:\n",
" 38\n",
" 1\n",
" 2\n",
" 3\n",
" 4\n",
" 5\n",
" 6\n",
" 7\n",
" 8\n",
" 9\n",
" 10"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#tmpelmap = [38 1 2 3 4 5 6 7 8 9 10; 38 11 12 13 14 15 16 17 18 19 20]'\n",
"tmpelmap = [38 1 2 3 4 5 6 7 8 9 10]'"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<Xdmf xmlns:xi=\"http://www.w3.org/2001/XInclude\" Version=\"2.1\">\n",
" <Domain>\n",
" <Grid CollectionType=\"Temporal\" GridType=\"Collection\" Name=\"Collection\">\n",
" <Geometry Type=\"None\"/>\n",
" <Topology Dimensions=\"0\" Type=\"NoTopology\"/>\n",
" <Grid Name=\"Grid\">\n",
" <Time Value=\"0\"/>\n",
" <Geometry Type=\"XYZ\">\n",
" <DataItem DataType=\"Float\" Dimensions=\"298 3\" Format=\"XML\" Precision=\"8\">\n",
"\t\t20.0 5.0 5.0\n",
"\t\t25.0 5.0 5.0\n",
"\t\t40.0 5.0 5.0\n",
"\t\t42.5 5.0 2.5\n",
"\t\t47.5 7.5 5.0\n",
"\t\t42.5 7.5 5.0\n",
"\t\t85.0 5.0 5.0\n",
"\t\t90.0 5.0 5.0\n",
"\t\t80.0 5.0 5.0\n",
"\t\t77.5 5.0 2.5\n",
"\t\t92.5 2.5 5.0\n",
"\t\t97.5 2.5 5.0\n",
"\t\t95.0 7.5 7.5\n",
"\t\t97.5 5.0 2.5\n",
"\t\t92.5 5.0 2.5\n",
"\t\t97.5 7.5 5.0\n",
"\t\t2.5 2.5 5.0\n",
"\t\t5.0 2.5 2.5\n",
"\t\t35.0 5.0 5.0\n",
"\t\t10.0 5.0 5.0\n",
"\t\t15.0 5.0 5.0\n",
"\t\t55.0 2.5 7.5\n",
"\t\t77.5 5.0 7.5\n",
"\t\t75.0 7.5 7.5\n",
"\t\t75.0 2.5 7.5\n",
"\t\t75.0 5.0 5.0\n",
"\t\t75.0 2.5 2.5\n",
"\t\t75.0 7.5 2.5\n",
"\t\t2.5 7.5 5.0\n",
"\t\t7.5 7.5 5.0\n",
"\t\t5.0 5.0 5.0\n",
"\t\t7.5 2.5 5.0\n",
"\t\t5.0 2.5 7.5\n",
"\t\t30.0 5.0 5.0\n",
"\t\t50.36999 4.749 5.47225\n",
"\t\t50.18499 2.3745 7.73613\n",
"\t\t47.68499 4.8745 7.73613\n",
"\t\t52.68499 4.8745 7.73613\n",
"\t\t45.0 2.5 7.5\n",
"\t\t47.68499 2.3745 5.23613\n",
"\t\t52.68499 2.3745 5.23613\n",
"\t\t55.0 7.5 7.5\n",
"\t\t55.0 5.0 5.0\n",
"\t\t52.68499 7.3745 5.23613\n",
"\t\t50.18499 7.3745 7.73613\n",
"\t\t50.18499 7.3745 2.73613\n",
"\t\t47.5 5.0 2.5\n",
"\t\t50.18499 2.3745 2.73613\n",
"\t\t52.68499 4.8745 2.73613\n",
"\t\t55.0 2.5 2.5\n",
"\t\t55.0 7.5 2.5\n",
"\t\t65.13577 4.94114 4.99547\n",
"\t\t62.56788 2.47057 7.49773\n",
"\t\t62.56788 2.47057 2.49773\n",
"\t\t60.06788 2.47057 4.99773\n",
"\t\t60.06788 7.47057 4.99773\n",
"\t\t57.5 5.0 2.5\n",
"\t\t57.5 5.0 7.5\n",
"\t\t62.56788 7.47057 7.49773\n",
"\t\t67.56788 7.47057 7.49773\n",
"\t\t67.56788 2.47057 7.49773\n",
"\t\t67.56788 2.47057 2.49773\n",
"\t\t70.06788 2.47057 4.99773\n",
"\t\t70.06788 7.47057 4.99773\n",
"\t\t72.5 5.0 7.5\n",
"\t\t70.06788 4.97057 2.49773\n",
"\t\t67.56788 7.47057 2.49773\n",
"\t\t62.56788 7.47057 2.49773\n",
"\t\t50.0 10.0 0.0\n",
"\t\t50.0 10.0 10.0\n",
"\t\t55.0 10.0 5.0\n",
"\t\t50.0 10.0 5.0\n",
"\t\t52.5 10.0 7.5\n",
"\t\t52.5 10.0 2.5\n",
"\t\t60.0 10.0 10.0\n",
"\t\t55.0 10.0 10.0\n",
"\t\t57.5 10.0 7.5\n",
"\t\t60.0 10.0 0.0\n",
"\t\t55.0 10.0 0.0\n",
"\t\t57.5 10.0 2.5\n",
"\t\t60.0 10.0 5.0\n",
"\t\t100.0 10.0 0.0\n",
"\t\t95.0 10.0 5.0\n",
"\t\t100.0 10.0 10.0\n",
"\t\t97.5 10.0 2.5\n",
"\t\t97.5 10.0 7.5\n",
"\t\t100.0 10.0 5.0\n",
"\t\t90.0 10.0 10.0\n",
"\t\t92.5 10.0 7.5\n",
"\t\t95.0 10.0 10.0\n",
"\t\t90.0 10.0 0.0\n",
"\t\t95.0 10.0 0.0\n",
"\t\t92.5 10.0 2.5\n",
"\t\t90.0 10.0 5.0\n",
"\t\t70.0 10.0 10.0\n",
"\t\t80.0 10.0 10.0\n",
"\t\t75.0 10.0 5.0\n",
"\t\t75.0 10.0 10.0\n",
"\t\t77.5 10.0 7.5\n",
"\t\t72.5 10.0 7.5\n",
"\t\t80.0 10.0 0.0\n",
"\t\t80.0 10.0 5.0\n",
"\t\t77.5 10.0 2.5\n",
"\t\t70.0 10.0 0.0\n",
"\t\t72.5 10.0 2.5\n",
"\t\t70.0 10.0 5.0\n",
"\t\t75.0 10.0 0.0\n",
"\t\t0.0 10.0 0.0\n",
"\t\t0.0 10.0 10.0\n",
"\t\t10.0 10.0 0.0\n",
"\t\t0.0 10.0 5.0\n",
"\t\t5.0 10.0 5.0\n",
"\t\t5.0 10.0 0.0\n",
"\t\t10.0 10.0 10.0\n",
"\t\t10.0 10.0 5.0\n",
"\t\t5.0 10.0 10.0\n",
"\t\t20.0 10.0 0.0\n",
"\t\t20.0 10.0 10.0\n",
"\t\t30.0 10.0 0.0\n",
"\t\t20.0 10.0 5.0\n",
"\t\t25.0 10.0 5.0\n",
"\t\t25.0 10.0 0.0\n",
"\t\t30.0 10.0 10.0\n",
"\t\t30.0 10.0 5.0\n",
"\t\t25.0 10.0 10.0\n",
"\t\t65.0 10.0 0.0\n",
"\t\t65.0 10.0 5.0\n",
"\t\t65.0 10.0 10.0\n",
"\t\t40.0 10.0 10.0\n",
"\t\t40.0 10.0 0.0\n",
"\t\t45.0 10.0 10.0\n",
"\t\t45.0 10.0 5.0\n",
"\t\t40.0 10.0 5.0\n",
"\t\t45.0 10.0 0.0\n",
"\t\t15.0 10.0 5.0\n",
"\t\t15.0 10.0 0.0\n",
"\t\t35.0 10.0 0.0\n",
"\t\t35.0 10.0 5.0\n",
"\t\t85.0 10.0 5.0\n",
"\t\t85.0 10.0 0.0\n",
"\t\t85.0 10.0 10.0\n",
"\t\t35.0 10.0 10.0\n",
"\t\t15.0 10.0 10.0\n",
"\t\t55.0 5.0 0.0\n",
"\t\t50.0 0.0 0.0\n",
"\t\t52.5 7.5 0.0\n",
"\t\t52.5 2.5 0.0\n",
"\t\t50.0 5.0 0.0\n",
"\t\t60.0 0.0 0.0\n",
"\t\t57.5 2.5 0.0\n",
"\t\t55.0 0.0 0.0\n",
"\t\t57.5 7.5 0.0\n",
"\t\t60.0 5.0 0.0\n",
"\t\t10.0 0.0 0.0\n",
"\t\t0.0 0.0 0.0\n",
"\t\t5.0 5.0 0.0\n",
"\t\t5.0 0.0 0.0\n",
"\t\t2.5 2.5 0.0\n",
"\t\t7.5 2.5 0.0\n",
"\t\t7.5 7.5 0.0\n",
"\t\t10.0 5.0 0.0\n",
"\t\t0.0 5.0 0.0\n",
"\t\t2.5 7.5 0.0\n",
"\t\t80.0 0.0 0.0\n",
"\t\t70.0 0.0 0.0\n",
"\t\t75.0 5.0 0.0\n",
"\t\t75.0 0.0 0.0\n",
"\t\t72.5 2.5 0.0\n",
"\t\t77.5 2.5 0.0\n",
"\t\t77.5 7.5 0.0\n",
"\t\t80.0 5.0 0.0\n",
"\t\t70.0 5.0 0.0\n",
"\t\t72.5 7.5 0.0\n",
"\t\t45.0 5.0 0.0\n",
"\t\t40.0 0.0 0.0\n",
"\t\t40.0 5.0 0.0\n",
"\t\t45.0 0.0 0.0\n",
"\t\t90.0 0.0 0.0\n",
"\t\t100.0 0.0 0.0\n",
"\t\t90.0 5.0 0.0\n",
"\t\t95.0 5.0 0.0\n",
"\t\t95.0 0.0 0.0\n",
"\t\t85.0 0.0 0.0\n",
"\t\t85.0 5.0 0.0\n",
"\t\t65.0 5.0 0.0\n",
"\t\t65.0 0.0 0.0\n",
"\t\t30.0 0.0 0.0\n",
"\t\t30.0 5.0 0.0\n",
"\t\t35.0 5.0 0.0\n",
"\t\t35.0 0.0 0.0\n",
"\t\t20.0 0.0 0.0\n",
"\t\t25.0 0.0 0.0\n",
"\t\t25.0 5.0 0.0\n",
"\t\t15.0 0.0 0.0\n",
"\t\t15.0 5.0 0.0\n",
"\t\t20.0 5.0 0.0\n",
"\t\t100.0 5.0 0.0\n",
"\t\t55.0 0.0 5.0\n",
"\t\t45.0 0.0 5.0\n",
"\t\t52.5 0.0 2.5\n",
"\t\t50.0 0.0 5.0\n",
"\t\t47.5 0.0 2.5\n",
"\t\t50.0 0.0 10.0\n",
"\t\t40.0 0.0 10.0\n",
"\t\t47.5 0.0 7.5\n",
"\t\t45.0 0.0 10.0\n",
"\t\t42.5 0.0 7.5\n",
"\t\t42.5 0.0 2.5\n",
"\t\t40.0 0.0 5.0\n",
"\t\t52.5 0.0 7.5\n",
"\t\t60.0 0.0 10.0\n",
"\t\t57.5 0.0 7.5\n",
"\t\t55.0 0.0 10.0\n",
"\t\t57.5 0.0 2.5\n",
"\t\t60.0 0.0 5.0\n",
"\t\t0.0 0.0 10.0\n",
"\t\t5.0 0.0 5.0\n",
"\t\t10.0 0.0 10.0\n",
"\t\t2.5 0.0 7.5\n",
"\t\t7.5 0.0 7.5\n",
"\t\t5.0 0.0 10.0\n",
"\t\t7.5 0.0 2.5\n",
"\t\t10.0 0.0 5.0\n",
"\t\t2.5 0.0 2.5\n",
"\t\t0.0 0.0 5.0\n",
"\t\t75.0 0.0 5.0\n",
"\t\t77.5 0.0 2.5\n",
"\t\t72.5 0.0 2.5\n",
"\t\t70.0 0.0 10.0\n",
"\t\t72.5 0.0 7.5\n",
"\t\t70.0 0.0 5.0\n",
"\t\t80.0 0.0 10.0\n",
"\t\t80.0 0.0 5.0\n",
"\t\t77.5 0.0 7.5\n",
"\t\t75.0 0.0 10.0\n",
"\t\t90.0 0.0 10.0\n",
"\t\t90.0 0.0 5.0\n",
"\t\t85.0 0.0 5.0\n",
"\t\t85.0 0.0 10.0\n",
"\t\t30.0 0.0 10.0\n",
"\t\t30.0 0.0 5.0\n",
"\t\t25.0 0.0 5.0\n",
"\t\t20.0 0.0 10.0\n",
"\t\t20.0 0.0 5.0\n",
"\t\t25.0 0.0 10.0\n",
"\t\t100.0 0.0 10.0\n",
"\t\t95.0 0.0 5.0\n",
"\t\t95.0 0.0 10.0\n",
"\t\t100.0 0.0 5.0\n",
"\t\t65.0 0.0 5.0\n",
"\t\t35.0 0.0 5.0\n",
"\t\t15.0 0.0 5.0\n",
"\t\t15.0 0.0 10.0\n",
"\t\t35.0 0.0 10.0\n",
"\t\t65.0 0.0 10.0\n",
"\t\t100.0 5.0 5.0\n",
"\t\t100.0 5.0 10.0\n",
"\t\t55.0 5.0 10.0\n",
"\t\t45.0 5.0 10.0\n",
"\t\t52.5 2.5 10.0\n",
"\t\t50.0 5.0 10.0\n",
"\t\t47.5 2.5 10.0\n",
"\t\t42.5 2.5 10.0\n",
"\t\t42.5 7.5 10.0\n",
"\t\t47.5 7.5 10.0\n",
"\t\t40.0 5.0 10.0\n",
"\t\t75.0 5.0 10.0\n",
"\t\t77.5 7.5 10.0\n",
"\t\t77.5 2.5 10.0\n",
"\t\t80.0 5.0 10.0\n",
"\t\t72.5 2.5 10.0\n",
"\t\t72.5 7.5 10.0\n",
"\t\t70.0 5.0 10.0\n",
"\t\t52.5 7.5 10.0\n",
"\t\t57.5 7.5 10.0\n",
"\t\t57.5 2.5 10.0\n",
"\t\t60.0 5.0 10.0\n",
"\t\t5.0 5.0 10.0\n",
"\t\t2.5 7.5 10.0\n",
"\t\t7.5 7.5 10.0\n",
"\t\t0.0 5.0 10.0\n",
"\t\t2.5 2.5 10.0\n",
"\t\t7.5 2.5 10.0\n",
"\t\t10.0 5.0 10.0\n",
"\t\t95.0 5.0 10.0\n",
"\t\t97.5 2.5 10.0\n",
"\t\t92.5 2.5 10.0\n",
"\t\t97.5 7.5 10.0\n",
"\t\t92.5 7.5 10.0\n",
"\t\t90.0 5.0 10.0\n",
"\t\t85.0 5.0 10.0\n",
"\t\t65.0 5.0 10.0\n",
"\t\t15.0 5.0 10.0\n",
"\t\t25.0 5.0 10.0\n",
"\t\t20.0 5.0 10.0\n",
"\t\t35.0 5.0 10.0\n",
"\t\t30.0 5.0 10.0\n",
"\t\t0.0 5.0 5.0\n",
" </DataItem>\n",
" </Geometry>\n",
" <Topology TopologyType=\"Mixed\" NumberOfElements=\"120\">\n",
" <DataItem DataType=\"Int\" Dimensions=\"120 11\" Format=\"XML\" Precision=\"8\">\n",
"\t\t38 242 239 190 116 244 241 243 0 1 195\n",
"\t\t38 203 198 174 129 206 207 208 2 3 175\n",
"\t\t38 258 69 68 129 264 71 4 5 131 133\n",
"\t\t38 144 174 198 129 176 207 201 173 175 3\n",
"\t\t38 95 87 235 177 140 289 290 6 7 236\n",
"\t\t38 95 100 163 96 101 170 8 98 102 9\n",
"\t\t38 235 87 284 177 289 288 286 236 7 10\n",
"\t\t38 284 178 177 82 11 181 10 12 13 14\n",
"\t\t38 83 245 284 81 256 285 287 86 255 15\n",
"\t\t38 154 215 277 108 224 281 16 297 280 278\n",
"\t\t38 154 216 153 155 223 221 156 157 17 158\n",
"\t\t38 203 174 239 129 208 250 253 2 175 18\n",
"\t\t38 113 217 153 116 283 222 19 134 20 194\n",
"\t\t38 202 257 210 197 259 275 212 209 21 211\n",
"\t\t38 95 163 100 90 8 170 101 138 183 139\n",
"\t\t38 231 95 163 225 269 8 232 233 22 226\n",
"\t\t38 96 266 225 95 23 24 25 98 267 22\n",
"\t\t38 163 165 225 96 168 26 226 9 27 25\n",
"\t\t38 178 81 90 82 196 91 180 13 84 92\n",
"\t\t38 235 284 245 177 286 285 247 236 10 246\n",
"\t\t38 87 177 90 82 7 179 93 88 14 92\n",
"\t\t38 266 231 228 225 268 234 270 24 233 229\n",
"\t\t38 107 108 155 109 110 28 162 112 111 159\n",
"\t\t38 113 153 109 116 19 160 114 134 194 135\n",
"\t\t38 155 113 277 153 29 279 30 158 19 31\n",
"\t\t38 277 153 216 155 31 221 32 30 158 17\n",
"\t\t38 107 108 154 155 110 297 161 162 28 157\n",
"\t\t38 113 153 155 109 19 158 29 114 160 159\n",
"\t\t38 108 113 277 155 115 279 278 28 29 30\n",
"\t\t38 277 154 155 216 16 157 30 32 223 17\n",
"\t\t38 108 154 155 277 297 157 28 278 16 30\n",
"\t\t38 163 100 165 96 170 169 168 9 102 27\n",
"\t\t38 108 113 155 109 115 29 28 111 114 159\n",
"\t\t38 164 225 163 165 227 226 166 167 26 168\n",
"\t\t38 284 81 82 83 15 84 12 287 86 85\n",
"\t\t38 203 239 128 129 253 295 265 2 18 132\n",
"\t\t38 258 128 69 129 263 130 264 5 132 131\n",
"\t\t38 239 117 122 118 293 124 296 33 120 123\n",
"\t\t38 239 174 186 118 250 189 240 33 188 187\n",
"\t\t38 239 118 190 116 33 192 241 1 121 195\n",
"\t\t38 239 117 118 116 293 120 33 1 119 121\n",
"\t\t38 242 190 153 116 243 193 251 0 195 194\n",
"\t\t38 113 117 242 116 142 294 292 134 119 0\n",
"\t\t38 217 242 153 116 252 251 222 20 0 194\n",
"\t\t38 128 239 122 118 295 296 141 137 33 123\n",
"\t\t38 239 186 190 118 240 191 241 33 187 192\n",
"\t\t38 113 242 217 116 292 252 283 134 0 20\n",
"\t\t38 202 258 257 34 261 260 259 35 36 37\n",
"\t\t38 202 198 258 34 204 38 261 35 39 36\n",
"\t\t38 202 197 198 34 209 200 204 35 40 39\n",
"\t\t38 202 257 197 34 259 21 209 35 37 40\n",
"\t\t38 257 70 197 34 41 42 21 37 43 40\n",
"\t\t38 257 69 70 34 273 72 41 37 44 43\n",
"\t\t38 69 68 70 34 71 73 72 44 45 43\n",
"\t\t38 258 68 69 34 4 71 264 36 45 44\n",
"\t\t38 257 258 69 34 260 264 273 37 36 44\n",
"\t\t38 258 68 198 129 4 46 38 5 133 3\n",
"\t\t38 34 258 68 198 36 4 45 39 38 46\n",
"\t\t38 178 81 82 284 196 84 13 11 15 12\n",
"\t\t38 144 68 198 34 147 46 201 47 45 39\n",
"\t\t38 144 143 68 34 146 145 147 47 48 45\n",
"\t\t38 144 197 143 34 199 49 146 47 40 48\n",
"\t\t38 144 198 197 34 201 200 199 47 39 40\n",
"\t\t38 197 70 143 34 42 50 49 40 43 48\n",
"\t\t38 68 143 70 34 145 50 73 45 48 43\n",
"\t\t38 210 148 197 51 214 213 211 52 53 54\n",
"\t\t38 197 70 51 148 42 55 54 213 56 53\n",
"\t\t38 70 143 148 197 50 149 56 42 49 213\n",
"\t\t38 197 257 74 70 21 274 57 42 41 76\n",
"\t\t38 210 257 74 197 275 274 276 211 21 57\n",
"\t\t38 74 197 51 210 57 54 58 276 211 52\n",
"\t\t38 94 210 74 51 291 276 127 59 52 58\n",
"\t\t38 228 210 94 51 254 291 272 60 52 59\n",
"\t\t38 228 164 210 51 230 249 254 60 61 52\n",
"\t\t38 228 225 164 51 229 227 230 60 62 61\n",
"\t\t38 225 96 51 228 25 63 62 229 64 60\n",
"\t\t38 96 266 228 225 23 270 64 25 24 229\n",
"\t\t38 225 96 165 51 25 27 26 62 63 65\n",
"\t\t38 164 225 165 51 227 26 167 61 62 65\n",
"\t\t38 164 165 103 51 167 172 171 61 65 66\n",
"\t\t38 164 103 77 51 171 125 184 61 66 67\n",
"\t\t38 148 164 77 51 185 184 152 53 61 67\n",
"\t\t38 210 164 148 51 249 185 214 52 61 53\n",
"\t\t38 148 70 51 77 56 55 53 152 79 67\n",
"\t\t38 77 143 148 70 151 149 152 79 50 56\n",
"\t\t38 74 70 77 51 76 79 80 58 55 67\n",
"\t\t38 70 197 51 74 42 54 55 76 57 58\n",
"\t\t38 94 74 77 51 127 80 126 59 58 67\n",
"\t\t38 94 77 103 51 126 125 105 59 67 66\n",
"\t\t38 94 103 96 51 105 104 99 59 66 63\n",
"\t\t38 165 96 103 51 27 104 172 65 63 66\n",
"\t\t38 94 266 228 96 271 270 272 99 23 64\n",
"\t\t38 228 96 51 94 64 63 60 272 99 59\n",
"\t\t38 258 203 128 129 262 265 263 5 2 132\n",
"\t\t38 239 129 174 118 18 175 250 33 136 188\n",
"\t\t38 128 129 239 118 132 18 295 137 136 33\n",
"\t\t38 284 177 87 82 10 7 288 12 14 88\n",
"\t\t38 217 153 216 277 222 221 219 282 31 32\n",
"\t\t38 225 95 163 96 22 8 226 25 98 9\n",
"\t\t38 95 87 177 90 140 7 6 138 93 179\n",
"\t\t38 144 198 68 129 201 46 147 173 3 133\n",
"\t\t38 95 235 163 177 290 237 8 6 236 182\n",
"\t\t38 95 177 163 90 6 182 8 138 179 183\n",
"\t\t38 245 284 178 177 285 11 248 246 10 181\n",
"\t\t38 165 100 103 96 169 106 172 27 102 104\n",
"\t\t38 284 87 83 82 288 89 287 12 88 85\n",
"\t\t38 144 197 148 143 199 213 150 146 49 149\n",
"\t\t38 81 245 284 178 255 285 15 196 248 11\n",
"\t\t38 257 69 74 70 273 75 274 41 72 76\n",
"\t\t38 95 266 225 231 267 24 22 269 268 233\n",
"\t\t38 242 117 239 116 294 293 244 0 119 1\n",
"\t\t38 95 235 231 163 290 238 269 8 237 232\n",
"\t\t38 215 277 217 216 281 282 220 218 32 219\n",
"\t\t38 216 215 277 154 218 281 32 223 224 16\n",
"\t\t38 68 143 77 70 145 151 78 73 50 79\n",
"\t\t38 153 113 277 217 19 279 31 222 283 282\n",
"\t\t38 178 90 177 82 180 179 181 13 92 14\n",
"\t\t38 202 203 258 198 205 262 261 204 206 38\n",
"\t\t38 95 266 94 96 267 271 97 98 23 99\n",
"\t\t38 258 198 203 129 38 206 262 5 3 2\n",
"</DataItem>\n",
" </Topology>\n",
" <Attribute Center=\"Node\" Name=\"Displacement\" Type=\"Vector\">\n",
" <DataItem DataType=\"Float\" Dimensions=\"894\" Format=\"XML\" Precision=\"4\">-0.047965729097026406 -0.47405360694192544 0.23267688897869185 -0.04839712032381492 -0.4188173068079019 0.19805068341926818 -0.04972836397419108 -0.2541761950494791 0.09483546166701359 -0.06677485893350904 -0.2690782455890474 0.08210568032541768 -0.08178506070914221 -0.16363834779526634 0.02802453692971962 -0.08016199450682145 -0.22758038186903723 0.03479151154023378 -1.5804349184169515 0.011367993034710765 -7.480312028855505 -2.0676630077700833 0.03382986432510028 -9.754515438360277 -1.0462457612381162 -0.03644143935910425 -5.275667760899228 -1.726713436285188 -0.2060828623672494 -4.0860843843813255 -2.2137093789738853 0.07925610664268293 -10.710947653722311 -2.787437803216165 0.07167172350619123 -13.00814484395848 -1.6074491367545345 0.27882830716382606 -12.603139019122711 -4.043723685861553 -0.2034412125611042 -12.99195327474299 -3.4666151361860247 -0.18938985865702038 -10.64586945104657 -3.030383848950366 0.023033912807956938 -13.528178348150965 -0.018694549365319026 -0.6663622199230039 0.3940663781701929 -0.035755459571178094 -0.6793344824400395 0.37715517472979276 -0.049198663139684067 -0.3092376223887039 0.1280265760623059 -0.04714087652030377 -0.5842345312188942 0.3018567869325058 -0.047547269452917124 -0.529161839741 0.26727394542495425 0.06928108760818566 -0.015627413937322313 0.2595012942790379 0.0767624362004812 0.1655046187925633 -4.523061280826332 0.07901403707404484 0.14510639685209448 -3.7199300629611334 0.20971414214805742 0.1425775854583779 -3.427139715141933 -0.6478467913881932 -0.01194598181817827 -3.342148646620809 -1.4479561070974147 -0.18677944545003708 -3.0948023257062602 -1.5548104540952734 -0.1913388710335726 -3.379382376226174 -0.07431980244959735 -0.6673217756872455 0.3134257246813109 -0.07474304858230338 -0.6122504381178779 0.278832124031785 -0.04671874975343763 -0.6393056883230281 0.33644950069878476 -0.019117086827051457 -0.6112900526082293 0.35947369153310893 -0.0020568568078323042 -0.5983160776261545 0.37638464112010395 -0.04896452596291781 -0.36387373098173365 0.1632878696208949 -0.0319398111972994 -0.09222340428892116 0.08448044560169332 0.005285546875953886 -0.07797179838956966 0.0 0.0 -0.12203984359370061 0.0 -0.010982649581565213 -0.057750229417927026 0.12196508427419606 0.004183890009327347 -0.16429170544796834 0.08923533765153951 -0.018496996429775623 -0.1620011179730926 0.07527064114067424 -0.01753870441729097 -0.09395347711603876 0.18124328313616497 -0.0007776007507524766 -0.007955464055126803 0.17069980138556098 -0.0721044217940912 -0.047619282266660755 0.297893518711578 -0.06335370417180371 -0.0773063389442382 0.12745729054550167 -0.054685743666010665 -0.0779783279731788 0.06978496552976325 -0.10145146109919913 -0.1461780324423574 0.06663853374684127 -0.07780363983544336 -0.2057316778785314 0.07618293357915183 -0.03496652533659665 -0.1780999651492029 0.1596198836561621 -0.08852146924247566 -0.1347498168040807 0.15043019197952426 -0.1695618827519498 -0.13305064346559115 0.26071130497706146 -0.21796559512883132 -0.11947219651288987 0.1592972214589671 -0.2135129311674945 0.0 -0.5926904288415352 0.28369353412985393 0.12877922375902964 -0.13378996663099613 -0.5263939861681952 -0.11683879940758961 0.0 -0.10974398546956422 -0.013330577977185364 0.04624196825920747 -0.193516981457963 -0.0006148271887108712 -0.07437646117908586 -0.3297467387547477 -0.1048633517785947 0.24040130978664023 0.13325904592774976 0.029361752786866643 0.19137557692257412 0.14225465896795317 0.07773054156564677 -0.26920849795571533 0.18642946344449174 0.07568153589329588 -1.2780393524288247 0.33056414766573194 0.12245610753730929 -1.1371090921528515 -0.7994273568669944 -0.16842843093368637 -0.9498153406860345 -0.35675742414471423 -0.025253165246244158 -1.7538110264858364 -0.4699599291313302 -0.020220701912772896 -1.9946084312297603 0.18176143469822173 0.12030732193736497 -2.694400681395747 -1.0432796715548522 -0.1514170499202772 -1.7654297681197768 -0.9373011163016199 -0.12285660476993283 -1.271142111544261 -0.6195327416845549 -0.08066865844591749 -0.16505643215442242 -0.18469478264160283 -0.2055167878211854 0.025531244888579434 -0.07962436103466564 -0.0692937266073 -0.012230750661163194 -0.1761601644312843 -0.05489023567181979 0.15074026483224712 -0.12854045300848546 -0.12676052455328152 0.0 -0.10816952021390164 -0.05661450958071297 0.09475127219738581 -0.16770256353265753 -0.1255016156909703 0.0896955317096843 0.2754413948544713 0.07428396588726943 0.0 0.07871659565210719 0.021852559099717794 0.03822553912809209 0.05330335535551464 0.03575129680647851 0.08396589459413166 -0.7851967964595475 -0.15316809002998358 -0.08418956558599154 -0.35630046464236226 -0.14914729001559882 0.034405770951162484 -0.43453715092539363 -0.05283785933063878 0.07987085547895767 -0.16587012514719132 0.013965336696996409 -0.05004982365120022 -5.722660049041769 -0.5200069795964476 -14.52667328037748 -2.8539150952570123 0.02076916472850137 -12.535194322634458 -1.1641758713518928 0.5217737098367664 -15.449170689704438 -4.272352654390285 -0.25564976733865985 -13.472651480820652 -2.0039557914216313 0.26065471973583904 -14.019028479954342 -3.439878318475382 -0.008695127730949125 -14.935329497875086 -0.10084188993098371 0.4444090430827425 -10.666727210051148 -1.4583171194346642 0.25094895065301626 -11.639335770404061 -0.6095536247328149 0.4923525017243669 -13.09673271500324 -4.487606666749117 -0.4314764848184639 -9.611662927450727 -5.1351778722580805 -0.490723554037711 -12.002580048371243 -3.7019431837620345 -0.21940402555656036 -11.073245561411625 -2.2950426032773508 0.0 -10.153561398569527 0.7644783025637677 0.17659270005169025 -2.2506764640469212 0.7881830999734697 0.358562240737584 -6.076114778192403 -0.8094195671397438 -0.010638667411575835 -3.6596800793780173 0.8460253549690263 0.26345636944233214 -4.104283292756102 -0.06646680500717818 0.1663678113467481 -4.801762880834504 0.0 0.05088188065568029 -2.897167159442851 -3.211260767463459 -0.43742162502765536 -5.252531307168398 -1.231266826045317 -0.019173825258966597 -5.651583583760707 -1.913556966020636 -0.19704300405962422 -4.4034105004164985 -1.8509487580850996 -0.2751452518671518 -2.0229432077098832 -1.3138377231166645 -0.15175743468116942 -2.813098190258421 -0.49145072949190444 -0.0614749308538247 -2.0913527653978545 -2.423285086333881 -0.35509732649554243 -3.5593216894250097 -0.13562028121554442 -0.7763576425543823 0.2911718516414826 -0.06822290162700494 -0.6143196677574919 0.289632881489414 -0.1364635725568115 -0.6662121680366447 0.22198682115133725 -0.10192129190743907 -0.6953385010093142 0.2904020538530397 -0.10234483504406645 -0.6402676067379166 0.25580705547820554 -0.1360415192690181 -0.7212849084599603 0.25657767739220383 -0.06906520487631836 -0.5041703097132678 0.2204446025832387 -0.10277124168162215 -0.5851994121453588 0.22121405709445124 -0.06864471010018737 -0.5592469529325729 0.25503817033781584 -0.13732883135365861 -0.5560329621109351 0.15278808719504022 -0.06979350205503553 -0.3939536933122908 0.151189344244134 -0.13868846383820757 -0.44626371033613105 0.08264962775090069 -0.10363470876065228 -0.47509071801681074 0.15200810364079081 -0.10400043568754139 -0.4198191513465178 0.11722634301747097 -0.13777327418304808 -0.500776334518748 0.11822596096132337 -0.07046378225306367 -0.28404084583465633 0.08180352513206532 -0.10432336005612114 -0.3649136418132531 0.08219933926866091 -0.07008588015608205 -0.3389002086666551 0.11648307864968548 -1.3176630754924685 -0.21843469509647914 -0.9400075364376895 -0.13642162813274905 -0.007757044931628335 -0.9393273897074608 0.5590714754264643 0.12891962057742173 -1.0141521782369056 -0.07122196294186438 -0.17851718142218737 0.014341064299544367 -0.1369396110426348 -0.33497059522248007 0.01326951459494449 -0.08064823591635184 -0.12599468499497785 -0.008806942900384356 -0.11543997824071656 -0.19474506627465435 -0.016122403256118866 -0.10659695473642065 -0.25531917468180126 0.013297445179014909 -0.1323229387983942 -0.2722643114499709 -0.017332875697368143 -0.10319998549156792 -0.5301372595159655 0.1866226708216105 -0.13690111113997916 -0.6111404800984386 0.18739698799338209 -0.13916485414520863 -0.39105145200107333 0.04736714158837961 -0.10492523572033977 -0.30993771410049653 0.04712887420059887 -1.7541994357664783 -0.0005792311633284 -7.8616047926675785 -3.9061541991935314 -0.3993125724184914 -7.353289363755013 0.36592921859598865 0.40070633211835854 -8.402522688869404 -0.07090294944928281 -0.2304158305465479 0.04747654650607198 -0.06944103173641163 -0.4490744891987199 0.18584018533433988 -0.3379162755119088 -0.18004101855780588 0.2138703278463336 -0.057772497251470906 -0.24938199362522914 0.23397169182995128 -0.1992371235010566 -0.1882622459881342 0.11434109602451309 -0.1638043677618825 -0.2130591025954032 0.20527585233313717 -0.10504837042258369 -0.22162009564717283 0.11712881721857264 -0.6038245319800848 -0.22666133511991648 0.20319099679477254 -0.4453249751832846 -0.1841955004808417 0.24034147018409557 -0.25745874362345883 -0.2178760564167578 0.2512596997372918 -0.4940388681387688 -0.15782569336968238 0.08140117544735002 -0.7086015220411741 -0.16831780067917781 0.19262570794867515 -0.025213742491690123 -0.6642855937660482 0.38327189429099146 -0.024369285625460854 -0.7744378275333292 0.4524536292523566 -0.08041812858304163 -0.7203250696865323 0.33721888183020204 -0.024791259145738268 -0.7193632478460578 0.41786115202441454 -0.05239363226762076 -0.7473813916524793 0.39483635695410907 -0.05281632241398205 -0.6923071655426928 0.36024370291838226 -0.10844071757462344 -0.6932691630684207 0.2796014005025253 -0.08083915000906501 -0.6652524862117442 0.30262534328105845 -0.0799947310656859 -0.7753978385839632 0.3718127654359158 -0.10801881549417736 -0.7483410913238301 0.31419527136952957 -2.861312175356208 -0.40449443529868956 -4.491783964993224 -1.6447662828670482 -0.3255723406820727 -1.4291645315447814 -2.324502315279406 -0.34365770901486026 -3.1224832382742864 -2.2192879649562722 -0.36755447980193473 -2.90499037785823 -1.9889418607595064 -0.34462802491423694 -2.2471672565398015 -2.598937899850412 -0.3839677137714592 -3.792372094948321 -2.73992035965378 -0.39967020349842064 -4.137154497261919 -2.9939062352625747 -0.4280624553387076 -4.867255537430509 -1.7356171530687616 -0.3070393649247481 -1.673143683850175 -2.062562131215739 -0.30036806575948233 -2.5399989439944317 -0.07414657151351439 -0.28118889507163386 0.0700390845348723 -0.02545068136485103 -0.3374151388659947 0.1768345559341324 -0.08248573961563273 -0.33540247204920487 0.09373316648827278 -0.022705260568893205 -0.2850796198870722 0.18085321877016405 -4.031147806022462 -0.3727198331200897 -8.80548102123114 -5.220385984050723 -0.41603006712540447 -13.368455372234632 -4.270227559411124 -0.4074509447059446 -9.208428932554598 -4.889498644571033 -0.4431711544388824 -11.499072588559455 -4.634308727657519 -0.40162634390452573 -11.088162778734548 -3.4751712702748487 -0.40288218308820206 -6.6365553011638685 -3.7337487299914507 -0.4190340764186671 -6.97836794455023 -1.2169427992022834 -0.25111538021425817 -0.6151893666474478 -1.1185199779330708 -0.27236971108263597 -0.46985411075185324 -0.026672799730434446 -0.44455927335026374 0.2450529936818268 -0.08289081203328263 -0.44518196731152787 0.16383782070410652 -0.08350080590852561 -0.3899089385911751 0.12827370550847797 -0.026349637870557243 -0.3894965914267727 0.21056132065194208 -0.02607006689024707 -0.5541281162360233 0.31413418177273067 -0.02647304046685257 -0.4992324012446699 0.27949064649848837 -0.08227878040931949 -0.5001199767851968 0.19867321436490634 -0.025634448075775463 -0.609212899014135 0.34867854102931206 -0.08125110224735822 -0.610176349813134 0.26804593579688857 -0.08166682320757503 -0.5550820344133942 0.2334714119406424 -5.476535772910673 -0.4689258986847368 -13.931485467491994 0.015405199297464305 -0.05768223206291513 0.353254087307141 -0.004284059566232646 -0.20302461245378808 0.1423871529064458 -0.030279153735737762 -0.16219137202228495 0.2872951699539964 0.009893350122390645 -0.1455335596605565 0.21677540345565466 -0.022989385790295386 -0.22500035267620017 0.17691342169252813 0.0723268140144121 -0.04500703660259545 0.1913911016766751 0.03975225302392074 -0.17231367426974978 0.1767621221566391 0.039138786789668825 -0.12267294053160017 0.12966581805479893 0.05210593814124876 -0.10491614028091974 0.15813945004688956 0.019017646795029007 -0.1884798963638575 0.16202655967499668 -0.015287931629018505 -0.27094060234400735 0.15930445082060088 0.004367861501230276 -0.2545572362586046 0.17592054566098012 0.03673791419978042 -0.04342356410235774 0.24633119237984089 0.5564749250635144 0.15253172799693993 0.08300437302119189 0.24890524298566413 0.06341554244785445 0.33376248738031516 0.19830106213258958 0.08337923732507081 0.2189630436612385 -0.30781544081944057 -0.14139391606479979 0.32383903550587445 -0.09055376170303923 0.008758277742892139 0.23738035199205418 0.04302806618315445 -0.6123998442273875 0.45091291040744497 0.008906864425090597 -0.6383450360700776 0.4170895674834273 0.04218173828751821 -0.5022565952880745 0.3817212791452501 0.0259674626393265 -0.6253727241297466 0.43400131183637997 0.025543627932032322 -0.5703018579308011 0.39940679622838 0.042604918540645936 -0.5573289219121731 0.4163181004853647 -0.008153438279380877 -0.6513164421484274 0.4001796753641282 0.008484306556432106 -0.5832751597030574 0.38249591286600104 -0.007731228480324075 -0.7063916916706321 0.43477165328291195 0.009329388910927184 -0.6934188173908522 0.4516833582748249 -0.5768910710722052 -0.020817579122237292 -3.050608500142118 -1.6924013473850792 -0.23394930223377505 -3.7629154592296103 -1.13842377408308 -0.19793825889936395 -2.2150978063227234 1.0408930013298476 0.2809555562912507 -1.8735119143721761 0.26950982072523055 0.11810243154585093 -2.439776141913557 -0.34572405482245444 -0.046249051528531 -1.5704467535071216 1.0714332051133424 0.4106012479845788 -5.417347269208392 -0.8885482009921877 -0.0077584579372758505 -4.963321487611734 0.22904481975518634 0.19144954870495304 -4.183555352555141 1.0446510756762741 0.33070033444041164 -3.5464729854308548 0.3084510472903371 0.525711788907861 -9.833240801670238 -1.8169911384342474 0.07945355886834034 -9.352576061083182 -1.3059029375558169 0.03735769193328975 -7.139068107856563 0.6950582880091182 0.4653643411880185 -7.598626578284048 0.040453435251621574 -0.28213894343947377 0.2433409577726728 0.0067054149873055574 -0.3632840301928922 0.2439697286111284 0.00720946552359674 -0.41807725728833706 0.27872786460874843 0.04132513611292125 -0.39214488795517805 0.3124952291910621 0.007648788670507387 -0.4731403280181489 0.31330902632611374 0.04088032045174907 -0.3370592087004853 0.27793471854332086 -0.7006135613633653 0.5922572350966205 -14.450593002485887 -2.3822402379295213 0.09057146096663068 -11.630788254273844 -0.16366983743141195 0.5713167762055666 -12.16828923543039 -2.954477817259094 0.09273584197025529 -13.906275903237926 -0.3518758442986853 -0.041934834745262724 -0.5048611884102177 0.006440547751504181 -0.3087428533154893 0.20906115028142058 0.00806224084417239 -0.5282088659325198 0.3478868322853771 0.04175715289929721 -0.4471855733128842 0.34712369812518123 0.04026367315859773 -0.22726519126867822 0.2096831459864206 0.8116246703221361 0.24910663430630192 -0.7400685267700304 -3.1998914956705056 0.04164736776803859 -14.427044106642478 -0.9225775760338462 0.5625563690038407 -14.966984648665667 0.15813498952420885 0.04451062755336954 0.19432860288940448 -0.00023169456635840308 -0.12381098751066959 0.04451857461019447 0.05398555440349261 0.0023047341829060793 0.16143626181463736 0.012001268527900415 -0.04747747185161327 0.07447113699285579 0.029918965780170215 -0.07010107458517302 0.053967821511682224 0.019384380824443312 -0.14451204058796685 0.1083599024467668 -0.03784322617619329 -0.153909152476789 0.031128890458504994 -0.04928504968680727 -0.09316115390402904 0.006284167583016508 -0.013971330632081844 -0.17392143827105147 0.0946052606802253 0.9249513284253921 0.28462164248519795 -3.767121787536245 0.8744818704897865 0.32451039421454686 -4.90506896962685 1.0785830620009245 0.34737889091180424 -4.584364995402746 0.9199129150073241 0.3854289168265285 -5.754209400171687 0.9949021384742094 0.27588779023879245 -2.787869216120964 0.893632544973017 0.23281737185950901 -3.001293602568804 0.8992714361146932 0.21365722086430394 -1.9560941672902137 -0.005652557699938412 -0.021348042729725413 0.10102256783093026 0.21552429101438245 0.06915405630752935 0.09425621158000139 0.3145086238580911 0.10422405754179641 0.17372282157321245 0.46142305760993185 0.14023720250360783 0.10933687384675493 -0.013019227354410032 -0.5582864618360743 0.3356790340718974 -0.04062070421096781 -0.5863029273833091 0.31265572737092306 -0.0410422195165195 -0.531229530972922 0.2780615027833012 -0.012596234960148724 -0.6133598889995131 0.3702729276182241 0.015004314467624716 -0.585343247022487 0.39329629153147017 0.01458071509855983 -0.5302734140075925 0.3587018974517421 -0.01344375293594734 -0.5032141882644785 0.30108529882614404 -0.3620456247533485 0.5519867699907384 -12.620344556531794 -0.526966243814986 0.5761773089089341 -13.53252924781271 -0.010580716254271554 0.5370526569804701 -11.240538337103064 -0.7590766917007422 0.5424585404804543 -14.06075381984704 -0.2241267810324015 0.5080924245964678 -11.678636409861051 0.12435591418543097 0.4890125752209692 -10.2901175360841 0.5644461793934311 0.4452121362167419 -7.977671709359734 0.6877930605010911 0.1763463728609681 -0.8949858092003476 -0.013854912976747782 -0.44812265379862676 0.26650158133217267 -0.014668310361330275 -0.33793775862863673 0.1972625056180801 -0.014256902850070032 -0.3930499585001261 0.23188288965132975 -0.015529548039433162 -0.22964069733477832 0.12824581547933717 -0.01505131691402543 -0.28309752287511414 0.16251145574210094 -0.04629575533140819 -0.6943785848803764 0.37104295188956193</DataItem>\n",
" </Attribute>\n",
" </Grid>\n",
" </Grid>\n",
" </Domain>\n",
"</Xdmf>\n",
"\n"
]
},
{
"data": {
"text/plain": [
"28476"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"using LightXML\n",
"\n",
"function xdmf_new_mesh(grid, X, elmap)\n",
" dim, nnodes = size(X)\n",
" geometry = new_child(grid, \"Geometry\")\n",
" set_attribute(geometry, \"Type\", \"XYZ\")\n",
" dataitem = new_child(geometry, \"DataItem\")\n",
" set_attribute(dataitem, \"DataType\", \"Float\")\n",
" set_attribute(dataitem, \"Dimensions\", \"$nnodes $dim\")\n",
" set_attribute(dataitem, \"Format\", \"XML\")\n",
" set_attribute(dataitem, \"Precision\", 8)\n",
" #add_text(dataitem, join(X, \" \"))\n",
" s = \"\\n\"\n",
" \n",
" for i=1:nnodes\n",
" s *= \"\\t\\t\" * join(X[:,i], \" \") * \"\\n\"\n",
" end\n",
" s *= \" \"\n",
" add_text(dataitem, s)\n",
"\n",
" elmap2 = copy(elmap)\n",
" elmap2[2:end,:] -= 1\n",
" dim, nelements = size(elmap2)\n",
"\n",
" topology = new_child(grid, \"Topology\")\n",
" #set_attribute(topology, \"Dimensions\", \"1\")\n",
" set_attribute(topology, \"TopologyType\", \"Mixed\")\n",
" set_attribute(topology, \"NumberOfElements\", nelements)\n",
" dataitem = new_child(topology, \"DataItem\")\n",
" set_attribute(dataitem, \"DataType\", \"Int\")\n",
" set_attribute(dataitem, \"Dimensions\", \"$nelements $dim\")\n",
" set_attribute(dataitem, \"Format\", \"XML\")\n",
" set_attribute(dataitem, \"Precision\", 8)\n",
" s = \"\\n\"\n",
" for i=1:nelements\n",
" s *= \"\\t\\t\" * join(elmap2[:,i], \" \") * \"\\n\"\n",
" end\n",
" add_text(dataitem, s)\n",
" #add_text(dataitem, join(elmap2, \" \"))\n",
" \n",
"end\n",
"\n",
"xdoc, xmodel = JuliaFEM.xdmf.xdmf_new_model()\n",
"temporal_collection = JuliaFEM.xdmf.xdmf_new_temporal_collection(xmodel)\n",
"grid = JuliaFEM.xdmf.xdmf_new_grid(temporal_collection; time=0)\n",
"xdmf_new_mesh(grid, X, elmap2)\n",
"JuliaFEM.xdmf.xdmf_new_field(grid, \"Displacement\", \"nodes\", u)\n",
"print(xdoc)\n",
"JuliaFEM.xdmf.xdmf_save_model(xdoc, \"/tmp/foo3d.xmf\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 0.4.0-dev",
"language": "julia",
"name": "julia-0.4"
},
"language_info": {
"name": "julia",
"version": "0.4.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}