GetFEM  5.4.2
bgeot::mesh_structure Class Reference

Mesh structure definition. More...

#include <bgeot_mesh_structure.h>

Inherited by bgeot::basic_mesh.

Public Member Functions

const dal::bit_vector & convex_index () const
 Return the list of valid convex IDs.
 
dal::bit_vector convex_index (dim_type) const
 Return the list of valid convex IDs of a given dimension.
 
size_type nb_convex () const
 The total number of convexes in the mesh.
 
size_type nb_allocated_convex () const
 The number of convex indexes from 0 to the index of the last convex.
 
bool is_convex_valid (size_type i)
 Return true if i is in convex_index()
 
bool is_point_valid (size_type i) const
 Return true if the point i is used by at least one convex.
 
const ind_set & ind_points_of_convex (size_type ic) const
 Return a container to the list of points attached to convex ic. More...
 
size_type local_ind_of_convex_point (size_type ic, size_type ip) const
 Return the "local" index for point ip of the mesh.
 
pconvex_structure structure_of_convex (size_type ic) const
 Return the pconvex_structure of the convex ic.
 
short_type nb_points_of_convex (size_type ic) const
 Return the number of points of convex ic.
 
short_type nb_faces_of_convex (size_type ic) const
 Return the number of faces of convex ic.
 
void swap_points (size_type i, size_type j)
 Exchange two point IDs.
 
void swap_convex (size_type cv1, size_type cv2)
 Exchange two convex IDs.
 
template<class ITER >
size_type add_convex (pconvex_structure cs, ITER ipts, bool *present=0)
 Insert a new convex in the mesh_structure. More...
 
void sup_convex (size_type ic)
 Remove the convex ic.
 
template<class ITER >
void sup_convex_with_points (ITER ipts, short_type nb)
 Remove a convex given its points. More...
 
size_type add_face_of_convex (size_type ic, short_type f)
 Insert a new convex corresponding to face f of the convex ic.
 
void add_faces_of_convex (size_type ic)
 Insert new convexes corresponding to the faces of the convex ic.
 
void to_faces (dim_type n)
 build a new mesh, such that its convexes are the faces of the convexes of the previous one
 
void to_edges ()
 build a new mesh, such that its convexes are the edges of the convexes of the previous one
 
const ind_cv_ct & convex_to_point (size_type ip) const
 Return a container of the convexes attached to point ip.
 
void ind_points_to_point (size_type, ind_set &) const
 Return a container of the points attached (via an edge) to point ip.
 
template<class ITER >
bool is_convex_having_points (size_type ic, short_type nb, ITER pit) const
 Return true if the convex contains the listed points. More...
 
template<class ITER >
bool is_convex_face_having_points (size_type ic, short_type face_num, short_type nb, ITER pit) const
 Return true if the face of the convex contains the given list of points.
 
ind_pt_face_ct ind_points_of_face_of_convex (size_type ic, short_type f) const
 Return a container of the (global) point number for face f or convex ic.
 
void optimize_structure ()
 Reorder the convex IDs and point IDs, such that there is no hole in their numbering.
 
void clear ()
 erase the mesh
 
void neighbors_of_convex (size_type ic, short_type f, ind_set &s) const
 Return in s a list of neighbors of a given convex face. More...
 
void neighbors_of_convex (size_type ic, const std::vector< short_type > &ftab, ind_set &s) const
 Return in s a list of neighbors of a given convex sharing the intersection of a given list of faces. More...
 
void neighbors_of_convex (size_type ic, ind_set &s) const
 Return a list of neighbors of a given convex. More...
 
size_type neighbor_of_convex (size_type ic, short_type f) const
 Return a neighbor convex of a given convex face. More...
 
convex_face adjacent_face (size_type ic, short_type f) const
 Return a face of the neighbouring element that is adjacent to the given face. More...
 
size_type first_convex_of_point (size_type ip) const
 Convex ID of the first convex attached to the point ip.
 
size_type ind_in_convex_of_point (size_type ic, size_type ip) const
 Find the local index of the point of global index ip with respect to the convex cv. More...
 

Detailed Description

Mesh structure definition.

At this point, the mesh is just a graph: the points have no associated coordinates

Definition at line 73 of file bgeot_mesh_structure.h.

Member Function Documentation

◆ ind_points_of_convex()

const ind_set& bgeot::mesh_structure::ind_points_of_convex ( size_type  ic) const
inline

Return a container to the list of points attached to convex ic.

They are ordered according to structure_of_convex(ic)

Definition at line 107 of file bgeot_mesh_structure.h.

◆ add_convex()

template<class ITER >
size_type bgeot::mesh_structure::add_convex ( pconvex_structure  cs,
ITER  ipts,
bool *  present = 0 
)

Insert a new convex in the mesh_structure.

Parameters
csthe structure of the new convex.
iptsan iterator over a sequence of integers (point IDs of the convex nodes).
presentan optional argument, contains true on return if the convex already exists in the mesh_structure.
Returns
the convex ID

Definition at line 306 of file bgeot_mesh_structure.h.

◆ sup_convex_with_points()

template<class ITER >
void bgeot::mesh_structure::sup_convex_with_points ( ITER  ipts,
short_type  nb 
)

Remove a convex given its points.

Parameters
nbthe number of points for the convex
iptsan iterator over the list of point IDs of the convex

Definition at line 317 of file bgeot_mesh_structure.h.

◆ is_convex_having_points()

template<class ITER >
bool bgeot::mesh_structure::is_convex_having_points ( size_type  ic,
short_type  nb,
ITER  pit 
) const

Return true if the convex contains the listed points.

Parameters
icthe convex ID.
nbthe number of points which are searched in ic.
pitan iterator to the list of points searched.

Definition at line 272 of file bgeot_mesh_structure.h.

◆ neighbors_of_convex() [1/3]

void bgeot::mesh_structure::neighbors_of_convex ( size_type  ic,
short_type  f,
ind_set &  s 
) const

Return in s a list of neighbors of a given convex face.

Parameters
icthe convex id.
fthe face number of the convex.
sthe resulting ind_set.

Definition at line 217 of file bgeot_mesh_structure.cc.

◆ neighbors_of_convex() [2/3]

void bgeot::mesh_structure::neighbors_of_convex ( size_type  ic,
const std::vector< short_type > &  ftab,
ind_set &  s 
) const

Return in s a list of neighbors of a given convex sharing the intersection of a given list of faces.

Parameters
icthe convex id.
fthe face number of the convex.
sthe resulting ind_set.

Definition at line 232 of file bgeot_mesh_structure.cc.

◆ neighbors_of_convex() [3/3]

void bgeot::mesh_structure::neighbors_of_convex ( size_type  ic,
ind_set &  s 
) const

Return a list of neighbors of a given convex.

Parameters
icthe convex id.
sthe resulting ind_set.

Definition at line 280 of file bgeot_mesh_structure.cc.

◆ neighbor_of_convex()

size_type bgeot::mesh_structure::neighbor_of_convex ( size_type  ic,
short_type  f 
) const

Return a neighbor convex of a given convex face.

Parameters
icthe convex id.
fthe face number of the convex.
Returns
size_type(-1) if there is no neighbor to this convex and the index of the first neighbor found otherwise.

Definition at line 297 of file bgeot_mesh_structure.cc.

◆ adjacent_face()

convex_face bgeot::mesh_structure::adjacent_face ( size_type  ic,
short_type  f 
) const

Return a face of the neighbouring element that is adjacent to the given face.

Parameters
icthe convex id.
fthe face number of the convex.
Returns
convex_face that contains the neighbors convex id and the adjacent face number, or convex_face::invalid_face() otherwise.

Definition at line 311 of file bgeot_mesh_structure.cc.

◆ ind_in_convex_of_point()

size_type bgeot::mesh_structure::ind_in_convex_of_point ( size_type  ic,
size_type  ip 
) const

Find the local index of the point of global index ip with respect to the convex cv.

Returns
local index (a number smaller than nb_points_of_convex(first_convex_of_point(ip))) or size_type(-1) if the point is not found.

Definition at line 327 of file bgeot_mesh_structure.cc.


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