#include <msh_gmshreader.h>
|
| TYPEDEF_ERR_INFO (EI_FieldName, std::string) |
|
| TYPEDEF_ERR_INFO (EI_GMSHFile, std::string) |
|
| TYPEDEF_ERR_INFO (EI_Time, double) |
|
| TYPEDEF_ERR_INFO (EI_Type, std::string) |
|
| TYPEDEF_ERR_INFO (EI_TokenizerMsg, std::string) |
|
| TYPEDEF_ERR_INFO (EI_Section, std::string) |
|
| TYPEDEF_ERR_INFO (EI_ElementId, int) |
|
| TYPEDEF_ERR_INFO (EI_ElementType, int) |
|
| DECLARE_INPUT_EXCEPTION (ExcFieldNameNotFound,<< "No data for field: "<< EI_FieldName::qval<< " and time: "<< EI_Time::val<< " in the input file: "<< EI_GMSHFile::qval) |
|
| DECLARE_EXCEPTION (ExcWrongFormat,<< "Wrong format of "<< EI_Type::val<< ", "<< EI_TokenizerMsg::val<< "\n"<< "in the input file: "<< EI_GMSHFile::qval) |
|
| DECLARE_EXCEPTION (ExcMissingSection,<< "Missing section "<< EI_Section::qval<< " in the GMSH input file: "<< EI_GMSHFile::qval) |
|
| DECLARE_EXCEPTION (ExcUnsupportedType,<< "Element "<< EI_ElementId::val<< "in the GMSH input file "<< EI_GMSHFile::qval<< " is of the unsupported type "<< EI_ElementType::val) |
|
| GmshMeshReader (const FilePath &file_name) |
|
| GmshMeshReader (std::istream &in) |
|
| ~GmshMeshReader () |
|
void | read_mesh (Mesh *mesh) |
|
void | read_physical_names (Mesh *mesh) |
|
template<typename T > |
ElementDataCache< T >::ComponentDataPtr | get_element_data (GMSH_DataHeader &search_header, std::vector< int > const &el_ids, unsigned int component_idx) |
|
Definition at line 78 of file msh_gmshreader.h.
Map of ElementData sections in GMSH file.
For each field_name contains vector of GMSH_DataHeader. Headers are sorted by time in ascending order.
Definition at line 107 of file msh_gmshreader.h.
GmshMeshReader::GmshMeshReader |
( |
const FilePath & |
file_name | ) |
|
Construct the GMSH format reader from given filename. This opens the file for reading.
Definition at line 38 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 48 of file msh_gmshreader.cc.
GmshMeshReader::~GmshMeshReader |
( |
| ) |
|
GmshMeshReader::DECLARE_EXCEPTION |
( |
ExcWrongFormat |
, |
|
|
<< "Wrong format of "<< EI_Type::val<< " |
, |
|
|
"<< EI_TokenizerMsg::val<< "\n"<< "in the input file:"<< EI_GMSHFile::qval |
|
|
) |
| |
GmshMeshReader::DECLARE_EXCEPTION |
( |
ExcMissingSection |
, |
|
|
<< "Missing section "<< EI_Section::qval<< " in the GMSH input file: "<< EI_GMSHFile::qval |
|
|
) |
| |
GmshMeshReader::DECLARE_EXCEPTION |
( |
ExcUnsupportedType |
, |
|
|
<< "Element "<< EI_ElementId::val<< "in the GMSH input file "<< EI_GMSHFile::qval<< " is of the unsupported type "<< EI_ElementType::val |
|
|
) |
| |
GmshMeshReader::DECLARE_INPUT_EXCEPTION |
( |
ExcFieldNameNotFound |
, |
|
|
<< "No data for field: "<< EI_FieldName::qval<< " and time: "<< EI_Time::val<< " in the input file: "<< EI_GMSHFile::qval |
|
|
) |
| |
GMSH_DataHeader & GmshMeshReader::find_header |
( |
double |
time, |
|
|
std::string |
field_name |
|
) |
| |
|
private |
Finds GMSH data header for ElementData given by time and field_name and return it as the first parameter.
Definition at line 418 of file msh_gmshreader.cc.
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 294 of file msh_gmshreader.cc.
void GmshMeshReader::make_header_table |
( |
| ) |
|
|
private |
Reads table of ElementData headers from the tokenizer file.
Definition at line 391 of file msh_gmshreader.cc.
Reads the header from the tokenizer tok
and return it as the second parameter.
Definition at line 237 of file msh_gmshreader.cc.
void GmshMeshReader::read_elements |
( |
Mesh * |
mesh | ) |
|
|
private |
Method for reading of elements. Input of the mesh allows changing regions within the input CON file.
Definition at line 106 of file msh_gmshreader.cc.
void GmshMeshReader::read_mesh |
( |
Mesh * |
mesh | ) |
|
Reads mesh
from the GMSH file. Input of the mesh allows changing regions within the input CON file.
Definition at line 63 of file msh_gmshreader.cc.
void GmshMeshReader::read_nodes |
( |
Mesh * |
mesh | ) |
|
|
private |
void GmshMeshReader::read_physical_names |
( |
Mesh * |
mesh | ) |
|
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 207 of file msh_gmshreader.cc.
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_FieldName |
, |
|
|
std::string |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_GMSHFile |
, |
|
|
std::string |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_Time |
, |
|
|
double |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_Type |
, |
|
|
std::string |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_TokenizerMsg |
, |
|
|
std::string |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_Section |
, |
|
|
std::string |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_ElementId |
, |
|
|
int |
|
|
) |
| |
GmshMeshReader::TYPEDEF_ERR_INFO |
( |
EI_ElementType |
, |
|
|
int |
|
|
) |
| |
Tokenizer GmshMeshReader::tok_ |
|
private |
Tokenizer used for reading ASCII GMSH file format.
Definition at line 182 of file msh_gmshreader.h.
The documentation for this class was generated from the following files: