Skip to content

Commit

Permalink
Renamed found_meshtype_atomistic to found_meshtype_lattice
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz committed Sep 5, 2021
1 parent 9b3ddcc commit 6c1308b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/detail/atomistic_keywords.hpp
Expand Up @@ -37,8 +37,8 @@ namespace keywords
static void apply( const Input& in, ovf_file & f, ovf_segment & segment)
{
segment.meshtype = strdup(in.string().c_str());
f._state->found_meshtype_atomistic = true;
f._state->found_meshtype = true;
f._state->found_meshtype_lattice = true;
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/detail/parse_rules.hpp
Expand Up @@ -465,7 +465,7 @@ namespace parse
if( !file._state->found_meshtype )
missing_keywords.push_back("meshtype");

if( std::string(segment.meshtype) == "rectangular" || (file.ovf_extension_format == OVF_EXTENSION_FORMAT_AOVF_COMP && file._state->found_meshtype_atomistic) )
if( std::string(segment.meshtype) == "rectangular" || (file.ovf_extension_format == OVF_EXTENSION_FORMAT_AOVF_COMP && file._state->found_meshtype_lattice) )
{
segment.N = segment.n_cells[0] * segment.n_cells[1] * segment.n_cells[2];
if( !file._state->found_xbase )
Expand Down Expand Up @@ -517,7 +517,7 @@ namespace parse
wrong_keywords.push_back("pointcount");
}

if( std::string(segment.meshtype) == "lattice" || file._state->found_meshtype_atomistic )
if( std::string(segment.meshtype) == "lattice" || file._state->found_meshtype_lattice )
{
segment.N = segment.n_cells[0] * segment.n_cells[1] * segment.n_cells[2] * segment.ncellpoints;
if( !file._state->found_anodes )
Expand Down
11 changes: 9 additions & 2 deletions include/detail/pegtl_defines.hpp
Expand Up @@ -50,8 +50,15 @@ struct parser_state
bool found_cnodes = false;
bool found_basis = false;

// Needed to keep track of the current line when reading in the basis positions
bool found_meshtype_atomistic = false;
/*
We need and additional bool, because in the compatibiliby format, we can have:
# meshtype : rectangular
##% meshtype : lattice
So if the meshtype is rectangula, but found_meshtype_lattice is true we know the lattice meshtype was requested in the CAOVF format
*/
bool found_meshtype_lattice = false;

std::vector<std::array<float, 3>> _basis = std::vector<std::array<float, 3>>(0);
int _cur_basis_line = 0;

/*
Expand Down

0 comments on commit 6c1308b

Please sign in to comment.