fe_caseg#

Purpose

Gateway functions for advanced FEM utilities in SDT, regarding assembly, integrated case definition and post-treatments.

Description

This function is only used for internal SDT operation and actual implementation will vary over time. The following commands are documented to allow user calls and SDT source code understanding.

Assemble#

Optimized strategies for assembly are provided in SDT through the fe_caseg Assemble command. More details are given in section 4.10.7.

StressCut#

The StressCut command is the gateway for dynamic stress observation commands. Typical steps of this command are

  • View mesh generation, see section 4.9.1.
  • Generate a selection sel=fe_caseg('stresscut -selout',VIEW,model);
  • Display the selection in feplot using fe_caseg('stresscut',sel,cf)
  • Observe the result using curve=fe_caseg('StressObserve',cf.sel(2),def)

For the selection generation, accepted options are

  • VIEW can be a mesh so that feutilb Match is used to find elements associated with viewing positions. A structure struct('type','Gauss') to return selection at Gauss points. A structure struct('type','BeamGauss') to return selection at beam Gauss points.
  • a model or feplot handle cf can be provided as third argument.
  • -SelOut requires selection output.
  • -Radiusval provides a search radius for the feutilb Match call.

The sel data structure is a standard selection (see feplot sel) with additional field .StressObs a structure with the following fields

  • .cta observation matrix for stress components. The expected sort is to have all components at first node, all at second node, ...
  • .DOF expected DOF needed for the observation.
  • .X,.Xlab labels for the observation, see Multi-dim curve for details.
  • .CritFcn callback to be evaluated, see fe_stress CritFcn.
  • .Node,.Elt nodes and elements for the view mesh.
  • .trans structure for the observation of interpolated displacement (needed when view mesh nodes are not nodes of the original mesh).

Change[,set]#

High level model change functionality. These commands aim at providing a strategy to define model features that can be changed during a simulation procedure.

During model setup, one can define a changing feature with command ChangeSet.

The syntax is model=fe_caseg('ChangeSet',model,type,name,data). model is a standard SDT model, type is the feature type, name is the change feature reference name, data is defines the feature that will be changed. This command then stores relevant information in the model nmap('Map:MChange').

The following types and associated data definition strategy are supported

  • elt type: allows adding/removing elements. data is either a string providing a FindElt command to ba applied on the model, or a structure with either field .sel as FindElt string, or .Elt to directly provide the elements.
  • elprop type: allows assigning different element properties. data is a structure with a FindElt command in field .sel or concerned EltId in field .data. To alter the MatId, the field .pl must be set to the new MatId to be assigned, or to alter the ProId, the field .il must be set to the new ProId to be assigned. Each entry can only handle one property. The mat/pro entry must be present in the model.
  • mp type: allows changing a mat/pro value. data is a string of the form param=val -matid vali that will call feutilsetmat with the given values and identifiers. One can use -proid to have a setpro.
  • case type: allows adding/removing a case entry. data is either a string providing the case entry name, or a structure with field .cname providing the case entry name. On can provide field .data as a stack line to directly provide the case entry to handle.
  • cbk type; allows a fully customized call. data is a callback entry in cell array format or UrnCb format to the user function that will be called upon a change event.

During simulation, one can then alter the model using predefined features with command Change The syntax is model=fe_caseg('Changeevt'),model,name)' or can be generated as a callback as model=fe_caseg(model,evt,'change')'. In the latter case, evt is a struct with fields .evt to define the change event, and .data to provide the change reference name. In the former case, evt is the change event. Depending on the change type, the following events are supported:

  • elt support change events
    • Add to add the defined elements in the model.
    • RM to remove the defined elements in the model.
    • Reset to come back to the model state corresponding to the ChangeSet definition.
  • elprop support change events
    • MP to apply the defined MatId or ProId to the concerned elements.
    • Reset to come back the model state corresponding to the ChangeSet definition.
  • mp support change events
    • MP to apply the defined property setting to the concerned MatId or ProId.
    • Reset to come back the model state corresponding to the ChangeSet definition.
  • case support change events
    • Add to add the defined case entry to the model case.
    • RM to remove the defined case entry from the model case.
    • Reset to come back the model state corresponding to the ChangeSet definition.
  • cbk calls the custom function with model and evt as a structure.
model=demosdt('demoubeam-noplot');
% add aluminum property
model=m_elastic('dbval2 aluminum',model);
% define change feature
model=fe_caseg('ChangeSet',model,'newmat',struct('sel','groupall','pl',2));
% apply feature change
evt=struct('evt','mp','data','newmat');
model=fe_caseg(model,evt,'change');
% reset feature change
model=fe_caseg('ChangeReset',model,'newmat');

Par[Mat,Pro,SE,Init,Set,2Case]#

Advanced parameter declaration in models. Lower level declaration can be found in fe_case par. Model parametrization framework can be found in the zcoef documentation.

The following commands are available to declare SDT parameters

  • ParMat Support to declare as parameter and possibly split a material property. Warning: Some formulations and parameter classes cannot directly be split from the constitutive law, in such case the resulting assembled matrices may not be computable. Advances material splitting features are available in the Viscoelastic toolbox [38] (fevisco('MatSplit') command). Syntax is model=fe_caseg('ParMat',model,'p1 .... -matid i',par); with model a SDT model, p1 is a constitutive law parameter as declared in the corresponding m_ function, and par is a parameter entry. The working material is defined by the token -matid. The output model can have a split material featuring varying parameters, and will have a Case par entry declaring the parameter and a entry in Stack,Range0 providing its variation.
  • ParPro Support declaration as parameter and possibly split of an integration property, this is designed for discrete structural elements such as celas, cbush, mass1elements. Syntax is model=fe_caseg('ParPro',model,'p1 .... -proid i',par); with model a SDT model, p1 is a constitutive law parameter as declared in the corresponding p_ function, and par is a parameter entry. The working property is defined by the token -proid. The output model can have duplicated elements featuring varying parameters, and will have a Case par entry declaring the parameter and a entry in Stack,Range0 providing its variation.
  • ParSE Support to declare as parameter a superelement, or a subset of superelement matrices. One can identify the SE of interest either by its SeName or its ProId. If necessary one can identify matrices of interest either by Klab or matdes, or property name in the p_superentry. If a single matrix is targeted ensuring no low-level assembly is performed by using KlabNoA to provide the matrix label for identification.
    model=fe_caseg('ParSE',model,' -SeName"se1"',par);
    model=fe_caseg('ParSE',model,'coef1 -proid1001',par);
    model=fe_caseg('ParSE',model,' matdes3 -proid1001',par);
    
    The output model can have duplicated elements featuring varying parameters, and will have a Case par entry declaring the parameter and a entry in Stack,Range0 providing its variation.

The following commands are available to declare and handle broader parameter definitions, to be used in dedicated routines

  • ParInit Instantiate .param entries in supported model features. model=fe_caseg('ParInit',model,par); par is here a parameter or a cell array of parameters to be implemented. Implementation or the feature to be affected is provided through the .info field of the parameter. It is a string following the format type>entry TokenId.
    • type is optionnal (> is then omitted) and provides a way of defining field .type of the parameter usual types are double, pop, but other custom types can be defined for dedicated applications.
    • entry defines the parameter effect, the value depends on the type of feature to be parametered, defined by the TokenId
    • TokenId defines the feature on which the parameter is applied. The following features are supported
      • Materials, either defined by -matname or -matidi. Acceptable entries as then any declared constitutive law in the corresponding m_ function.
      • Structural properties, either defined by -proname or -proidi. Acceptable entries as then any declared constitutive law in the corresponding p_ function. Properties in NLdata are supported, in such case the entry must start with nldata.val to affect field .val of field .NLdata.
      • Loads, defined by their type and name typename (e.g. -dofLoad''ExForce''). entry is then the impacted field name.
      • Boundary conditions, defined by their type and name typename (e.g. -rigid''conn''). entry is then the impacted field name.
  • ParSet Applies a current parameter set (or design point) to a model for which fe_caseg ParInit has been applied. Given an SDT model and a Range structure with field .jPar, the procedure loops over supported features having a .param field, and applies the current values. model=fe_caseg('ParSet',model,Range);.

StressObserve#

The StressCut command typically returns all stress components (x, y, and z), for a relevant plot, it is useful to define a further post-treatment, using the sel.StressObs.CritFcn callback. This callback is called once the stress observation have been performed. The current result is stored in variable r1, and follows the dimensions declared in field .X of the observation. For example to extract stresses in the x direction, the callback is

 sel.StressObs.CritFcn='r1=r1(1,:,:);';

The StressObserve command outputs the stress observation in an curve structure. You can provide a callback -crit "my_callback". The command option -trans allows observation of translations for selections that have this observation. If empty, all components are kept.

data=fe_caseg('StressObserve -crit""',cf.sel(2),def);
iiplot(data); % plot results

ZoomClip#

The command accessible through the axes context menu Clip, can now also be called from the command line fe_caseg('ZoomClip',cf.ga,[xyz_left;xyz_right]).