ug4
ug::GridWriterUGX Class Reference

Grants write access to ugx files. More...

#include <file_io_ugx.h>

Classes

struct  Entry
 entries are stored for each grid. More...
 

Public Member Functions

template<class TElem , class TAttachment >
void add_attachment (TAttachment attachment, const char *name, size_t refGridIndex)
 
template<class TPositionAttachment >
bool add_grid (Grid &grid, const char *name, TPositionAttachment &aPos)
 
void add_projection_handler (ProjectionHandler &ph, const char *name, size_t refGridIndex)
 
void add_selector (ISelector &sel, const char *name, size_t refGridIndex)
 
void add_subset_handler (ISubsetHandler &sh, const char *name, size_t refGridIndex)
 
 GridWriterUGX ()
 
bool write_to_file (const char *filename)
 
virtual bool write_to_stream (std::ostream &out)
 
virtual ~GridWriterUGX ()
 

Protected Types

typedef Grid::EdgeAttachmentAccessor< AIntAAEdgeIndex
 
typedef Grid::FaceAttachmentAccessor< AIntAAFaceIndex
 
typedef Grid::VolumeAttachmentAccessor< AIntAAVolIndex
 
typedef Grid::VertexAttachmentAccessor< AIntAAVrtIndex
 

Protected Member Functions

void add_elements_to_node (rapidxml::xml_node<> *node, Grid &grid)
 adds grid elements (edges, faces, volumes) to the given node. More...
 
void add_subset_attributes (rapidxml::xml_node<> *targetNode, ISubsetHandler &sh, size_t subsetIndex)
 
template<class TElem >
const char * attachment_node_name ()
 
rapidxml::xml_node * create_constrained_edge_node (ConstrainedEdgeIterator edgesBegin, ConstrainedEdgeIterator edgesEnd, AAVrtIndex aaIndVRT, AAEdgeIndex aaIndEDGE, AAFaceIndex aaIndFACE)
 
rapidxml::xml_node * create_constrained_quadrilateral_node (ConstrainedQuadrilateralIterator quadsBegin, ConstrainedQuadrilateralIterator quadsEnd, AAVrtIndex aaIndVRT, AAFaceIndex aaIndFACE)
 
rapidxml::xml_node * create_constrained_triangle_node (ConstrainedTriangleIterator trisBegin, ConstrainedTriangleIterator trisEnd, AAVrtIndex aaIndVRT, AAFaceIndex aaIndFACE)
 
template<class TAAPos >
rapidxml::xml_node * create_constrained_vertex_node (ConstrainedVertexIterator vrtsBegin, ConstrainedVertexIterator vrtsEnd, TAAPos &aaPos, AAEdgeIndex aaIndEDGE, AAFaceIndex aaIndFACE)
 
rapidxml::xml_node * create_constraining_edge_node (ConstrainingEdgeIterator edgesBegin, ConstrainingEdgeIterator edgesEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_constraining_quadrilateral_node (ConstrainingQuadrilateralIterator quadsBegin, ConstrainingQuadrilateralIterator quadsEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_constraining_triangle_node (ConstrainingTriangleIterator trisBegin, ConstrainingTriangleIterator trisEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_edge_node (RegularEdgeIterator edgesBegin, RegularEdgeIterator edgesEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_hexahedron_node (HexahedronIterator hexasBegin, HexahedronIterator hexasEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_octahedron_node (OctahedronIterator octsBegin, OctahedronIterator octsEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_prism_node (PrismIterator prismsBegin, PrismIterator prismsEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_projector_node (RefinementProjector &proj, const char *nodeName)
 
rapidxml::xml_node * create_pyramid_node (PyramidIterator pyrasBegin, PyramidIterator pyrasEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_quadrilateral_node (QuadrilateralIterator quadsBegin, QuadrilateralIterator quadsEnd, AAVrtIndex aaIndVRT)
 
template<class TGeomObj >
rapidxml::xml_node * create_selector_element_node (const char *name, const ISelector &sel)
 
template<class TGeomObj >
rapidxml::xml_node * create_subset_element_node (const char *name, const ISubsetHandler &sh, size_t si)
 
rapidxml::xml_node * create_tetrahedron_node (TetrahedronIterator tetsBegin, TetrahedronIterator tetsEnd, AAVrtIndex aaIndVRT)
 
rapidxml::xml_node * create_triangle_node (TriangleIterator trisBegin, TriangleIterator trisEnd, AAVrtIndex aaIndVRT)
 
template<class TAAPos >
rapidxml::xml_node * create_vertex_node (RegularVertexIterator vrtsBegin, RegularVertexIterator vrtsEnd, TAAPos &aaPos)
 
void init_grid_attachments (Grid &grid)
 
template<class TElem >
void process_global_attachments (Grid &grid, rapidxml::xml_node<> *gridNode)
 

Protected Attributes

AInt m_aInt
 attached to vertices of each grid during add_grid. More...
 
rapidxml::xml_document m_doc
 the xml_document which stores the data More...
 
std::vector< Entrym_vEntries
 List of accessible grids. More...
 

Detailed Description

Grants write access to ugx files.

Make sure that all elements added via one of the add_* methods exist until the FileAccessor is destroyed.

Member Typedef Documentation

◆ AAEdgeIndex

◆ AAFaceIndex

◆ AAVolIndex

◆ AAVrtIndex

Constructor & Destructor Documentation

◆ GridWriterUGX()

ug::GridWriterUGX::GridWriterUGX ( )

◆ ~GridWriterUGX()

ug::GridWriterUGX::~GridWriterUGX ( )
virtual

Member Function Documentation

◆ add_attachment()

template<class TElem , class TAttachment >
void ug::GridWriterUGX::add_attachment ( TAttachment  attachment,
const char *  name,
size_t  refGridIndex 
)

◆ add_elements_to_node()

void ug::GridWriterUGX::add_elements_to_node ( rapidxml::xml_node<> *  node,
Grid grid 
)
protected

adds grid elements (edges, faces, volumes) to the given node.

References ug::Grid::begin(), ug::Grid::end(), and ug::Grid::num().

Referenced by add_grid().

◆ add_grid()

template<class TPositionAttachment >
bool ug::GridWriterUGX::add_grid ( Grid grid,
const char *  name,
TPositionAttachment &  aPos 
)

TPositionAttachments value type has to be compatible with MathVector. Make sure that aPos is attached to the vertices of the grid.

References add_elements_to_node(), ug::Grid::begin(), create_constrained_vertex_node(), create_vertex_node(), ug::Grid::end(), ug::Grid::has_vertex_attachment(), init_grid_attachments(), m_aInt, m_doc, m_vEntries, name, ug::Grid::num(), and UG_LOG.

Referenced by ug::SaveDomain(), and ug::SaveGridToUGX().

◆ add_projection_handler()

◆ add_selector()

void ug::GridWriterUGX::add_selector ( ISelector sel,
const char *  name,
size_t  refGridIndex 
)

◆ add_subset_attributes()

void ug::GridWriterUGX::add_subset_attributes ( rapidxml::xml_node<> *  targetNode,
ISubsetHandler sh,
size_t  subsetIndex 
)
protected

◆ add_subset_handler()

◆ attachment_node_name()

template<class TElem >
const char * ug::GridWriterUGX::attachment_node_name
protected

◆ create_constrained_edge_node()

rapidxml::xml_node * ug::GridWriterUGX::create_constrained_edge_node ( ConstrainedEdgeIterator  edgesBegin,
ConstrainedEdgeIterator  edgesEnd,
AAVrtIndex  aaIndVRT,
AAEdgeIndex  aaIndEDGE,
AAFaceIndex  aaIndFACE 
)
protected

◆ create_constrained_quadrilateral_node()

rapidxml::xml_node * ug::GridWriterUGX::create_constrained_quadrilateral_node ( ConstrainedQuadrilateralIterator  quadsBegin,
ConstrainedQuadrilateralIterator  quadsEnd,
AAVrtIndex  aaIndVRT,
AAFaceIndex  aaIndFACE 
)
protected

◆ create_constrained_triangle_node()

rapidxml::xml_node * ug::GridWriterUGX::create_constrained_triangle_node ( ConstrainedTriangleIterator  trisBegin,
ConstrainedTriangleIterator  trisEnd,
AAVrtIndex  aaIndVRT,
AAFaceIndex  aaIndFACE 
)
protected

◆ create_constrained_vertex_node()

template<class TAAPos >
rapidxml::xml_node * ug::GridWriterUGX::create_constrained_vertex_node ( ConstrainedVertexIterator  vrtsBegin,
ConstrainedVertexIterator  vrtsEnd,
TAAPos &  aaPos,
AAEdgeIndex  aaIndEDGE,
AAFaceIndex  aaIndFACE 
)
protected

References m_doc.

Referenced by add_grid().

◆ create_constraining_edge_node()

rapidxml::xml_node * ug::GridWriterUGX::create_constraining_edge_node ( ConstrainingEdgeIterator  edgesBegin,
ConstrainingEdgeIterator  edgesEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_constraining_quadrilateral_node()

rapidxml::xml_node * ug::GridWriterUGX::create_constraining_quadrilateral_node ( ConstrainingQuadrilateralIterator  quadsBegin,
ConstrainingQuadrilateralIterator  quadsEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_constraining_triangle_node()

rapidxml::xml_node * ug::GridWriterUGX::create_constraining_triangle_node ( ConstrainingTriangleIterator  trisBegin,
ConstrainingTriangleIterator  trisEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_edge_node()

rapidxml::xml_node * ug::GridWriterUGX::create_edge_node ( RegularEdgeIterator  edgesBegin,
RegularEdgeIterator  edgesEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_hexahedron_node()

rapidxml::xml_node * ug::GridWriterUGX::create_hexahedron_node ( HexahedronIterator  hexasBegin,
HexahedronIterator  hexasEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_octahedron_node()

rapidxml::xml_node * ug::GridWriterUGX::create_octahedron_node ( OctahedronIterator  octsBegin,
OctahedronIterator  octsEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_prism_node()

rapidxml::xml_node * ug::GridWriterUGX::create_prism_node ( PrismIterator  prismsBegin,
PrismIterator  prismsEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_projector_node()

xml_node * ug::GridWriterUGX::create_projector_node ( RefinementProjector proj,
const char *  nodeName 
)
protected

◆ create_pyramid_node()

rapidxml::xml_node * ug::GridWriterUGX::create_pyramid_node ( PyramidIterator  pyrasBegin,
PyramidIterator  pyrasEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_quadrilateral_node()

rapidxml::xml_node * ug::GridWriterUGX::create_quadrilateral_node ( QuadrilateralIterator  quadsBegin,
QuadrilateralIterator  quadsEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_selector_element_node()

◆ create_subset_element_node()

template<class TGeomObj >
rapidxml::xml_node * ug::GridWriterUGX::create_subset_element_node ( const char *  name,
const ISubsetHandler sh,
size_t  si 
)
protected

◆ create_tetrahedron_node()

rapidxml::xml_node * ug::GridWriterUGX::create_tetrahedron_node ( TetrahedronIterator  tetsBegin,
TetrahedronIterator  tetsEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_triangle_node()

rapidxml::xml_node * ug::GridWriterUGX::create_triangle_node ( TriangleIterator  trisBegin,
TriangleIterator  trisEnd,
AAVrtIndex  aaIndVRT 
)
protected

◆ create_vertex_node()

template<class TAAPos >
rapidxml::xml_node * ug::GridWriterUGX::create_vertex_node ( RegularVertexIterator  vrtsBegin,
RegularVertexIterator  vrtsEnd,
TAAPos &  aaPos 
)
protected

References m_doc.

Referenced by add_grid().

◆ init_grid_attachments()

◆ process_global_attachments()

template<class TElem >
void ug::GridWriterUGX::process_global_attachments ( Grid grid,
rapidxml::xml_node<> *  gridNode 
)
protected

◆ write_to_file()

bool ug::GridWriterUGX::write_to_file ( const char *  filename)

◆ write_to_stream()

bool ug::GridWriterUGX::write_to_stream ( std::ostream &  out)
virtual

Member Data Documentation

◆ m_aInt

AInt ug::GridWriterUGX::m_aInt
protected

attached to vertices of each grid during add_grid.

Referenced by add_grid().

◆ m_doc

rapidxml::xml_document ug::GridWriterUGX::m_doc
protected

◆ m_vEntries

std::vector<Entry> ug::GridWriterUGX::m_vEntries
protected

List of accessible grids.

Referenced by add_attachment(), and add_grid().


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