14#include "arcane/utils/Array.h"
15#include "arcane/utils/FatalErrorException.h"
16#include "arcane/utils/NotImplementedException.h"
17#include "arcane/utils/TraceInfo.h"
19#include "arcane/core/IMesh.h"
20#include "arcane/core/Item.h"
23#include "arcane/core/IItemFamily.h"
24#include "arcane/core/MeshToMeshTransposer.h"
66 iKind = iKind - dimB + dimA;
69 if (iKind < 0 || iKind > 3)
74 if (kindB ==
IK_Edge && dimB < 3)
76 else if (kindB ==
IK_Face && dimB < 2)
88 ARCANE_ASSERT((meshA != NULL && meshB != NULL), (
"Bad NULL mesh"));
91 if (itemsA.
size() == 0)
99 return _transpose(familyA, familyB, itemsA, do_fatal);
108 ARCANE_ASSERT((familyA != NULL && familyB != NULL), (
"Bad NULL mesh"));
111 if (itemsA.
size() == 0)
114 return _transpose(familyA, familyB, itemsA, do_fatal);
128 if (parent_familyA == familyB) {
132 const Item& item = *iitem;
135 return ItemVector(familyB, lidsB);
137 else if (parent_familyB == familyA) {
142 UniqueArray<Int64> uidsA(itemsA.
size());
144 uidsA[iitem.index()] = iitem->uniqueId();
146 UniqueArray<Int32> lidsB(uidsA.size());
148 return ItemVector(familyB, lidsB);
151 throw NotImplementedException(A_FUNCINFO,
"Cannot only transpose item to cell or node");
154 else if (familyA == familyB) {
156 return ItemVector(familyB, itemsA.
localIds());
159 throw NotImplementedException(A_FUNCINFO, String::format(
"Cannot transpose between families {0}::{1} and {2}::{3}", familyA->
mesh()->
name(), familyA->
name(), familyA->
mesh()->
name(), familyB->
name()));
Declarations of types on entities.
Exception when a fatal error has occurred.
Interface of an entity family.
virtual String name() const =0
Family name.
virtual IItemFamily * parentFamily() const =0
IItemFamily parent.
virtual eItemKind itemKind() const =0
Entity kind.
virtual IMesh * mesh() const =0
Associated mesh.
virtual void itemsUniqueIdToLocalId(Int32ArrayView local_ids, Int64ConstArrayView unique_ids, bool do_fatal=true) const =0
Converts an array of unique numbers to local numbers.
virtual String name() const =0
Mesh name.
virtual IItemFamily * itemFamily(eItemKind ik)=0
Returns the entity family of type ik.
virtual Integer dimension()=0
Mesh dimension (1D, 2D, or 3D).
View on a vector of entities.
Int32 size() const
Number of elements in the vector.
Int32ConstArrayView localIds() const
Array of local IDs of entities.
Base class for a mesh element.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Item parent(Int32 i) const
i-th parent for submeshes
static eItemKind kindTranspose(eItemKind kindA, IMesh *meshA, IMesh *meshB)
Transpose the kind kindA of mesh meshA to the associated kind in meshB.
static ItemVector transpose(IMesh *meshA, IMesh *meshB, ItemVectorView itemsA, bool do_fatal=false)
Transpose itemsA from meshB to items on meshB.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
eItemKind
Mesh entity type.
@ IK_Node
Node mesh entity.
@ IK_Cell
Cell mesh entity.
@ IK_Face
Face mesh entity.
@ IK_Edge
Edge mesh entity.