← Back to team overview

dolfin team mailing list archive

Re: [Question #153448]: Importing mesh and entities

 

Question #153448 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/153448

B. Emek Abali posted a new comment:
now it ignores the lines which has nothing, can handle generated and
internal elsets

and at the end write out many datas, here is my help for the user
-----------------------------------------------------------------------------------------------------------------------------
Abaqus to Xml converter. Script reads the input data XXX.inp and writes out
- out.xml an Ascii which has the nodes and connectivity
- out-material.xml an Ascii which has materials dependent 1,2 values (let's say 1 is copper 2 is steel) for the cells
- out-copper.xml, out-steel.xml each with cells of each defined materials

Save this data and input data in the same directory and use these commands under python:
--------------------------------------------
from dolfin import *
from abaqus2xml import *
convert('XXX.inp', 'out.xml')
mesh = Mesh('out.xml')
mesh.order()

cells_copy = MeshFunction('uint', mesh, 3)

cells_copper =  MeshFunction('uint',mesh,'out_copper.xml')
cells_steel =  MeshFunction('uint',mesh,'out_steel.xml')

materials =  MeshFunction('uint',mesh,'out_material.xml')

cells_copy.set_all(0)
cells_copper.set_all(1)
cells_steel.set_all(2)

copper_mesh = SubMesh(mesh, materials, 1)
steel_mesh = SubMesh(mesh, materials, 2)

plot(cells_copy, title='all cells')
plot(cells_copper, title='copper cells')
plot(cells_steel, title='steel cells')

plot(copper_mesh, title='copper')
plot(steel_mesh, title='steel')
interactive()
-------------------------------------------

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.