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
725f4088
Commit
725f4088
authored
20 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
small bug fix: smooth() did not recompute TimeStepMin/Max
parent
cbcf66c7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Common/Views.cpp
+33
-27
33 additions, 27 deletions
Common/Views.cpp
with
33 additions
and
27 deletions
Common/Views.cpp
+
33
−
27
View file @
725f4088
// $Id: Views.cpp,v 1.15
3
2004-12-2
6 19:50:1
6 geuzaine Exp $
// $Id: Views.cpp,v 1.15
4
2004-12-2
7 21:05:0
6 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -1210,34 +1210,34 @@ void generate_connectivities(List_T * list, int nbList, int nbTimeStep, int nbVe
delete
[]
vals
;
}
void
smooth_list
(
List_T
*
list
,
int
nbList
,
double
*
min
,
double
*
max
,
void
smooth_list
(
List_T
*
list
,
int
nbList
,
double
*
min
,
double
*
max
,
double
*
tsmin
,
double
*
tsmax
,
int
nbTimeStep
,
int
nbVert
,
xyzcont
&
connectivities
)
{
double
*
x
,
*
y
,
*
z
,
*
v
;
int
i
,
j
,
k
;
if
(
!
nbList
)
return
;
*
min
=
VAL_INF
;
*
max
=
-
VAL_INF
;
int
nb
=
List_Nbr
(
list
)
/
nbList
;
for
(
i
=
0
;
i
<
List_Nbr
(
list
);
i
+=
nb
)
{
x
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
);
y
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
nbVert
);
z
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
2
*
nbVert
);
v
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
3
*
nbVert
);
for
(
j
=
0
;
j
<
nbVert
;
j
++
)
{
for
(
int
i
=
0
;
i
<
List_Nbr
(
list
);
i
+=
nb
)
{
double
*
x
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
);
double
*
y
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
nbVert
);
double
*
z
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
2
*
nbVert
);
double
*
v
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
3
*
nbVert
);
for
(
int
j
=
0
;
j
<
nbVert
;
j
++
)
{
xyzv
xyz
(
x
[
j
],
y
[
j
],
z
[
j
]);
xyziter
it
=
connectivities
.
find
(
xyz
);
if
(
it
!=
connectivities
.
end
())
{
for
(
k
=
0
;
k
<
nbTimeStep
;
k
++
)
{
v
[
j
+
k
*
nbVert
]
=
(
*
it
).
vals
[
k
];
if
(
v
[
j
+
k
*
nbVert
]
<
*
min
)
*
min
=
v
[
j
+
k
*
nbVert
];
if
(
v
[
j
+
k
*
nbVert
]
>
*
max
)
*
max
=
v
[
j
+
k
*
nbVert
];
for
(
int
k
=
0
;
k
<
nbTimeStep
;
k
++
)
{
double
dd
=
(
*
it
).
vals
[
k
];
v
[
j
+
k
*
nbVert
]
=
dd
;
if
(
dd
<
*
min
)
*
min
=
dd
;
if
(
dd
>
*
max
)
*
max
=
dd
;
if
(
dd
<
tsmin
[
k
])
tsmin
[
k
]
=
dd
;
if
(
dd
>
tsmax
[
k
])
tsmax
[
k
]
=
dd
;
}
}
}
...
...
@@ -1252,6 +1252,12 @@ void Post_View::smooth()
if
(
NbSL
||
NbST
||
NbSQ
||
NbSS
||
NbSH
||
NbSI
||
NbSY
)
{
xyzcont
con
;
Msg
(
INFO
,
"Smoothing scalar primitives in View[%d]"
,
Index
);
Min
=
VAL_INF
;
Max
=
-
VAL_INF
;
for
(
int
k
=
0
;
k
<
NbTimeStep
;
k
++
)
{
TimeStepMin
[
k
]
=
VAL_INF
;
TimeStepMax
[
k
]
=
-
VAL_INF
;
}
generate_connectivities
(
SL
,
NbSL
,
NbTimeStep
,
2
,
con
);
generate_connectivities
(
ST
,
NbST
,
NbTimeStep
,
3
,
con
);
generate_connectivities
(
SQ
,
NbSQ
,
NbTimeStep
,
4
,
con
);
...
...
@@ -1259,13 +1265,13 @@ void Post_View::smooth()
generate_connectivities
(
SH
,
NbSH
,
NbTimeStep
,
8
,
con
);
generate_connectivities
(
SI
,
NbSI
,
NbTimeStep
,
6
,
con
);
generate_connectivities
(
SY
,
NbSY
,
NbTimeStep
,
5
,
con
);
smooth_list
(
SL
,
NbSL
,
&
Min
,
&
Max
,
NbTimeStep
,
2
,
con
);
smooth_list
(
ST
,
NbST
,
&
Min
,
&
Max
,
NbTimeStep
,
3
,
con
);
smooth_list
(
SQ
,
NbSQ
,
&
Min
,
&
Max
,
NbTimeStep
,
4
,
con
);
smooth_list
(
SS
,
NbSS
,
&
Min
,
&
Max
,
NbTimeStep
,
4
,
con
);
smooth_list
(
SH
,
NbSH
,
&
Min
,
&
Max
,
NbTimeStep
,
8
,
con
);
smooth_list
(
SI
,
NbSI
,
&
Min
,
&
Max
,
NbTimeStep
,
6
,
con
);
smooth_list
(
SY
,
NbSY
,
&
Min
,
&
Max
,
NbTimeStep
,
5
,
con
);
smooth_list
(
SL
,
NbSL
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
2
,
con
);
smooth_list
(
ST
,
NbST
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
3
,
con
);
smooth_list
(
SQ
,
NbSQ
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
4
,
con
);
smooth_list
(
SS
,
NbSS
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
4
,
con
);
smooth_list
(
SH
,
NbSH
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
8
,
con
);
smooth_list
(
SI
,
NbSI
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
6
,
con
);
smooth_list
(
SY
,
NbSY
,
&
Min
,
&
Max
,
TimeStepMin
,
TimeStepMax
,
NbTimeStep
,
5
,
con
);
Changed
=
1
;
}
...
...
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