1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
// -------------------------------------------------------------------
// MAdLib - Copyright (C) 2008-2009 Universite catholique de Louvain
//
// See the Copyright.txt and License.txt files for license information.
// You should have received a copy of these files along with MAdLib.
// If not, see <http://www.madlib.be/license/>
//
// Please report all bugs and problems to <contrib@madlib.be>
//
// Authors: Gaetan Compere, Jean-Francois Remacle
// -------------------------------------------------------------------
#ifdef _HAVE_GMSH_
#include "gmsh/Gmsh.h"
#endif
#ifdef PARALLEL
#include "mpi.h"
#include "autopack.h"
#endif
#include "MAdMessage.h"
#include "MAdResourceManager.h"
#include <string>
using std::string;
using namespace MAd;
void MAdLibInitialize(int * argc, char** argv[])
{
#ifdef PARALLEL
MPI_Init(argc,argv);
AP_init(argc,argv);
#endif
#ifdef _HAVE_GMSH_
char * tmp[1];
tmp[0] = (char*)" ";
GmshInitialize(1,tmp);
unsigned int i = 1;
int j = 0;
GmshSetOption("General","Terminal",i,j);
#endif
MAdMsgSgl::instance().initialize();
MAdResourceManagerSgl::instance().initialize();
}
void MAdLibFinalize()
{
MAdResourceManagerSgl::instance().finalize();
MAdMsgSgl::instance().finalize();
#ifdef _HAVE_GMSH_
GmshFinalize();
#endif
#ifdef PARALLEL
MPI_Barrier(MPI_COMM_WORLD);
AP_finalize();
MPI_Finalize();
#endif
}
|