SDT-base         Contents     Functions         Previous Next     PDF Index

lsutil

Purpose

Level set utilities.

Syntax

model=lsutil('cut',model,li,RO)
def=lsutil('gen',model,li)
lsutil('ViewLs',model,li) 

Description

lsutil provides a number of tools for level-set creation and manipulation.

Some commands return the model structure while others return the value of the level-set. Plot outputs are also available.

Available lsutil commands are

edge[cut, sellevellines, self2, gensel]

eltset

gen[-max]

Level-set computation. This call takes 2 arguments: model a standard model and li data to build LS functions. li can be a structure or a cellarray containing structures. Required field in each structure is .shape, a string defining the form of the LS. Accepted shapes are

Instead of using coordinates (.xc, .yc, .zc) to define center of those shapes, user can provide a nodeId in the field .idc. Other optional fields are accepted, namely .rsc to scale LS values, .LevelList to fixed target levels.

cut[,face2tria]

Accepted options are

Here a first example with placement of circular piezo elements

  RO=struct('dim',[400 300 8],'tolE',.3);
  [mdl,li]=ofdemos('LS2d',RO);lsutil('ViewLs',mdl,li);
  li{1} % Specification of a circular level set
  mo3=lsutil('cut',mdl,li,RO);
  lsutil('ViewLs',mo3,li); % display the level set
  fecom('ShowFiPro') % Show element properties

Now a volume example

  RO=struct('dim',[10 10 40],'tolE',.1);
  [model,li]=ofdemos('LS3d',RO);li{1} % Spherical cut
  mo3=lsutil('cut',model,li,RO);
  cf=feplot(mo3);feplot('ShowFiMat')
  
  % Now do a cylinder cut
  li={struct('shape','cyl','xc',.5,'yc',.5,'zc',1,'nx',0,'ny',0,'nz',-1, ...
      'rc',.2,'z0',-.4,'z1',.4,'mpid',[200 300])};
  mo3=lsutil('cut',model,li,RO);feplot(mo3);
  cf.sel={'innode {x>=.5}','colordatamat -edgealpha.1'}
  fecom('ShowFiPro') % Show element properties


Command CutFace2Tria transforms faces of selected elements into a triangular mesh. Combination with the cut command, it ensures that the cut interface only features triangular elements. This can be useful to perform tet remeshing of one of the cut volumes while ensuring mesh compatibility at the interface.

Syntax is model=lsutil('CutFace2Tria',model,sel); with model a standard model, and sel either

% Generate a cube model
RO=struct('dim',[10 10 40],'tolE',.1);
[model]=ofdemos('LS3d',RO); 
model=stack_rm(model,'info','EltOrient');
% Transform one face to use triangles
model=lsutil('CutFace2Tria',model,'selface & innode{x==0}');

mpid

Command MPID assigns MatId and ProId provided in the level set data structure, or by default as indices of level sets to which they belong.

RO=struct('dim',[10 10 40],'tolE',.1);
[model,li]=ofdemos('LS3d',RO);li{1} % Spherical cut
% li{1} features MatId 200 and ProId 300
% assign these properties to elements in level set
model=lsutil('mpid',model,li);
feplot(model)
fecom('ShowFiPro');

surf[,stream,frompoly,remesh,fromrectmesh]

See also

feplot


©1991-2024 by SDTools
Previous Up Next