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
4e7d1cb1
Commit
4e7d1cb1
authored
9 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
time sign option
parent
bbd28080
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Plugin/HarmonicToTime.cpp
+12
-8
12 additions, 8 deletions
Plugin/HarmonicToTime.cpp
with
12 additions
and
8 deletions
Plugin/HarmonicToTime.cpp
+
12
−
8
View file @
4e7d1cb1
...
@@ -10,6 +10,7 @@ StringXNumber HarmonicToTimeOptions_Number[] = {
...
@@ -10,6 +10,7 @@ StringXNumber HarmonicToTimeOptions_Number[] = {
{
GMSH_FULLRC
,
"RealPart"
,
NULL
,
0.
},
{
GMSH_FULLRC
,
"RealPart"
,
NULL
,
0.
},
{
GMSH_FULLRC
,
"ImaginaryPart"
,
NULL
,
1.
},
{
GMSH_FULLRC
,
"ImaginaryPart"
,
NULL
,
1.
},
{
GMSH_FULLRC
,
"NumSteps"
,
NULL
,
20.
},
{
GMSH_FULLRC
,
"NumSteps"
,
NULL
,
20.
},
{
GMSH_FULLRC
,
"TimeSign"
,
NULL
,
-
1.
},
{
GMSH_FULLRC
,
"View"
,
NULL
,
-
1.
}
{
GMSH_FULLRC
,
"View"
,
NULL
,
-
1.
}
};
};
...
@@ -27,8 +28,9 @@ std::string GMSH_HarmonicToTimePlugin::getHelp() const
...
@@ -27,8 +28,9 @@ std::string GMSH_HarmonicToTimePlugin::getHelp() const
"time steps `RealPart' and `ImaginaryPart' of "
"time steps `RealPart' and `ImaginaryPart' of "
"the view `View', and creates a new view "
"the view `View', and creates a new view "
"containing
\n\n
"
"containing
\n\n
"
"`View'[`RealPart'] * cos(p) - `View'[`ImaginaryPart'] * sin(p)
\n\n
"
"`View'[`RealPart'] * cos(p) +- `View'[`ImaginaryPart'] * sin(p)
\n\n
"
"with p = 2*Pi*k/`NumSteps', k = 0, ..., `NumSteps'-1.
\n\n
"
"with p = 2*Pi*k/`NumSteps', k = 0, ..., `NumSteps'-1.
\n
"
"The + or - sign is controlled by `TimeSign'.
\n\n
"
"If `View' < 0, the plugin is run on the current view.
\n\n
"
"If `View' < 0, the plugin is run on the current view.
\n\n
"
"Plugin(HarmonicToTime) creates one new view."
;
"Plugin(HarmonicToTime) creates one new view."
;
}
}
...
@@ -48,7 +50,8 @@ PView *GMSH_HarmonicToTimePlugin::execute(PView * v)
...
@@ -48,7 +50,8 @@ PView *GMSH_HarmonicToTimePlugin::execute(PView * v)
int
rIndex
=
(
int
)
HarmonicToTimeOptions_Number
[
0
].
def
;
int
rIndex
=
(
int
)
HarmonicToTimeOptions_Number
[
0
].
def
;
int
iIndex
=
(
int
)
HarmonicToTimeOptions_Number
[
1
].
def
;
int
iIndex
=
(
int
)
HarmonicToTimeOptions_Number
[
1
].
def
;
int
nSteps
=
(
int
)
HarmonicToTimeOptions_Number
[
2
].
def
;
int
nSteps
=
(
int
)
HarmonicToTimeOptions_Number
[
2
].
def
;
int
iView
=
(
int
)
HarmonicToTimeOptions_Number
[
3
].
def
;
double
tsign
=
HarmonicToTimeOptions_Number
[
3
].
def
>
0
?
1.
:
-
1.
;
int
iView
=
(
int
)
HarmonicToTimeOptions_Number
[
4
].
def
;
PView
*
v1
=
getView
(
iView
,
v
);
PView
*
v1
=
getView
(
iView
,
v
);
if
(
!
v1
)
return
v
;
if
(
!
v1
)
return
v
;
...
@@ -72,7 +75,7 @@ PView *GMSH_HarmonicToTimePlugin::execute(PView * v)
...
@@ -72,7 +75,7 @@ PView *GMSH_HarmonicToTimePlugin::execute(PView * v)
PView
*
v2
=
new
PView
();
PView
*
v2
=
new
PView
();
PViewDataList
*
data2
=
getDataList
(
v2
);
PViewDataList
*
data2
=
getDataList
(
v2
);
for
(
int
ent
=
0
;
ent
<
data1
->
getNumEntities
(
0
);
ent
++
){
for
(
int
ent
=
0
;
ent
<
data1
->
getNumEntities
(
0
);
ent
++
){
for
(
int
ele
=
0
;
ele
<
data1
->
getNumElements
(
0
,
ent
);
ele
++
){
for
(
int
ele
=
0
;
ele
<
data1
->
getNumElements
(
0
,
ent
);
ele
++
){
if
(
data1
->
skipElement
(
0
,
ent
,
ele
))
continue
;
if
(
data1
->
skipElement
(
0
,
ent
,
ele
))
continue
;
...
@@ -89,14 +92,15 @@ PView *GMSH_HarmonicToTimePlugin::execute(PView * v)
...
@@ -89,14 +92,15 @@ PView *GMSH_HarmonicToTimePlugin::execute(PView * v)
data1
->
getValue
(
iIndex
,
ent
,
ele
,
nod
,
comp
,
vi
[
numComp
*
nod
+
comp
]);
data1
->
getValue
(
iIndex
,
ent
,
ele
,
nod
,
comp
,
vi
[
numComp
*
nod
+
comp
]);
}
}
}
}
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
out
->
push_back
(
x
[
nod
]);
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
out
->
push_back
(
x
[
nod
]);
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
out
->
push_back
(
y
[
nod
]);
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
out
->
push_back
(
y
[
nod
]);
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
out
->
push_back
(
z
[
nod
]);
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
out
->
push_back
(
z
[
nod
]);
for
(
int
t
=
0
;
t
<
nSteps
;
t
++
)
{
for
(
int
t
=
0
;
t
<
nSteps
;
t
++
)
{
double
p
=
2.
*
M_PI
*
t
/
nSteps
;
double
p
=
2.
*
M_PI
*
t
/
nSteps
;
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
{
for
(
int
nod
=
0
;
nod
<
numNodes
;
nod
++
)
{
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
{
for
(
int
comp
=
0
;
comp
<
numComp
;
comp
++
)
{
double
val
=
vr
[
numComp
*
nod
+
comp
]
*
cos
(
p
)
-
double
val
=
vr
[
numComp
*
nod
+
comp
]
*
cos
(
p
)
+
tsign
*
vi
[
numComp
*
nod
+
comp
]
*
sin
(
p
);
vi
[
numComp
*
nod
+
comp
]
*
sin
(
p
);
out
->
push_back
(
val
);
out
->
push_back
(
val
);
}
}
...
...
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