LifeV
|
Some general Utilities on MeshEntityContainer. More...
Functions | |
template<typename EntityContainer > | |
void | reorderAccordingToIdPermutation (EntityContainer &container, std::vector< ID > const &newToOld) |
Reorder according to a permutation vector. More... | |
template<typename EntityContainer , typename RefEntityContainer > | |
void | fixAfterPermutation (EntityContainer &container, RefEntityContainer const &refcontainer, std::vector< ID > const &newToOld) |
Fix pointers after permutation If a mesh entity contains pointers to other mesh entities (typically Points), after the renumbering of the referenced mesh entity (for instance using reorderAccordingToPermutation on Points) the address stored in the pointers will be wrong since it refers to the old numbering! This routine fixes it. More... | |
template<typename EntityContainer , typename PointContainer > | |
void | fixAfterShallowCopy (EntityContainer &container, PointContainer const &newPointContainer) |
! Fix pointers after shallow copy More... | |
Some general Utilities on MeshEntityContainer.
void LifeV::Utilities::reorderAccordingToIdPermutation | ( | EntityContainer & | container, |
std::vector< ID > const & | newToOld | ||
) |
Reorder according to a permutation vector.
We can reorder a MeshEntityContainer by passing a permutation vector std::vector<ID> newToOld;
The entity originally in position newtoold[id] will be moved to position id All ids (local id!) will be renumbered to reflect the new position in the container.
Definition at line 539 of file MeshEntityContainer.hpp.
void LifeV::Utilities::fixAfterPermutation | ( | EntityContainer & | container, |
RefEntityContainer const & | refcontainer, | ||
std::vector< ID > const & | newToOld | ||
) |
Fix pointers after permutation If a mesh entity contains pointers to other mesh entities (typically Points), after the renumbering of the referenced mesh entity (for instance using reorderAccordingToPermutation on Points) the address stored in the pointers will be wrong since it refers to the old numbering! This routine fixes it.
It has to be called AFTER the reordering of the references mesh entities (i.e. the points) and NOT before.
Example:
Definition at line 572 of file MeshEntityContainer.hpp.
void LifeV::Utilities::fixAfterShallowCopy | ( | EntityContainer & | container, |
PointContainer const & | newPointContainer | ||
) |
! Fix pointers after shallow copy
If a mesh entity contains pointers to other mesh entities (typically Points), after a shallow copy, for instance by the automatic copy constructor, the pointers may still refer to a wrong list of Points! This utility allows to change the situation and make the pointers to point to the new list of Points. By this utility the deep copy of a RegionMesh is now possible!
Example:
container | the entity container with the wrong pointers to Point |
newPointContainer | the container with the list new Points |
Definition at line 616 of file MeshEntityContainer.hpp.