TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
ScatterMED.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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
17#include <ScatterMED.h>
18#include <LireMED.h>
19#include <Domaine.h>
20#include <SFichier.h>
21
22Implemente_instanciable(ScatterMED,"ScatterMED",Scatter);
23// XD scattermed scatter scattermed NO_BRACE This keyword will read the partition of the domain_name domain into a the
24// XD_CONT MED format files file.med created by Medsplitter.
25
26/*! @brief Simple appel a: Interprete::printOn(Sortie&)
27 *
28 * @param (Sortie& os) un flot de sortie
29 * @return (Sortie&) le flot de sortie modifie
30 */
32{
33 return Scatter::printOn(os);
34}
35
37{
38 return Scatter::readOn(is);
39}
40
41
42/*! @brief Lit le domaine dans le fichier de nom "nomentree", de type LecFicDistribueBin ou LecFicDistribue
43 *
44 * (selon fichier_domaine_format_binaire_)
45 * Le format historique n'est plus supporte.
46 * Format attendu : Domaine::ReadOn
47 * le Domaine est renomme comme le domaine (pour lance_test_seq_par)
48 *
49 */
51{
52 Nom fichiermed(nomentree);
53 fichiermed.prefix(".med");
54 Nom n(me()+1);
55 fichiermed+=n;
56 fichiermed+=".med";
57 Domaine& dom = domaine();
58 Nom nom_lu(dom.le_nom());
59 nom_lu+="_";
60 nom_lu+=n;
61 LireMED lire_med(fichiermed, nom_lu);
62 lire_med.associer_domaine(dom);
63 lire_med.lire_geom(true);
64
65 // Renseigne dans quel fichier le domaine a ete lu
66 dom.set_fichier_lu(nomentree);
67
68 // On renomme le domaine (important pour le format lml:
69 // nom de la topologie utilise par lance_test_seq_par)
70 const Nom& nom_dom = dom.le_nom();
71 dom.nommer(nom_dom);
72
73 if (0)
74 {
75 Nom org=("debug.Zones");
76 org=org.nom_me(me());
77 SFichier file_out(org);
78 file_out << dom << finl<<"0 "<<finl;
79 }
80 barrier();
81}
82
void nommer(const Nom &nom) override
Donne un nom a l'Objet_U Methode virtuelle a surcharger.
const Nom & le_nom() const override
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
void set_fichier_lu(Nom &nom)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
void lire_geom(bool subDom=true)
Definition LireMED.cpp:925
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Nom nom_me(int, const char *prefix=0, int without_padding=0) const
Insere _prefix000n (n=me() ou nproc()) dans un nom de fichier (par ex:toto.
Definition Nom.cpp:387
Nom & prefix(const char *const)
Definition Nom.cpp:329
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static void barrier()
Synchronise tous les processeurs du groupe courant (attend que tous les processeurs soient arrives a ...
Definition Process.cpp:136
static int me()
renvoie mon rang dans le groupe de communication courant.
Definition Process.cpp:125
Cette classe est a la classe C++ ofstream ce que la classe Sortie est a la classe C++ ostream Elle re...
Definition SFichier.h:27
void lire_domaine(Nom &) override
Lit le domaine dans le fichier de nom "nomentree", de type LecFicDistribueBin ou LecFicDistribue.
Domaine & domaine()
Renvoi le domaine associe.
Definition Scatter.cpp:73
Classe de base des flux de sortie.
Definition Sortie.h:52