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
3febcbaa
Commit
3febcbaa
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
removed limit (was 100) on number of possible values for a solver option
parent
410556b9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Fltk/Solvers.cpp
+31
-11
31 additions, 11 deletions
Fltk/Solvers.cpp
Fltk/Solvers.h
+3
-2
3 additions, 2 deletions
Fltk/Solvers.h
Fltk/solverWindow.cpp
+8
-4
8 additions, 4 deletions
Fltk/solverWindow.cpp
with
42 additions
and
17 deletions
Fltk/Solvers.cpp
+
31
−
11
View file @
3febcbaa
...
@@ -165,11 +165,10 @@ int Solver(int num, const char *args)
...
@@ -165,11 +165,10 @@ int Solver(int num, const char *args)
}
}
if
(
num
>=
0
){
if
(
num
>=
0
){
for
(
int
i
=
0
;
i
<
SINFO
[
num
].
nboptions
;
i
++
)
SINFO
[
num
].
nbval
[
i
]
=
0
;
SINFO
[
num
].
pid
=
0
;
SINFO
[
num
].
pid
=
0
;
SINFO
[
num
].
server
=
0
;
SINFO
[
num
].
server
=
0
;
}
}
bool
initOption
[
5
]
=
{
true
,
true
,
true
,
true
,
true
};
Msg
::
StatusBar
(
2
,
false
,
"Running '%s'"
,
prog
.
c_str
());
Msg
::
StatusBar
(
2
,
false
,
"Running '%s'"
,
prog
.
c_str
());
...
@@ -211,24 +210,44 @@ int Solver(int num, const char *args)
...
@@ -211,24 +210,44 @@ int Solver(int num, const char *args)
Msg
::
StatusBar
(
2
,
false
,
"%s"
,
message
);
Msg
::
StatusBar
(
2
,
false
,
"%s"
,
message
);
break
;
break
;
case
GmshServer
::
CLIENT_OPTION_1
:
case
GmshServer
::
CLIENT_OPTION_1
:
if
(
initOption
[
0
]){
SINFO
[
num
].
option
[
0
].
clear
();
initOption
[
0
]
=
false
;
}
if
(
num
>=
0
)
if
(
num
>=
0
)
SINFO
[
num
].
option
[
0
]
[
SINFO
[
num
].
nbval
[
0
]
++
]
=
message
;
SINFO
[
num
].
option
[
0
]
.
push_back
(
message
)
;
break
;
break
;
case
GmshServer
::
CLIENT_OPTION_2
:
case
GmshServer
::
CLIENT_OPTION_2
:
if
(
initOption
[
1
]){
SINFO
[
num
].
option
[
1
].
clear
();
initOption
[
1
]
=
false
;
}
if
(
num
>=
0
)
if
(
num
>=
0
)
SINFO
[
num
].
option
[
1
]
[
SINFO
[
num
].
nbval
[
1
]
++
]
=
message
;
SINFO
[
num
].
option
[
1
]
.
push_back
(
message
)
;
break
;
break
;
case
GmshServer
::
CLIENT_OPTION_3
:
case
GmshServer
::
CLIENT_OPTION_3
:
if
(
initOption
[
2
]){
SINFO
[
num
].
option
[
2
].
clear
();
initOption
[
2
]
=
false
;
}
if
(
num
>=
0
)
if
(
num
>=
0
)
SINFO
[
num
].
option
[
2
]
[
SINFO
[
num
].
nbval
[
2
]
++
]
=
message
;
SINFO
[
num
].
option
[
2
]
.
push_back
(
message
)
;
break
;
break
;
case
GmshServer
::
CLIENT_OPTION_4
:
case
GmshServer
::
CLIENT_OPTION_4
:
if
(
initOption
[
3
]){
SINFO
[
num
].
option
[
3
].
clear
();
initOption
[
3
]
=
false
;
}
if
(
num
>=
0
)
if
(
num
>=
0
)
SINFO
[
num
].
option
[
3
]
[
SINFO
[
num
].
nbval
[
3
]
++
]
=
message
;
SINFO
[
num
].
option
[
3
]
.
push_back
(
message
)
;
break
;
break
;
case
GmshServer
::
CLIENT_OPTION_5
:
case
GmshServer
::
CLIENT_OPTION_5
:
if
(
initOption
[
4
]){
SINFO
[
num
].
option
[
4
].
clear
();
initOption
[
4
]
=
false
;
}
if
(
num
>=
0
)
if
(
num
>=
0
)
SINFO
[
num
].
option
[
4
]
[
SINFO
[
num
].
nbval
[
4
]
++
]
=
message
;
SINFO
[
num
].
option
[
4
]
.
push_back
(
message
)
;
break
;
break
;
case
GmshServer
::
CLIENT_MERGE_FILE
:
case
GmshServer
::
CLIENT_MERGE_FILE
:
if
(
num
<
0
||
(
num
>=
0
&&
SINFO
[
num
].
merge_views
))
{
if
(
num
<
0
||
(
num
>=
0
&&
SINFO
[
num
].
merge_views
))
{
...
@@ -281,10 +300,11 @@ int Solver(int num, const char *args)
...
@@ -281,10 +300,11 @@ int Solver(int num, const char *args)
}
}
if
(
num
>=
0
){
if
(
num
>=
0
){
if
(
!
initOption
[
0
]
||
!
initOption
[
1
]
||
!
initOption
[
2
]
||
!
initOption
[
3
]
||
!
initOption
[
4
]){
// some options have been changed
for
(
int
i
=
0
;
i
<
SINFO
[
num
].
nboptions
;
i
++
)
{
for
(
int
i
=
0
;
i
<
SINFO
[
num
].
nboptions
;
i
++
)
{
if
(
SINFO
[
num
].
nbval
[
i
])
{
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
i
]
->
clear
();
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
i
]
->
clear
();
for
(
int
j
=
0
;
j
<
SINFO
[
num
].
nbval
[
i
]
;
j
++
)
for
(
int
j
=
0
;
j
<
SINFO
[
num
].
option
[
i
].
size
()
;
j
++
)
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
i
]
->
add
(
SINFO
[
num
].
option
[
i
][
j
].
c_str
());
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
i
]
->
add
(
SINFO
[
num
].
option
[
i
][
j
].
c_str
());
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
i
]
->
value
(
0
);
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
i
]
->
value
(
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/Solvers.h
+
3
−
2
View file @
3febcbaa
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#define _SOLVERS_H_
#define _SOLVERS_H_
#include
<string>
#include
<string>
#include
<vector>
#define MAX_NUM_SOLVERS 5
#define MAX_NUM_SOLVERS 5
#define MAX_NUM_SOLVER_OPTIONS 5
#define MAX_NUM_SOLVER_OPTIONS 5
...
@@ -21,8 +22,8 @@ typedef struct{
...
@@ -21,8 +22,8 @@ typedef struct{
std
::
string
button_name
[
MAX_NUM_SOLVER_OPTIONS
];
std
::
string
button_name
[
MAX_NUM_SOLVER_OPTIONS
];
std
::
string
button_command
[
MAX_NUM_SOLVER_OPTIONS
];
std
::
string
button_command
[
MAX_NUM_SOLVER_OPTIONS
];
std
::
string
option_name
[
MAX_NUM_SOLVER_OPTIONS
],
option_command
;
std
::
string
option_name
[
MAX_NUM_SOLVER_OPTIONS
],
option_command
;
std
::
string
option
[
MAX_NUM_SOLVER_OPTIONS
]
[
100
]
;
std
::
vector
<
std
::
string
>
option
[
MAX_NUM_SOLVER_OPTIONS
];
int
nboptions
,
nbval
[
MAX_NUM_SOLVER_OPTIONS
]
;
int
nboptions
;
std
::
string
help
;
std
::
string
help
;
int
client_server
,
popup_messages
,
merge_views
;
int
client_server
,
popup_messages
,
merge_views
;
int
pid
;
int
pid
;
...
...
This diff is collapsed.
Click to expand it.
Fltk/solverWindow.cpp
+
8
−
4
View file @
3febcbaa
...
@@ -110,7 +110,7 @@ static void solver_command_cb(Fl_Widget *w, void *data)
...
@@ -110,7 +110,7 @@ static void solver_command_cb(Fl_Widget *w, void *data)
char
tmp
[
256
],
mesh
[
256
],
arg
[
512
],
command
[
256
];
char
tmp
[
256
],
mesh
[
256
],
arg
[
512
],
command
[
256
];
int
num
=
((
int
*
)
data
)[
0
];
int
num
=
((
int
*
)
data
)[
0
];
int
idx
=
((
int
*
)
data
)[
1
];
int
idx
=
((
int
*
)
data
)[
1
];
int
i
,
usedopts
=
0
;
int
usedopts
=
0
;
if
(
SINFO
[
num
].
popup_messages
)
if
(
SINFO
[
num
].
popup_messages
)
GUI
::
instance
()
->
messages
->
show
(
true
);
GUI
::
instance
()
->
messages
->
show
(
true
);
...
@@ -125,14 +125,18 @@ static void solver_command_cb(Fl_Widget *w, void *data)
...
@@ -125,14 +125,18 @@ static void solver_command_cb(Fl_Widget *w, void *data)
}
}
if
(
nbs
(
SINFO
[
num
].
button_command
[
idx
].
c_str
()))
{
if
(
nbs
(
SINFO
[
num
].
button_command
[
idx
].
c_str
()))
{
for
(
i
=
0
;
i
<
idx
;
i
++
)
for
(
int
i
=
0
;
i
<
idx
;
i
++
)
usedopts
+=
nbs
(
SINFO
[
num
].
button_command
[
i
].
c_str
());
usedopts
+=
nbs
(
SINFO
[
num
].
button_command
[
i
].
c_str
());
if
(
usedopts
>
SINFO
[
num
].
nboptions
)
{
if
(
usedopts
>
SINFO
[
num
].
nboptions
)
{
Msg
::
Error
(
"Missing options to execute command"
);
Msg
::
Error
(
"Missing options to execute command"
);
return
;
return
;
}
}
sprintf
(
command
,
SINFO
[
num
].
button_command
[
idx
].
c_str
(),
SINFO
[
num
].
option
int
val
=
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
usedopts
]
->
value
();
[
usedopts
][
GUI
::
instance
()
->
solver
[
num
]
->
choice
[
usedopts
]
->
value
()].
c_str
());
if
(
val
<
SINFO
[
num
].
option
[
usedopts
].
size
())
sprintf
(
command
,
SINFO
[
num
].
button_command
[
idx
].
c_str
(),
SINFO
[
num
].
option
[
usedopts
][
val
].
c_str
());
else
Msg
::
Error
(
"Invalid option index: missing value"
);
}
}
else
{
else
{
strcpy
(
command
,
SINFO
[
num
].
button_command
[
idx
].
c_str
());
strcpy
(
command
,
SINFO
[
num
].
button_command
[
idx
].
c_str
());
...
...
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