Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #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, 12:48.

      Comment


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

        Comment


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

          Comment


          • #6
            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

            Comment


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

              Comment


              • #8
                Originally posted by KMM View Post
                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?.
                hi..
                can you tell me how to read particular data like node coordinates and material properties in .inp file (which is obtained from abaqus) in matlab

                kindly help me regarding this. I will be highly thank ful in advance

                Comment


                • #9
                  Hi,
                  KMM and Chandana, If you know about how to read/write/call/modify abaqus input files from Matlab, please help me. I want to learn new things. For example: I created a job with jobname, now I want to work (plot graphs of node displacement and Lengths) on it via Matlab withoput opening Abaqus CAE again. Thanks in advance.

                  Comment


                  • #10
                    Hello KMM, Thanks!
                    Can you please suggest how to insert updated parameters in .inp files. (Example E=200e09, mu-0.3 at 100th line of .inp file, replace it with E-200e09.6 and mu=0.33). Have to do this for 20 times for example.
                    Thanks!

                    Comment


                    • #11
                      how to input three files simultaneously in abaqus from documentation. i am trying to run three point bend specimen tutorial in abaqus. it has three input files. I tried to run each .inp file individually and then in combination also, the job is submitted successfully but results are not coming. Please help me in resolving this problem. this is urgent!!
                      email: sushillamba121@gmail.com

                      Comment


                      • #12
                        Sorry brother, just started working on it. However, we can help each other simultaneously. If I get any clue, I will be happy to solve your problem. Till then keep patience. And If you know how to run input files via documentation, you can share it so that others can get benefited by this.
                        Regards
                        PM

                        Comment


                        • #13
                          Originally posted by P M G View Post
                          Sorry brother, just started working on it. However, we can help each other simultaneously. If I get any clue, I will be happy to solve your problem. Till then keep patience. And If you know how to run input files via documentation, you can share it so that others can get benefited by this.
                          Regards
                          PM
                          single input file is easy to run from abaqus documentation. Go to import>model>documentation>eif folder and then choose the input file you need to run from documentation.

                          Comment

                          Working...
                          X