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
133697af
Commit
133697af
authored
21 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Generalize SphericalRaise to accept a TimeStep argument + fix the time step selection warning.
parent
80311575
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
Plugin/DisplacementRaise.cpp
+2
-2
2 additions, 2 deletions
Plugin/DisplacementRaise.cpp
Plugin/SphericalRaise.cpp
+32
-22
32 additions, 22 deletions
Plugin/SphericalRaise.cpp
with
34 additions
and
24 deletions
Plugin/DisplacementRaise.cpp
+
2
−
2
View file @
133697af
// $Id: DisplacementRaise.cpp,v 1.
6
2003-11-1
8 21:04:41
geuzaine Exp $
// $Id: DisplacementRaise.cpp,v 1.
7
2003-11-1
9 01:52:32
geuzaine Exp $
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -102,9 +102,9 @@ static void displacementRaiseList(Post_View * iView, List_T * iList, int iNbElm,
// should we treat multiple time steps by generating new views
// (cf. time dependent CutMaps)?
if
(
dTimeStep
<
0
||
dTimeStep
>
dView
->
NbTimeStep
-
1
){
dTimeStep
=
0
;
Msg
(
WARNING
,
"Invalid TimeStep (%d) in View[%d]: choosing TimeStep 0"
,
dTimeStep
,
dView
->
Index
);
dTimeStep
=
0
;
}
iView
->
Changed
=
1
;
...
...
This diff is collapsed.
Click to expand it.
Plugin/SphericalRaise.cpp
+
32
−
22
View file @
133697af
// $Id: SphericalRaise.cpp,v 1.
7
2003-11-1
4 21:20:55
geuzaine Exp $
// $Id: SphericalRaise.cpp,v 1.
8
2003-11-1
9 01:52:32
geuzaine Exp $
//
// Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -33,6 +33,7 @@ StringXNumber SphericalRaiseOptions_Number[] = {
{
GMSH_FULLRC
,
"Yc"
,
NULL
,
0.
},
{
GMSH_FULLRC
,
"Zc"
,
NULL
,
0.
},
{
GMSH_FULLRC
,
"Raise"
,
NULL
,
1.
},
{
GMSH_FULLRC
,
"TimeStep"
,
NULL
,
0.
},
{
GMSH_FULLRC
,
"iView"
,
NULL
,
-
1.
}
};
...
...
@@ -61,15 +62,16 @@ void GMSH_SphericalRaisePlugin::getInfos(char *author, char *copyright,
strcpy
(
author
,
"C. Geuzaine (geuz@geuz.org)"
);
strcpy
(
copyright
,
"DGR (www.multiphysics.com)"
);
strcpy
(
help_text
,
"Plugin(SphericalRaise) transforms the coordinates
\n
"
"of the elements in the view 'iView' according to
\n
"
"the elements' associated values. Instead of
\n
"
"elevating the nodes along the X, Y and Z axes
\n
"
"as in View['iView'].RaiseX, View['iView'].RaiseY
\n
"
"Plugin(SphericalRaise) transforms the
\n
"
"coordinates of the elements in the view 'iView'
\n
"
"using the values associated with the
\n
"
"'TimeStep'-th time step. Instead of elevating
\n
"
"the nodes along the X, Y and Z axes as in
\n
"
"View['iView'].RaiseX, View['iView'].RaiseY
\n
"
"and View['iView'].RaiseZ, the raise is applied
\n
"
" along the radius of a sphere centered at ('Xc',
\n
"
"'Yc', 'Zc'). If 'iView' < 0, the plugin is run
on
\n
"
"the current view.
\n
"
);
"'Yc', 'Zc'). If 'iView' < 0, the plugin is run
\n
"
"
on
the current view.
\n
"
);
}
int
GMSH_SphericalRaisePlugin
::
getNbOptions
()
const
...
...
@@ -88,7 +90,8 @@ void GMSH_SphericalRaisePlugin::CatchErrorMessage(char *errorMessage) const
}
static
void
sphericalRaiseList
(
Post_View
*
v
,
List_T
*
list
,
int
nbelm
,
int
nbvert
,
double
center
[
3
],
double
raise
)
int
nbvert
,
int
timeStep
,
double
center
[
3
],
double
raise
)
{
double
*
x
,
*
y
,
*
z
,
*
val
,
d
[
3
],
coef
;
int
nb
,
i
,
j
;
...
...
@@ -98,6 +101,12 @@ static void sphericalRaiseList(Post_View * v, List_T * list, int nbelm,
else
return
;
if
(
timeStep
<
0
||
timeStep
>
v
->
NbTimeStep
-
1
){
Msg
(
WARNING
,
"Invalid TimeStep (%d) in View[%d]: choosing TimeStep 0"
,
timeStep
,
v
->
Index
);
timeStep
=
0
;
}
// for each element
// for each node
// compute d=(x-Xc,y-Yc,z-Zc)
...
...
@@ -116,7 +125,7 @@ static void sphericalRaiseList(Post_View * v, List_T * list, int nbelm,
d
[
1
]
=
y
[
j
]
-
center
[
1
];
d
[
2
]
=
z
[
j
]
-
center
[
2
];
norme
(
d
);
coef
=
raise
*
val
[
j
];
coef
=
raise
*
val
[
nbvert
*
timeStep
+
j
];
x
[
j
]
+=
coef
*
d
[
0
];
y
[
j
]
+=
coef
*
d
[
1
];
z
[
j
]
+=
coef
*
d
[
2
];
...
...
@@ -124,16 +133,17 @@ static void sphericalRaiseList(Post_View * v, List_T * list, int nbelm,
}
}
static
void
sphericalRaise
(
Post_View
*
v
,
double
center
[
3
],
double
raise
)
static
void
sphericalRaise
(
Post_View
*
v
,
int
timeStep
,
double
center
[
3
],
double
raise
)
{
sphericalRaiseList
(
v
,
v
->
SP
,
v
->
NbSP
,
1
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SL
,
v
->
NbSL
,
2
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
ST
,
v
->
NbST
,
3
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SQ
,
v
->
NbSQ
,
4
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SS
,
v
->
NbSS
,
4
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SH
,
v
->
NbSH
,
8
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SI
,
v
->
NbSI
,
6
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SY
,
v
->
NbSY
,
5
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SP
,
v
->
NbSP
,
1
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SL
,
v
->
NbSL
,
2
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
ST
,
v
->
NbST
,
3
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SQ
,
v
->
NbSQ
,
4
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SS
,
v
->
NbSS
,
4
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SH
,
v
->
NbSH
,
8
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SI
,
v
->
NbSI
,
6
,
timeStep
,
center
,
raise
);
sphericalRaiseList
(
v
,
v
->
SY
,
v
->
NbSY
,
5
,
timeStep
,
center
,
raise
);
}
Post_View
*
GMSH_SphericalRaisePlugin
::
execute
(
Post_View
*
v
)
...
...
@@ -145,8 +155,8 @@ Post_View *GMSH_SphericalRaisePlugin::execute(Post_View * v)
center
[
1
]
=
SphericalRaiseOptions_Number
[
1
].
def
;
center
[
2
]
=
SphericalRaiseOptions_Number
[
2
].
def
;
raise
=
SphericalRaiseOptions_Number
[
3
].
def
;
int
iView
=
(
int
)
SphericalRaiseOptions_Number
[
4
].
def
;
int
timeStep
=
(
int
)
SphericalRaiseOptions_Number
[
4
].
def
;
int
iView
=
(
int
)
SphericalRaiseOptions_Number
[
5
].
def
;
if
(
v
&&
iView
<
0
)
vv
=
v
;
...
...
@@ -159,7 +169,7 @@ Post_View *GMSH_SphericalRaisePlugin::execute(Post_View * v)
}
}
sphericalRaise
(
vv
,
center
,
raise
);
sphericalRaise
(
vv
,
timeStep
,
center
,
raise
);
return
vv
;
}
...
...
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