SDT-base         Contents     Functions         Previous Next     PDF Index

feutilb

Purpose

Gateway function for advanced FEM utilities in SDT.

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.

AddNode

This command provides optimized operation when compared to the feutil equivalent and finer control.

CaseC2SE

Constraint penalization. This command packages the penalization of all constraints in the model. Types FixDOF, RBE3, MPC, rigid are supported.

model=feutilb('CaseC2SE',model,list); returns the model with penalized constraints. The constraints are then transformed into coupling superelements in the model. model is an SDT model. list is an optional restriction cell array of constraint names to be transformed. If omitted all found constraints are penalized.

CaseL2G

Case resolution in the global frame. Case definition using node displacement local frame DID is supported, resolution schemes are however unpractical and conventions may depend on the code, see section 7.14 for conventions used in SDT. It is thus strongly recommended to resolve local frame based constraints before running the model.

model=feutilb('CaseL2G'',model,); returns the model with constraints projected in the global frame. The following operations are performed

CombineModel

mo1=feutilb('combinemodel',mo1,mo2);
[mo1,r1]=feutilb('combinemodel',mo1,mo2);

Integrated combining of two separate models. This call aims at creating an assembly from two separate mechanical components. This command properly handles potential NodeId, EltId, ProId, or MatId overlaying by setting disjoint ID sets before assembly. Stack or Case entries with overlaying names are resolved, adding (1) to common names in the second model. Sets with identical names between both models are concatenated into a single set. The original node numbering matrix for mo2 is output as a second argument (r1 in the second example call). The original element numbering matrix for mo2 can also be output as a third argument.

mo1 is taken as the reference to which mo2 will be added, the Node/Elt appending is performed by feutilAddTest.

GeoLineTopo, ...

 r2=feutilb('geolinetopo',model,struct('starts',nodes));
 r2=feutilb('geolinetopo',model,struct('starts',RO.nodes(j1,1), ...
       'cos',0,'dir',r1.p(:,2)','circle',r1));

GeoLineTopo searches a topological line by following mesh edges.

Accepted fields are

GeoFindCircle packages the GeoLineTopo command to detect nodes on a quasi-circular mesh,

GeoFindCircle, ...

GeoFindCircle searches a topological circular line by following mesh edges. One can either provide three points one the circle, or one point with origin and axis.

 r2=feutilb('geofindcircle',model,struct('nodes',[n1 ...]);
 r2=feutilb('geofindcircle',model,...
struct('nodes',n1,'Origin',[x y z],'axis',[nx ny nz]);

where n1 is a NodeId, x,y,z are the coordinates of the circle origin, nx, ny, nz is the normal to the plane containing the circle.

The output r2 contains fields

The following example illustrates how one can exploit this feature to define a connection screw based on a hole in plates.

% use the demonstration model for screw defintions with two plates
model=demosdt('demoscrew layer 0 40 20 3 3 layer 0 40 20 4');
% use 3D line pick to find three nodes on the hole
% fe_fmesh('3dlineinit') % acitvate option, and click on 3 nodes on the hole
nodes=[47 43 40]; % nodes picked on the hole
% detect hole
r1=feutilb('geofindcircle',model,struct('nodes',nodes)); r1=r1{1};
n1=feutil('getnodegroupall',model); n2=n1;
% define planes: need to detect plane altitudes
% 1- transform coordinates in the local hole basis for planes generation
n1(:,5:7)=(n1(:,5:7)-ones(size(n1,1),1)*r1.Origin)*r1.p;
[z1,i1]=unique(n1(:,7)); 
% 2- use global altitudes for the elements detection
z2=n2(i1,7); % use type 1
r2=[num2cell([z1 1+0*z1]) ...
 cellfun(@(x) sprintf('z==%.15g',x),num2cell(z2),'uni',0)];
% 3- screw model, see sdtweb fe_case
r2=struct('Origin',r1.Origin,'axis',r1.normal','radius',r1.radius, ...
 'planes',{r2},...
 'MatProId',[101 101],'rigid',[Inf abs('rigid')],...
 'NewNode',0);
model=fe_caseg('ConnectionScrew',model,'screw1',r2);
% compute modes to test
def=fe_eig(model,[5 10 1e3]);
cf=feplot(model); cf.def=def;

GeoFindSphere

GeoFindSphere searches a topological sphere surface passing through four given points (not coplanar).

 r2=feutilb('geofindsphere',model,struct('nodes',[n1 ...]);

where n1 is a NodeId list, with at least four entries.

The output r2 contains fields

GeomRB,[Mass,ByParts,Beam1]

def=feutilb('geomrb',node,RefXYZ,adof,m) returns a geometric rigid body modes. If a mass matrix consistent with adof is provided the total mass, position of the center of gravity and inertia matrix at CG is computed. You can use def=feutilb('geomrb cg',Up) to force computation of rigid body mass properties.

def=feutilb('geomrbMass',model) returns the rigid body modes and mass, center of gravity and inertia matrix information. -bygroup, -bymat, -bypro can be used to detail results by subgroups. With no output argument, the results are shown in a table that can be copied to other software.

def=feutilb('GeomRbByParts',model) returns the rigid body modes of the model taking into account unconnected regions. Each unconnected mesh region is considered as a different part for which a set of 6 rigid body modes will be generated. def containts then a sequence of six rigid body modes by unconnected mesh region, placed in the global model DOF.

il=feutilb('GeomRBBeam1',mdl,RefXYZ) returns standard p_beam properties for a given model section where RefXYZ is the coordinates of the reference point from the gravity center.

feutilb('GeomRB',mdl,[0 0 0],sens) or feutilb('GeomRB',mdl,[0 0 0],Load) provide a rigid body check of the work generated by loads or loads collocated to sensors on rigid body motion. This provides a direction of application and moments around the origin. These are then used to estimate a point that would lead to the same moments. This point should be on a line of direction of force and containing the actual application point (xtrue=xest + α dx, ...)

GetUsedNodes

Node=feutilb('GetUsedNodes',model); returns the model nodes that are effectively used in the model. This command accounts for nodes present in SE elements and nodes used in Case constraints that may be not used by elements in model.Elt.

% Used nodes recovery in a model
% Use a base model with a rigid ring using a node not used by other elements
model=demosdt('demoscrew layer 0 40 20 3 3 layer 0 40 20 4'); % create model
r1=struct('Origin',[20 10 0],'axis',[0 0 1],'radius',3, ...
          'planes',[1.5 0 111 1 3.1;
                    5.0 0 112 1 4;], ...
          'rigid',[Inf abs('rigid')],...
          'NewNode',0);
model=fe_caseg('ConnectionScrew',model,'screw1',r1);
cf=feplot(model); % show model 
fecom('promodelviewon');fecom('curtab Cases','screw1');

% Used nodes recovery strategy
n1=feutil('getnodegroupall',cf.mdl); % selects nodes used in model.Elt only
%n2=feutil('optimmodel',cf.mdl); % obsolete call that is based on GetNodeGroupall
n3=feutilb('GetUsedNodes',cf.mdl);

setdiff(n3(:,1),n1(:,1)) % node exclusively used by rigid case

Match

Non conform mesh matching utilities. The objective is to return matching elements and local coordinates for a list of nodes.

Matching elements mean

A typical node matching call would be

% Example of a base match call
model=femesh('test hexa8');
match=struct('Node',[.1 .1 .1;.5 .5 .5;1 1 1]);
match=feutilb('match -info radius .9 tol 1e-8',model,match)
% Example of a matchSurf call
model=demosdt('demoTwoPlate');
% get nodes of half bottom plate 
n1=feutil('getnode z==0 & y>.5',model);
% prepare the match structure
match=struct('Node',n1(:,5:7));
% perform surface match on the top plate selection
match=feutilb('matchsurf',model,match,'innode{z==.1}');
% display model and nodes
cf=feplot(model);
fecom(cf,'shownodemark',match.Node,'marker','o'); % display initial nodes
% then overlay matched points
fecom(cf,'shownodemark-noclear',match.StickNode,'marker','s','color','b')

% Use InterpNormal token to get clean normal at matched point
match=struct('Node',n1(:,5:7),'InterpNormal',1);
match=feutilb('matchsurf',model,match,'innode{z==.1}');
fecom(cf,'showmap',struct('vertex',match.StickNode,...
'normal',match.InterpNormal))

Accepted command options are

The output structure contains the fields


.Nodeoriginal positions
.rstjposition in element coordinates and jacobian information.
.StickNodeorthogonal projection on element surface if the original node is not within the element, otherwise original position.
.Infoone row per matched node/element giving NodeId if exact match (0 otherwise), number of nodes per element, element type (1 (1D), 2 (2D), 3 (3D), or 5 (SE), an element code and a distance indicator.
.matchobtained when calling the command with -info, typically for row by row post-processing of the match. A cell array with one row per matched node/element giving eltname, slave element row, rstj, sticknode
.slavean element matrix providing for each node of field .Node the matched element.
.slaveindthe element index (cEGI) in the .Elt matrix of input model providing for each node of field .Node the matched element index.
.mastera sub-index vector providing only the matched nodes in other fields.

MeasThick,Show

Measure of thickness through a volume. Thickness is here defined as the distance from a node on a surface to another surface along the node face normal direction. The base call requires a surface selection on a wolume mesh from which thickness is measured. The measure in internally performed as a feutilb Match call on the other surfaces connected to the surface selected (then assumed fully connected).

The definition of thickness is not unique in the general case, so that peculiar effects can be obtained, especially at corner locations. The defintion chosen here correctly suits thin 3D volumes for which the closest surface nodes to a given surface point is in the opposite surface.

The following commands are supported

Command MeasThickShow performs a display of the thickness map on the mesh in feplot.

% Thickness measurment and display
model=demosdt('demoUBeam NoPlot'); % demo model
model=feutil('divide 4 4 4',model); % some refinement
[eltid,model.Elt]=feutil('eltidfix;',model); % clean EltId
cf=feplot(model);
RO=struct('sel','selface & innode{y==0.5}',...
 'osel','selface & innode{notin{innode{z==0|z==2.5|y==.5}}}')
d1=feutilb('MeasThick-Show',cf.mdl,RO);

MpcFromMatch

This command is used to build multiple point constraints from a match.
model=feutilb('MpcFromMatch',model,match).

The default output is the model with added MPC. The following command options are available

The solution retained for surfaces is to first project the arbitrarily located connection point P on the element surface onto a point Q on the neutral fiber used where element nodes are located. Then Q1 or P1 shape functions and their derivatives are used to define a linear relation between the 6 degree of freedom of point Q and the 3 or 4 nodes of the facing surface. Motion at P is then deduced using a linearized rigid PQ link. One chooses to ignore rotations at the nodes since their use is very dependent on the shell element formulation.


Figure 10.2: Non conform mesh handling

The local element coordinates are defined by xje,j=1:3 along the r coordinate line

 
    (10.3)

ye that is orthogonal to xe and in the xe, ∂ Ni/∂ sxij plane, and ze that defines an orthonormal basis.

The local rotations at point Q are estimated from rotations at the corner nodes using

 
    (10.4)

with uik the translation at element nodes and j=1:3, i=1:Nnode, k=1:3. Displacement at Q is interpolated simply from shape functions, displacement at P is obtained by considering that the segment QP is rigid.

For volumes, displacement is interpolated using shape functions while rotations are obtained by averaging displacement gradients in orthogonal directions

 
    (10.5)

You can check that the constraints generated do not constrain rigid body motion using fe_caseg('rbcheck',model) which builds the transformation associated to linear constraints and returns a list of DOFs where geometric rigid body modes do not coincide with the transformation.

PlaceInDof

This command places DOF based matrices into different sets of DOFs. This can thus be used for def curves, observation, constraint, models or matrices. For subsets of DOFs a direct elimination is performed; if the new DOF set contains exclusive DOF, zeros are added, as no expansion is performed here.

This is typically used to eliminate DOFs, add zeros for unused DOFs or simply reorder DOFs. See also fe_def SubDof.

High level calls for data structures are supported using syntax data= feutilb('PlaceInDof',DOF,data); where DOF is the new set of DOF and data is a structure whose fields depends on the type of matrix

The other fields are left unchanged.

Lower level calls for matrices are supported using syntax mat=feutilb('PlaceInDof',DOF,oldDOF,mat);. This call then returns the data matrix placed in the new DOF field, assuming that matrix mat is based on oldDOF. Depending on the size of mat, feutilb assumes the type of matrix it handles,

SeparateByMat,Pro

Command SeparateBy ensures that only one MatId or ProId exist in each element group. If a group contains several MatId or ProId the group will be split in the element list, so that the new groups are inserted directly after the currently split group.

By default the criterion is based on MatId, use command SeparateByPro to base it on the ProId. To avoid separating in too many groups, the default Max20 option is used. To bypass this limit specify a larger maximum number of groups.

% Separate elements groups by Mat/ProId
% demonstration model
model=demosdt('demoubeam noplot');
% observe element groups
feutil('info',model)
% apply different MatId to different selections
i1=feutil('findelt withnode{z>1&z<=2}',model);
i2=feutil('findelt withnode{z>2}',model);
mpid=feutil('mpid',model.Elt);
mpid(i1,1)=2; mpid(i2,1)=3;
model.Elt=feutil('mpid',model.Elt,mpid);
% now one group with several MatId
feutil('info',model)
% apply group separation
model.Elt=feutilb('SeparateByMat',model.Elt);
% now three groups with unique MatId
feutil('info',model)

SubModel

This command aims at extracting a functional model from a selection of an element subset. From a FindElt selection, this command

If the FindElt command is omitted or set to groupall, the cleanup is performed on the whole model.

The following command options can be used not to clear some specific fields

% Call to extract a submodel from a model
model=demosdt('demoubeam');
mo1=feutilb('submodel',model,'innode{x<.5}');
feplot(mo1)

SurfaceAsQuad[,Group]

This command handles post-treatment of surfaces selections.

The syntax is mo1=feutilb('SurfaceAsQuad',model,eltsel);, where

The following sample calls illustrate the syntax and the command outputs:

% SurfaceAsQuad, transform mesh into quad4 surface
model=femesh('testtetra4'); % sample volume mesh
mo1=feutilb('SurfaceAsQuad',model); % transform into surface quad4 mesh
feutil('info',mo1)

% SurfaceAsQuadGroup, post treat surface selection based on sharp edges
model=femesh('testtetra4'); % sample volume mesh
% Generate the surface mesh with group division by sharp edges
mo1=feutilb('surfaceasquadgroup 90',model);
cf=feplot(mo1); fecom(cf,';colordatagroup;viewn++-;');

% Generate a meta-set named face of FaceId divided by sharp edges
model=feutilb('surfaceasquadgroup90 -set"face"',model);
data=stack_get(model,'set','face','get');
data.SetNames % names of splitted face selections

SurfaceSplitDef

This command builds a deformation curve with associated colormap that localizes areas in a model, based on a curve result.

d1=feutilb('SurfaceSplitDef',model,def,RO) returns a deformation curve based on def with zeros for non-localized areas and connectivity levels to a starting area. model is an SDT model providing the mesh topology, def is a curve based on which areas will be localized and RO is a running option structure with fields

This command uses the feutilb @levNodeCon object.

% SurfaceSplitDef example
% demonstration model
demosdt('demoubeam')
cf=feplot; def=cf.def;
[~,cf.mdl.Elt]=feutil('eltidfix;',cf.mdl);

% Node based field, node clustering
d1=feutilb('surfacesplitdef',cf.mdl,def,struct('tol',.5,'starts','max2'));
cf.def=d1; fecom colordataa
ii_plp('colormap',struct('map',jet(2), ...
 'cval',[0 .01 1],'Band',0,'refine',10,'bSplit',2))

% Element based field
Ek=fe_stress('ener -MatDes 1 -curve',cf.mdl,def);
% Element clustering
d2=feutilb('surfacesplitdef-elt',cf.mdl,Ek,struct('tol',.2,'starts','max2'));
cf.def=def; fecom('colordataelt',d2); colormap(cf.ga,jet);

SurfVisible

This command provides visible elements from a particular feplot view.

[eltind,elt,eltindWithHeaders]=feutilb('SurfaceVisible',cf); will output the indices eltind or with headers in cf.mdl.Elt that are currently visible in the display. The second output elt are the face elements consitituting the visible model skin.

This function is compatible but not conforming to feutil FindElt command. When outputting elements of different nature than for the model, the base FindElt commands will provide empty indices. This function still outputs the visible elements indices of the base model to allow further manipulations.

The following command options are available, either in the input string or in an additionnal running options structure.

% Recovering visible elements from a feplot display
model=demosdt('demoubeam-noplot'); % demo model
% tweak its position
model.Node=basis('gnode','rx=45;ry=45;rz=45;',model.Node);
% display in feplot
cf=feplot(model);
% choose a view
fecom(cf','view2');
% Recover visible elements
[ind,elt,i1]=feutilb('SurfVisible',cf);
% restrain view to visible elements
cf.sel='@feutilb(''SurfVisible'',cf)';

SurfWjNode

This command provides nodal weights for node based surface integration. The weights are computed as the sum of each element weight contribution using node integration rules.

r1=feutilb('SurfWjNode',model,sel);. model is a standard SDT model, sel is a selection that must provide face elements. If omitted sel is set to selface, one can provide an empty sel is the model is already using shells or the resultof face selection itself. The output r1 is a structure with fields .ID and .wjdet respectively providing the NodeId and associated surface weights on the given surface.

TKT[,dTKT,TKTSolve]

Optimized matrix projection utilities. This family of commands provides optimized operations obtained through compiled functionalities, and supports out of core, compatible with the sdthdf formats.

For real bases T, support for RAM footprint optimization is provided through the use of blockwise operations, this can be controlled by the preference BlasBufSize providing a block size in GB. This can be set to Inf to alleviate the behavior. It can be set using sdtdef  sdtdef('BlasBufSize',2).

For very large bases T stored in v_handle format through sdthdf  command TKTMinRead allows performing blockwise operations on every matrix K at once to limit disc I/O access when loading T. The block sizes are driven by preference OutOfCoreBufferSize providing a memory limit in MB.

Write

feutilb('WriteFileName.m',model) writes a clean output of a model to a script. Without a file name, the script is shown in the command window.

feutilb('_writeil',model) writes properties. feutilb('_writepl',model) writes materials.

Note that this command automatically overwrites existing script files

@levNodeCon

Internal node connectivity object that can be created through its constructor levNodeCon accessed trhough conn=feval(feutilb('@levNodeCon'),[],model);.Note that this call is case sensitive.

The packaged functionalities allow browsing nodes or elts based on element edge levelled connectivity. By default, the node connectivity is initialized only, but one can activate element connectivity with token econ in the construction. conn=feval(feutilb('@levNodeCon'),[],model,'econ');].

Alternative commands allow node/elt expansion based on threholds associated to external data (e.g. an energy curve)

The following methods are available

 
% levNodeConn object example node or elt list by connectivity
demosdt('demoubeam')
cf=feplot; def=cf.def;
% object initialization
conn=feval(feutilb('@levNodeCon'),[],cf.mdl,'econ'); % init
start=1; % eltid 1
eltid=feval(conn.expE2Lev,conn,start,5); % levEltCon
data=struct('EltId',eltid(:,1),'data',eltid(:,2));
fecom('colordataelt',data);
% sample call with ndoes
n2=feval(conn.expN2Lev,conn,[125],2);

@unConSel

Internal method whose function handle can be obtained for external use by unConSel=feutilb('@unConSel');.Note that this call is case sensitive.

sel=feval(feutilb('@unConSel'),model); returns a cell array of EltId vectors respectively constituting an unconnected mesh region of the model. The length of the selection is then the number of disconnected mesh regions in the model. This command does not take constraints into account. One has the possibility to work on a model on which constraints have been penalized using command feutilb CaseC2SE.


©1991-2024 by SDTools
Previous Up Next