Contents     Functions         Previous Next     PDF Index

7.13  Defining fields trough tables, expressions, ...

Finite element fields are used in four main formats

The field definition structure has fields


data.dira cell array specifying the value of various fields. Each cell of data.dir can give a constant value, a position dependent value defined by a string FcnName that is evaluated using
 fv(:,jDir)=eval(FcnName) or fv(:,jDir)=feval(FcnName,node) if the first fails. Note that node corresponds to nodes of the model in the global coordinate system and you can use the coordinates x,y,z for your evaluation.
data.labcell array giving label for each field of an InfoAtNode or gstate structure.
data.DOFa vector defining the DOF associated with each .dir entry. The transformation to a vector defined at model.DOF is done using vect=elem0('VectFromDirAtDof',model,data,model.DOF).

For example

 femesh('reset');model=femesh('testubeam');
 data=struct('dir',{{'ones(size(x))','y','1*x.^3'}}, ...
    'DOF',[.01;.02;.03]);
 model.DOF=feutil('GetDOF',model);
 def=elem0('VectFromDirAtDof',model,data,model.DOF)

 data=struct('dir',{{'x./sqrt(x.^2+y.^2)','y./sqrt(x.^2+y.^2)',0}}, ...
    'lab',{{'v1x','v1y','v1z'}});
 pro=struct('il',1,'type','p_solid','MAP',data);
 model=stack_set(model,'pro','WithMap',pro);
 C1=fe_mknl('init',model);InfoAtNode=C1.GroupInfo{7}

©1991-2010 by SDTools
Previous Up Next