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
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
gmsh
Commits
21a9f834
Commit
21a9f834
authored
18 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
2nd part of streamline patch from oshima@eng.niigata-u.ac.jp
parent
6c5d0caa
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/ViewsIO.cpp
+1
-3
1 addition, 3 deletions
Common/ViewsIO.cpp
Plugin/StreamLines.cpp
+24
-8
24 additions, 8 deletions
Plugin/StreamLines.cpp
with
25 additions
and
11 deletions
Common/ViewsIO.cpp
+
1
−
3
View file @
21a9f834
// $Id: ViewsIO.cpp,v 1.
9
200
6-11-27 22:22:08
geuzaine Exp $
// $Id: ViewsIO.cpp,v 1.
10
200
7-05-19 22:01:27
geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -68,8 +68,6 @@ int ReadView(char *filename)
}
if
(
size
==
sizeof
(
double
))
Msg
(
DEBUG
,
"Data is in double precision format (size==%d)"
,
size
);
else
if
(
size
==
sizeof
(
float
))
Msg
(
DEBUG
,
"Data is in single precision format (size==%d)"
,
size
);
else
{
Msg
(
GERROR
,
"Unknown data size (%d) in post-processing file"
,
size
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Plugin/StreamLines.cpp
+
24
−
8
View file @
21a9f834
// $Id: StreamLines.cpp,v 1.2
6
2007-05-19
16:38:01
geuzaine Exp $
// $Id: StreamLines.cpp,v 1.2
7
2007-05-19
22:01:27
geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -186,7 +186,9 @@ void GMSH_StreamLinesPlugin::getInfos(char *author, char *copyright,
"interpolated on the vector view. The time stepping
\n
"
"scheme is a RK44 with step size `DT' and `MaxIter'
\n
"
"maximum number of iterations. If `iView' < 0, the
\n
"
"plugin is run on the current view.
\n
"
"plugin is run on the current view. If `TimeStep' < 0,
\n
"
"the plugin tries to compute streamlines of the unsteady
\n
"
"flow.
\n
"
"
\n
"
"Plugin(StreamLines) creates one new view. This
\n
"
"view contains multi-step vector points if `dView'
\n
"
...
...
@@ -261,7 +263,7 @@ Post_View * GMSH_StreamLinesPlugin::GenerateView(int iView, int dView) const
}
int
timestep
=
(
int
)
StreamLinesOptions_Number
[
13
].
def
;
if
(
timestep
<
0
||
timestep
>
v1
->
NbTimeStep
-
1
){
if
(
timestep
>
v1
->
NbTimeStep
-
1
){
Msg
(
GERROR
,
"Invalid time step (%d) in View[%d]: using step 0 instead"
,
timestep
,
v1
->
Index
);
timestep
=
0
;
...
...
@@ -290,10 +292,24 @@ Post_View * GMSH_StreamLinesPlugin::GenerateView(int iView, int dView) const
List_Add
(
View
->
VP
,
&
X
[
2
]);
}
int
currentTimeStep
=
0
;
for
(
int
iter
=
0
;
iter
<
(
int
)
StreamLinesOptions_Number
[
11
].
def
;
iter
++
){
double
XPREV
[
3
]
=
{
X
[
0
],
X
[
1
],
X
[
2
]
};
if
(
timestep
<
0
){
const
double
currentT
=
DT
*
iter
;
for
(;
currentTimeStep
<
v1
->
NbTimeStep
-
1
&&
currentT
>
0.5
*
(
*
(
double
*
)
List_Pointer
(
v1
->
Time
,
currentTimeStep
)
+
*
(
double
*
)
List_Pointer
(
v1
->
Time
,
currentTimeStep
+
1
));
currentTimeStep
++
);
}
else
{
currentTimeStep
=
timestep
;
}
//Msg(DEBUG, "iter = %d, currentTimeStep = %d", iter, currentTimeStep);
// dX/dt = V
// X1 = X + a1 * DT * V(X)
// X2 = X + a2 * DT * V(X1)
...
...
@@ -301,17 +317,17 @@ Post_View * GMSH_StreamLinesPlugin::GenerateView(int iView, int dView) const
// X4 = X + a4 * DT * V(X3)
// X = X + b1 X1 + b2 X2 + b3 X3 + b4 x4
// o.searchVector(X[0], X[1], X[2], val,
t
ime
s
tep, &sizeElem);
// o.searchVector(X[0], X[1], X[2], val,
currentT
ime
S
tep, &sizeElem);
// double normV = sqrt(val[0]*val[0]+val[1]*val[1]+val[2]*val[2]);
// if (normV==0.0) normV = 1.0;
// double DT = sizeElem / normV ; // CFL = 1 ==> secure
o
.
searchVector
(
X
[
0
],
X
[
1
],
X
[
2
],
val
,
t
ime
s
tep
);
o
.
searchVector
(
X
[
0
],
X
[
1
],
X
[
2
],
val
,
currentT
ime
S
tep
);
for
(
int
k
=
0
;
k
<
3
;
k
++
)
X1
[
k
]
=
X
[
k
]
+
DT
*
val
[
k
]
*
a1
;
o
.
searchVector
(
X1
[
0
],
X1
[
1
],
X1
[
2
],
val
,
t
ime
s
tep
);
o
.
searchVector
(
X1
[
0
],
X1
[
1
],
X1
[
2
],
val
,
currentT
ime
S
tep
);
for
(
int
k
=
0
;
k
<
3
;
k
++
)
X2
[
k
]
=
X
[
k
]
+
DT
*
val
[
k
]
*
a2
;
o
.
searchVector
(
X2
[
0
],
X2
[
1
],
X2
[
2
],
val
,
t
ime
s
tep
);
o
.
searchVector
(
X2
[
0
],
X2
[
1
],
X2
[
2
],
val
,
currentT
ime
S
tep
);
for
(
int
k
=
0
;
k
<
3
;
k
++
)
X3
[
k
]
=
X
[
k
]
+
DT
*
val
[
k
]
*
a3
;
o
.
searchVector
(
X3
[
0
],
X3
[
1
],
X3
[
2
],
val
,
t
ime
s
tep
);
o
.
searchVector
(
X3
[
0
],
X3
[
1
],
X3
[
2
],
val
,
currentT
ime
S
tep
);
for
(
int
k
=
0
;
k
<
3
;
k
++
)
X4
[
k
]
=
X
[
k
]
+
DT
*
val
[
k
]
*
a4
;
for
(
int
k
=
0
;
k
<
3
;
k
++
)
...
...
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