TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
SFichier.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 SFichier_included
17#define SFichier_included
18
19#include <Sortie_Fichier_base.h>
20
21/*! @brief SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
22 *
23 * It redefines the write operators virtually for writing to a file.
24 *
25 * @sa EFichier
26 */
27
29{
30 Declare_instanciable(SFichier);
31public:
32 inline SFichier(const char* name, IOS_OPEN_MODE mode=ios::out):Sortie_Fichier_base(name,mode)
33 {
34 if (Process::me()>=1)
35 {
36 Cerr << "Error! You can't use SFichier to open the file " << name << " on several processes! Only on the master process." << finl;
38 }
39 };
40
41 SFichier(const SFichier& ) = default;
42 SFichier& operator=(const SFichier& f) = default;
43};
44
45#endif /* SFichier_included */
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
Definition Process.cpp:122
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
SFichier & operator=(const SFichier &f)=default
SFichier(const char *name, IOS_OPEN_MODE mode=ios::out)
Definition SFichier.h:32
SFichier(const SFichier &)=default