D3PLOT 22.1

Saving and Reloading User-Defined Components

Saving and reloading user-defined components

All types of user-defined component described above can be saved in a "User Component File" called "d3plot.ucf" using the Save component button, which will save the current component in the file for future reuse.

Likewise Reload saved will present a menu of components found in the "d3plot.ucf" file, and choosing one will import its settings for the component you are currently editing or creating.

Save component Saving the current component to file

When you Save the current component you are asked to choose:

  • Which file(s) to save it in.

    OA_INSTALL is your Oasys Suite installation directory.
    OA_HOME is your home directory.
    <cwd> is the current working directory.

    The component will be saved in all files selected for which you have write permission.

  • Overwrite existing determines what happens if the name of the component to be stored matches one already in the file.

    If you choose to overwrite then the original component in the file will be overwritten with the new definition.
    Otherwise the current component's name will be added to the file, with its name modified by adding the suffix #1 (or #2, ...) to make it unique.

    Name comparison is not case-sensitive, but does consider embedded white space. For example:

    " My beam component " is treated as being identical to " MY BEAM COMPONENT "

Reload saved Reloading a component from disk to the current definition

When you choose to Reload saved the various "d3plot.ucf" files are scanned for components that match the current type, and these are listed in a menu for selection.

In this example the user is using a Simple Formula to define a solid/shell tensor, and there are three components to choose from.

Note that the component "My SoSh tensor #1" has been stored multiple times, and, because Overwrite existing was not used, the subsequent definitions have had the digit on the end incremented to make their names unique. (This is because D3PLOT requires components to have unique names, otherwise its internal parsing of components by name can get confused).

Automatic reloading of user-defined components

When D3PLOT starts it automatically scans any "d3plot.ucf" files and loads any " unique " components, meaning that saved user-defined components automatically become available in a new session.

On start-up it scans the following directories:

OA_INSTALL Typically where the software is installed, and suitable for system-wide components. You may not have write permission to this directory
OA_HOME Your home directory. This would be suitable for components you want to use for a range of projects.
<cwd> (Current working directory)

The location of this varies:

  • On Unix/Linux it will normally be the directory from which you started D3PLOT

  • On Windows it will be the "start in" directory defined on an icon, unless over-ruled by a command-line "start-in" argument
    If you double-clicked on a file, or dragged a file onto the D3PLOT icon it will be the directory of that file.

In addition whenever a new model is opened any "d3plot.ucf" file in that model's directory is scanned, and any "unique" components are loaded.

Definition of a "unique" component

A component is deemed to be "unique" if :

  • Its name does not match any currently stored component (including "built-in" and UBIN components).

    As explained above name matching is not case sensitive, but does consider embedded white space.

and

  • Its data row(s) do not match stored data rows(s)

    FILE and JAVA script filename comparisons are made verbatim.

    FORM ulae matching ignores both case and embedded white space. (i.e. the formulae are compressed to remove any white space before testing for matches)

If a component read from file is found not to be unique, i.e. it has already been read and stored, then it is ignored. In this way multiple reads of the same file, or the presence of a formula in more than one file, will not result in multiple definitions being read and stored.

If a component name matches, but its content (data rows) does not, then it is read in and its name has "#1", "#2", etc. added to make it unique.

The Format of the "d3plot.ucf" file

Components are saved in the generic format:

<Type> <Source> <Name> <Type> is one of NODE_SCALAR
SOSH_SCALAR
BEAM_SCALAR
OTHR_SCALAR
NODE_VECTOR
BEAM_VECTOR
OTHR_VECTOR
SOSH_TENSOR
OTHR_TENSOR
<Source> is one of FILE
FORM (ula)
JAVA (script)
<Name> Is a user-defined name up to 30 characters long

<Definition row #1>
: :
(Up to five further rows)

For FILE a single row A filename up to 256 characters long
For FORM 1, 3 or 6 formulae. Each
on a new line, and each up to 256
characters long.
xxxx_SCALAR
xxxx_VECTOR
xxxx_TENSOR

one formula
three formulae
six formulae

<scalar>
<x, y, z>
<xx,yy,zz,xy,yz,zx>
For JAVA script a single row A filename up to 256 characters long

The file is free-format ASCII (text) and is not case sensitive.
Each row must be on a single line, up to 256 characters long.
Blank lines are ignored.
Lines starting with "%", "$" or "#" in column 1 are treated as comments, and are also ignored.

The only exception is that on Unix/Linux systems filenames are case-sensitive and they will be stored exactly as they have been defined.

The file may be hand-edited using a normal text editor. It will also be updated by the Save and Reload options described above.

Here is an example of a typical file

$ Example file, created for user manual 1/11/2007

NODE_VECTOR FILE Example of nodal vector file
i:\demos\example1.dat

NODE_SCALAR FORM Example of scalar node form
sqrt(dx + dy + dz)

BEAM_VECTOR FORM Example of vector beam form
fx * eax
fy * eyz
fz * ezx

SOSH_TENSOR FORM Example of elem tensor form
sxx * exx
Syy * Eyy
sxx * ezz
sxy * exy * 0.5
syz * eyz * 0.5
szx * ezx * 0.5

BEAM_SCALAR JAVA Example of beam scalar Java
/local/demos/javascript/beam_scalar.js