Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
750cea65
Commit
750cea65
authored
21 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
cleanuip (removed duplicate code) + new function u() to get the abscissa more easily
parent
b70454f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/ExtrudeParams.cpp
+19
-50
19 additions, 50 deletions
Geo/ExtrudeParams.cpp
Geo/ExtrudeParams.h
+1
-0
1 addition, 0 deletions
Geo/ExtrudeParams.h
with
20 additions
and
50 deletions
Geo/ExtrudeParams.cpp
+
19
−
50
View file @
750cea65
// $Id: ExtrudeParams.cpp,v 1.1
5
2004-0
2-07 01:40:19
geuzaine Exp $
// $Id: ExtrudeParams.cpp,v 1.1
6
2004-0
4-18 03:09:01
geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -67,55 +67,8 @@ void ExtrudeParams::fill(int type,
void
ExtrudeParams
::
Extrude
(
int
iLayer
,
int
iElemLayer
,
double
&
x
,
double
&
y
,
double
&
z
)
{
double
dx0
,
dy0
,
dz0
,
dx1
,
dy1
,
dz1
;
double
dx
,
dy
,
dz
,
angle
;
if
(
!
iLayer
)
{
dx0
=
dy0
=
dz0
=
0.0
;
dx1
=
mesh
.
hLayer
[
0
];
dy1
=
mesh
.
hLayer
[
0
];
dz1
=
mesh
.
hLayer
[
0
];
}
else
{
dx0
=
mesh
.
hLayer
[
iLayer
-
1
];
dy0
=
mesh
.
hLayer
[
iLayer
-
1
];
dz0
=
mesh
.
hLayer
[
iLayer
-
1
];
dx1
=
mesh
.
hLayer
[
iLayer
];
dy1
=
mesh
.
hLayer
[
iLayer
];
dz1
=
mesh
.
hLayer
[
iLayer
];
}
double
t
=
(
double
)
iElemLayer
/
(
double
)
mesh
.
NbElmLayer
[
iLayer
];
switch
(
geo
.
Type
)
{
case
TRANSLATE
:
dx
=
geo
.
trans
[
0
]
*
(
dx0
+
t
*
(
dx1
-
dx0
));
dy
=
geo
.
trans
[
1
]
*
(
dy0
+
t
*
(
dy1
-
dy0
));
dz
=
geo
.
trans
[
2
]
*
(
dz0
+
t
*
(
dz1
-
dz0
));
x
+=
dx
;
y
+=
dy
;
z
+=
dz
;
break
;
case
ROTATE
:
angle
=
geo
.
angle
;
geo
.
angle
=
geo
.
angle
*
(
dx0
+
t
*
(
dx1
-
dx0
));
ProtudeXYZ
(
x
,
y
,
z
,
this
);
geo
.
angle
=
angle
;
break
;
case
TRANSLATE_ROTATE
:
angle
=
geo
.
angle
;
geo
.
angle
=
geo
.
angle
*
(
dx0
+
t
*
(
dx1
-
dx0
));
ProtudeXYZ
(
x
,
y
,
z
,
this
);
geo
.
angle
=
angle
;
dx
=
geo
.
trans
[
0
]
*
(
dx0
+
t
*
(
dx1
-
dx0
));
dy
=
geo
.
trans
[
1
]
*
(
dy0
+
t
*
(
dy1
-
dy0
));
dz
=
geo
.
trans
[
2
]
*
(
dz0
+
t
*
(
dz1
-
dz0
));
x
+=
dx
;
y
+=
dy
;
z
+=
dz
;
break
;
default:
Msg
(
GERROR
,
"Unknown extrusion type"
);
break
;
}
double
t
=
u
(
iLayer
,
iElemLayer
);
Extrude
(
t
,
x
,
y
,
z
);
}
void
ExtrudeParams
::
Rotate
(
double
matr
[
3
][
3
])
...
...
@@ -162,3 +115,19 @@ void ExtrudeParams::Extrude(double t, double &x, double &y, double &z)
break
;
}
}
double
ExtrudeParams
::
u
(
int
iLayer
,
int
iElemLayer
)
{
double
t0
,
t1
;
if
(
!
iLayer
)
{
t0
=
0.0
;
t1
=
mesh
.
hLayer
[
0
];
}
else
{
t0
=
mesh
.
hLayer
[
iLayer
-
1
];
t1
=
mesh
.
hLayer
[
iLayer
];
}
double
t
=
(
double
)
iElemLayer
/
(
double
)
mesh
.
NbElmLayer
[
iLayer
];
return
t0
+
t
*
(
t1
-
t0
);
}
This diff is collapsed.
Click to expand it.
Geo/ExtrudeParams.h
+
1
−
0
View file @
750cea65
...
...
@@ -38,6 +38,7 @@ public :
double
T0
,
double
T1
,
double
T2
,
double
A0
,
double
A1
,
double
A2
,
double
X0
,
double
X1
,
double
X2
,
double
angle
);
double
u
(
int
iLayer
,
int
iElemLayer
);
void
Extrude
(
int
iLayer
,
int
iElemLayer
,
double
&
dx
,
double
&
dy
,
double
&
dz
);
void
Extrude
(
double
t
,
double
&
x
,
double
&
y
,
double
&
z
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment