demo03 of writeMesh
Quadrilateral mesh
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_3.mat"
We will see 3 variables.
vert
4.6900 23.8200
4.8300 25.9900
5.4000 51.5200
5.8100 21.8900
5.8400 55.1300
6.1100 48.1200
6.1500 27.8100
8.4500 19.4400
10.4000 63.5800
10.9200 17.9300
ele
207 217 220 219
214 218 220 217
216 219 220 218
200 221 224 223
183 222 224 221
212 223 224 222
204 225 228 227
208 226 228 225
214 227 228 226
190 229 232 231
Check the number of phase in the mesh
Plot mesh
Use function plotMeshes to plot mesh.
plotMeshes(vert,ele,tnum);
We saw 3 phases in the 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 3 sections. Each section corresponds to one phase in the mesh.
We can specify element type, precision_nodecoor and file name.
printInp2d( vert, ele, tnum, ele_type, precision_nodecoor, file_name );
printInp2d Done! Check the inp file!
Export as bdf file (Nastran bulk data)
We use function printBdf2d to write 2d mesh to bdf file.
printBdf2d( vert, ele, tnum, [], precision_nodecoor, file_name );
printBdf2d Done! Check the bdf file!
Export as msh file (Gmsh mesh file)
Function printMsh currently does not work for quadrilateral element. We will see error message.
printMsh( vert, ele, tnum, [], precision_nodecoor, file_name );
Error using printMsh (line 113)
printMsh not work for quadrilateral elements.
set(groot, 'DefaultFigurePosition', 'factory')