OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
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 <string>
15#include <utility>
16#include <vector>
17#include "OPALTypes.h"
18
19class ElementBase;
20
21class MeshData {
22public:
23 std::vector<Vector_t<double, 3>> vertices_m;
24 std::vector<Vector<unsigned int, 3>> triangles_m;
25 std::vector<std::pair<Vector_t<double, 3>, Vector_t<double, 3>>> decorations_m;
26 int type_m;
27};
28
30public:
32
33 void add(const ElementBase& element);
34
35 void write(const std::string& fname);
36
37private:
39
40 static MeshData getCylinder(
41 double length, double minor, double major, double formFactor,
42 const unsigned int numSegments = 36);
43
44 static MeshData getBox(double length, double width, double height, double formFactor);
45
46 std::vector<MeshData> elements_m;
47};
48
49#endif
ippl::Vector< T, Dim > Vector_t
std::vector< Vector_t< double, 3 > > vertices_m
std::vector< std::pair< Vector_t< double, 3 >, Vector_t< double, 3 > > > decorations_m
std::vector< Vector< unsigned int, 3 > > triangles_m
void add(const ElementBase &element)
static MeshData getBox(double length, double width, double height, double formFactor)
std::vector< MeshData > elements_m
void write(const std::string &fname)
static MeshData getCylinder(double length, double minor, double major, double formFactor, const unsigned int numSegments=36)