Search
Close this search box.
Notifications
Clear all

Insert text data into Abaqus input file (.inp) - How to?.

13 Posts
7 Users
0 Likes
1,512 Views
Posts: 36
Topic starter
(@jmaikos)
Eminent Member
Joined: 15 years ago

Hi all,

Ive a question about inserting some data or plain text into specified line of Abaqus input file. For example,

*Heading
** Job name: InputFile_Standard_MergedCell Model name: Standard-MergedCell
** Generated by: Abaqus/CAE 6.10-EF1
*Preprint, echo=NO, model=NO, history=NO, contact=NO
**
** PARTS
**
*Part, name=MergedCell
*End Part

Let say I want to add *MPC keyword after *Part, name=MergedCell. I want to write Matlab script, open Abaqus input file for me, find the right location, then add/change some text/data into it. Anyone please give me and advise.

I know I can edit it by using text editor but Im asking in case I need to add/change a lot of data/keyword in Abaqus input file and dont need to do it by hand.

Thanks in advance.

Topic Tags
12 Replies
Posts: 8
(@ahkulkar)
Active Member
Joined: 14 years ago

Abaqus has a very simple structure for the input files.

Heading - where you put the title and some other info (comments mostly)

Bulk data - nodes, elements, parts definition and so on

Execution part - STEPS definition, here is where you tell it what to do with your geometry.

If you want to add a big chunk of data in your file you can do one of the following:

a) Add the info into a separate file and call that file in your main file with the command:

*INCLUDE, INPUT=myfile.inp

This tells Abaqus that the file you included is also part of the model.

b) Manually add the info into the bulk part of your file. Be careful though that there are commands that spread on more lines so youd better put the info before a *Command.

I would suggest that you go with option a) since is way more elegant and you can make you file a lot clearer.

Topic Tags
12 Replies
Posts: 36
Topic starter
(@jmaikos)
Eminent Member
Joined: 15 years ago

Thanks kroz. Im gonna try it.

Additional:

I try and it works well but that means you have to prepare separate file(in case you have different types of data) and then use command include, input=*.inp
on the appropriate portion of main Abaqus input file manually.

If you have more data to include into Abaqus input file, however, what should you do?.
For instance-you have
1. MPC code and it must be inserted before keyword *End Part
2. Dummy nodes that must be inserted under keyword *Node
3. Boundary conditions that must be inserted after keyword *End Assembly

I made all of those data in one file, let say mydata.inp, then use keyword *include, input=mydata.inp after keyword *End Part, it didnt work.

So, I want to open main Abaqus input file (by Matlab or others), find keyword *End Part, append my MPC code after that keyword. Fine next keyword *Node, then append dummy nodes after that keyword. Find the last keyword *End Assembly, insert my boundary conditions after that keyword. Those are what I want to do.

Any suggestions please.

Reply
Posts: 36
Topic starter
(@jmaikos)
Eminent Member
Joined: 15 years ago

Hi All,

Ok, so far I can manage using textscan command in Matlab for myfile1.inp file and create an array for the data already, let say name of array is N and dimension is [100x1].

For instance,
N(8,1) = *Part, name=MergedCell
N(9,1) = *End Part

I want Matlab to insert 1 line between those, *include, input = myfile2.inp by using the followings:

fid = fopen(myfile1.inp.r+),

but I dont know how to insert something between N(8,1) and N(9,1) using fprintf or others command.

Thanks.
kmm.

Reply
Posts: 8
(@ahkulkar)
Active Member
Joined: 14 years ago

You do realize that this is an ABAQUS thread and not a Matlab one, right ? Besides, i would use an Excel macro to automatically edit the files.

Reply
Posts: 3998
(@jorgen)
Member
Joined: 5 years ago

I use Python more than Matlab these days, but there must be a way to read one line at a time in Matlab and then insert the line you like at the right place. I recommend that you check the Matlab Help.

-Jorgen

Reply
Posts: 36
Topic starter
(@jmaikos)
Eminent Member
Joined: 15 years ago

Dr.Jorgen,

Thanks for your reply. I found the solution on Matlab already. Anyway, I would like to learn python also cause it can communicate with ABAQUS well. Would you recommend the book i should start or read from ABAQUS manual?.

Reply
Page 1 / 2
Share: