Arcane  v3.16.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ArcaneMeshConverter.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* ArcaneMeshConverter.cc (C) 2000-2020 */
9/* */
10/* Service de partitionnement externe du maillage. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/BasicService.h"
17#include "arcane/IMeshUtilities.h"
18#include "arcane/IDirectExecution.h"
19
20#include "arcane/ServiceBuilder.h"
21
22#include "arcane/std/ArcaneMeshConverter_axl.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
36class ArcaneMeshConverter
38{
39 public:
40
41 public:
42
43 explicit ArcaneMeshConverter(const ServiceBuildInfo& cb);
44
45 public:
46
47 void build() override {}
48 void execute() override;
49 void setParallelMng(IParallelMng*) override {}
50 bool isActive() const override { return true; }
51
52 private:
53};
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
57
58ArcaneMeshConverter::
59ArcaneMeshConverter(const ServiceBuildInfo& sb)
60: ArcaneArcaneMeshConverterObject(sb)
61{
62}
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
68execute()
69{
70 String file_name = options()->fileName();
71 if (file_name.empty())
72 ARCANE_FATAL("Invalid null option file-name");
73 bool r = mesh()->utilities()->writeToFile(file_name,options()->writerServiceName());
74 if (r)
75 ARCANE_FATAL("Error during mesh conversion");
76}
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81ARCANE_REGISTER_SERVICE_ARCANEMESHCONVERTER(ArcaneMeshConverter,ArcaneMeshConverter);
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86} // End namespace Arcane
87
88/*---------------------------------------------------------------------------*/
89/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
ArcaneArcaneMeshConverterObject(const Arcane::ServiceBuildInfo &sbi)
Constructeur.
CaseOptionsArcaneMeshConverter * options() const
Options du jeu de données du service.
Service de conversion de format du maillage.
void build() override
Construction de niveau build du service.
void setParallelMng(IParallelMng *) override
Positionne le gestionnaire de parallèlisme associé. Cette méthode doit être appelée avant execute()
void execute() override
Exécute l'opération du service.
bool isActive() const override
Vrai si le service est actif.
Interface du gestionnaire de parallélisme pour un sous-domaine.
Structure contenant les informations pour créer un service.
Chaîne de caractères unicode.
bool empty() const
Vrai si la chaîne est vide (nulle ou "")
Definition String.cc:315
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-