Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MeshEnvironmentBuildInfo.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* MeshEnvironmentBuildInfo.cc (C) 2000-2023 */
9/* */
10/* Informations pour la création d'un milieu. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/TraceInfo.h"
15#include "arcane/utils/FatalErrorException.h"
16
17#include "arcane/materials/MeshEnvironmentBuildInfo.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane::Materials
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28MeshEnvironmentBuildInfo::
29MeshEnvironmentBuildInfo(const String& name)
30: m_name(name)
31{
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37MeshEnvironmentBuildInfo::
38~MeshEnvironmentBuildInfo()
39{
40}
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45void MeshEnvironmentBuildInfo::
46addMaterial(const String& name)
47{
48 _checkValid(name);
49 m_materials.add(MatInfo(name));
50}
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
55void MeshEnvironmentBuildInfo::
56_checkValid(const String& name)
57{
58 for( Integer i=0, nb_mat=m_materials.size(); i<nb_mat; ++i ){
59 const String& mat_name = m_materials[i].m_name;
60 if (mat_name==name)
61 ARCANE_FATAL("environment named '{0}' already has a material named '{1}'",
62 m_name,name);
63 }
64}
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69}
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Chaîne de caractères unicode.
Active toujours les traces dans les parties Arcane concernant les matériaux.