ug4
ug::UGXFileInfo Class Reference

#include <file_io_ugx.h>

Classes

struct  GridInfo
 
struct  SubsetHandlerInfo
 
struct  SubsetInfo
 

Public Member Functions

bool grid_has_edges (size_t gridInd) const
 
bool grid_has_faces (size_t gridInd) const
 
bool grid_has_vertices (size_t gridInd) const
 
bool grid_has_volumes (size_t gridInd) const
 
std::string grid_name (size_t gridInd) const
 
size_t grid_world_dimension (size_t gridInd) const
 Returns the dimension of the world-coordinates required for the given grid. More...
 
size_t num_grids () const
 
size_t num_subset_handlers (size_t gridInd) const
 
size_t num_subsets (size_t gridInd, size_t shInd) const
 
bool parse_file (const char *filename)
 
size_t physical_grid_dimension (size_t gridInd) const
 Returns the physical dimension of the given grid. More...
 
std::string subset_handler_name (size_t gridInd, size_t shInd) const
 
std::string subset_name (size_t gridInd, size_t shInd, size_t subsetInd) const
 
size_t topological_grid_dimension (size_t gridInd) const
 Returns the topological dimension of the given grid. More...
 
 UGXFileInfo ()
 

Private Member Functions

bool calculate_vertex_node_bbox (rapidxml::xml_node<> *vrtNode, AABox< vector3 > &bb) const
 calculates the bounding box of a group of vertices More...
 
void check_file_parsed () const
 throws an error if no file has been parsed yet More...
 
const GridInfogrid_info (size_t index) const
 return the queried grid info and throws an error if the grid index is out of range More...
 
std::string node_name (rapidxml::xml_node<> *n) const
 returns the name-attribute of the node or "" if none exists More...
 
const SubsetHandlerInfosubset_handler_info (size_t gridInd, size_t shInd) const
 throws an error if the subset handler index is out of range More...
 
const SubsetInfosubset_info (size_t gridInd, size_t shInd, size_t subsetInd) const
 throws an error if the subset index is out of range. More...
 

Private Attributes

bool m_fileParsed
 
std::vector< GridInfom_grids
 

Constructor & Destructor Documentation

◆ UGXFileInfo()

ug::UGXFileInfo::UGXFileInfo ( )

Member Function Documentation

◆ calculate_vertex_node_bbox()

bool ug::UGXFileInfo::calculate_vertex_node_bbox ( rapidxml::xml_node<> *  vrtNode,
AABox< vector3 > &  bb 
) const
private

calculates the bounding box of a group of vertices

Parameters
[in]vrtNodenode in the xml file (containing vertex information)
[out]bboutput bounding box
Returns
true if at least one valid (coordinate dimension in {0,1,2,3}) vertex is contained

References UG_ASSERT.

Referenced by parse_file().

◆ check_file_parsed()

void ug::UGXFileInfo::check_file_parsed ( ) const
private

throws an error if no file has been parsed yet

References m_fileParsed, and UG_THROW.

Referenced by grid_info(), and num_grids().

◆ grid_has_edges()

bool ug::UGXFileInfo::grid_has_edges ( size_t  gridInd) const

◆ grid_has_faces()

bool ug::UGXFileInfo::grid_has_faces ( size_t  gridInd) const

◆ grid_has_vertices()

bool ug::UGXFileInfo::grid_has_vertices ( size_t  gridInd) const

◆ grid_has_volumes()

bool ug::UGXFileInfo::grid_has_volumes ( size_t  gridInd) const

◆ grid_info()

const UGXFileInfo::GridInfo & ug::UGXFileInfo::grid_info ( size_t  index) const
private

return the queried grid info and throws an error if the grid index is out of range

Also calls check_file_parsed().

References check_file_parsed(), m_grids, and UG_THROW.

Referenced by grid_has_edges(), grid_has_faces(), grid_has_vertices(), grid_has_volumes(), grid_name(), num_subset_handlers(), physical_grid_dimension(), subset_handler_info(), and topological_grid_dimension().

◆ grid_name()

std::string ug::UGXFileInfo::grid_name ( size_t  gridInd) const

◆ grid_world_dimension()

size_t ug::UGXFileInfo::grid_world_dimension ( size_t  gridInd) const

Returns the dimension of the world-coordinates required for the given grid.

We define the 'maximal range' as the maximum of the ranges of the the particular coordinates. Then the result is 3 - if the z-coordinate are in a range that is larger than SMALL times the maximal range; 2 - if it is not 3 and the y-coordinate are in a range that is larger than SMALL times the maximal range; 1 - if it is not 0 or 1 and the x-coordinate are in a range that is larger than SMALL times the maximal range; 0 - if it is not 3 or 2 or 1 (i.e. if the geometry resides in one point).

Note
The functionality of this method has been changed slightly as of 2015-03-13 and is the same as in physical_grid_dimension(size_t gridInd); the previous functionality is still available in topological_grid_dimension(size_t gridInd).
Deprecated:
This method is marked deprecated and might be removed in a future update. Please use physical_grid_dimension(size_t gridInd) and topological_grid_dimension(size_t gridInd) instead.

References physical_grid_dimension().

◆ node_name()

std::string ug::UGXFileInfo::node_name ( rapidxml::xml_node<> *  n) const
private

returns the name-attribute of the node or "" if none exists

Referenced by parse_file().

◆ num_grids()

size_t ug::UGXFileInfo::num_grids ( ) const

References check_file_parsed(), and m_grids.

◆ num_subset_handlers()

size_t ug::UGXFileInfo::num_subset_handlers ( size_t  gridInd) const

◆ num_subsets()

size_t ug::UGXFileInfo::num_subsets ( size_t  gridInd,
size_t  shInd 
) const

◆ parse_file()

◆ physical_grid_dimension()

size_t ug::UGXFileInfo::physical_grid_dimension ( size_t  gridInd) const

Returns the physical dimension of the given grid.

We define the 'maximal range' as the maximum of the ranges of the the particular coordinates. Then the result is 3 - if the z-coordinate are in a range that is larger than SMALL times the maximal range; 2 - if it is not 3 and the y-coordinate are in a range that is larger than SMALL times the maximal range; 1 - if it is not 0 or 1 and the x-coordinate are in a range that is larger than SMALL times the maximal range; 0 - if it is not 3 or 2 or 1 (i.e. if the geometry resides in one point).

References grid_info(), ug::UGXFileInfo::GridInfo::m_extension, and ug::SMALL.

Referenced by grid_world_dimension().

◆ subset_handler_info()

const UGXFileInfo::SubsetHandlerInfo & ug::UGXFileInfo::subset_handler_info ( size_t  gridInd,
size_t  shInd 
) const
private

throws an error if the subset handler index is out of range

Also calls check_grid_index.

References grid_info(), ug::UGXFileInfo::GridInfo::m_subsetHandlers, and UG_THROW.

Referenced by num_subsets(), subset_handler_name(), and subset_info().

◆ subset_handler_name()

std::string ug::UGXFileInfo::subset_handler_name ( size_t  gridInd,
size_t  shInd 
) const

◆ subset_info()

const UGXFileInfo::SubsetInfo & ug::UGXFileInfo::subset_info ( size_t  gridInd,
size_t  shInd,
size_t  subsetInd 
) const
private

throws an error if the subset index is out of range.

Also calls check_subset_handler_index.

References ug::UGXFileInfo::SubsetHandlerInfo::m_subsets, subset_handler_info(), and UG_THROW.

Referenced by subset_name().

◆ subset_name()

std::string ug::UGXFileInfo::subset_name ( size_t  gridInd,
size_t  shInd,
size_t  subsetInd 
) const

◆ topological_grid_dimension()

size_t ug::UGXFileInfo::topological_grid_dimension ( size_t  gridInd) const

Returns the topological dimension of the given grid.

That is the dimension of the element of highest dimension in the given grid.

References grid_info(), ug::UGXFileInfo::GridInfo::m_hasEdges, ug::UGXFileInfo::GridInfo::m_hasFaces, and ug::UGXFileInfo::GridInfo::m_hasVolumes.

Member Data Documentation

◆ m_fileParsed

bool ug::UGXFileInfo::m_fileParsed
private

Referenced by check_file_parsed(), and parse_file().

◆ m_grids

std::vector<GridInfo> ug::UGXFileInfo::m_grids
private

Referenced by grid_info(), num_grids(), and parse_file().


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