Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ArcaneCaseMeshMasterService.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2024 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/* ArcaneCaseMeshMasterService.h (C) 2000-2024 */
9/* */
10/* Service Arcane gérant les maillages du jeu de données. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15#include "arcane/core/ICaseMeshMasterService.h"
16#include "arcane/core/IMainFactory.h"
17#include "arcane/core/ICaseMeshService.h"
18#include "arcane/core/MeshBuildInfo.h"
19#include "arcane/impl/ArcaneCaseMeshMasterService_axl.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
32{
33 public:
34
37 , m_sub_domain(sbi.subDomain())
38 {}
39
40 private:
41
42 void createMeshes() override
43 {
44 if (m_is_created)
45 ARCANE_FATAL("Meshes have already been created");
46
47 Integer nb_mesh = options()->mesh.size();
48 info() << "Creating meshes from 'ArcaneCaseMeshMasterService' nb_mesh=" << nb_mesh;
49 Integer index = 0;
50 for( ICaseMeshService* s : options()->mesh ){
51 String name = String("Mesh")+String::fromNumber(index);
52 s->createMesh(name);
53 ++index;
54 }
55 m_is_created = true;
56 }
57
58 void allocateMeshes() override
59 {
60 if (m_is_allocated)
61 ARCANE_FATAL("Meshes have already been allocated");
62 if (!m_is_created)
63 ARCANE_FATAL("You need to call createMeshes() before allocateMeshes()");
64
65 for( ICaseMeshService* s : options()->mesh )
66 s->allocateMeshItems();
67 m_is_allocated = true;
68 }
69
70 void partitionMeshes() override
71 {
72 if (!m_is_allocated)
73 ARCANE_FATAL("Meshes have do be allocated before partitioning. call allocateMeshes() before");
74 for( ICaseMeshService* s : options()->mesh )
75 s->partitionMesh();
76 }
77
79 {
80 if (!m_is_allocated)
81 ARCANE_FATAL("Meshes are not allocated. call allocateMeshes() before");
82 for (ICaseMeshService* s : options()->mesh)
83 s->applyAdditionalOperations();
84 }
85
86 ICaseOptions* _options() override
87 {
88 return options()->caseOptions();
89 }
90 private:
91 ISubDomain* m_sub_domain;
92 bool m_is_created = false;
93 bool m_is_allocated = false;
94 UniqueArray<IPrimaryMesh*> m_meshes;
95};
96
97/*---------------------------------------------------------------------------*/
98/*---------------------------------------------------------------------------*/
99
100ARCANE_REGISTER_SERVICE_ARCANECASEMESHMASTERSERVICE(ArcaneCaseMeshMasterService,
101 ArcaneCaseMeshMasterService);
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
106} // End namespace Arcane
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Ce fichier contient les différentes fabriques de services et macro pour enregistrer les services.
CaseOptionsArcaneCaseMeshMasterService * options() const
Options du jeu de données du service.
void partitionMeshes() override
Partitionne les maillages.
void allocateMeshes() override
Créé les maillages.
void applyAdditionalOperationsOnMeshes() override
Applique les éventuelles opérations additionnelles sur le maillage crée.
void createMeshes() override
Créé les maillages.
Interface du service gérant les maillages du jeu de données.
Interface d'une liste d'options du jeu de données.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Structure contenant les informations pour créer un service.
constexpr Integer size() const noexcept
Retourne la taille du tableau.
Chaîne de caractères unicode.
TraceMessage info() const
Flot pour un message d'information.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-