x
Our website uses cookies. By using the website you agree ot its use. More information can be found in our privacy policy.

An example using Generic Extractor (GenEx) to extract responses

The LS-OPT Generic Extractor provides features for extracting entities from text files. This allows LS-OPT to be used with any solver code that produces a text database. GenEx (Generic Extractor) is a tool to create the .g6 file used by LS-OPT to extract responses and histories. It is included in the LS-OPT distribution as the executable file genex.

This example explains how to extract a number of responses from the LS-DYNA d3hsp file. Different search options are employed to demonstrate the various options.

  1. From the Responses panel select GENeric EXtraction as a response.
  2. Create a new .g6 file by clicking the Create/Edit button.
    ( When first starting GenEx, there will be two predefined anchors in the tree on the left, Start of File and End of File. It is not possible to change or remove these two anchors.)

 

  1. In the GenEx GUI select d3hsp as the input file by using File→Select input file. The d3hsp file is displayed in the middle. We are interested in 3 responses at various cycles and a fourth response to be the last one in the file.

 

Defining an anchor using a plain search

  1. Define an anchor by clicking on the anchor icon  or using the Edit option.
    (Anchors describe how to find a certain position in the data file. This can be done with searching for keywords or with an absolute position.)
  2. Type the anchor name Cycle4800_Plain.
  3. For Origin switch to Start of File.
    (Origin is the parent anchor of the anchor/entity.)
  4. For Type switch to Plain search.
  5. Type Text to search for: "dt of cycle    4800". Hit the "Enter" key.
    (If you want to change the string in the text box, remember to hit the "Enter" key on the keyboard. The anchor is displayed as a
    small anchor icon in the leftmost column of the line that matches the search string. The next step would be to find the desired field relative to this anchor.)

 

 

Defining an entity

  1. Define a new entity by using the leftmost x-icon  or the Edit option.
    (An entity is a quantity we want to extract from LS-OPT. Entities describe both what the number should look like as well as where, relative to the parent, to find it. )
  2. Type for entity name SWEner.
  3. Choose the previously defined anchor as the Origin.
  4. Find the desired field by searching 6 lines below the anchor, 2 columns across. The desired field is displayed as highlighted in yellow with a black border. See figure below.

 

Now define a new entity referred to the same anchor Cycle4800_Plain:

  1. Click the x-icon.
  2. Type for the entity name Yvelocity.
  3. This entity is 18 lines below the anchor and 3 columns across.

 

 

Defining a second anchor using a global search

  1. Click on the anchor icon.
  2. Type for anchor name Cycle4700_Glob.
  3. The origin of this anchor is also the start of the file and the search is forward from the point.
  4. For Type switch to Glob search.
  5. Type Text to search for: "4700 is controlled".
    Note the anchor placement on the figure below just before the string "4700 is controlled".

 

 

Defining an anchor relative to the previous anchor

Now define an anchor InternalEnergy_Absolute relative to the previous anchor by setting the origin as Cycle4700_Glob and type as Absolute, then searching 5 lines down and one column across.

 

Define a new entity InternalEnergy using the InternalEnergy_Absolute anchor as reference point. The desired field is immediately found since the anchor is already at the desired location.

 

 

Defining an anchor with reference to the end of the file

The next desired entity is the final total energy ratio (i.e. the one in the last cycle in the file).

  1. In this case we define a new anchor called LastCycle,
  2. set the reference to the end of the file (Origin) and
  3. search backwards (Direction)
  4. The search string is total energy.
  5. The regular expression search type is used.

 

  1. Define a new entity and type for entity name Energy4900.
  2. The entity is found by using LastCycle as the anchor
  3. and searching in the 5th column.

 

This completes the GenEx setup. Save the file.

 

  1. Now open the LS-OPT GUI on the Responses page and select the GENeric EXtraction response type on the left. Open the Input GenEx file. A browse option is available. Importing the file will display the selected entities in the Entities box.
  2. Select the input data file, namely d3hsp. This file must be available in the run directory during the LS-OPT run.
  3. Select an entity, define a response name at the bottom of the page and Add the response. It will appear in the tree on the right associated with the selected case.
  4. Repeat the procedure for the remaining three response entities. Note the last four entity definitions SWEner, Yvelocity, InternalEnergy and Energy4900 listed under Case1 below.

 

 LS-OPT can now be run and the response entities will be extracted for each simulation run.