PRIMER 22.1

Options: Controls Many Aspects of Reading Ansys LS-DYNA Files

Options: Controls Many Aspects of Reading Ansys LS-DYNA Files

The defaults for reading Ansys LS-DYNA files are chosen to give behaviour that should be appropriate for the vast majority of input decks, and in most cases you will not need to visit this panel. However problem decks that contain errors, or keywords that contain undocumented extra data fields, may become readable if the relevant options are used.

It is also possible to tune the hardware settings used for file reading and writing. This sometimes helps with access speed when files are on a remote network disk.

Options: Force large keyword format Force I10 keyword format

By default Ansys LS-DYNA input format is "small", however there are two options: (see "Getting started", "General card format" in Volume I of the Ansys LS-DYNA manual for more information.)

  • Large ("long") keyword format expands all data fields in an input deck to 20 columns wide.
  • "I10" keyword format is the same as ordinary (small) format, except that any data fields narrower than 10 columns wide are promoted to 10 columns

Both formats permit larger labels to be used, but "I10" is often preferred since file size is not much greater than "small" format, and the increase of label size from 99,999,999 to 9,999,999,999 is usually sufficient.

Normally the format of an Ansys LS-DYNA input deck is determined as follows:

Format *KEYWORD header suffix Individual *card suffices
"Long" format *KEYWORD long=y

A "+" after a keyword to denote long format, a "-" to denote reversion to the native format of the file. For example

*NODE +
.. following lines of node data use [I10, 3E20, 2I20] format

"I10" format *KEYWORD i10=y

A "%" after a keyword denoting I10 format, for example:

*NODE %
... following lines use [I10, 3E16, 2I10] format

However it is possible to omit these yet to force Ansys LS-DYNA to read a file in i10 or long keyword format by adding " i10=y " or " long=y " to the execution line, therefore PRIMER also permits the format to be stipulated in this way using this option.

Combining "i10=y" with "long=s"

The Ansys LS-DYNA keyword reader converts the incoming keyword format file to an intermediate structured file for input to the Ansys LS-DYNA analysis code itself.  For historical reasons this file also has small and long formats and it is sometimes the case that a keyword deck read in i10 format may contain labels which are too long for some small structured file fields. In these situations adding "long=s" (documented as "read small keyword, write long structured") solves the problem.   The nomenclature "read small..." is misleading, it actually means "read small or i10" so this combination of directives is legal, for example the line may become:

*KEYWORD  i10=y long=s

PRIMER adds "long=s" to the *KEYWORD line of a file in the following situations:

  • The original input file contained "long=s".  (Unless the file is being written in long format in which case "long=y" will be used.)
  • The model contains labels > 99,999,999.   This is conservative but will do no harm.
  • The preference  primer*long_structured_deck is set to ALWAYS

It is possible to turn this off completely by setting preference primer*long_structured_deck to NEVER.

The default value of this preference is AUTO giving the behaviour defined above.


Options: Include files inherit format

Ansys LS-DYNA treats the format of the master file of a keyword deck as being the default for any subsequent include files. It ignores any "long=y", "i10=y" or "long=s" suffices on *KEYWORD lines in child include files, so if an include file is to have a format that is different to that of the master file it is necessary to add a suffix to the *INCLUDE statement as follows:

Suffix on *INCLUDE statement Meaning
*INCLUDE (no suffix) Child include is in format of master file.
*INCLUDE % Child include is in i10 format
*INCLUDE + Child include is in large format
*INCLUDE - Child include is in small format

PRIMER obeys the same convention by default, however unlike Ansys LS-DYNA it does inspect any *KEYWORD line in child include files, and if it finds any of "long=y", "i10=y" or "long=s" suffices on *KEYWORD lines it uses those to determine the format of the file, regardless of the format of the parent file or any suffices on *INCLUDE.

Turning the Include files inherits format option off will suppress the default behaviour, treating each include file independently of its parent. However any suffices on the parent *INCLUDE card or on a *KEYWORD line in the file will still be read and taken as determining the format of the child include file.

This setting can be made permanent via the following preferemce:

primer*inherit_file_format:true |false (default true )

Options: Wrap Large format at 80 cols

The syntax of "long" format in LS_DYNA changed in Ansys LS-DYNA 7.1, November 2013.

  • Prior to this date all lines in long format were limited to 80 columns, and a new line was started if the card contained more than 4 data fields resulting in 2 or sometimes 3 physical lines per "Logical" data card line.

  • From Ansys LS-DYNA 7.1, Nov 2013, onwards "long" format lines are permitted to be up to 240 columns long, meaning that each logical line in the keyword manual also occupies a physical line in the file.

The newer (7.1) format is now definitive, and the older format is obsolete. Since large format was not really used prior to early 2014 all large decks are expected to use the later syntax, however there may be a limited need to convert "old" decks to the "new" format, and the option to Wrap Large format at 80 cols permits this by making the PRIMER keyword reader obey the old rules.

(Note that when writing large format PRIMER uses the "new" syntax by default, but it is possible to write decks using the older syntax.)

Options: Pre-read *PARAMETER cards

Generally PRIMER does a good job of reading decks that use *PARAMETER cards, even when the definition of a parameter only appears after it has been used. In order to avoid the time delay involved in performing two read passes it handles this "used before defined" problem as follows:

  • If this is not an item's label field the "unknown parameter value" of zero is inserted
  • If this is a label field then a special non-zero internal label value is inserted (zero won't work for labels)
  • Once the complete deck has been read and parameter values are known it revisits these cards ad substitutes the correct values.

However this approach can fail in some cases. In some situations the temporary substitution of zero in a data field causes an error in the keyword. Another example is where the format of a data card depends on the value of fields within it, and while substituting zero may be legal it means that the meanings of other data fields on the card are interpreted wrongly. Yet another situation that may cause problems is very complicated usage of *INCLUDE_TRANSFORM that depends on parameters.

In these situations the solution is to make sure that the value and type of all parameters are known before their names are referenced, as in this way the correct values can be used ab initio with no need to go back and reformat a card. Selecting this pre-read option achieves this by making keyword reading a two phase operation:

  1. The complete input file, and any include files, are scanned for *PARAMETER cards only so that their information is known.
  2. The whole input deck is then reread, using the now known parameter values.

Although the scan phase (1) is much faster than a normal keyword read (2) it will still take a significant amount of time, and it is recommended that you perform the following reorganisation of your input deck to avoid the problem in the first place. Your goal is to make sure that all parameter definitions are "known" before they are "used", and you can achieve this as follows:

Suggested methods of resolving "out of order" parameter problems in input decks.
Best method: Define all *PARAMETER cards explicitly at the top of the master input file, before any other keywords and in particular before any *INCLUDE files in which they might be used.
Also good: Define all *PARAMETER definitions in one or more *INCLUDE files dedicated to this purpose, and put these at the top of the input deck, before any other keywords. You need to be careful that the order of include files does not get changed, but this is simple enough.
Acceptable:

Define *PARAMETER definitions used in a given include file at the top of that file, before any other cards that might use them. There are two weaknesses to this method: firstly parameters defined in include file A may end up being referred to in include file B, which may go wrong if B is read before A; secondly there is a danger of parameter name clashes if the same parameter is defined multiple times in different files.

If you adopt this approach it may be worthwhile to copy all parameter definitions in the top of all include files, using the _LOCAL suffix or the *PARAMETER_DUPLICATION card to avoid problems with clashes. This has the merit that it makes include files "free-standing" as far as parameter usage goes, but it may be complex to maintain.

Bad!! Placing *PARAMETER definitions at the end of the master file, after any *INCLUDE definitions that may refer to them.

Warning:

PRIMER can handle "out of order" parameters, but Ansys LS-DYNA may not be able to do so. In particular Ansys LS-DYNA explicitly forbids a *PARAMETER_EXPRESSION to contain a reference to a parameter that has not yet been defined.

There are options inside PRIMER to reorder parameters to fix this problem, see "The order in which parameters are defined" under [keyword] PARAMETERS . However it is best to avoid this situation by paying attention to how input decks using parameters are organised.

Options: Convert <expression...> parameters to values

Ansys LS-DYNA permits "implicit" parameter expressions to be created in any data field by enclosing an expression in <...>. For example:

*PARAMETER
         R scale3.25
*NODE
   10,   <2.0*scale>,  2.0,  3.0

In this fragment SCALE is a conventional parameter of value 3.25 , and the X coordinate of node 10 will be 2.0 * scale = 6.50 (Using this syntax requires comma-separated format.)

PRIMER handles this by creating an "implicit" *PARAMETER_EXPRESSION associated with that data field, allowing it to be edited and "remembered" for subsequent keyword output.

However in a model with many < expression > definitions this results in many parameters being created, and this can make PRIMER very slow and unwieldy because parameters are expensive to store and process. Therefore an alternative of converting these < expressions > to their equivalent numeric values during keyword input is available, which works as follows:

  • The "explicit" parameters defined using *PARAMETER cards (eg scale in the example above) are read and stored in the normal way.

  • When an < expression > is found it is evaluated, and replaced with the numeric value. So in the example above <2.0 * scale> is replaced by 6.50 .

Clearly this means that the < expression > is lost, the field cannot be edited as an expression and it no longer "knows" that its value depends on parameter scale . If the deck is written out this loss becomes permanent and the values are "frozen".

So there are significant disadvantages to using this option and it needs to be used with some care and forethought, but it does solve the problem of processing files with a large number of distinct < expression > definitions.

The default for this option is off, but this can be controlled by the preference

primer*convert_implicit_parameter: true |false

During keyword input PRIMER keeps track of how many <...> expressions have been encountered and issues a warning if this exceeds a threshold, offering to turn on this option for future expressions. By default this threshold is 100, but you can alter this by using the preference

primer*warn_num_implicit_parameters: <value> Where <value> is a +ve integer, default 100, or zero to turn the warning off altogether.

Options: Read one entry per *keyword:
Possible way of reading newer input decks in an format that is not yet understood by PRIMER .

When an input deck for a version of Ansys LS-DYNA newer than the current version of PRIMER "understands" is read, keywords sometimes gain extra lines of data. This confuses the keyword reader, making it think that the input deck is invalid, and it rejects the definition - even if there is only one definition per *keyword header.

If this option is selected then PRIMER will read up to the number of lines it expects for the selected keywords ( *AIRBAG, *EOS , etc) and ignore any unexpected trailing ones by skipping to the next *keyword header, which usually makes these input decks readable.

Options: Permit duplicate definitions

Ansys LS-DYNA permits some keywords to be read multiple times. This applies both to:

  • The special case of coincident *NODE definitions.
  • Some other labelled keywords, eg *MAT
  • Some "once only" keywords, eg *CONTROL_ xxx

*NODE is a special case. Duplicate definitions with the same label in different include files will be merged if:

They have the same restraint codes ( TC and RC )

AND

The distance between the nodes is less than 1e-8 times the average coordinate of the nodes.

If a *NODE_MERGE_TOLERANCE card is defined then the nodes are also merged if the distance between them is less than this tolerance.

Duplicate nodes not meeting these criteria for coincidence are treated as an error during keyword input.

Coincident nodes are often used to "stitch together" models from include files, where multiple definitions of nodes are merged into a single entity. PRIMER emulates this by merging nodes using the same criteria so long as the *NODE entry in this panel is selected, which it is by default.

*CONTACT is also a special case.

Ansys LS-DYNA will permit duplicate labelled contact surface definitions, and from PRIMER 13.0 there is special logic to handle this.

See Contact, Duplicates during input for details.

The treatment of duplicate nodes (and other item types) has changed in PRIMER 12.0 with the introduction of "cloning":

Prior to PRIMER 12.0 Versions prior to PRIMER 12.0 will "lose" the 2nd and subsequent definitions of duplicate nodes, meaning that if a model and include files containing these definitions is read in and then written out these nodes will be omitted.
From PRIMER 12.0 onwards

From PRIMER 12.0 onwards these duplicate nodes will be remembered as "clone" definitions. This is implemented in the following way:

  • Only a single, unique, version of a *NODE is stored in the database. So it can only have a single coordinate and other properties, and all references to it point to this single unique definition.

  • Any number of "clone" definitions of this node can exist subject to the following rules:

    - Each such definition must be in a different include file. It is illegal to have two items of the same label in the same file.
    - A clone definition is simply a "placeholder" recording the fact that the node exists in some other include file.
    - It will appear in cross reference listings, but it will not be editable.

  • On keyword output an identical keyword for each duplicate node will be output in each include file where it was originally found.

In this way duplicate nodes are no longer "lost", and will be rewritten in all include files in which they originally appeared.

See [Tools] Clones for more information on how clones work, and how to process and visualise them.

A similar (and also undocumented) feature in Ansys LS-DYNA is that the following keywords may be multiply defined with the same label. In Ansys LS-DYNA it is likely, but not certain, that the last definition found will be used and the earlier ones discarded.

*SECTION *MAT (Not in R9) *DEFINE_BOX
*DEFINE_COORDINATE_... *DEFINE_SD_ORIENTATION *DEFINE_VECTOR
It seems probable that the following keywords either are, or will, also be permitted to occur multiple times in Ansys LS-DYNA:
*EOS *HOURGLASS *MAT_THERMAL

Therefore PRIMER contains similar logic that will permit these cards to be defined multiple times if selected here.

Prior to PRIMER 12.0 Warnings will be issued if such duplicates are found, and only the first such definition will be used with the remainder being discarded. If the model is written out the 2nd and subsequent duplicate definitions will be lost.
From PRIMER 12.0 onwards

These definitions will be "cloned"during keyword input in much the same way as duplicate nodes, however unlike nodes there are no rules with Ansys LS-DYNA to permit duplicate definitions to be merged using some tolerance. In addition it is not always clear whether Ansys LS-DYNA will take the first definition encountered, discarding the rest; or will always use the last, discarding all earlier ones. Therefore PRIMER applies the following rules:

  • When keyword input is complete any duplicate definitions of a given keyword are checked for differences.

  • If all definitions are found to be identical then PRIMER silently discards all but one, making "clones" of the rest, and input processing continues without intervention from the user.

  • If differences are found these are listed, and the user is required to choose what action to take. Various options including "abort", "take first", "take last", "take definition in master file", etc are available. See [Tools] Clones, What happens if duplicate definitions contain differences? for more information about these options.

    It is strongly recommended that if differences are found the keyword input process should be aborted and the problem investigated manually. The reason being that Ansys LS-DYNA will not generally warn you about this problem, and if supposedly identical definitions in different include files are not in fact the same the results you get from an analysis may depend on the order in which the include files are read.

    (Special rules apply to *NODE cards, as described above. It is an unconditional error if duplicate but non-coincident nodes are found during input.)

Assuming that duplicate definitions are found to be identical PRIMER will maintain a single unique definition of each definition, plus some number of clones. On keyword output an identical definition will be output in each include file in which it originally appeared.

A further, and once again undocumented, feature of Ansys LS-DYNA is that "once only" keywords souch as *CONTROL cards will also be accepted if defined multiple times. As with the keywords above versions before PRIMER 12.0 would "lose" the 2nd and subsequent definitions; from PRIMER 12.0 onwards these too tested for differences, and then "cloned", and identical definitions will be written to every include file in which they were originally found.

Options: Treatment of severe errors

PRIMER is quite strict about errors when reading input decks, since invalid data fields can result in a corrupt database. This can be a problem when it rejects what it believes is a corrupt deck when you, the user, know that it will in fact be OK to continue.


If you choose Skip & Continue these errors are downgraded to warnings, the offending data cards are skipped, and input continues. You do this at your own risk, and you must deal with the consequences of any resulting database inconsistencies.
Options: Special input exceptions

Sometimes an input deck will contain a very large number of *BOUNDARY , *INITIAL or *LOAD cards, and this can be a nuisance if you only want to look at geometry as it makes the model slow to read and will also consume a lot of memory. You can choose to:


  • Read these cards. This is the default behaviour, and they will be read normally.
  • Skip these cards. They will not be read, but will be placed in a "skip" file. If the model is written out they will be copied verbatim from the "skip" file into the output deck.
  • Ignore these cards. They will not be read or saved in any way. If the model is written out they will be lost.

Clearly the Ignore option is only suitable for read-only inspection of the deck, and the Skip option may give problems if nodes or elements are deleted or renumbered.

Options: Save embedded comments

Comment lines are often placed among keywords, and PRIMER can remember these and write them back out in the same locations. PRIMER regards comments as being "embedded" if they are between a *Keyword header and data lines, or within data lines. Consider the following example:
$ This comment is "free standing" since it is not between a *keyword and data lines
$
*NODE
$ This comment is "embedded": it is between the keyword header (*NODE) and following data
1 1.0e3 0.0 0.0 $ This comment is "embedded" because it is between data rows 2 2.0e3 0.0 0.0 $ $This comment is "free standing" because it is not between a *keyword and data lines. $ *ELEMENT_SHELL

In the example above the comments in italics are "free standing" and will not be saved, whereas those in normal text are "embedded" and will be saved.

A special exception is comment lines starting " $: ",. PRIMER does not save these lines, regardless of their location. Such lines are used when PRIMER writes things like data field headers, and it stops these lines being saved and rewritten multiple times. For example:

*PART
$ User-defined comment $: PID SECID MID EOSID HGID GRAV ADPOPT TMID
1 10 2 0 0 0 0 0

The "user defined comment" line starting with plain $ is embedded, and will be saved; but the field header line starting $: is not saved. It will be recreated on output if field header display is turned on.

More details about the processing of embedded comments may be found in "Embedded" Keyword Comments.

Options: Ignore LSPP comments

LS-PrePost "tags" comments that don't need to be kept, such as card field headers, by starting these lines "$#" (similar to the way PRIMER uses "$:"). By default PRIMER ignores comments with this tag, untick this box to preserve them.
Options: Processing of *COMMENT cards


The Ansys LS-DYNA keyword format has a *COMMENT keyword which allows any number of lines of user text to be added to a deck, the comment being terminated by the next *keyword. This topic is covered in detail in *COMMENT , but a summary is provided here.

"Anchoring" of *COMMENT cards

Ansys LS-DYNA ignores this keyword and its contents completely, but some users like to associate the *COMMENT with the following keyword(s) in order to store meta-data associated with that keyword. Therefore PRIMER stores the keyword(s) which follow the comment so that it can be re-inserted in the same place during keyout, maintaining the association between comment and keyword(s). The process is referred to as "anchoring" the comment in the deck and it can take place at two levels of complexity:

Anchor single This stores only the keyword immediately following the comment.
Anchor multiple This stores all keywords between the next *keyword header and the following *keyword header

Both for backwards compatibility and to maintain speed during keyword output the default is "anchor single", but you can choose "anchor multiple" at any time. Swapping between modes has the following effects:

  • A *COMMENT that has already been read maintains the single/multiple anchoring mode that was current when it was created, that is when the deck containing the comment was read or when the comment was created interactively inside PRIMER .

  • When any future keyword files are read the current mode will apply, and this will also be the default mode for the editor used for creating new comments inside PRIMER .

In other words changing modes here only affects future operations on comments, it has no retrospective effect and each comment "remembers" the mode used when it was created. The default setting can be changed by the preference

primer*anchored_comment_handling: SINGLE | MULTIPLE

Treatment of "$" comment lines within *COMMENT

It is sometimes the case that *COMMENT is used to remove a keyword temporarily from the input deck. In this example the user wishes to remove some user-defined loading from the model without losing the keywords, so the *USER keyword has been preceded by *COMMENT.

*COMMENT *USER_LOADING_SET
$
$ Load #1 is for nodal forces
1FORCEN 1 1 1.0 2.0 3.0 3
$ Load #2 is for body forces
2BODYFN 2 2 4.0 5.0 6.0 4
$ Load #3 is for nodal temperatures
3TEMPTN 3 3 7.0 8.0 9.0 5
$ Load #4 is for pressure on shells
4PRESSS 4 4 10.0 11.0 12.0 6
$ Load #5 is for pressure on beams
5PRESSB 5 5 13.0 14.0 15.0 7
However how are the original comment lines starting with "$..." to be handled when PRIMER reads and stores the *COMMENT card? In this example it is fairly obvious that they should be remembered since they convey useful information. However what about the following examples?


Field headers added by 3rd party software (starting "$ ")

*COMMENT *CONTROL_TERMINATION
$ ENDTIM ENDCYC DTMIN ENDENG ENDMAS NOSOL
0.01 0 0.0 0.0 0.0 0


Field headers added by LS-PREPOST (starting "$# ")

*COMMENT *DATABASE_BINARY_D3THDT
$# DT LCDT
0.005 0


Field headers added by PRIMER (starting "$: ") and also some HyperMesh comments starting "$HM..."

*COMMENT  *MAT_PLASTIC_KINEMATIC_TITLE
$HMNAME MATS 1steel350
MATS 1steel350
$: mid ro e pr sigy etan beta
1 7.85E-9 207000.0 0.3 350.0 1000.0 0.0
$: src srp fs vp
0.0 0.0 0.0 0.0


There isn't a simple answer that meets all requirements so the following options are available to allow the various "$" comment line possibilities to be processed separately.

By default all are read and remembered, but you can set any permutation you wish and save this via preferences.

Truncation of trailing "$" comment lines

*COMMENT cards are often padded with additional empty "$" comment lines, for example

*COMMENT
The quick brown fox jumped over the lazy dog $
$


PRIMER typically adds "$" lines at the ends of keyword blocks to make the deck more readable, and it also adds a single "$" at the end of a *COMMENT block for the same reason.

If reading of "$" lines is included in the *COMMENT this could lead to a build up of an extra"$" line each time the deck passes through PRIMER , so by default processing of *COMMENT truncates trailing "empty" comment lines to a single one.

Options: *SET_COLLECT in *INCLUDE_TRANSFORM

When *INCLUDE_TRANSFORM is used to read an include file it is possible to define label offsets for sets, variable IDSOFF, which is applied to all sets except _COLLECT ones.  This means that if a self-contained file which contains *SET_xxx_COLLECT definitions and references to these is read with offsets it may "break" the logic of the file. This is because:

  • Any references to set N will become references to set (N + IDSOFF).
  • But SET_xxx_COLLECT N will continue to have label N.

This option is designed to deal with this problem, its sub-menu looks like this:

By default PRIMER will behave like Ansys LS-DYNA, however if you have a file containing the situation above it may still be possible to read it using the option "Map unresolved references to set". This looks for the combination of SET_xxx_COLLECT N and undefined (latent) SET_xxx label (N + IDSOFF), if it finds this is maps the undefined set (N + IDSOFF) onto the _COLLECT set N.

In addition PRIMER will check for combinations of set labels in such files which might suggest modelling errors.  For example if you have *SET_xxx (N - IDSOFF) and *SET_xxx_COLLECT N this is likely to cause problems.   These warnings can be turned off by un-ticking the "Issue warnings about possible errors" box.

Options: Drag & drop files are Ansys LS-DYNA

If you wish to drag and drop Ansys LS-DYNA files (*KEYWORD format) that have a non-standard extension (*.inp,*.dat etc.) then tick the checkbox. It will not check the extension of the file and read it as a *KEYWORD file.

If it's unchecked, then file extension will be used to decide the file type and then read accordingly.

Options: Remember skipped include files


Prior to PRIMER V22 any include files not found and skipped during keyword input were "lost" in the PRIMER session: they would be omitted from the Include tree and no *INCLUDE statement for them would appear in the keyword output file.

From V22 onwards the default is now to "remember" these files. They will appear in the Include tree and can be read subsequently from there, their *INCLUDE statements will also appear in the keword output file (although the file itself is not written).   By unticking this option you can revert to the pre-V22 behaviour and forget these files.

Options: Find data during scan

When using Scan or Quick scan to read a subset of include files from your model problems can arise if *PARAMETER or *DEFINE_TRNSFORMATION cards are referred to by the include files read, but are defined in other include files that have not been read.

If this option is selected then PRIMER will search other include files for the missing definitions and read them in so that the files that have been read are correct.

Options: Zero field spillover

PRIMER is strict about formatting and grammar errors when reading data, and this can result in an input deck being rejected due to minor editing errors. A particular example of this is when a data field has been hand-edited and given too many trailing zeros so that it spills over into the next data field. Consider the following example:

$   FIELD1    FIELD2    FIELD3    FIELD4    FIELD5
    200000  100.0000         1      30.00        1

In this example it is clear that the trailing zero on 30.00 (in red) is an accidental spill-over into the next data field, and can safely ignored. By default PRIMER will reject this line as being wrongly formatted, but permitting "Zero field spillover" will accept it instead.

WARNING : permitting this can cause errors. The example above showed harmless trailing zeros on a floating point number, but consider the following:

$   FIELD1    FIELD2    FIELD3    FIELD4    FIELD5
    200000  100.0000         1      30000        1

Field #4 is now an integer, and by ignoring the trailing zero its value has been changed from 30000 to 3000, which would (probably) be an error. Use this facility with caution, and only after you have inspected the offending line to make sure that it is safe.

Options: File input & output tuning

We have received reports of slow keyword file read and write behaviour on some platforms when the files in questions are on a remote networked disk.

PRIMER uses standard ANSI C buffered i/o routines when reading and writing files and in most cases the default system settings are satisfactory. However users with "problem" remote files have reported improvements when changing the default settings, so the following may be altered:


Input and output Buffer size

These are the sizes in bytes of the memory buffers used by the system for reading and writing files.

ANSI C documentation states that they must be a multiple of 2 bytes, although it does not stipulate a size; most systems default to 4096 bytes. Experimentation by Oasys Ltd suggests that:

  • Values less than 512 bytes or greater than 131072 bytes are likely to reduce speed.
  • Values in the range 4096 to 32768 bytes are likely to give the best results.
  • Values less than 4096 bytes should be a multiple of 512.
  • Values greater than 4096 bytes should be a multiple of 4096.

However you may find that different values work better on your system: you can experiment by setting these values manually and measuring the time taken to read and write files. If you find values that work better than the defaults then you can set them in the "oa_pref" file using:

primer*input_buffer_size: nnnnnn
primer*output_buffer_size: nnnnnn

Where nnnnnn is the size in bytes.

For most users disk read/write speed is not a problem, and it is suggested that the default values are used unless they are demonstrably inefficient.

Echo frequency (lines)

During file input and output PRIMER reports its progress via an "echo" of the current line to the dialogue box, by default every 1000 lines. It also checks the user interface at this frequency to see if the user has made any inputs, for example using the Stop button to halt i/o.

Users working on remote displays, where updates of the user interface have to travel over the network, may find that there is a speed advantage in reducing this echo frequency. You will need to experiment, but values of 10,000 or greater may help in these circumstances. To store revised settings in the "oa_pref" file use:

primer*input_echo_frequency: nnnnnn
primer*output_echo_frequency: nnnnnn

Where nnnnnn is the number of lines.

Users working on a local display will almost certainly find no benefit is gained from increasing these values.

Options: Comment reading options


Read HM comments - Turn ON/OFF reading of HM comments in the keyword file.

Read ANSA comments - Turn ON/OFF reading of ANSA comments in the keyword file.

Copy HM titles - When ON, PRIMER will set a material or section title (if one is available from an HM comment), and if the item does not already have a title. If OFF, The title will not be set to any available HM comment title, but the comment will be retained for keyout.
Options: Text box messages during Keyword read

Some errors and warnings during Keyword input generate a "text box" panel that halts processing until the user clicks OK (or something else) to acknowledge the message.

If the "suppress" option is used then the messages will still be output, but only in the dialogue box, so the user does not have to acknowledge them and processing is not halted.
Options: Save Keyin log to file

During keyword input all messages written to the dialogue box are also saved to file, and can be viewed in an external editor using the View log button. However this log file is overwritten each time a new keyword file is read, and it is also lost at the end of the PRIMER session unless saved manually from an external edit session.

It can be useful to save this information, especially when running PRIMER in batch mode (no graphical user interface), and this option permits all messages to the dialogue box to be saved in file primer_readlog.txt in the directory of your choice.

The directory may be specified in two ways:

  • By giving an explicit pathname, for example C:\users\myself\readlogs

  • By using the special name JOBDIR , which means "use the directory from which the master keyword file was read". It is legal to append relative paths to this, for example JOBDIR/../logs will select the directory above, then down into sub-directory logs. This can be useful if your system has read-only directories.

If the file primer_readlog.txt already exists its name will be amended to primer_readlog _n .txt where _n is the smallest integer required to make the filename unique. In this way existing files will not be overwritten.

Writing of this log file can also be turned on in two other ways:

  1. By using the command-line option ' -rlog_dir= pathname '
  2. By setting the preference ' primer*save_read_log_dir: pathname '

It doesn't matter which method is used, all create the same file. The order in which these are read are (1) preference, (2) command-line, (3) this options panel. The most recently read definition will control the pathname that is used.

If this facility is turned on then two extra blocks of information are written:

(1) Merged *NODE data Ansys LS-DYNA permits multiple definitions of a *NODE with the same label to exist in an input deck so long as the bopundary conditions ( TC and RC ) of the two definitions are the same, and their coordinates are coincident to within a small tolerance. This tolerance is defined by:

(xdist2 / xdist1) < 1.0e-8 where

  • xdist2 is the vector distance between the coordinate of the two nodes
  • xdist1 is max(1.0e-16, vector distance of node from origin)

In addition if a *NODE_MERGE_TOLERANCE card is defined then the nodes must be further apart than this tolerance to be considered "not coincident".

PRIMER uses the same logic as Ansys LS-DYNA, and automatically merges coincident nodes that obey these rules. It "remembers" the duplicate definitions as "clones" - see Permit Duplicate Definitions above for more details about this process. Normally this merging process is carried out silently, but if this log file is being written then an extra report of all merged nodes is written to the file. An example of this output is:

Node 1 merge SUCCEEDED
First definition at 1.00110E+03 1.00000E+02 4.23501E+03, TC = 0, RC = 0, in incl_1.key
Duplicate definition at 1.00110E+03 1.00000E+02 4.23501E+03, TC = 0, RC = 0, in Master file
Distance to origin (xdist1) = 1.0172e+03, separation distance (xdist2) = 0.0, (xdist2/xdist1) = 0.0

It will be seen that the coordinates and also the include file containing each definition is reported.

Merged nodes can be visualised, see [NODE] Duplicates for more information.

(2) Duplicate *PARAMETER data Ansys LS-DYNA permits the *PARAMETER keyword to use suffices _LOCAL and _MUTABLE , which make it legal for a parameter name to be used more than once, possibly with different values. In addition the *PARAMETER_DUPLICATION card controls how potentially illegal duplicate parameter definitions will be processed, and controls which of multiple definitions will be the true value.

These options may be flexible, but they can also lead to complexity if input decks with many include files contain multiple different definitions of a parameter, making it hard to tell which value is used in which context.

PRIMER tolerates this, obeying the same rules as Ansys LS-DYNA to determine how multiple definitions should be processed. It also tolerates and "remembers" illegal duplicate definitions, both so that they can be written out again and also to cope with changes to the various keywords that could alter their legality. This processing is normally carried out silently, and it is necessary to go to the [keyword] PARAMETER, MODIFY panel to view the status, value and legality of all parameters.

However if keyin logging is in force then the status of all duplicate parameter names is written to this file, giving a permanent record of their status when read. An example of this output is:

Parameter name: X701

Instance 1: *PARAMETER (Real, value = 701.1) in master file
OK-USED: global definition

Instance 2: *PARAMETER_LOCAL (Real, value = 801.1) in incl_2.key
OK-USED: locally because of _LOCAL suffix

Instance 3: *PARAMETER (Real, value = 901.1) in incl_3.key
ERROR-IGNORED: illegal definition is saved but ignored in PRIMER

In this example parameter X701 is defined three times:

  1. In the master deck as plain *PARAMETER , with the value 701.1
  2. In include file incl_2.key as *PARAMETER_LOCAL , with the value 801.1
  3. In include file incl_3.key as plain *PARAMETER , with the value 901.1

Usages #1 and #2 above are legal, since #2 (being _LOCAL ) will only apply in include file incl_2.key. So both are marked as OK-USED

Usage #3 is illegal since a plain *PARAMETER with no suffix is "global", and this conflicts with the original definition in the master file. So this is marked as ERROR-IGNORED .

You can find out more about how PRIMER handles parameters under the PARAMETER keyword documentation.