7.13 Defining fields trough tables, expressions, ...#
Finite element fields are used in four main formats
- def field at DOFs
- InfoAtNode field at nodes of an element group can be built from a pro.MAP field which can be an VectFromDir structure, a structure with fields .bas and .EltId with EltId=0 to define material orientations.
info,EltOrient is an alternative to specify the orientation of all elements rather than associate values for each property entry. The format is a structure with field .EltId giving the identifiers and .bas giving an orientation for each element in the basis format. To interpolate constitutive properties as a function of temperature, ... see section 7.3. - gstate field at integration points of an element group (can be built from a pro.gstate field).
- a field definition structure to be transformed to the other formats using a elem0('VectFromDir') command as illustrated below.
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
% Material field at node sdtweb('_eval','d_mesh.m#RVEConstitInterp')