demo04 of writeMesh
Mesh with quadratic elements
Initialize
Set default image size.
x = 250; y = 250; width = 250; height = 250;
set(groot, 'DefaultFigurePosition', [x,y,width,height])
% set(groot, 'DefaultFigurePosition', 'factory')
Load mesh
Let's load the mesh data from "mesh_data_1.mat"
We will see 2 variables.
vert
44.5000 48.5000
52.5000 98.5000
76.5000 158.5000
84.5000 96.5000
100.5000 156.5000
104.5000 17.5000
104.5000 47.5000
105.5000 205.5000
105.5000 222.5000
109.5000 214.5000
ele
36 17 86
49 77 58
77 84 88
57 82 92
45 71 22
4 73 40
87 67 66
52 28 46
86 35 36
5 82 64
'ele' has 3 column so it is a triangular mesh with linear elements.
Plot mesh
Use function plotMeshes to plot mesh.
Convert linear elements to quadratic elements
We use function insertNode to convert the linear elements to quadratic elements.
% vert2, ele2 define quadratic elements
[vert2, ele2] = insertNode(vert, ele);
Let check the size of them
We saw that 'ele2' has 6 column so it is a triangular mesh with quadratic elements.
Plot mesh
Use function plotMeshes to plot mesh.
Export as inp file (Abaqus)
We use function printInp2d to write 2d mesh to inp file.
The exported inp file would have a model with one part, which contains one section.
We can specify element type, precision_nodecoor and file name.
printInp2d( vert2, ele2, [], ele_type, precision_nodecoor, file_name );
printInp2d Done! Check the inp file!
Export as bdf file (Nastran bulk data)
Function printBdf2d currently does not work for quadratic element. We will see error message.
printBdf2d( vert2, ele2, [], [], precision_nodecoor, file_name );
Error using printBdf2d (line 228)
Function printBdf2d do not support quadratic elements.
Export as msh file (Gmsh mesh file)
Function printMsh currently does not work for quadratic element. Mesh element will be proceesed as linear elements.
printMsh( vert2, ele2, [], [], precision_nodecoor, file_name );
Warning: Mesh elements will be processed as linear trangles.
printMsh Done! Check the msh file!
set(groot, 'DefaultFigurePosition', 'factory')