Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
edu
mafe
Commits
294d5325
Commit
294d5325
authored
May 24, 2018
by
Andreas Zilian
Browse files
Re-locate meshing example.
parent
52cb49fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/meshes/area_with_hole.m
0 → 100644
View file @
294d5325
%% 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
();
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment