Flow123d  jenkins-Flow123d-windows32-release-multijob-51
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GmshMeshReader Class Reference

#include <msh_gmshreader.h>

Collaboration diagram for GmshMeshReader:
Collaboration graph
[legend]

Public Member Functions

 GmshMeshReader (const FilePath &file_name)
 
 GmshMeshReader (std::istream &in)
 
 ~GmshMeshReader ()
 
void read_mesh (Mesh *mesh, const RegionDB::MapElementIDToRegionID *el_to_reg_map=NULL)
 
void read_element_data (GMSH_DataHeader &search_header, double *data, std::vector< int > const &el_ids)
 

Private Member Functions

void read_physical_names (Tokenizer &in, Mesh *mesh)
 
void read_nodes (Tokenizer &in, Mesh *)
 
void read_elements (Tokenizer &in, Mesh *, const RegionDB::MapElementIDToRegionID *el_to_reg_map=NULL)
 
void read_data_header (Tokenizer &tok, GMSH_DataHeader &head)
 

Private Attributes

Tokenizer tok_
 Tokenizer used for reading ASCII GMSH file format. More...
 
GMSH_DataHeader last_header
 Last read header of ElementData section. More...
 

Detailed Description

Definition at line 87 of file msh_gmshreader.h.

Constructor & Destructor Documentation

GmshMeshReader::GmshMeshReader ( const FilePath file_name)

Construct the GMSH format reader from given filename. This opens the file for reading.

Definition at line 51 of file msh_gmshreader.cc.

GmshMeshReader::GmshMeshReader ( std::istream &  in)

Construct the GMSH format reader from given input stream. The input stream should be correctly opened. To get correct information about line numbers there should be no previous reading from the stream.

Definition at line 61 of file msh_gmshreader.cc.

GmshMeshReader::~GmshMeshReader ( )

Destructor close the file if opened.

Definition at line 71 of file msh_gmshreader.cc.

Member Function Documentation

void GmshMeshReader::read_data_header ( Tokenizer &  tok,
GMSH_DataHeader head 
)
private

Definition at line 249 of file msh_gmshreader.cc.

Here is the caller graph for this function:

void GmshMeshReader::read_element_data ( GMSH_DataHeader search_header,
double *  data,
std::vector< int > const &  el_ids 
)

Reads ElementData sections of opened GMSH file. The file is serached for the \$ElementData section with header that match the given search_header (same field_name, time of the next section is the first greater then that given in the search_header). If such section has not been yet read, we read the data section into raw buffer data. The map id_to_idx is used to convert IDs that marks individual input rows/entities into indexes to the raw buffer. The buffer must have size at least search_header.n_components * search_header.n_entities. Indexes in the map must be smaller then search_header.n_entities. If the data buffer is updated we set search_header.actual to true.

Possible optimizations: If the map ID lookup seem slow, we may assume that IDs are in increasing order, use simple array of IDs instead of map and just check that they comes in in correct order.

Definition at line 304 of file msh_gmshreader.cc.

void GmshMeshReader::read_elements ( Tokenizer &  in,
Mesh mesh,
const RegionDB::MapElementIDToRegionID el_to_reg_map = NULL 
)
private

Method for reading of elements. Optional map el_to_reg_map can be used to override region of some elements provided by GMSH file. Input of the mesh allows changing regions within the input CON file.

Definition at line 119 of file msh_gmshreader.cc.

Here is the caller graph for this function:

void GmshMeshReader::read_mesh ( Mesh mesh,
const RegionDB::MapElementIDToRegionID el_to_reg_map = NULL 
)

Reads mesh from the GMSH file. Optional map el_to_reg_map can be used to override region of some elements provided by GMSH file. Input of the mesh allows changing regions within the input CON file.

Definition at line 76 of file msh_gmshreader.cc.

Here is the caller graph for this function:

void GmshMeshReader::read_nodes ( Tokenizer &  in,
Mesh mesh 
)
private

private method for reading of nodes

Definition at line 87 of file msh_gmshreader.cc.

Here is the caller graph for this function:

void GmshMeshReader::read_physical_names ( Tokenizer &  in,
Mesh mesh 
)
private

Read section '$PhysicalNames' of the GMSH file and save the physical sections as regions in the RegionDB.

Region Labels starting with '!' are treated as boundary regions. Elements of these regions are used just to assign regions to the boundary and are not used in actual FEM computations.

Definition at line 220 of file msh_gmshreader.cc.

Here is the caller graph for this function:

Member Data Documentation

GMSH_DataHeader GmshMeshReader::last_header
private

Last read header of ElementData section.

Definition at line 158 of file msh_gmshreader.h.

Tokenizer GmshMeshReader::tok_
private

Tokenizer used for reading ASCII GMSH file format.

Definition at line 156 of file msh_gmshreader.h.


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