| 1 |
/************************************************************************* |
| 2 |
* 2022 Tóth János * |
| 3 |
* * |
| 4 |
* This program is free software; it is licensed under the terms of the * |
| 5 |
* GNU General Public License v2 or later. See file LICENSE for details. * |
| 6 |
*************************************************************************/ |
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include "Parser.hpp" |
| 11 |
|
| 12 |
#include <vector> |
| 13 |
|
| 14 |
namespace yade { |
| 15 |
namespace ymport { |
| 16 |
namespace foamfile { |
| 17 |
|
| 18 |
class BoundaryParser final : public Parser { |
| 19 |
public: |
| 20 |
struct Boundary { |
| 21 |
enum Type { UNKNOWN = 0, PATCH, WALL, EMPTY }; |
| 22 |
|
| 23 |
std::string name; |
| 24 |
Type type; |
| 25 |
int nFaces; |
| 26 |
int startFace; |
| 27 |
}; |
| 28 |
|
| 29 |
BoundaryParser(const boost::filesystem::path& path) |
| 30 |
: Parser(path, "polyBoundaryMesh", "boundary") |
| 31 |
{ |
| 32 |
} |
| 33 |
|
| 34 |
void parse() override; |
| 35 |
|
| 36 |
const std::vector<Boundary>& boundaries() const { return m_boundaries; } |
| 37 |
|
| 38 |
private: |
| 39 |
void readBoundary(); |
| 40 |
|
| 41 |
int m_boundariesToRead { 0 }; |
| 42 |
std::vector<Boundary> m_boundaries; |
| 43 |
}; |
| 44 |
|
| 45 |
} // namespace foamfile |
| 46 |
} // namespace ymport |
| 47 |
} // namespace yade |