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
661e73cb
Commit
661e73cb
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
onelab: better mesh+save logic
parent
9ea87754
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
Fltk/onelabWindow.cpp
+29
-13
29 additions, 13 deletions
Fltk/onelabWindow.cpp
with
29 additions
and
13 deletions
Fltk/onelabWindow.cpp
+
29
−
13
View file @
661e73cb
...
...
@@ -281,12 +281,12 @@ bool onelab::localNetworkClient::kill()
return
false
;
}
static
void
saveMesh
(
onelab
::
client
*
c
)
static
std
::
string
getMshFileName
(
onelab
::
client
*
c
)
{
std
::
vector
<
onelab
::
string
>
ps
;
c
->
get
(
ps
,
"Gmsh/MshFileName"
);
if
(
ps
.
size
()){
C
re
ateOutputFile
(
ps
[
0
].
getValue
()
,
CTX
::
instance
()
->
mesh
.
fileFormat
)
;
re
turn
ps
[
0
].
getValue
();
}
else
{
std
::
string
name
=
CTX
::
instance
()
->
outputFileName
;
...
...
@@ -298,7 +298,7 @@ static void saveMesh(onelab::client *c)
}
onelab
::
string
o
(
"Gmsh/MshFileName"
,
name
,
"Mesh name"
);
c
->
set
(
o
);
C
re
ateOutputFile
(
o
.
getValue
(),
CTX
::
instance
()
->
mesh
.
fileFormat
)
;
re
turn
name
;
}
}
...
...
@@ -340,23 +340,39 @@ void onelab_cb(Fl_Widget *w, void *data)
// can assume this)
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
findClient
(
"Gmsh"
);
if
(
it
!=
onelab
::
server
::
instance
()
->
lastClient
()){
static
std
::
string
gmshModelName
=
GModel
::
current
()
->
getName
();
// reload geometry and/or mesh it if Gmsh parameters have been
// modified or if the geometrical model has changed
if
(
onelab
::
server
::
instance
()
->
getChanged
(
"Gmsh"
)
||
gmshModelName
!=
GModel
::
current
()
->
getName
()){
gmshModelName
=
GModel
::
current
()
->
getName
();
if
(
action
==
"check"
){
onelab
::
client
*
c
=
it
->
second
;
std
::
string
mshFileName
=
getMshFileName
(
c
);
static
std
::
string
modelName
=
GModel
::
current
()
->
getName
();
if
(
action
==
"check"
){
if
(
onelab
::
server
::
instance
()
->
getChanged
(
"Gmsh"
)
||
modelName
!=
GModel
::
current
()
->
getName
()){
// reload geometry if Gmsh parameters have been modified or if
// the model name has changed
modelName
=
GModel
::
current
()
->
getName
();
geometry_reload_cb
(
0
,
0
);
}
else
if
(
action
==
"compute"
){
}
else
if
(
action
==
"compute"
){
if
(
onelab
::
server
::
instance
()
->
getChanged
(
"Gmsh"
)
||
modelName
!=
GModel
::
current
()
->
getName
()){
// reload the geometry, mesh it and save the mesh if Gmsh
// parameters have been modified or if the model name has
// changed
modelName
=
GModel
::
current
()
->
getName
();
geometry_reload_cb
(
0
,
0
);
if
(
FlGui
::
instance
()
->
onelab
->
meshAuto
()){
mesh_3d_cb
(
0
,
0
);
saveMesh
(
it
->
second
);
CreateOutputFile
(
mshFileName
,
CTX
::
instance
()
->
mesh
.
fileFormat
);
}
}
else
if
(
StatFile
(
mshFileName
)){
// mesh+save if the mesh file does not exist
if
(
FlGui
::
instance
()
->
onelab
->
meshAuto
()){
mesh_3d_cb
(
0
,
0
);
CreateOutputFile
(
mshFileName
,
CTX
::
instance
()
->
mesh
.
fileFormat
);
}
onelab
::
server
::
instance
()
->
setChanged
(
false
,
"Gmsh"
);
}
onelab
::
server
::
instance
()
->
setChanged
(
false
,
"Gmsh"
);
}
}
...
...
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