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
9bf2a5c3
Commit
9bf2a5c3
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
#if not defined -> #if !defined
parent
0b3f09bc
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
Common/Gmsh.cpp
+4
-4
4 additions, 4 deletions
Common/Gmsh.cpp
Common/GmshMessage.cpp
+20
-20
20 additions, 20 deletions
Common/GmshMessage.cpp
Common/GmshMessage.h
+4
-3
4 additions, 3 deletions
Common/GmshMessage.h
with
28 additions
and
27 deletions
Common/Gmsh.cpp
+
4
−
4
View file @
9bf2a5c3
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
//test new algo generation points
//test new algo generation points
#include
"BasisFactory.h"
#include
"BasisFactory.h"
#if defined(HAVE_ONELAB) &&
not
defined(HAVE_ONELAB2)
#if defined(HAVE_ONELAB) &&
!
defined(HAVE_ONELAB2)
#include
"gmshLocalNetworkClient.h"
#include
"gmshLocalNetworkClient.h"
#endif
#endif
...
@@ -198,7 +198,7 @@ int GmshBatch()
...
@@ -198,7 +198,7 @@ int GmshBatch()
Msg
::
GetCommSize
(),
Msg
::
GetCommSize
()
>
1
?
"s"
:
""
,
Msg
::
GetCommSize
(),
Msg
::
GetCommSize
()
>
1
?
"s"
:
""
,
Msg
::
GetMaxThreads
(),
Msg
::
GetMaxThreads
()
>
1
?
"s"
:
""
);
Msg
::
GetMaxThreads
(),
Msg
::
GetMaxThreads
()
>
1
?
"s"
:
""
);
Msg
::
Info
(
"Started on %s"
,
Msg
::
GetLaunchDate
().
c_str
());
Msg
::
Info
(
"Started on %s"
,
Msg
::
GetLaunchDate
().
c_str
());
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
if
(
CTX
::
instance
()
->
onelab
.
listen_port
>
0
)
{
if
(
CTX
::
instance
()
->
onelab
.
listen_port
>
0
)
{
OnelabServer
::
instance
(
0
,
CTX
::
instance
()
->
onelab
.
listen_port
);
OnelabServer
::
instance
(
0
,
CTX
::
instance
()
->
onelab
.
listen_port
);
OnelabServer
::
instance
()
->
Run
();
OnelabServer
::
instance
()
->
Run
();
...
@@ -234,7 +234,7 @@ int GmshBatch()
...
@@ -234,7 +234,7 @@ int GmshBatch()
#endif
#endif
if
(
CTX
::
instance
()
->
batch
==
-
3
){
if
(
CTX
::
instance
()
->
batch
==
-
3
){
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
GmshRemote
();
GmshRemote
();
#endif
#endif
}
}
...
@@ -350,7 +350,7 @@ int GmshFLTK(int argc, char **argv)
...
@@ -350,7 +350,7 @@ int GmshFLTK(int argc, char **argv)
else
else
Msg
::
Error
(
"Invalid background mesh (no view)"
);
Msg
::
Error
(
"Invalid background mesh (no view)"
);
}
}
#if
n
def
HAVE_ONELAB2
#if
!
def
ined(
HAVE_ONELAB2
)
// listen to external solvers
// listen to external solvers
if
(
CTX
::
instance
()
->
solver
.
listen
){
if
(
CTX
::
instance
()
->
solver
.
listen
){
gmshLocalNetworkClient
*
c
=
new
gmshLocalNetworkClient
(
"Listen"
,
""
);
gmshLocalNetworkClient
*
c
=
new
gmshLocalNetworkClient
(
"Listen"
,
""
);
...
...
This diff is collapsed.
Click to expand it.
Common/GmshMessage.cpp
+
20
−
20
View file @
9bf2a5c3
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#if defined(HAVE_ONELAB)
#if defined(HAVE_ONELAB)
#include
"onelab.h"
#include
"onelab.h"
#endif
#endif
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
#include
"gmshLocalNetworkClient.h"
#include
"gmshLocalNetworkClient.h"
#endif
#endif
...
@@ -65,7 +65,7 @@ std::string Msg::_firstError;
...
@@ -65,7 +65,7 @@ std::string Msg::_firstError;
GmshMessage
*
Msg
::
_callback
=
0
;
GmshMessage
*
Msg
::
_callback
=
0
;
std
::
string
Msg
::
_commandLine
;
std
::
string
Msg
::
_commandLine
;
std
::
string
Msg
::
_launchDate
;
std
::
string
Msg
::
_launchDate
;
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
GmshClient
*
Msg
::
_client
=
0
;
GmshClient
*
Msg
::
_client
=
0
;
#endif
#endif
std
::
string
Msg
::
_execName
;
std
::
string
Msg
::
_execName
;
...
@@ -264,7 +264,7 @@ void Msg::Fatal(const char *fmt, ...)
...
@@ -264,7 +264,7 @@ void Msg::Fatal(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
)
(
*
_callback
)(
"Fatal"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Fatal"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Error
(
str
);
if
(
_client
)
_client
->
Error
(
str
);
#endif
#endif
...
@@ -312,7 +312,7 @@ void Msg::Error(const char *fmt, ...)
...
@@ -312,7 +312,7 @@ void Msg::Error(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
)
(
*
_callback
)(
"Error"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Error"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Error
(
str
);
if
(
_client
)
_client
->
Error
(
str
);
#endif
#endif
...
@@ -352,7 +352,7 @@ void Msg::Warning(const char *fmt, ...)
...
@@ -352,7 +352,7 @@ void Msg::Warning(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
)
(
*
_callback
)(
"Warning"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Warning"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Warning
(
str
);
if
(
_client
)
_client
->
Warning
(
str
);
#endif
#endif
#if defined(HAVE_FLTK)
#if defined(HAVE_FLTK)
...
@@ -389,7 +389,7 @@ void Msg::Info(const char *fmt, ...)
...
@@ -389,7 +389,7 @@ void Msg::Info(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
)
(
*
_callback
)(
"Info"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Info"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Info
(
str
);
if
(
_client
)
_client
->
Info
(
str
);
#endif
#endif
...
@@ -430,7 +430,7 @@ void Msg::Direct(const char *fmt, ...)
...
@@ -430,7 +430,7 @@ void Msg::Direct(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
)
(
*
_callback
)(
"Direct"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Direct"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Info
(
str
);
if
(
_client
)
_client
->
Info
(
str
);
#endif
#endif
...
@@ -471,7 +471,7 @@ void Msg::StatusBar(bool log, const char *fmt, ...)
...
@@ -471,7 +471,7 @@ void Msg::StatusBar(bool log, const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
&&
log
)
(
*
_callback
)(
"Info"
,
str
);
if
(
_callback
&&
log
)
(
*
_callback
)(
"Info"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
&&
log
)
_client
->
Info
(
str
);
if
(
_client
&&
log
)
_client
->
Info
(
str
);
#endif
#endif
...
@@ -526,7 +526,7 @@ void Msg::Debug(const char *fmt, ...)
...
@@ -526,7 +526,7 @@ void Msg::Debug(const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
if
(
_callback
)
(
*
_callback
)(
"Debug"
,
str
);
if
(
_callback
)
(
*
_callback
)(
"Debug"
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Info
(
str
);
if
(
_client
)
_client
->
Info
(
str
);
#endif
#endif
...
@@ -561,7 +561,7 @@ void Msg::ProgressMeter(int n, int N, bool log, const char *fmt, ...)
...
@@ -561,7 +561,7 @@ void Msg::ProgressMeter(int n, int N, bool log, const char *fmt, ...)
va_end
(
args
);
va_end
(
args
);
sprintf
(
str2
,
"%3d%% : %s"
,
_progressMeterCurrent
,
str
);
sprintf
(
str2
,
"%3d%% : %s"
,
_progressMeterCurrent
,
str
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
if
(
_client
)
_client
->
Progress
(
str2
);
if
(
_client
)
_client
->
Progress
(
str2
);
#endif
#endif
...
@@ -747,7 +747,7 @@ void Msg::SetOnelabNumber(std::string name, double val, bool visible)
...
@@ -747,7 +747,7 @@ void Msg::SetOnelabNumber(std::string name, double val, bool visible)
#if defined(HAVE_ONELAB)
#if defined(HAVE_ONELAB)
if
(
_onelabClient
){
if
(
_onelabClient
){
std
::
vector
<
onelab
::
number
>
numbers
;
std
::
vector
<
onelab
::
number
>
numbers
;
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
get
(
numbers
,
name
,
"Gmsh"
);
_onelabClient
->
get
(
numbers
,
name
,
"Gmsh"
);
#else
#else
_onelabClient
->
get
(
numbers
,
name
);
_onelabClient
->
get
(
numbers
,
name
);
...
@@ -758,7 +758,7 @@ void Msg::SetOnelabNumber(std::string name, double val, bool visible)
...
@@ -758,7 +758,7 @@ void Msg::SetOnelabNumber(std::string name, double val, bool visible)
}
}
numbers
[
0
].
setValue
(
val
);
numbers
[
0
].
setValue
(
val
);
numbers
[
0
].
setVisible
(
visible
);
numbers
[
0
].
setVisible
(
visible
);
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
set
(
numbers
[
0
],
"Gmsh"
);
_onelabClient
->
set
(
numbers
[
0
],
"Gmsh"
);
#else
#else
_onelabClient
->
set
(
numbers
[
0
]);
_onelabClient
->
set
(
numbers
[
0
]);
...
@@ -772,7 +772,7 @@ void Msg::SetOnelabString(std::string name, std::string val, bool visible)
...
@@ -772,7 +772,7 @@ void Msg::SetOnelabString(std::string name, std::string val, bool visible)
#if defined(HAVE_ONELAB)
#if defined(HAVE_ONELAB)
if
(
_onelabClient
){
if
(
_onelabClient
){
std
::
vector
<
onelab
::
string
>
strings
;
std
::
vector
<
onelab
::
string
>
strings
;
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
get
(
strings
,
name
,
"Gmsh"
);
_onelabClient
->
get
(
strings
,
name
,
"Gmsh"
);
#else
#else
_onelabClient
->
get
(
strings
,
name
);
_onelabClient
->
get
(
strings
,
name
);
...
@@ -783,7 +783,7 @@ void Msg::SetOnelabString(std::string name, std::string val, bool visible)
...
@@ -783,7 +783,7 @@ void Msg::SetOnelabString(std::string name, std::string val, bool visible)
}
}
strings
[
0
].
setValue
(
val
);
strings
[
0
].
setValue
(
val
);
strings
[
0
].
setVisible
(
visible
);
strings
[
0
].
setVisible
(
visible
);
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
set
(
strings
[
0
],
"Gmsh"
);
_onelabClient
->
set
(
strings
[
0
],
"Gmsh"
);
#else
#else
_onelabClient
->
set
(
strings
[
0
]);
_onelabClient
->
set
(
strings
[
0
]);
...
@@ -822,7 +822,7 @@ public:
...
@@ -822,7 +822,7 @@ public:
void
Msg
::
InitializeOnelab
(
const
std
::
string
&
name
,
const
std
::
string
&
sockname
)
void
Msg
::
InitializeOnelab
(
const
std
::
string
&
name
,
const
std
::
string
&
sockname
)
{
{
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
if
(
sockname
.
empty
()){
if
(
sockname
.
empty
()){
if
(
name
!=
"Gmsh"
){
// load db from file:
if
(
name
!=
"Gmsh"
){
// load db from file:
FILE
*
fp
=
Fopen
(
name
.
c_str
(),
"rb"
);
FILE
*
fp
=
Fopen
(
name
.
c_str
(),
"rb"
);
...
@@ -996,7 +996,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
...
@@ -996,7 +996,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
}
}
std
::
vector
<
onelab
::
number
>
ps
;
std
::
vector
<
onelab
::
number
>
ps
;
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
get
(
ps
,
name
,
"Gmsh"
);
_onelabClient
->
get
(
ps
,
name
,
"Gmsh"
);
#else
#else
_onelabClient
->
get
(
ps
,
name
);
_onelabClient
->
get
(
ps
,
name
);
...
@@ -1080,7 +1080,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
...
@@ -1080,7 +1080,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
if
(
noClosed
&&
fopt
.
count
(
"Closed"
))
if
(
noClosed
&&
fopt
.
count
(
"Closed"
))
ps
[
0
].
setAttribute
(
"Closed"
,
fopt
[
"Closed"
][
0
]
?
"1"
:
"0"
);
ps
[
0
].
setAttribute
(
"Closed"
,
fopt
[
"Closed"
][
0
]
?
"1"
:
"0"
);
_setStandardOptions
(
&
ps
[
0
],
fopt
,
copt
);
_setStandardOptions
(
&
ps
[
0
],
fopt
,
copt
);
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
set
(
ps
[
0
],
"Gmsh"
);
_onelabClient
->
set
(
ps
[
0
],
"Gmsh"
);
#else
#else
_onelabClient
->
set
(
ps
[
0
]);
_onelabClient
->
set
(
ps
[
0
]);
...
@@ -1138,7 +1138,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
...
@@ -1138,7 +1138,7 @@ void Msg::ExchangeOnelabParameter(const std::string &key,
if
(
noMultipleSelection
&&
copt
.
count
(
"MultipleSelection"
))
if
(
noMultipleSelection
&&
copt
.
count
(
"MultipleSelection"
))
ps
[
0
].
setAttribute
(
"MultipleSelection"
,
copt
[
"MultipleSelection"
][
0
]);
ps
[
0
].
setAttribute
(
"MultipleSelection"
,
copt
[
"MultipleSelection"
][
0
]);
_setStandardOptions
(
&
ps
[
0
],
fopt
,
copt
);
_setStandardOptions
(
&
ps
[
0
],
fopt
,
copt
);
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
_onelabClient
->
set
(
ps
[
0
],
"Gmsh"
);
_onelabClient
->
set
(
ps
[
0
],
"Gmsh"
);
#else
#else
_onelabClient
->
set
(
ps
[
0
]);
_onelabClient
->
set
(
ps
[
0
]);
...
@@ -1186,7 +1186,7 @@ void Msg::ImportPhysicalsAsOnelabRegions()
...
@@ -1186,7 +1186,7 @@ void Msg::ImportPhysicalsAsOnelabRegions()
void
Msg
::
RunOnelabClient
(
const
std
::
string
&
name
,
const
std
::
string
&
command
)
void
Msg
::
RunOnelabClient
(
const
std
::
string
&
name
,
const
std
::
string
&
command
)
{
{
#if defined(HAVE_ONELAB) &&
not
defined(HAVE_ONELAB2)
#if defined(HAVE_ONELAB) &&
!
defined(HAVE_ONELAB2)
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
findClient
(
name
);
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
findClient
(
name
);
onelab
::
client
*
client
=
0
;
onelab
::
client
*
client
=
0
;
if
(
it
!=
onelab
::
server
::
instance
()
->
lastClient
()){
if
(
it
!=
onelab
::
server
::
instance
()
->
lastClient
()){
...
@@ -1220,7 +1220,7 @@ void Msg::RunOnelabClient(const std::string &name, const std::string &command)
...
@@ -1220,7 +1220,7 @@ void Msg::RunOnelabClient(const std::string &name, const std::string &command)
void
Msg
::
FinalizeOnelab
()
void
Msg
::
FinalizeOnelab
()
{
{
#ifdef
HAVE_ONELAB2
#if
def
ined(
HAVE_ONELAB2
)
if
(
_onelabClient
)
{
if
(
_onelabClient
)
{
_onelabClient
->
finalize
();
_onelabClient
->
finalize
();
delete
_onelabClient
;
delete
_onelabClient
;
...
...
This diff is collapsed.
Click to expand it.
Common/GmshMessage.h
+
4
−
3
View file @
9bf2a5c3
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
class
GmshClient
;
class
GmshClient
;
namespace
onelab
{
class
client
;
}
namespace
onelab
{
class
client
;
}
#ifdef HAVE_ONELAB2
#if defined(HAVE_ONELAB2)
class
OnelabDatabase
;
class
OnelabDatabase
;
#endif
#endif
...
@@ -46,7 +47,7 @@ class Msg {
...
@@ -46,7 +47,7 @@ class Msg {
static
GmshMessage
*
_callback
;
static
GmshMessage
*
_callback
;
// command-line and startup time
// command-line and startup time
static
std
::
string
_commandLine
,
_launchDate
;
static
std
::
string
_commandLine
,
_launchDate
;
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
// communication with Gmsh when run remotely
// communication with Gmsh when run remotely
static
GmshClient
*
_client
;
static
GmshClient
*
_client
;
#endif
#endif
...
@@ -108,7 +109,7 @@ class Msg {
...
@@ -108,7 +109,7 @@ class Msg {
static
void
SetExecutableName
(
const
std
::
string
&
name
)
{
_execName
.
assign
(
name
);
}
static
void
SetExecutableName
(
const
std
::
string
&
name
)
{
_execName
.
assign
(
name
);
}
static
std
::
string
GetExecutableName
()
{
return
_execName
;
}
static
std
::
string
GetExecutableName
()
{
return
_execName
;
}
static
void
LoadOnelabClient
(
const
std
::
string
&
name
,
const
std
::
string
&
sockName
);
static
void
LoadOnelabClient
(
const
std
::
string
&
name
,
const
std
::
string
&
sockName
);
#if
not
defined(HAVE_ONELAB2)
#if
!
defined(HAVE_ONELAB2)
static
GmshClient
*
GetGmshClient
(){
return
_client
;
}
static
GmshClient
*
GetGmshClient
(){
return
_client
;
}
#else
#else
static
int
GetGmshClient
(){
return
1
;
}
static
int
GetGmshClient
(){
return
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