8#include "arcane/geometry/impl/GeometryTemplatesT.h"
9#include "arcane/core/VariableBuildInfo.h"
14namespace Arcane::Numerics
20template <
typename GeometryT>
21void GeometryServiceBase::
22updateGroup(
ItemGroup group, GeometryT& geometry)
24 PropertyMap::iterator igroup = m_group_property_map.find(group.
internal());
25 if (igroup == m_group_property_map.end())
26 throw FatalErrorException(A_FUNCINFO,
"Undefined ItemGroup property");
28 ItemGroupGeometryProperty& properties = igroup->second;
29 if ((properties.defined & ~properties.computed & ~properties.delegated) == 0) {
34 for (
typename ItemGroupGeometryProperty::StorageInfos::iterator i = properties.storages.begin(); i != properties.storages.end(); ++i) {
35 IGeometryProperty::eProperty
property = i->first;
36 ItemGroupGeometryProperty::StorageInfo& storage = i->second;
38 if ((properties.computed & property) || (properties.delegated & property)) {
39 traceMng()->
debug() <<
"Property " << IGeometryProperty::name(property) <<
" is delayed for group " << group.
name();
43 traceMng()->
debug() <<
"Property " << IGeometryProperty::name(property) <<
" will be computed for group " << group.
name();
46 if (IGeometryProperty::isScalar(property)) {
47 std::shared_ptr<RealVariable>& ivar = storage.realVar;
48 if (!ivar && (storage.storageType & IGeometryProperty::PVariable)) {
49 String varName = IGeometryProperty::name(property) + String(
"Of") + group.
name() +
m_suffix;
51 ivar.reset(
new RealVariable(VariableBuildInfo(group.
mesh(),
59 ARCANE_ASSERT((IGeometryProperty::isVectorial(property)), (
"Vectorial property expected"));
60 std::shared_ptr<Real3Variable>& ivar = storage.real3Var;
61 if (!ivar && (storage.storageType & IGeometryProperty::PVariable)) {
62 String varName = IGeometryProperty::name(property) + String(
"Of") + group.
name() +
m_suffix;
64 ivar.reset(
new Real3Variable(VariableBuildInfo(group.
mesh(),
73 if (properties.defined & ~properties.computed & ~properties.delegated) {
75 updater.setGroupProperty(&properties);
80 for (
typename ItemGroupGeometryProperty::StorageInfos::iterator i = properties.storages.begin(); i != properties.storages.end(); ++i) {
81 IGeometryProperty::eProperty
property = i->first;
82 if ((properties.computed & property) || (properties.delegated & property))
84 properties.computed |= property;
virtual String name() const =0
Family name.
virtual TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium)=0
Stream for a debug message.
@ PTemporary
Indicates that the variable is temporary.
@ PPrivate
Indicates that the variable is private.
ItemGroupImpl * internal() const
Returns the group implementation.
const String & name() const
Group name.
IItemFamily * itemFamily() const
Entity family to which this group belongs (0 for the null group).
void applyOperation(IItemOperationByBasicType *operation) const
Applies the operation operation to the entities of the group.
eItemKind itemKind() const
Group kind. This is the kind of its elements.
IMesh * mesh() const
Mesh to which this group belongs (0 for the null group).
String m_suffix
suffix for internal variable names
virtual ITraceMng * traceMng()=0
Access to traceMng.
virtual IGeometry * geometry()=0
Get underlying geometry.