Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::geometric::GeomShapeMng Class Reference

Class managing the GeomShapes of a mesh. More...

#include <arcane/geometry/GeomShapeMng.h>

Public Member Functions

 GeomShapeMng (IMesh *mesh, const String &name)
 Initializes for the mesh mesh with the name name.
 GeomShapeMng (IMesh *mesh)
 Initializes for the mesh mesh with the default name GenericElement.
 GeomShapeMng (const GeomShapeMng &rhs)
 Copy constructor.
bool isInitialized () const
 Indicates if the instance is initialized.
void initialize ()
 Initializes the instance.
void initShape (GeomShapeView &ge, Cell cell) const
 Initializes the view ge with the information of the cell cell.
GeomShapeMutableView mutableShapeView (Cell cell)
 Returns a mutable view on the GeomShape of the cell cell.
const Stringname () const
 Manager name.

Detailed Description

Class managing the GeomShapes of a mesh.

This class stores the information of the geometric shapes (GeomShape) associated to the mesh cells. For a cell, retrieving a view is done via the initShape() method:

GeomShapeMng shape_mng;
Cell cell;
GeomShapeView shape_view;
// Initializes the view \a shape_view on the cell \a cell
shape_mng.initShape(shape_view,cell);
Cell of a mesh.
Definition Item.h:1300
GeomShapeMng(IMesh *mesh, const String &name)
Initializes for the mesh mesh with the name name.
void initShape(GeomShapeView &ge, Cell cell) const
Initializes the view ge with the information of the cell cell.
Constant view on a geometric shape GeomShape.

A view can be used multiple times. For example, if you want to iterate over multiple cells:

GeomShapeMng shape_mng;
GeomShapeView shape_view;
ENUMERATE_CELL(icell,allCells()){
Cell cell = *icell;
// Initializes the view \a shape_view on the cell \a cell
shape_mng.initShape(shape_view,cell);
info() << "Node0=" << shape_view.node(0);
}
#define ENUMERATE_CELL(name, group)
Generic enumerator for a cell group.
const Real3 node(Integer i) const
Position of the i-th node of the shape.

The view retrieved by GeomShapeView is constant. To retrieve a mutable view, you must use mutableShapeView(). The mutable view is only used to update the different coordinates (nodes, face centers, ...).

Before being able to use one of the initShape() or mutableShapeView() methods, you must initialize one of the instances by calling initialize(). Initialization only performs memory allocation but does not update the coordinates.

Warning
The initialize() method must also be called when the topology of the mesh changes, for example after adding or deleting a cell.

This class only manages the data on the geometric shapes and these are independent of other variables. This means that if the coordinates of a cell node change, you must explicitly update the geometric shape information. Arcane provides the BarycentricGeomShapeComputer class for this, but the user can calculate this information in another way than using the barycenter.

All instances of this class whose name name() is identical are implicitly shared and therefore provide the same GeomShapeView. For example:

IMesh* mesh;
GeomShapeMng shape_mng(mesh,"GenericElement");
GeomShapeMng shape_mng2(shape_mng);
// shape_mng and shape_mng2 share the same GeomShapeView
GeomShapeMng shape_mng3(mesh,"AleGenericElement");
// shape_mng and shape_mng3 use different values.

Definition at line 90 of file GeomShapeMng.h.

Constructor & Destructor Documentation

◆ GeomShapeMng() [1/3]

Arcane::geometric::GeomShapeMng::GeomShapeMng ( IMesh * mesh,
const String & name )

Initializes for the mesh mesh with the name name.

Definition at line 26 of file GeomShapeMng.cc.

Referenced by GeomShapeMng().

◆ GeomShapeMng() [2/3]

Arcane::geometric::GeomShapeMng::GeomShapeMng ( IMesh * mesh)

Initializes for the mesh mesh with the default name GenericElement.

Definition at line 38 of file GeomShapeMng.cc.

◆ GeomShapeMng() [3/3]

Arcane::geometric::GeomShapeMng::GeomShapeMng ( const GeomShapeMng & rhs)

Copy constructor.

Definition at line 50 of file GeomShapeMng.cc.

References GeomShapeMng().

Member Function Documentation

◆ initialize()

void Arcane::geometric::GeomShapeMng::initialize ( )

Initializes the instance.

Only instances with the same name need to be initialized once.

Definition at line 65 of file GeomShapeMng.cc.

References Arcane::ItemStaticInfo::MAX_CELL_FACE, and Arcane::ItemStaticInfo::MAX_CELL_NODE.

◆ initShape()

void Arcane::geometric::GeomShapeMng::initShape ( GeomShapeView & ge,
Cell cell ) const
inline

Initializes the view ge with the information of the cell cell.

Definition at line 120 of file GeomShapeMng.h.

◆ isInitialized()

bool Arcane::geometric::GeomShapeMng::isInitialized ( ) const
inline

Indicates if the instance is initialized.

Definition at line 110 of file GeomShapeMng.h.

◆ mutableShapeView()

GeomShapeMutableView Arcane::geometric::GeomShapeMng::mutableShapeView ( Cell cell)
inline

Returns a mutable view on the GeomShape of the cell cell.

Definition at line 127 of file GeomShapeMng.h.

◆ name()

const String & Arcane::geometric::GeomShapeMng::name ( ) const
inline

Manager name.

Definition at line 133 of file GeomShapeMng.h.


The documentation for this class was generated from the following files: