ViennaGrid - The Vienna Grid Library  2.1.0
Data Structures | Public Types | Public Member Functions | Friends
segmentation< WrappedConfigType > Class Template Reference

A segmentation is a logical decomposition of the mesh (or a subset thereof) into segments. Segments may overlap. More...

#include <segmentation.hpp>

Data Structures

class  const_iterator
 Const iterator for iterating over all segments. More...
class  iterator
 Iterator for iterating over all segments. More...
struct  segment
 For internal use only.

Public Types

typedef
result_of::segmentation_appendix_type
< WrappedConfigType >::type 
appendix_type
 For internal use only.
typedef
result_of::segmentation_mesh_type
< WrappedConfigType >::type 
mesh_type
 The mesh type to which the segmentation references.
typedef
result_of::segmentation_segment_container_tag
< WrappedConfigType >::type 
segment_container_tag
 For internal use only.
typedef segment_handle< self_typesegment_handle_type
 The segment type of the segmentation.
typedef
result_of::segmentation_segment_id_type
< WrappedConfigType >::type 
segment_id_type
 The segment ID type.
typedef
viennagrid::segmentation
< WrappedConfigType > 
self_type
 For internal use only.
typedef
result_of::segmentation_view_type
< WrappedConfigType >::type 
view_type
 The view type in a segment.

Public Member Functions

view_typeall_elements ()
view_type const & all_elements () const
appendix_typeappendix ()
 Returns the appenix of the segmentation, for internal use only.
appendix_type const & appendix () const
 Returns the appenix of the segmentation, const version, for internal use only.
segment_handle_type const & at (segment_id_type const &segment_id) const
 Returns segment with segment_id. Throws.
segment_handle_type const & at (std::string const &segment_name) const
 Returns segment with segment_name. Throws.
iterator begin ()
 Returns an iterator pointing to the first segment.
const_iterator begin () const
 Returns a const iterator pointing to the first segment, const version.
const_iterator cbegin () const
 Returns a const iterator pointing to the first segment.
const_iterator cend () const
 Returns a const iterator pointing to the end of the segments.
void clear ()
 Completely clears a segmentations.
bool empty () const
 Queries if the segmentation is empty.
iterator end ()
 Returns an iterator pointing to the end of the segments.
const_iterator end () const
 Returns a const iterator pointing to the end of the segments, const version.
iterator find (segment_id_type const &segment_id)
 Finds a segment with a given segment ID.
const_iterator find (segment_id_type const &segment_id) const
 Finds a segment with a given segment ID, const version.
segment_handle_typeget_make_segment (segment_id_type const &segment_id)
 Returns the segment with the given ID, will create a new segment if no segment with the given ID is present.
segment_handle_typeget_make_segment (std::string const &segment_name)
 Returns the segment with the given ID, will create a new segment if no segment with the given ID is present.
segment_handle_typeget_segment (segment_id_type const &segment_id)
 Returns the segment with the given ID, will fail if no segment with segment_id is present.
segment_handle_type const & get_segment (segment_id_type const &segment_id) const
 Returns the segment with the given ID, will fail if no segment with segment_id is present.
segment_handle_typeget_segment (std::string const &segment_name)
 Returns the segment with the given name, will fail if no segment with segment_id is present.
segment_handle_type const & get_segment (std::string const &segment_name) const
 Returns the segment with the given name, will fail if no segment with segment_id is present.
segment_id_type id_upper_bound () const
 Returns the heighest segment ID.
void init (mesh_type &mesh_x)
 (Re-)Initializes a segmentation based on a mesh.
segment_handle_typemake_segment ()
 Creates a new segment with an automatic assigned ID.
mesh_typemesh ()
 Returns the mesh to which the segmentation is associated.
mesh_type const & mesh () const
 Returns the mesh to which the segmentation is associated, const version.
segment_handle_typeoperator() (segment_id_type const &segment_id)
 Calls get_make_segment with segment_id.
segment_handle_type const & operator() (segment_id_type const &segment_id) const
 Calls get_segment with segment_id.
segment_handle_typeoperator() (std::string const &segment_name)
 Calls get_make_segment with segment_name.
segment_handle_type const & operator() (std::string const &segment_name) const
 Calls get_segment with segment_name.
segment_handle_typeoperator[] (segment_id_type const &segment_id)
 Calls get_make_segment with segment_id.
segment_handle_type const & operator[] (segment_id_type const &segment_id) const
 Calls get_segment with segment_id.
segment_handle_typeoperator[] (std::string const &segment_name)
 Calls get_make_segment with segment_name.
segment_handle_type const & operator[] (std::string const &segment_name) const
 Calls get_segment with segment_name.
bool segment_present (segment_id_type const &segment_id) const
 Queries if a segment with given ID is present within the segmentation.
 segmentation (mesh_type &mesh_x)
 Constructor.
std::size_t size () const
 Returns the number of segments in the segmentation.

Friends

class segment_handle< segmentation< WrappedConfigType > >

Detailed Description

template<typename WrappedConfigType>
class viennagrid::segmentation< WrappedConfigType >

A segmentation is a logical decomposition of the mesh (or a subset thereof) into segments. Segments may overlap.


Member Typedef Documentation

typedef result_of::segmentation_appendix_type<WrappedConfigType>::type appendix_type

For internal use only.

typedef result_of::segmentation_mesh_type<WrappedConfigType>::type mesh_type

The mesh type to which the segmentation references.

typedef result_of::segmentation_segment_container_tag<WrappedConfigType>::type segment_container_tag

For internal use only.

typedef segment_handle<self_type> segment_handle_type

The segment type of the segmentation.

typedef result_of::segmentation_segment_id_type<WrappedConfigType>::type segment_id_type

The segment ID type.

typedef viennagrid::segmentation<WrappedConfigType> self_type

For internal use only.

typedef result_of::segmentation_view_type<WrappedConfigType>::type view_type

The view type in a segment.


Constructor & Destructor Documentation

segmentation ( mesh_type mesh_x) [inline]

Constructor.

Parameters:
mesh_xThe mesh object to which the segmentation references

Member Function Documentation

view_type& all_elements ( ) [inline]
view_type const& all_elements ( ) const [inline]
appendix_type& appendix ( ) [inline]

Returns the appenix of the segmentation, for internal use only.

Returns:
A reference to the appendix
appendix_type const& appendix ( ) const [inline]

Returns the appenix of the segmentation, const version, for internal use only.

Returns:
A const reference to the appendix
segment_handle_type const& at ( segment_id_type const &  segment_id) const [inline]

Returns segment with segment_id. Throws.

Parameters:
segment_idThe ID of the segment to search
Returns:
A const reference to newly created segment
segment_handle_type const& at ( std::string const &  segment_name) const [inline]

Returns segment with segment_name. Throws.

Parameters:
segment_nameThe name of the segment to search
Returns:
A const reference to newly created segment
iterator begin ( ) [inline]

Returns an iterator pointing to the first segment.

Returns:
An iterator pointing to the first segment
const_iterator begin ( ) const [inline]

Returns a const iterator pointing to the first segment, const version.

Returns:
A const iterator pointing to the first segment
const_iterator cbegin ( ) const [inline]

Returns a const iterator pointing to the first segment.

Returns:
A const iterator pointing to the first segment
const_iterator cend ( ) const [inline]

Returns a const iterator pointing to the end of the segments.

Returns:
A const iterator pointing to the end of the segments
void clear ( ) [inline]

Completely clears a segmentations.

bool empty ( ) const [inline]

Queries if the segmentation is empty.

Returns:
True if there are no segments, false otherwise
iterator end ( ) [inline]

Returns an iterator pointing to the end of the segments.

Returns:
An iterator pointing to the end of the segments
const_iterator end ( ) const [inline]

Returns a const iterator pointing to the end of the segments, const version.

Returns:
A const iterator pointing to the end of the segments
iterator find ( segment_id_type const &  segment_id) [inline]

Finds a segment with a given segment ID.

Parameters:
segment_idThe segment ID of the segment to find
Returns:
An iterator pointing segment with the given ID, if no segment was found it points to end()
const_iterator find ( segment_id_type const &  segment_id) const [inline]

Finds a segment with a given segment ID, const version.

Parameters:
segment_idThe segment ID of the segment to find
Returns:
A const iterator pointing segment with the given ID, if no segment was found it points to end()
segment_handle_type& get_make_segment ( segment_id_type const &  segment_id) [inline]

Returns the segment with the given ID, will create a new segment if no segment with the given ID is present.

Parameters:
segment_idThe ID of the segment to search
Returns:
A reference to the segment with the given ID
segment_handle_type& get_make_segment ( std::string const &  segment_name) [inline]

Returns the segment with the given ID, will create a new segment if no segment with the given ID is present.

Parameters:
segment_idThe ID of the segment to search
Returns:
A reference to the segment with the given ID
segment_handle_type& get_segment ( segment_id_type const &  segment_id) [inline]

Returns the segment with the given ID, will fail if no segment with segment_id is present.

Parameters:
segment_idThe ID of the segment to search
Returns:
A const reference to the segment with the given ID
segment_handle_type const& get_segment ( segment_id_type const &  segment_id) const [inline]

Returns the segment with the given ID, will fail if no segment with segment_id is present.

Parameters:
segment_idThe ID of the segment to search
Returns:
A const reference to the segment with the given ID
segment_handle_type& get_segment ( std::string const &  segment_name) [inline]

Returns the segment with the given name, will fail if no segment with segment_id is present.

Parameters:
segment_idThe name of the segment to search
Returns:
A const reference to the segment with the given name
segment_handle_type const& get_segment ( std::string const &  segment_name) const [inline]

Returns the segment with the given name, will fail if no segment with segment_id is present.

Parameters:
segment_idThe name of the segment to search
Returns:
A const reference to the segment with the given name
segment_id_type id_upper_bound ( ) const [inline]

Returns the heighest segment ID.

Returns:
The highest segment ID
void init ( mesh_type mesh_x) [inline]

(Re-)Initializes a segmentation based on a mesh.

Creates a new segment with an automatic assigned ID.

Returns:
A reference to newly created segment
mesh_type& mesh ( ) [inline]

Returns the mesh to which the segmentation is associated.

Returns:
A reference to the mesh
mesh_type const& mesh ( ) const [inline]

Returns the mesh to which the segmentation is associated, const version.

Returns:
A const reference to the mesh
segment_handle_type& operator() ( segment_id_type const &  segment_id) [inline]

Calls get_make_segment with segment_id.

Parameters:
segment_idThe ID of the segment to search
Returns:
A reference to newly created segment
segment_handle_type const& operator() ( segment_id_type const &  segment_id) const [inline]

Calls get_segment with segment_id.

Parameters:
segment_idThe ID of the segment to search
Returns:
A const reference to newly created segment
segment_handle_type& operator() ( std::string const &  segment_name) [inline]

Calls get_make_segment with segment_name.

Parameters:
segment_nameThe name of the segment to search
Returns:
A reference to newly created segment
segment_handle_type const& operator() ( std::string const &  segment_name) const [inline]

Calls get_segment with segment_name.

Parameters:
segment_nameThe name of the segment to search
Returns:
A const reference to newly created segment
segment_handle_type& operator[] ( segment_id_type const &  segment_id) [inline]

Calls get_make_segment with segment_id.

Parameters:
segment_idThe ID of the segment to search
Returns:
A reference to newly created segment
segment_handle_type const& operator[] ( segment_id_type const &  segment_id) const [inline]

Calls get_segment with segment_id.

Parameters:
segment_idThe ID of the segment to search
Returns:
A const reference to newly created segment
segment_handle_type& operator[] ( std::string const &  segment_name) [inline]

Calls get_make_segment with segment_name.

Parameters:
segment_nameThe name of the segment to search
Returns:
A reference to newly created segment
segment_handle_type const& operator[] ( std::string const &  segment_name) const [inline]

Calls get_segment with segment_name.

Parameters:
segment_nameThe name of the segment to search
Returns:
A const reference to newly created segment
bool segment_present ( segment_id_type const &  segment_id) const [inline]

Queries if a segment with given ID is present within the segmentation.

Parameters:
segment_idThe ID of the segment to search
Returns:
True if the segment is present, false otherwise
std::size_t size ( ) const [inline]

Returns the number of segments in the segmentation.

Returns:
The number of segments

Friends And Related Function Documentation

friend class segment_handle< segmentation< WrappedConfigType > > [friend]

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