ABAQUS-SwiftComp GUI Issues

After lots of debugging I pinpoint the issues with SwiftComp not working for me: I am doing 3D SG for beam analysis but I am unable to obtain the correct stiffness matrix. The reason is that I assigned orientation for composites using this


It turns out that using the ABAQUS-SwiftComp GUI I downloaded from here cdmHUB - The Composites HUB - Resources: ABAQUS-SwiftComp GUI: About, it is unable to detect orientation assigned to the elements where the composite materials are. So this GUI completely ignores the orientation I assigned and use global coordinate instead. In other words, if I have fiber angles being 30 degree, then it would be treated as 0 degree. I have proven this using examples (including cubes and airfoils) with extrusion and compare the results from 3D SG and VABS. The outputs are the same only when all fiber orientations are 0. Note that this happens when I use the cae file for homogenization:
image

Then I tried to use inp file for homogenization because the cae file is not working for me, but I encountered this error:


The inp file is prepared using Job → Write Input, and I checked the number of elements is 111050, so it seems that the number of element is read incorrectly which prevents SwiftComp from running.

Is there a way to fix it?
@Wenbin @Haodong @su.tian.22 @bagla0

1 Like

I think a better question would be how to get the correct sc file from inp file since SwiftComp uses sc file?

1 Like

Since Bo has not touched the code for almost 10 years, you might be able to figure it out faster than her by studying the source codes to figure it out. Are you able to access to the source code? This will help you understand Abaqus better.

I think @su.tian.22 also has experience maintaining the code

@Wenbin I only have the source code for Abaqus-SwiftComp GUI, but there is little documentation on it and the workflow (how the code works) is not explained very well. I can try to read the code and see how sc file is prepared. I think the sc file is incorrectly prepared and that’s why SwiftComp is complaining about element number exceeds the total number while the total number of element does not seem correct.

Have you got the supporting documents from

The code should be self-explanatory if you have a good knowledge of Abaqus cae.

Yes. I believe this document is a user level tutorial telling you how to use the GUI and the format of input etc but it does not seem to have the developer level documentation for how the source code works (e.g., structures of the code and workflow, like this method does this, then calls what method next), so if we want to modify the source code we do need to know what each script does. Also the tutorial was dated back to 2017 while the newest update shows 2020 and the tutorial shows a UI that is older than what we currently have. I can work with the source code provided in the package and the names of the methods do provide insights on what each method does. I think reading from Abaqus input files needs some fix which should fix this bug.

You can ask AI about it. Use cursor or copilot or codex

That might be a good way to understand the logic of the code.

You can ask Fei @tao364744553 who is an expert in DS Simulia products.

@SichenLiu I think right now the best way is to use the sgio package to convert inp file to swiftcomp format. You can easily install it through pip install -U sgio. Here is an example showing how to convert the format by one line command. Converting 3D SGs has not been tested thoroughly. So let me know if this does not work for you.

@su.tian.22 I forgot to mention it after you sent the tutorial to me via email. I got this error

D:\Users\liu3856\OneDrive - purdue.edu\Desktop\Abaqus-SwiftComp_GUI_v2.0.2>python -m sgio convert sg33_cube.inp sg33_cube.sg -ff abaqus -tf swiftcomp -tfv 2.1 -m sd1
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "C:\Users\liu3856\ivabs\scripts\sgio\__init__.py", line 1, in <module>
    from .core.sg import StructureGene
  File "C:\Users\liu3856\ivabs\scripts\sgio\core\__init__.py", line 1, in <module>
    from .builder import buildSG1D
  File "C:\Users\liu3856\ivabs\scripts\sgio\core\builder.py", line 4, in <module>
    from .sg import StructureGene
  File "C:\Users\liu3856\ivabs\scripts\sgio\core\sg.py", line 16, in <module>
    from sgio.meshio._mesh import Mesh
  File "C:\Users\liu3856\ivabs\scripts\sgio\meshio\__init__.py", line 1, in <module>
    from . import (
  File "C:\Users\liu3856\ivabs\scripts\sgio\meshio\med\__init__.py", line 1, in <module>
    from ._med import read, write
  File "C:\Users\liu3856\ivabs\scripts\sgio\meshio\med\_med.py", line 31, in <module>
    numpy_void_str = np.string_("")
                     ^^^^^^^^^^
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\numpy\__init__.py", line 413, in __getattr__
    raise AttributeError(
AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.

Does it mean I need an older version of NumPy to make it work?

It seems that the command is still calling the old version of sgio in the ivabs code (C:\Users\liu3856\ivabs\scripts\sgio). You can remove it or rename it to other names if you want to keep it as a backup for now.

I tried using Timoshenko beam for my example but encountered this problem:

D:\Users\liu3856\OneDrive - purdue.edu\Desktop\Abaqus-SwiftComp_GUI_v2.0.2>python -m sgio convert Job-1.inp Job-1.sc -ff abaqus -tf swiftcomp -tfv 2.1 -m bm2
{'func': 'convert', 'kwargs': {'loglevelcmd': 'info', 'loglevelfile': 'info', 'logfile': 'log.txt', 'from': 'Job-1.inp', 'to': 'Job-1.sc', 'from_format': 'abaqus', 'from_format_version': None, 'to_format': 'swiftcomp', 'to_format_version': '2.1', 'sgdim': 2, 'model_space': 'xy', 'material_ref_y': 'x', 'model': 'bm2', 'mesh_only': False, 'renumber_elements': False}}
[16:13:41] INFO     Converting file format...                                                                main.py:673
           INFO     Reading file...                                                                           main.py:67
Organizing block 25
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\__main__.py", line 6, in <module>
    cli(*sys.argv)
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\app.py", line 119, in cli
    main(func, **vars(pargs))
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\app.py", line 139, in main
    convert(
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\iofunc\main.py", line 682, in convert
    sg = read(
         ^^^^^
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\iofunc\main.py", line 84, in read
    sg = _abaqus.read(
         ^^^^^^^^^^^^^
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\iofunc\abaqus\_abaqus.py", line 88, in read
    mesh, materials, mocombos = process_mesh(inprw)
                                ^^^^^^^^^^^^^^^^^^^
  File "D:\Users\liu3856\AppData\Local\Programs\Python\Python311\Lib\site-packages\sgio\iofunc\abaqus\_abaqus.py", line 338, in process_mesh
    distr_name = _orient_block.data[0][0]._value
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'inpDecimal' object has no attribute '_value'

For the example you uploaded to sgio documentation, it seems the inp file has been successfully converted to sc file.

D:\Users\liu3856\OneDrive - purdue.edu\Desktop\Abaqus-SwiftComp_GUI_v2.0.2>python -m sgio convert sg33_cube.inp sg33_cube.sc -ff abaqus -tf swiftcomp -tfv 2.1 -m bm2
{'func': 'convert', 'kwargs': {'loglevelcmd': 'info', 'loglevelfile': 'info', 'logfile': 'log.txt', 'from': 'sg33_cube.inp', 'to': 'sg33_cube.sc', 'from_format': 'abaqus', 'from_format_version': None, 'to_format': 'swiftcomp', 'to_format_version': '2.1', 'sgdim': 2, 'model_space': 'xy', 'material_ref_y': 'x', 'model': 'bm2', 'mesh_only': False, 'renumber_elements': False}}
[16:14:47] INFO     Converting file format...                                                                main.py:673
           INFO     Reading file...                                                                           main.py:67
Organizing block 17
           INFO     Writing file...                                                                          main.py:534
           INFO     File format converted.                                                                   main.py:710

D:\Users\liu3856\OneDrive - purdue.edu\Desktop\Abaqus-SwiftComp_GUI_v2.0.2>swiftcomp sg33_cube.sc 1D H
 ****************************************************************
 *                      SwiftComp  2.1                          *
 *                                                              *
 *         Multiscale Constitutive Modeling of Composites       *
 *                                                              *
 *            School of Aeronautics and Astronautics            *
 *                       Purdue University                      *
 *                                                              *
 *                       Copyright Notice                       *
 *                     ====================                     *
 *                                                              *
 * Copyright (2015-) by Purdue Research Foundation, West        *
 * Lafayette, IN  47906.  Unless permission is granted, this    *
 * material may not be copied, reproduced or coded for          *
 * reproduction by any electrical, mechanical or chemical       *
 * process or combination thereof, now known or later developed.*
 *                                                              *
 * These commodities, technology or software were exported from *
 * the United States in accordance with the Export              *
 * Administration Regulations. Diversion contrary to U.S. law   *
 * prohibited.                                                  *
 ****************************************************************
 You can run SwiftComp for 305 days....

 SwiftComp begins at  161531.059
 Inputs echoed in file sg33_cube.sc.ech!

 Constitutive modeling for a 1D (beam) model!

 Homogenization will be carried out!

 You are running SwiftComp with full integration!

 Finished reading/processing model file!

 Effective properties can be found in file sg33_cube.sc.k!

  determinant of Jacobian matrix less than 0 for element           1. The first several nodes of distorted  element are:        1021 -0.40000000600000002      -0.50000000000000000        1092 -0.40000000600000002      -0.40000000600000002        1093 -0.400

Can you show me how the *Orientation data block looks like? Or you can just send me your inp file.

@su.tian.22

*Orientation, name=Ori-1
1., 0., 0., 0., 1., 0.
3, 45.

Looks like I cannot directly attach the .inp file so I added .txt
Job-1.inp.txt (202.3 KB)

This is a different way to define orientations that has not been implemented in sgio yet. I will update it. One way you can do right now without waiting for my updates is to use “Composite Layup” section and “Discrete”-type orientation (see the screenshot below) to give a distribution of local orientations for each element, although they are all the same. Attached is the modified inp file and should work with the current sgio version.

sg31_rec_mod.inp.txt (237.4 KB)

The input file you shared seems to be working.

D:\Users\liu3856\OneDrive - purdue.edu\Desktop\Abaqus-SwiftComp_GUI_v2.0.2>python -m sgio convert sg31_rec_mod.inp sg31_rec_mod.sc -ff abaqus -tf swiftcomp -tfv 2.1 -m bm2
{'func': 'convert', 'kwargs': {'loglevelcmd': 'info', 'loglevelfile': 'info', 'logfile': 'log.txt', 'from': 'sg31_rec_mod.inp', 'to': 'sg31_rec_mod.sc', 'from_format': 'abaqus', 'from_format_version': None, 'to_format': 'swiftcomp', 'to_format_version': '2.1', 'sgdim': 2, 'model_space': 'xy', 'material_ref_y': 'x', 'model': 'bm2', 'mesh_only': False, 'renumber_elements': False}}
[18:26:58] INFO     Converting file format...                                                                main.py:673
           INFO     Reading file...                                                                           main.py:67
Organizing block 28
[18:26:59] INFO     Writing file...                                                                          main.py:534
           INFO     File format converted.                                                                   main.py:710

D:\Users\liu3856\OneDrive - purdue.edu\Desktop\Abaqus-SwiftComp_GUI_v2.0.2>swiftcomp sg31_rec_mod.sc 1D H
 ****************************************************************
 *                      SwiftComp  2.1                          *
 *                                                              *
 *         Multiscale Constitutive Modeling of Composites       *
 *                                                              *
 *            School of Aeronautics and Astronautics            *
 *                       Purdue University                      *
 *                                                              *
 *                       Copyright Notice                       *
 *                     ====================                     *
 *                                                              *
 * Copyright (2015-) by Purdue Research Foundation, West        *
 * Lafayette, IN  47906.  Unless permission is granted, this    *
 * material may not be copied, reproduced or coded for          *
 * reproduction by any electrical, mechanical or chemical       *
 * process or combination thereof, now known or later developed.*
 *                                                              *
 * These commodities, technology or software were exported from *
 * the United States in accordance with the Export              *
 * Administration Regulations. Diversion contrary to U.S. law   *
 * prohibited.                                                  *
 ****************************************************************
 You can run SwiftComp for 305 days....

 SwiftComp begins at  182827.335
 Inputs echoed in file sg31_rec_mod.sc.ech!

 Constitutive modeling for a 1D (beam) model!

 Homogenization will be carried out!

 You are running SwiftComp with full integration!

 Finished reading/processing model file!

 Effective properties can be found in file sg31_rec_mod.sc.k!

  determinant of Jacobian matrix less than 0 for element           1. The first several nodes of distorted  element are:        2705   0.0000000000000000      -0.50000000000000000        2725   0.0000000000000000      -0.44999998800000002        2724  0.100

Btw it seems very strange that SwiftComp is complaining about determinant of Jacobian matrix being less than 0.

1 Like

I noticed that the converted file has only 2d nodal coordinates instead of 3d. This is due to an argument --sgdim set to 2 by default (since most users come from VABS). You can try to set it to 3 to see if it solves the issue, i.e., --sgdim 3.

1 Like

Thanks for the help. The issue has been resolved. The result seems right.

The commend is

python -m sgio convert Job-1.inp Job-1.sc -ff abaqus -tf swiftcomp -tfv 2.1 -m bm2 --sgdim 3

where Job-1.inp Job-1.sc can be replaced by any names. --sgdim 3 will ensure x, y, z coordinates will be written in the sc file.

1 Like