Commit 294d5325 authored by Andreas Zilian's avatar Andreas Zilian
Browse files

Re-locate meshing example.

parent 52cb49fa
%% Example Mesh
% create a rectangle geometry with hole and mesh
clear all; addpath([ '..' filesep '..' filesep ]);
n = 10; % n = number of grid nodes per side
% create all geo points
gp1 = mgen.MgGeoPoint( [-1, -1] );
gp2 = mgen.MgGeoPoint( [ 1, -1] );
gp3 = mgen.MgGeoPoint( [ 1, 1] );
gp4 = mgen.MgGeoPoint( [-1, 1] );
% center point
gcenter = mgen.MgGeoPoint([0.,0.]);
% create all geo lines
gl1 = mgen.MgGeoLine2Point( [gp1, gp2], n );
gl2 = mgen.MgGeoLine2Point( [gp2, gp3], n );
gl3 = mgen.MgGeoLine2Point( [gp3, gp4], n );
gl4 = mgen.MgGeoLine2Point( [gp4, gp1], n );
% number of ring => refine near the circle
a = 0.4;
b = 0.8;
c = 0.0; % ellipse rotation angle in rad
% refinement
normFunc = mgen.MgNormFunction( mgen.MgNormFunctionType.Quadratic);
% create area
ga1 = mgen.MgGeoArea4LineEllipsoidalVoid([gl1,gl2,gl3,gl4], 10, a, b, c, normFunc);
% create geo object and generate the mesh
geo = mgen.MgGeo( [gp1, gp2, gp3, gp4], ...
[gl1, gl2, gl3, gl4], ...
[ga1] );
% print geo and mesh data info
% fprintf(geo.print());
% plot mesh
cla; clf;
fig = figure(1); subplot('Position',[0.05 0.05 0.90 0.90]); axis equal; hold on;
geo.plot();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment