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
126a6006
Commit
126a6006
authored
19 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
I borked the smooth plugin with my cleanups: this fixes it
parent
33e9e089
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Common/Views.cpp
+40
-12
40 additions, 12 deletions
Common/Views.cpp
with
40 additions
and
12 deletions
Common/Views.cpp
+
40
−
12
View file @
126a6006
// $Id: Views.cpp,v 1.18
4
2006-0
1-28 21:13:35
geuzaine Exp $
// $Id: Views.cpp,v 1.18
5
2006-0
2-01 02:11:02
geuzaine Exp $
//
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -901,6 +901,37 @@ struct xyzv {
...
@@ -901,6 +901,37 @@ struct xyzv {
xyzv
(
double
xx
,
double
yy
,
double
zz
)
xyzv
(
double
xx
,
double
yy
,
double
zz
)
:
x
(
xx
),
y
(
yy
),
z
(
zz
),
vals
(
0
),
nbvals
(
0
),
nboccurences
(
0
)
{}
:
x
(
xx
),
y
(
yy
),
z
(
zz
),
vals
(
0
),
nbvals
(
0
),
nboccurences
(
0
)
{}
~
xyzv
(){
if
(
vals
)
delete
[]
vals
;
}
~
xyzv
(){
if
(
vals
)
delete
[]
vals
;
}
// the following two are needed for set<> operations, since the
// default copy ctor won't allocate *vals
xyzv
(
const
xyzv
&
other
)
{
x
=
other
.
x
;
y
=
other
.
y
;
z
=
other
.
z
;
nbvals
=
other
.
nbvals
;
nboccurences
=
other
.
nboccurences
;
if
(
other
.
vals
&&
other
.
nbvals
)
{
vals
=
new
double
[
other
.
nbvals
];
for
(
int
i
=
0
;
i
<
nbvals
;
i
++
)
vals
[
i
]
=
other
.
vals
[
i
];
}
}
xyzv
&
operator
=
(
const
xyzv
&
other
)
{
if
(
this
!=
&
other
)
{
x
=
other
.
x
;
y
=
other
.
y
;
z
=
other
.
z
;
nbvals
=
other
.
nbvals
;
nboccurences
=
other
.
nboccurences
;
if
(
other
.
vals
&&
other
.
nbvals
)
{
vals
=
new
double
[
other
.
nbvals
];
for
(
int
i
=
0
;
i
<
nbvals
;
i
++
)
vals
[
i
]
=
other
.
vals
[
i
];
}
}
return
*
this
;
}
void
update
(
int
n
,
double
*
v
)
void
update
(
int
n
,
double
*
v
)
{
{
if
(
!
vals
)
{
if
(
!
vals
)
{
...
@@ -945,21 +976,18 @@ typedef xyzv_cont::const_iterator xyzv_iter;
...
@@ -945,21 +976,18 @@ typedef xyzv_cont::const_iterator xyzv_iter;
void
generate_connectivities
(
List_T
*
list
,
int
nbList
,
int
nbTimeStep
,
int
nbVert
,
void
generate_connectivities
(
List_T
*
list
,
int
nbList
,
int
nbTimeStep
,
int
nbVert
,
xyzv_cont
&
connectivities
)
xyzv_cont
&
connectivities
)
{
{
double
*
x
,
*
y
,
*
z
,
*
v
;
int
i
,
j
,
k
;
if
(
!
nbList
)
return
;
if
(
!
nbList
)
return
;
double
*
vals
=
new
double
[
nbTimeStep
];
double
*
vals
=
new
double
[
nbTimeStep
];
int
nb
=
List_Nbr
(
list
)
/
nbList
;
int
nb
=
List_Nbr
(
list
)
/
nbList
;
for
(
i
=
0
;
i
<
List_Nbr
(
list
);
i
+=
nb
)
{
for
(
int
i
=
0
;
i
<
List_Nbr
(
list
);
i
+=
nb
)
{
x
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
);
double
*
x
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
);
y
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
nbVert
);
double
*
y
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
nbVert
);
z
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
2
*
nbVert
);
double
*
z
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
2
*
nbVert
);
v
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
3
*
nbVert
);
double
*
v
=
(
double
*
)
List_Pointer_Fast
(
list
,
i
+
3
*
nbVert
);
for
(
j
=
0
;
j
<
nbVert
;
j
++
)
{
for
(
int
j
=
0
;
j
<
nbVert
;
j
++
)
{
for
(
k
=
0
;
k
<
nbTimeStep
;
k
++
)
for
(
int
k
=
0
;
k
<
nbTimeStep
;
k
++
)
vals
[
k
]
=
v
[
j
+
k
*
nbVert
];
vals
[
k
]
=
v
[
j
+
k
*
nbVert
];
xyzv
xyz
(
x
[
j
],
y
[
j
],
z
[
j
]);
xyzv
xyz
(
x
[
j
],
y
[
j
],
z
[
j
]);
xyzv_iter
it
=
connectivities
.
find
(
xyz
);
xyzv_iter
it
=
connectivities
.
find
(
xyz
);
...
...
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