Contents  
Functions  
Index
 
 PDF |

cEGI |
vector of element property row indices of the current element group (without the group header) |
| constit | real (double) valued constitutive information. The constit for each group is stored in Case.GroupInfo{jGroup,4};. |
| def.def | vector of deformation at DOFs. This is used for non-linear, stress or energy computation calls that need displacement information. |
| EGID | Element Group Identifier of the current element group (different from jGroup if an EGID is declared). |
| elt | model description matrix. The element property row of the current element is given by elt(cEGI(jElt),:) which should appear in the calling format eCall of your element function. |
| ElemF | name of element function or name of superelement |
| ElemP | parent name (used by femesh in particular to allow property inheritance) |
| gstate | real (double) valued element state information. |
| integ | int32 valued constitutive information. |
| jElt | number of the current element in cEGI |
| jGroup | number of the current element group (order in the element matrix). [EGroup,nGroup]=getegroup(elt); finds the number of groups and group start indices. |
| nodeE | nodes of the current element. |
| NNode | node identification reindexing vector. NNode(ID) gives the row index (in the node matrix) of the nodes with identification numbers ID. You may use this to extract nodes in the node matrix using something like node(NNode(elt(cEGI(jElt),[1 2])),:) which will extract the two nodes with numbers given in columns 1 and 2 of the current element row (an error occurs if one of those nodes is not in node). This can be built using NNode=sparse(node(:,1),1,1:size(node,1). |
| pointers | one column per element in the current group gives. |
| DofPos | int32 matrix whose columns give the DOF positions in the full matrix of the associated elements. Numbering is C style (starting at 0) and -1 is used to indicate a fixed DOF. |
| pointers | int32 matrix whose columns describe information each element of the group. Pointers has one column per element giving [OutSize1 OutSize2 u3 NdNRule MatDes IntegOffset ConstitOffset StateOffset] Outsize1 size of element matrix (for elements issued from MODULEF), zero otherwise. MatDes type of desired output. See the fe_mk MatType section for a current list. IntegOffset gives the starting index (first element is 0) of integer options for the current element in integ. ConstitOffset gives the starting index (first element is 0) of real options for the current element in constit. |
| integ | int32 matrix storing integer values used to describe the element formulation of the group. Meaning depends on element family and should be documented in the element property function (p_solid BuildConstit for example). The nominal content of an integ column (as return by the element integinfo call) is MatId,ProId,NDofPerElt,NNodePerElt,IntegRuleType where integrules(ElemP,IntegRuleType) is supposed to return the approriate integration rule. |
| constit | double matrix storing integer values used to describe the element formulation of the group. Meaning depends on element family and should be documented in the element property function (p_solid BuildConstit for example). |
| gstate | double matrix whose columns describe the internal state of each element of the group. By default, column content is stress at integration points (Nstrain× Nw values). Users are of course free to add any appropriate value for their own elements, a typical application is the storage of internal variables. For an example of gstate initialization see fe_stres thermal. |
| ElMap | int32 element map matrix used to distinguish between internal and external element DOF numbering (for example : hexa8 uses all x DOF, then all y ... as internal numbering while the external numbering is done using all DOFs at node 1, then node 2, ...). The element matrix in extrenal sort is given by k_ext=ke(ElMap). EltConst.VectMap gives similar reordering information for vectors (loads, ...). |
| InfoAtNode | double matrix whose rows describe information at element nodes (as many columns as nodes in the model). An other possible format is a structure with .NodePos (int32) with as many columns as elements in the group giving column positions in a .data field. |
| EltConst | struct used to store element formulation information (integration rule, constitutive matrix topology, etc.) Details on this data structure are given in section 7.14.1. |
| .N | nw × Nnode shape functions at integration points |
| .Nr | nw × Nnode derivative of shape function with respect to the first reference coordinate r |
| .Ns | nw × Nnode derivative of shape function with respect to the second reference coordinate s |
| .Nt | nw × Nnode derivative of shape function with respect to the second reference coordinate t |
| .NDN | Nshape × nw (1+Ndim) memory allocation to store the shape functions and their derivatives with respect to physical coordinates [N N,x N,y N,z]. of_mk currently supports the following geometry rules 3 3D volume, 2 2D volume, 23 3D surface, 13 3D line (see integrules BuildNDN for calling formats). Cylindrical and spherical coordinates are not currently supported. In the case of rule 31 (hyperelastic elements), the storage scheme is modifified to be (1+Ndim) × Nshape × nw which perserves data locality better. |
| .jdet | Nw memory allocation to store the determinant of the jacobian matrix at integration points. |
| .bas | 9× Nw memory allocation to store local material basis. This is in particular used for 3D surface rules where components 6:9 of each column give the normal. |
| .Nw | number of integration points (equal to size(EltConst.N,1)) |
| .Nnode | number of nodes (equal to size(EltConst.N,2)=size(EltConst.NDN,1)) |
| .xi | Nnode × 3 reference vertex coordinates |
| .VectMap | index vector giving DOF positions in external sort. This is needed for RHS computations. |
% by //. In this example, the name of the created element is elem0. function [out,out1,out2]=elem0(CAM,varargin); %elem0 help sectionThe element function should then contain a section for standard calls which let other functions know how the element behaves.
if isstr(CAM) %standard calls with a string command
[CAM,Cam]=comstr(CAM,1); % remove blanks
if comstr(Cam,'integinfo')
% some code needed here
out= constit; % real parameter describing the constitutive law
out1=integ; % integer (int32) parameters for the element
out2=elmap;
elseif comstr(Cam,'matcall')
out=elem0('call');
out1=1; % SymFlag
elseif comstr(Cam,'call'); out = ['AssemblyCall'];
elseif comstr(Cam,'rhscall'); out = ['RightHandSideCall'];
elseif comstr(Cam,'scall'); out = ['StressComputationCall'];
elseif comstr(Cam,'node'); out = [NodeIndices];
elseif comstr(Cam,'prop'); out = [PropertyIndices];
elseif comstr(Cam,'dof'); out = [ GenericDOF ];
elseif comstr(Cam,'patch');
out = [ GenericPatchMatrixForPlotting ];
elseif comstr(Cam,'edge'); out = [ GenericEdgeMatrix ];
elseif comstr(Cam,'face'); out = [ GenericFaceMatrix ];
elseif comstr(Cam,'sci_face'); out = [ SciFaceMatrix ];
elseif comstr(Cam,'parent'); out = ['ParentName'];
elseif comstr(Cam,'test')
% typically one will place here a series of basic tests
end
return
end % of standard calls with string command
The expected outputs to these calls are detailed below.
[k1,m1]=elem0(nodeE,elt(cEGI(jElt),:),...
pointers(:,jElt),integ,constit,elmap);
To define other proper calling formats, you need to use the names of a number of variables that are internal to fe_mk. fe_mk variables used as output arguments of element functions are| k1 | element matrix (must always be returned, for opt(1)==0 it should be the stiffness, otherwise it is expected to be the type of matrix given by opt(1)) |
| m1 | element mass matrix (optional, returned for opt(1)==0, see below) |
sci_face = [1 2 2];). For a more than 4 nodes per face element, faces must be cut in subfaces. The most important thing is to not create new nodes by the cutting of a face and to use all nodes. For example, 9 nodes quadrilateral can be cut as follows :
but a 8 nodes quadrilaterals cannot by cut by this way. It can be cut as follows:![]()
Figure 7.1: Lower order patch representation of a 9 node quadrilateral
![]()
Figure 7.2: Lower order patch representation of a 8 node quadrilateral
eCall=elem0('call'). The default for the string eCall should be :
be=elem0(nodeE,elt(cEGI(jElt),:),pointers(:,jElt),...
integ,constit,elmap,estate);
The output argument be is the right hand side load. The inputs arguments are the same as those for matcall and call.
% elem0 matrix assembly section
% figure out what the input arguments are
node=CAM; elt=varargin{1};
point=varargin{2}; integ=varargin{3};
constit=varargin{4}; elmap=varargin{5};
typ=point(5);
% outputs are [k,m] for opt(1)==0
% [mat] for other opt(1)
switch point(5)
case 0
[out,out1] = ... % place stiffness in out and mass in out1
case 1
out= ... % compute stiffness
case 2
out= ... % compute mass
case 100
out= ... % compute right hand side
case 200
out= ... % compute stress ...
otherwise
error('Not a supported matrix type');
end
Distributed load computations (surface and volume) are handled by fe_load. Stress computations are handled by fe_stres.