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
f898b27d
Commit
f898b27d
authored
20 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
allow x,y,z in expressions
parent
471b0331
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
Plugin/Extract.cpp
+16
-10
16 additions, 10 deletions
Plugin/Extract.cpp
with
16 additions
and
10 deletions
Plugin/Extract.cpp
+
16
−
10
View file @
f898b27d
// $Id: Extract.cpp,v 1.1
2
2004-
09-16 19:15:27
geuzaine Exp $
// $Id: Extract.cpp,v 1.1
3
2004-
10-27 05:51:10
geuzaine Exp $
//
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -75,8 +75,10 @@ void GMSH_ExtractPlugin::getInfos(char *author, char *copyright, char *help_text
...
@@ -75,8 +75,10 @@ void GMSH_ExtractPlugin::getInfos(char *author, char *copyright, char *help_text
"Cos, Fabs, etc.) and operators (+, -, *, /, ^),
\n
"
"Cos, Fabs, etc.) and operators (+, -, *, /, ^),
\n
"
"the expressions can contain the symbols v0,
\n
"
"the expressions can contain the symbols v0,
\n
"
"v1, v2, ..., vn, which represent the n
\n
"
"v1, v2, ..., vn, which represent the n
\n
"
"components of the field. If `iView' < 0, the
\n
"
"components of the field, and the symbols x, y
\n
"
"plugin is run on the current view.
\n
"
"and z, which represent the three spatial
\n
"
"coordinates. If `iView' < 0, the plugin is
\n
"
"run on the current view.
\n
"
"
\n
"
"
\n
"
"Plugin(Extract) creates one new view.
\n
"
);
"Plugin(Extract) creates one new view.
\n
"
);
}
}
...
@@ -161,22 +163,26 @@ static void extract(char *expr[3], List_T *inList, int inNb,
...
@@ -161,22 +163,26 @@ static void extract(char *expr[3], List_T *inList, int inNb,
int
nb
=
List_Nbr
(
inList
)
/
inNb
;
int
nb
=
List_Nbr
(
inList
)
/
inNb
;
for
(
int
i
=
0
;
i
<
List_Nbr
(
inList
);
i
+=
nb
)
{
for
(
int
i
=
0
;
i
<
List_Nbr
(
inList
);
i
+=
nb
)
{
double
*
x
=
(
double
*
)
List_Pointer_Fast
(
inList
,
i
);
double
*
y
=
(
double
*
)
List_Pointer_Fast
(
inList
,
i
+
nbNod
);
double
*
z
=
(
double
*
)
List_Pointer_Fast
(
inList
,
i
+
2
*
nbNod
);
for
(
int
j
=
0
;
j
<
3
*
nbNod
;
j
++
)
for
(
int
j
=
0
;
j
<
3
*
nbNod
;
j
++
)
List_Add
(
outList
,
List_Pointer_Fast
(
inList
,
i
+
j
));
List_Add
(
outList
,
List_Pointer_Fast
(
inList
,
i
+
j
));
for
(
int
j
=
0
;
j
<
nbTime
;
j
++
){
for
(
int
j
=
0
;
j
<
nbTime
;
j
++
){
for
(
int
k
=
0
;
k
<
nbNod
;
k
++
){
for
(
int
k
=
0
;
k
<
nbNod
;
k
++
){
double
res
,
d
[
9
];
double
xx
=
x
[
k
];
double
yy
=
y
[
k
];
double
zz
=
z
[
k
];
double
d
[
9
]
=
{
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.
,
0.
};
for
(
int
l
=
0
;
l
<
nbComp
;
l
++
)
for
(
int
l
=
0
;
l
<
nbComp
;
l
++
)
List_Read
(
inList
,
i
+
3
*
nbNod
+
nbNod
*
nbComp
*
j
+
nbComp
*
k
+
l
,
&
d
[
l
]);
List_Read
(
inList
,
i
+
3
*
nbNod
+
nbNod
*
nbComp
*
j
+
nbComp
*
k
+
l
,
&
d
[
l
]);
for
(
int
l
=
nbComp
;
l
<
9
;
l
++
)
d
[
l
]
=
0.
;
for
(
int
l
=
0
;
l
<
outNbComp
;
l
++
){
for
(
int
l
=
0
;
l
<
outNbComp
;
l
++
){
#if defined(HAVE_MATH_EVAL)
#if defined(HAVE_MATH_EVAL)
char
*
names
[]
=
{
"v0"
,
"v1"
,
"v2"
,
"v3"
,
"v4"
,
"v5"
,
"v6"
,
"v7"
,
"v8"
};
char
*
names
[]
=
{
"x"
,
"y"
,
"z"
,
"v0"
,
"v1"
,
"v2"
,
"v3"
,
"v4"
,
"v5"
,
"v6"
,
"v7"
,
"v8"
};
double
values
[]
=
{
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
],
d
[
4
],
d
[
5
],
d
[
6
],
d
[
7
],
d
[
8
]
};
double
values
[]
=
{
xx
,
yy
,
zz
,
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
],
d
[
4
],
d
[
5
],
d
[
6
],
d
[
7
],
d
[
8
]
};
res
=
evaluator_evaluate
(
f
[
l
],
sizeof
(
names
)
/
sizeof
(
names
[
0
]),
names
,
values
);
double
res
=
evaluator_evaluate
(
f
[
l
],
sizeof
(
names
)
/
sizeof
(
names
[
0
]),
names
,
values
);
#else
#else
res
=
d
[
comp
[
l
]];
double
res
=
d
[
comp
[
l
]];
#endif
#endif
List_Add
(
outList
,
&
res
);
List_Add
(
outList
,
&
res
);
}
}
...
...
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