Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
GeometryServiceBaseT.h
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#include "arcane/geometry/impl/GeometryTemplatesT.h"
9#include "arcane/VariableBuildInfo.h"
10
11ARCANE_BEGIN_NAMESPACE
12NUMERICS_BEGIN_NAMESPACE
13
14template<typename GeometryT>
15void
16GeometryServiceBase::
17updateGroup(ItemGroup group, GeometryT & geometry)
18{
19 PropertyMap::iterator igroup = m_group_property_map.find(group.internal());
20 if (igroup == m_group_property_map.end())
21 throw FatalErrorException(A_FUNCINFO,"Undefined ItemGroup property");
22
23 ItemGroupGeometryProperty & properties = igroup->second;
24 if ((properties.defined & ~properties.computed & ~properties.delegated) == 0)
25 {
26 traceMng()->debug() << "Group " << group.name() << " properties already done";
27 return;
28 }
29
30 for(typename ItemGroupGeometryProperty::StorageInfos::iterator i = properties.storages.begin(); i != properties.storages.end(); ++i)
31 {
32 IGeometryProperty::eProperty property = i->first;
33 ItemGroupGeometryProperty::StorageInfo & storage = i->second;
34
35 if ((properties.computed & property) || (properties.delegated & property))
36 {
37 traceMng()->debug() << "Property " << IGeometryProperty::name(property) << " is delayed for group " << group.name();
38 continue; // skip that property
39 }
40 else
41 {
42 traceMng()->debug() << "Property " << IGeometryProperty::name(property) << " will be computed for group " << group.name();
43 }
44
45 if (IGeometryProperty::isScalar(property))
46 {
47 std::shared_ptr<RealVariable> & ivar = storage.realVar;
48 if (!ivar && (storage.storageType & IGeometryProperty::PVariable))
49 {
50 String varName = IGeometryProperty::name(property)+String("Of")+group.name()+m_suffix;
51 traceMng()->debug() << "Building Variable " << varName;
52 ivar.reset(new RealVariable(VariableBuildInfo(group.mesh(),
53 varName,
54 group.itemFamily()->name(),
56 group.itemKind()));
57 }
58
59 }
60 else
61 {
62 ARCANE_ASSERT((IGeometryProperty::isVectorial(property)),("Vectorial property expected"));
63 std::shared_ptr<Real3Variable> & ivar = storage.real3Var;
64 if (!ivar && (storage.storageType & IGeometryProperty::PVariable))
65 {
66 String varName = IGeometryProperty::name(property)+String("Of")+group.name()+m_suffix;
67 traceMng()->debug() << "Building Variable " << varName;
68 ivar.reset(new Real3Variable(VariableBuildInfo(group.mesh(),
69 varName,
70 group.itemFamily()->name(),
72 group.itemKind()));
73 }
74
75 }
76 }
77
78 if (properties.defined & ~properties.computed & ~properties.delegated) {
80 updater.setGroupProperty(&properties);
81 group.applyOperation(&updater);
82 }
83
84 /*** L'affectation générale est désormais faite dans GeometryTemplatesT ***/
85 for(typename ItemGroupGeometryProperty::StorageInfos::iterator i = properties.storages.begin(); i != properties.storages.end(); ++i)
86 {
87 IGeometryProperty::eProperty property = i->first;
88 if ((properties.computed & property) || (properties.delegated & property))
89 continue;
90 properties.computed |= property;
91 }
92}
93
94NUMERICS_END_NAMESPACE
95ARCANE_END_NAMESPACE
String m_suffix
suffix for internal variable names
virtual ITraceMng * traceMng()=0
Access to traceMng.
virtual String name() const =0
Nom de la famille.
@ PTemporary
Indique que la variable est temporaire.
Definition IVariable.h:126
@ PPrivate
Indique que la variable est privée.
Definition IVariable.h:114
Internal class implementation for TemisGeometryService and Euclidian3GeometryService.
Groupe d'entités de maillage.
Definition ItemGroup.h:49
ItemGroupImpl * internal() const
Retourne l'implémentation du groupe.
Definition ItemGroup.h:120
const String & name() const
Nom du groupe.
Definition ItemGroup.h:76
IItemFamily * itemFamily() const
Famille d'entité à laquelle appartient ce groupe (0 pour le group nul)
Definition ItemGroup.h:123
void applyOperation(IItemOperationByBasicType *operation) const
Applique l'opération operation sur les entités du groupe.
Definition ItemGroup.cc:530
eItemKind itemKind() const
Genre du groupe. Il s'agit du genre de ses éléments.
Definition ItemGroup.h:109
IMesh * mesh() const
Maillage auquel appartient ce groupe (0 pour le group nul)
Definition ItemGroup.h:126
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
virtual IGeometry * geometry()=0
Get underlying geometry.
Paramètres nécessaires à la construction d'une variable.
Exception lorsqu'une erreur fatale est survenue.
Chaîne de caractères unicode.
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flot pour un message de debug.