Types of Finite Elements

Contents

Demo contents

This demo illustrates how to get information about type of finite elements supported by Nadamak.

clear variables;

Types of finite elements

Finite elemet types are managed by enumeration class mp.FEM.FemTypes.

enumeration('mp.FEM.FemType')

fem = mp.FEM.FemType.Triang6;

fprintf('Information about FEM type: %s\n', fem);
fprintf('  GMSH element id: %d\n', fem.gmshID);
fprintf('  is Lagrangaian: %d\n', fem.isLagrangian);
fprintf('  order : %d\n', fem.order);
fprintf('  number of DOFs: %d\n', fem.numOfDofs);
fprintf('  ------------------------\n')
fprintf('  Node coordinates in reference element: \n');
disp(fem.dofsCoords());
fprintf('  Dofs on element entities\n');
dofstopo = fem.dofsTopo;
for i=1:size(dofstopo, 1)
    fprintf('     Dof idx: %d   entity dim: %d  entity local id: %d\n', ...
        i, dofstopo(i,1), dofstopo(i,2));
end
Enumeration members for class 'mp.FEM.FemType':

    Line2
    Line3
    Triang3
    Triang6
    Triang10
    Quad4
    Quad8
    Quad9
    Hex8

Information about FEM type: Triang6
  GMSH element id: 9
  is Lagrangaian: 1
  order : 2
  number of DOFs: 6
  ------------------------
  Node coordinates in reference element: 
         0         0         0
    1.0000         0         0
         0    1.0000         0
    0.5000         0         0
    0.5000    0.5000         0
         0    0.5000         0

  Dofs on element entities
     Dof idx: 1   entity dim: 0  entity local id: 1
     Dof idx: 2   entity dim: 0  entity local id: 2
     Dof idx: 3   entity dim: 0  entity local id: 3
     Dof idx: 4   entity dim: 1  entity local id: 1
     Dof idx: 5   entity dim: 1  entity local id: 2
     Dof idx: 6   entity dim: 1  entity local id: 3
mp_manage_demos('report', 'FEM_FemType', true);