OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
MeshGenerator.h
Go to the documentation of this file.
1 //
2 // Mesh Generator
3 //
4 // Copyright (c) 2008-2020
5 // Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved.
7 //
8 // OPAL is licensed under GNU GPL version 3.
9 //
10 
11 #ifndef MESHGENERATOR_H_
12 #define MESHGENERATOR_H_
13 
14 #include "Algorithms/Vektor.h"
15 
16 #include <string>
17 #include <utility>
18 #include <vector>
19 
20 class ElementBase;
21 
22 class MeshData {
23 public:
24  std::vector<Vector_t> vertices_m;
25  std::vector<Vektor<unsigned int, 3> > triangles_m;
26  std::vector<std::pair<Vector_t, Vector_t> > decorations_m;
27  int type_m;
28 };
29 
30 
32 public:
33  MeshGenerator();
34 
35  void add(const ElementBase &element);
36 
37  void write(const std::string &fname);
38 private:
39  enum MeshType {OTHER = 0
46  };
47 
48  static MeshData getCylinder(double length,
49  double minor,
50  double major,
51  double formFactor,
52  const unsigned int numSegments = 36);
53 
54  static MeshData getBox(double length,
55  double width,
56  double height,
57  double formFactor);
58 
59 
60  std::vector<MeshData> elements_m;
61 };
62 
63 #endif
std::vector< std::pair< Vector_t, Vector_t > > decorations_m
Definition: MeshGenerator.h:26
std::vector< Vektor< unsigned int, 3 > > triangles_m
Definition: MeshGenerator.h:25
std::vector< Vector_t > vertices_m
Definition: MeshGenerator.h:24
void add(const ElementBase &element)
static MeshData getBox(double length, double width, double height, double formFactor)
std::vector< MeshData > elements_m
Definition: MeshGenerator.h:60
void write(const std::string &fname)
static MeshData getCylinder(double length, double minor, double major, double formFactor, const unsigned int numSegments=36)