Results 1 to 7 of 7

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

  1. #1

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

    Hi all,

    I've 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 I'm asking in case I need to add/change a lot of data/keyword in Abaqus input file and don't need to do it by hand.

    Thanks in advance.

  2. #2
    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 you'd 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.

  3. #3
    Thanks kroz. I'm 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 didn't 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.
    Last edited by KMM; 2011-09-05 at 12:48.

  4. #4
    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 don't know how to insert something between N(8,1) and N(9,1) using fprintf or others command.

    Thanks.
    kmm.

  5. #5
    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.

  6. #6
    Join Date
    2000-02
    Location
    Boston, USA
    Posts
    3,362
    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
    Jorgen Bergstrom, Ph.D.
    PolymerFEM Administrator

  7. #7
    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?.

Similar Threads

  1. How to creat a data file of abaqus which can be readed by Matlab
    By lanfeng in forum Finite Element Modeling
    Replies: 13
    Last Post: 2013-07-16, 03:14
  2. Problem with input file of abaqus
    By rohitv in forum Finite Element Modeling
    Replies: 1
    Last Post: 2011-04-10, 12:38
  3. extract data from abaqus .odb file
    By tomo in forum Finite Element Modeling
    Replies: 6
    Last Post: 2011-02-20, 10:48
  4. Replies: 4
    Last Post: 2007-10-11, 07:59
  5. Input file command line for electric potential
    By murdoc82 in forum Finite Element Modeling
    Replies: 3
    Last Post: 2007-09-04, 19:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •