diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 27853d4e7581cb943d297fd93c9fb8e21c085355..e54c28196eb9c93fece226d3cdeb35ea1c111dc8 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -115,15 +115,15 @@ StringXString MeshOptions_String[] = { StringXString SolverOptions_String[] = { { F|S, "Executable0" , opt_solver_executable0 , "", - "System command to launch solver 0 (should not contain the `&' character)" }, + "System command to launch solver 0" }, { F|S, "Executable1" , opt_solver_executable1 , "" , - "System command to launch solver 1 (should not contain the `&' character)" }, + "System command to launch solver 1" }, { F|S, "Executable2" , opt_solver_executable2 , "" , - "System command to launch solver 2 (should not contain the `&' character)" }, + "System command to launch solver 2" }, { F|S, "Executable3" , opt_solver_executable3 , "" , - "System command to launch solver 3 (should not contain the `&' character)" }, + "System command to launch solver 3" }, { F|S, "Executable4" , opt_solver_executable4 , "" , - "System command to launch solver 4 (should not contain the `&' character)" }, + "System command to launch solver 4" }, { F|S, "Name0" , opt_solver_name0 , "GetDP" , "Name of solver 0" }, diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 3efc1085c1ad30986e16bdb7a2fa73a44aaf313a..370b677ad3ec4e3bfee42fd78c39f2d0f4109f65 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -447,12 +447,12 @@ for the unstructured part.}. @section Solver: external solver interface External solvers can be interfaced with Gmsh through Unix or TCP/IP -sockets, which permits to launch external computations and to collect -and process the results directly from within Gmsh's post-processing -module. The default solver interfaced with Gmsh is GetDP -(@uref{http://geuz.org/getdp/}). Examples on how to interface solvers -written in C, C++, Perl and Python are available in the source -distribution (in the @file{utils/solvers/} directory). +sockets, which permits to modify solver parameters, launch external +computations and process the results directly from within Gmsh's +post-processing module. The default solver interfaced with Gmsh is GetDP +(@uref{http://geuz.org/getdp/}). Examples on how to interface other +solvers are available in the source distribution (in the +@file{utils/solvers/} directory). @c ------------------------------------------------------------------------- @c Post-processing: scalar, vector and tensor field visualization @@ -507,8 +507,8 @@ flexible mesh size fields (@pxref{Mesh commands}); create simple extruded geometries and meshes (see @ref{Geometry commands}, and @ref{Mesh commands}); @item -interact with external solvers. Gmsh provides C, C++, Perl and Python -interfaces, and others can be easily added (@pxref{Solver module}); +interact with external solvers through a simple client-server +architecture (@pxref{Solver module}); @item visualize and export computational results in a great variety of ways. Gmsh can display scalar, vector and tensor datasets, perform @@ -3034,26 +3034,17 @@ as well as the way meshes are displayed in the GUI, is given in @cindex Solver, module @cindex Module, Solver -Five external solvers can be interfaced simultaneously with Gmsh. - -If you just want to start a solver from the solver module, with no -further interactions between the solver and Gmsh, just edit the options -relative to one of the five available solvers (e.g., -@code{Solver.Name0}, @code{Solver.Executable0}, @dots{}; see @ref{Solver -options list}), and set the corresponding ``client-server'' option to -zero (e.g., @code{Solver.ClientServer0 = 0}). This doesn't require any -modification to be made to the solver. - -If you want the solver to interact with Gmsh (for error messages, option -definitions, post-processing, etc.), you need to include -@file{GmshSocket.h} in your code and add the appropriate function calls -inside your program. You can then proceed as in the previous case, but -this time you should set the client-server option to 1 (e.g., -@code{Solver.ClientServer0 = 1}), so that Gmsh and the solver can -communicate through a Unix socket. See @ref{Solver example}, for an -example of how to interface a C++ solver. Bindings for solvers written -in other languages (C, Perl and Python) are available in the source -distribution. +External solvers can be interfaced with Gmsh using a simple +client-server model. + +To add a new solver in the solver module, you need to specify its name +(@code{Solver.Name0}, @code{Solver.Name1}, etc.) and the path to the +executable (@code{Solver.Executable0}, @code{Solver.Executable1}, etc.); +see @ref{Solver options list}). + +The client-server API for the solver interface is defined in the +@file{onelab.h} header: see @ref{Solver example}, for an example of how +to interface a C++ solver. @menu * Solver options:: @@ -3084,8 +3075,7 @@ The list of all the solver options is given in @ref{Solver options list}. Here is a small example of how to interface a C++ solver with Gmsh. The following listing reproduces the @file{utils/solvers/c++/solver.cpp} file -from the Gmsh source distribution (C, Perl and Python examples are also -available). +from the Gmsh source distribution. @sp 1 diff --git a/doc/texinfo/opt_solver.texi b/doc/texinfo/opt_solver.texi index cca89c698bf814fb1c562504ec0bee528b3e4cab..6598513e69d212997bfc6423a3507aa28a749b59 100644 --- a/doc/texinfo/opt_solver.texi +++ b/doc/texinfo/opt_solver.texi @@ -5,27 +5,27 @@ @ftable @code @item Solver.Executable0 -System command to launch solver 0 (should not contain the `&' character)@* +System command to launch solver 0@* Default value: @code{""}@* Saved in: @code{General.SessionFileName} @item Solver.Executable1 -System command to launch solver 1 (should not contain the `&' character)@* +System command to launch solver 1@* Default value: @code{""}@* Saved in: @code{General.SessionFileName} @item Solver.Executable2 -System command to launch solver 2 (should not contain the `&' character)@* +System command to launch solver 2@* Default value: @code{""}@* Saved in: @code{General.SessionFileName} @item Solver.Executable3 -System command to launch solver 3 (should not contain the `&' character)@* +System command to launch solver 3@* Default value: @code{""}@* Saved in: @code{General.SessionFileName} @item Solver.Executable4 -System command to launch solver 4 (should not contain the `&' character)@* +System command to launch solver 4@* Default value: @code{""}@* Saved in: @code{General.SessionFileName} diff --git a/utils/solvers/c/GmshClient.c b/utils/solvers/legacy/c/GmshClient.c similarity index 100% rename from utils/solvers/c/GmshClient.c rename to utils/solvers/legacy/c/GmshClient.c diff --git a/utils/solvers/c/GmshClient.h b/utils/solvers/legacy/c/GmshClient.h similarity index 100% rename from utils/solvers/c/GmshClient.h rename to utils/solvers/legacy/c/GmshClient.h diff --git a/utils/solvers/c/solver.c b/utils/solvers/legacy/c/solver.c similarity index 100% rename from utils/solvers/c/solver.c rename to utils/solvers/legacy/c/solver.c diff --git a/utils/solvers/c/solver.opt b/utils/solvers/legacy/c/solver.opt similarity index 100% rename from utils/solvers/c/solver.opt rename to utils/solvers/legacy/c/solver.opt diff --git a/utils/solvers/perl/GMSH_CLIENT.pm b/utils/solvers/legacy/perl/GMSH_CLIENT.pm similarity index 100% rename from utils/solvers/perl/GMSH_CLIENT.pm rename to utils/solvers/legacy/perl/GMSH_CLIENT.pm diff --git a/utils/solvers/perl/solver.opt b/utils/solvers/legacy/perl/solver.opt similarity index 100% rename from utils/solvers/perl/solver.opt rename to utils/solvers/legacy/perl/solver.opt diff --git a/utils/solvers/perl/solver.pl b/utils/solvers/legacy/perl/solver.pl similarity index 100% rename from utils/solvers/perl/solver.pl rename to utils/solvers/legacy/perl/solver.pl diff --git a/utils/solvers/python/Gmsh.py b/utils/solvers/legacy/python/Gmsh.py similarity index 100% rename from utils/solvers/python/Gmsh.py rename to utils/solvers/legacy/python/Gmsh.py diff --git a/utils/solvers/python/postcsv.opt b/utils/solvers/legacy/python/postcsv.opt similarity index 100% rename from utils/solvers/python/postcsv.opt rename to utils/solvers/legacy/python/postcsv.opt diff --git a/utils/solvers/python/postcsv.py b/utils/solvers/legacy/python/postcsv.py similarity index 100% rename from utils/solvers/python/postcsv.py rename to utils/solvers/legacy/python/postcsv.py diff --git a/utils/solvers/python/testcsv.csv b/utils/solvers/legacy/python/testcsv.csv similarity index 100% rename from utils/solvers/python/testcsv.csv rename to utils/solvers/legacy/python/testcsv.csv diff --git a/utils/solvers/python/testcsv.geo b/utils/solvers/legacy/python/testcsv.geo similarity index 100% rename from utils/solvers/python/testcsv.geo rename to utils/solvers/legacy/python/testcsv.geo diff --git a/utils/solvers/python/testcsv.msh b/utils/solvers/legacy/python/testcsv.msh similarity index 100% rename from utils/solvers/python/testcsv.msh rename to utils/solvers/legacy/python/testcsv.msh