Contents   Functions      PDF Index |
Finite element fields are used in four main formats
The VectFromDir structure has fields
data.dir | a 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.lab | cell array giving label for each field of an InfoAtNode or gstate structure. |
data.DOF | a 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
% Analytical expression for a displacement field 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) % Orientation field at nodes 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} feplot(model);fecom('showMap','WithMap') % display map