TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
mon_main.h
1/****************************************************************************
2* Copyright (c) 2026, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef mon_main_included
17#define mon_main_included
18
19
20#include <Process.h>
21#include <Interprete_bloc.h>
22#include <Comm_Group.h>
23#include <list>
24
25/*! @brief Class created and run by main() and during a TRUST execution through Python.
26 *
27 * Usage:
28 * - create a mon_main instance
29 * - initialise the parallel layer
30 * - call dowork(nom_du_cas) (read and interpret the dataset)
31 * At this point Python objects can be manipulated
32 * (see Interprete_bloc::objet_global(nom))
33 * - destroy the mon_main instance
34 * The main interpreter keeps its objects until the mon_main instance is destroyed.
35 *
36 */
38{
39public:
40 mon_main(int verbose_level=9, bool journal_master=false, Nom log_directory = "", bool apply_verification=true, bool disable_stop=false);
41 ~mon_main();
42
43 void init_parallel(const int argc, char **argv, bool with_mpi, bool check_enabled=false, bool with_petsc=true);
44 void finalize();
45 void dowork(const Nom& nom_du_cas);
46
47private:
48 int verbose_level_;
49 bool journal_master_;
50
51 Nom log_directory_;
52 bool trio_began_mpi_;
53 bool disable_stop_;
54 OWN_PTR(Comm_Group) groupe_trio_;
55 OWN_PTR(Comm_Group) node_group_;
56 OWN_PTR(Comm_Group) node_master_;
57 Interprete_bloc interprete_principal_;
58};
59extern bool error_handlers;
60
61#endif
: This class describes a group of processors on which
Definition Comm_Group.h:37
Interprets a block of instructions in the data set.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
void finalize()
Definition mon_main.cpp:280
void dowork(const Nom &nom_du_cas)
Definition mon_main.cpp:343
mon_main(int verbose_level=9, bool journal_master=false, Nom log_directory="", bool apply_verification=true, bool disable_stop=false)
Definition mon_main.cpp:70
void init_parallel(const int argc, char **argv, bool with_mpi, bool check_enabled=false, bool with_petsc=true)
Definition mon_main.cpp:198