Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ArcaneMeshConverter.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 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/* External mesh partitioning service. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/core/BasicService.h"
17#include "arcane/core/IMeshUtilities.h"
18#include "arcane/core/IDirectExecution.h"
19
20#include "arcane/core/ServiceBuilder.h"
21
22#include "arcane/std/ArcaneMeshConverter_axl.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
36class ArcaneMeshConverter
38{
39 public:
40 public:
41
42 explicit ArcaneMeshConverter(const ServiceBuildInfo& cb);
43
44 public:
45
46 void build() override {}
47 void execute() override;
48 void setParallelMng(IParallelMng*) override {}
49 bool isActive() const override { return true; }
50};
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55ArcaneMeshConverter::
56ArcaneMeshConverter(const ServiceBuildInfo& sb)
57: ArcaneArcaneMeshConverterObject(sb)
58{
59}
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
65execute()
66{
67 String file_name = options()->fileName();
68 if (file_name.empty())
69 ARCANE_FATAL("Invalid null option file-name");
70 bool r = mesh()->utilities()->writeToFile(file_name, options()->writerServiceName());
71 if (r)
72 ARCANE_FATAL("Error during mesh conversion");
73}
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78ARCANE_REGISTER_SERVICE_ARCANEMESHCONVERTER(ArcaneMeshConverter, ArcaneMeshConverter);
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83} // End namespace Arcane
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
ArcaneArcaneMeshConverterObject(const Arcane::ServiceBuildInfo &sbi)
Constructeur.
CaseOptionsArcaneMeshConverter * options() const
Options du jeu de données du service.
Mesh format conversion service.
void build() override
Build-level construction of the service.
void setParallelMng(IParallelMng *) override
Positions the associated parallelism manager. This method must be called before execute().
void execute() override
Executes the service operation.
bool isActive() const override
True if the service is active.
Interface of the parallelism manager for a subdomain.
Structure containing the information to create a service.
bool empty() const
True if the string is empty (null or "").
Definition String.cc:317
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --