sdtdef#

Purpose

Internal function used to handle default definitions.

Syntax

sdtdef('info')
[i1,r1]=sdtdef('in','Pref')
sdtdef('Pref')
sdtdef('Group.Pref')
sdtdef('Pref',Value)
sdtdef('Pref-safe',Value)
sdtdef('Pref-SetPref',Value)

Description

Allows to handle preferences of SDT, FEMLink and OpenFEM.

This function was initially developed to limit the risks of corruption of the MATLAB preference file, which can occur if multiple instances of MATLAB try to access this file at the same time with standard commands getpref/setpref.

To handle preferences of SDT, FEMLink and OpenFEM, the recommended use is to

  • sd_pref('set','[SDT,OpenFEM,FEMLink]','Pref','value') for the first creation of the preference.
  • [i1,r1]=sdtdef('in','Pref') to check if a preference is defined and get back the value .
  • sdtdef('[,OpenFEM.,FEMLink.]Pref','value') to perform a local modification of the preference value (in the current MATLAB session).
  • sdtdef('[,OpenFEM.,FEMLink.]Pref-safe','value') only performs the local modification if the preference does not exist (previous call fail in this case)
  • sdtdef('[,OpenFEM.,FEMLink.]Pref-SetPref','value') performs a hard modification of the preference (through a setpref). Only works if the preference already exists, only setpref can be used to create a preference for the first time.

To reset values to factory defaults use sdtdef('factory').

info#

The command sdtdef('info') provides the full list of preferences of SDT.

The command sdtdef('info','OpenFEM') provides the full list of preferences of OpenFEM.

The command sdtdef('info','FEMLink') provides the full list of preferences of FEMLink.

The command sdtdef('info','SDTools') provides the full list of preferences of SDTools.

in#

To check if a preference already exists in order to create it with setpref if not, use [i1,r1]=sdtdef('in','[,OpenFEM.,FEMLink.]Pref'). It tells if 'Group','Pref' exists in i1 as bool, and provides value r1 if true, empty if false.

With an empty Pref, the full list of preferences in the Group is forwarded in r1 if the group exists.

SDT preferences#

Preferences of SDT are accessed directly by the call sdtdef('Pref') (replaced by the standard call getpref('SDT','value'). It returns an error if the preference does not exist.

Here is a partial list of SDT preferences :

  • avi : cell array of default AVI properties, see the MATLAB avifile command.
  • DefaultZeta :Default value for the viscous damping ratio. The nominal value is 1e-2. The value can also be specified in a model stack and is then handled by fe_def defzeta and fe_def defeta commands.
  • KikeMemSize : Memory in megabytes used to switch to an out-of-core saving of element matrix dictionaries.
  • DefaultFeplot : cell array of default feplot figure properties. For MATLAB versions earlier than 6.5, the OpenGL driver is buggy so you will typically want to set the value with

    sdtdef('DefaultFeplot',{'Renderer' 'zbuffer' ... 'doublebuffer' 'on'})

  • epsl : tolerance on node coincidence used by femesh, feutil. Defaults to 1e-6 which is generally OK except for MEMS applications, ...
  • tempdir : can be used to specify a directory different than the tempdir returned by MATLAB. This is typically used to specify a faster local disk.
  • OutOfCoreBufferSize : Memory in bytes used to decide switching to an out-of-core procedure. This is currently used by nasread when reading large OUTPUT2 files.

OpenFEM preferences#

Preferences of SDT are accessed directly by the call sdtdef('OpenFEM.Pref') (replaced by the standard call getpref('OpenFEM','value'). It returns an error if the preference does not exist.

Here is a partial list of OpenFEM preferences :