This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Import abaqus (.inp file) mesh into Fenics (.xml file) 2D

+1 vote

Hi,
I am new to FEniCS.
how can we import abaqus (.inp file ) mesh into Fenics (.xml file) for two dimension.

if necessary i will post .inp file

Thanks

asked Nov 22, 2016 by hirshikesh FEniCS User (1,890 points)

1 Answer

0 votes

Apparently dolfin-convert can do this, but I've never tried it before. From dolfin-convert --help:

Supported formats:

  xml      - DOLFIN XML mesh format (current)
  abaqus   - Abaqus tetrahedral grid format

If --input or --output are not specified, the format will
be deduced from the suffix:

  .xml  - xml
  .inp  - abaqus

so try:

dolfin-convert abaqus_mesh.inp dolfin_mesh.xml

answered Nov 22, 2016 by nate FEniCS Expert (17,050 points)

Blockquote *Heading
** Job name: Job-1 Model name: Model-1
** Generated by: Abaqus/CAE 6.12-3
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=Part-1
*Node
1, 1.21213198, 1.21213198
2, 1., 1.29999995
3, 0.787867963, 1.21213198
4, 0.699999988, 1.
5, 0.787867963, 0.787867963
6, 1., 0.699999988
7, 1.21213198, 0.787867963
8, 1.29999995, 1.
9, 2., 0.
10, 0., 0.
11, 2., 2.
12, 0., 2.
13, 1.5, 0.
14, 1., 0.
15, 0.5, 0.
16, 2., 1.5
17, 2., 1.
18, 2., 0.5
19, 0.5, 2.
20, 1., 2.
21, 1.5, 2.
22, 0., 0.5
23, 0., 1.
24, 0., 1.5
25, 1.38874793, 1.18828034
26, 1.44338953, 0.849958897
27, 1.21780229, 0.478074729
28, 0.555326641, 0.850122213
29, 0.622935355, 1.19518638
30, 0.865681708, 1.43292499
31, 1.18672538, 1.38707769
32, 0.783443153, 0.477859646
33, 0.419712394, 0.527148783
34, 0.518972576, 1.5006566
35, 1.57998264, 0.527278781
36, 1.48345375, 1.48363864
37, 1.67571867, 1.13837302
38, 1.73981822, 0.803122163
39, 0.32617113, 1.14228785
40, 1.13995051, 1.67203271
41, 0.260242015, 0.803911746
42, 0.804920971, 1.72112286
*Element, type=CPS3
1, 35, 26, 27
2, 35, 27, 13
3, 33, 32, 28
4, 29, 28, 4
5, 39, 29, 34
6, 34, 29, 30
7, 31, 30, 2
8, 40, 31, 36
9, 36, 31, 25
10, 37, 36, 25
11, 26, 8, 7
12, 32, 6, 5
13, 18, 13, 9
14, 27, 14, 13
15, 32, 15, 14
16, 21, 16, 11
17, 37, 25, 26
18, 38, 26, 35
19, 24, 19, 12
20, 42, 30, 40
21, 40, 30, 31
22, 22, 10, 15
23, 41, 28, 39
24, 39, 28, 29
25, 25, 1, 8
26, 26, 25, 8
27, 38, 37, 26
28, 27, 26, 7
29, 27, 7, 6
30, 32, 27, 6
31, 41, 33, 28
32, 28, 5, 4
33, 29, 4, 3
34, 30, 29, 3
35, 42, 34, 30
36, 30, 3, 2
37, 31, 2, 1
38, 31, 1, 25
39, 32, 14, 27
40, 32, 5, 28
41, 33, 22, 15
42, 33, 15, 32
43, 34, 19, 24
44, 39, 34, 24
45, 35, 13, 18
46, 38, 35, 18
47, 36, 16, 21
48, 40, 36, 21
49, 37, 17, 16
50, 37, 16, 36
51, 38, 18, 17
52, 38, 17, 37
53, 39, 24, 23
54, 41, 39, 23
55, 40, 21, 20
56, 42, 40, 20
57, 41, 23, 22
58, 41, 22, 33
59, 42, 20, 19
60, 42, 19, 34
*Nset, nset=Set-1, generate
1, 42, 1
*Elset, elset=Set-1, generate
1, 60, 1
** Section: Section-1
*Solid Section, elset=Set-1, material=Material-1
,
*End Part
**
**
** ASSEMBLY
**
*Assembly, name=Assembly
**
*Instance, name=Part-1-1, part=Part-1
*End Instance
**
*Nset, nset=Set-1, instance=Part-1-1
9, 10, 13, 14, 15
*Elset, elset=Set-1, instance=Part-1-1
13, 14, 15, 22
*Nset, nset=Set-2, instance=Part-1-1
10,
*Elset, elset=_Surf-1_S3, internal, instance=Part-1-1
16,
*Elset, elset=_Surf-1_S2, internal, instance=Part-1-1
19, 55, 59
*Surface, type=ELEMENT, name=Surf-1
_Surf-1_S3, S3
_Surf-1_S2, S2
*End Assembly
**
** MATERIALS
**
*Material, name=Material-1
*Elastic
2e+10, 0.3
** ----------------------------------------------------------------
**
** STEP: Step-1
**
*Step, name=Step-1
*Static
1., 1., 1e-05, 1.
**
** BOUNDARY CONDITIONS
**
** Name: BC-1 Type: Symmetry/Antisymmetry/Encastre
*Boundary
Set-1, YSYMM
** Name: BC-2 Type: Displacement/Rotation
*Boundary
Set-2, 1, 1
**
** LOADS
**
** Name: Load-1 Type: Pressure
*Dsload
Surf-1, P, -100.
**
** OUTPUT REQUESTS
**
*Restart, write, frequency=0
**
** FIELD OUTPUT: F-Output-1
**
*Output, field, variable=PRESELECT
**
** HISTORY OUTPUT: H-Output-1
**
*Output, history, variable=PRESELECT
*End Step

I have tried this command but I am getting error like:

Traceback (most recent call last):
File "/usr/bin/dolfin-convert", line 131, in
main(sys.argv[1:])
File "/usr/bin/dolfin-convert", line 78, in main
meshconvert.convert2xml(ifilename, ofilename, iformat=iformat)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1303, in convert2xml
convert(ifilename, XmlHandler(ofilename), iformat=iformat)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/meshconvert.py", line 1342, in convert
abaqus.convert(ifilename, handler)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/abaqus.py", line 96, in convert
cell_type, cell_set_name = _read_element_keywords(cell_sets, l)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/abaqus.py", line 413, in _read_element_keywords
check_element_support(element_type)
File "/usr/lib/python2.7/dist-packages/dolfin_utils/meshconvert/abaqus.py", line 482, in check_element_support
raise Exception("Element type not supported.")
Exception: Element type not supported.

...