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

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

#include <arcane/geometry/GeomShapeMng.h>

Collaboration diagram for Arcane::geometric::GeomShapeMng:

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.

Private Attributes

String m_name
VariableCellArrayReal3 m_cell_shape_nodes
 Generic elements nodes.
VariableCellArrayReal3 m_cell_shape_faces
 Generic elements face.
VariableCellReal3 m_cell_shape_centers
 Generic elements center.

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:

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 src/arcane/geometry/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.

References m_cell_shape_centers, m_cell_shape_faces, and m_cell_shape_nodes.

Referenced by GeomShapeMng().

Here is the caller graph for this function:

◆ 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.

References m_cell_shape_centers, m_cell_shape_faces, and m_cell_shape_nodes.

◆ GeomShapeMng() [3/3]

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

Copy constructor.

Definition at line 50 of file GeomShapeMng.cc.

References GeomShapeMng(), m_cell_shape_centers, m_cell_shape_faces, and m_cell_shape_nodes.

Here is the call graph for this function:

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 m_cell_shape_faces, m_cell_shape_nodes, 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 src/arcane/geometry/GeomShapeMng.h.

References m_cell_shape_centers, m_cell_shape_faces, and m_cell_shape_nodes.

◆ isInitialized()

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

Indicates if the instance is initialized.

Definition at line 110 of file src/arcane/geometry/GeomShapeMng.h.

References m_cell_shape_nodes.

◆ 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 src/arcane/geometry/GeomShapeMng.h.

References m_cell_shape_centers, m_cell_shape_faces, and m_cell_shape_nodes.

◆ name()

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

Manager name.

Definition at line 133 of file src/arcane/geometry/GeomShapeMng.h.

Member Data Documentation

◆ m_cell_shape_centers

VariableCellReal3 Arcane::geometric::GeomShapeMng::m_cell_shape_centers
private

Generic elements center.

Definition at line 140 of file src/arcane/geometry/GeomShapeMng.h.

Referenced by GeomShapeMng(), GeomShapeMng(), GeomShapeMng(), initShape(), and mutableShapeView().

◆ m_cell_shape_faces

VariableCellArrayReal3 Arcane::geometric::GeomShapeMng::m_cell_shape_faces
private

Generic elements face.

Definition at line 139 of file src/arcane/geometry/GeomShapeMng.h.

Referenced by GeomShapeMng(), GeomShapeMng(), GeomShapeMng(), initialize(), initShape(), and mutableShapeView().

◆ m_cell_shape_nodes

VariableCellArrayReal3 Arcane::geometric::GeomShapeMng::m_cell_shape_nodes
private

◆ m_name

String Arcane::geometric::GeomShapeMng::m_name
private

Definition at line 137 of file src/arcane/geometry/GeomShapeMng.h.


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