Loading...
Searching...
No Matches
surfunstructured.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#ifndef __BITPIT_SURFUNSTRUCTURED_HPP__
26#define __BITPIT_SURFUNSTRUCTURED_HPP__
27
28#include <array>
29#include <vector>
30
31#include "bitpit_patchkernel.hpp"
32#include "bitpit_lineunstructured.hpp"
33
34namespace bitpit {
35
37
38public:
40
41 // Constructors
42#if BITPIT_ENABLE_MPI==1
43 SurfUnstructured(MPI_Comm communicator, std::size_t haloSize = 1);
44 SurfUnstructured(int dimension, MPI_Comm communicator, std::size_t haloSize = 1);
45 SurfUnstructured(int id, int dimension, MPI_Comm communicator, std::size_t haloSize = 1);
46 SurfUnstructured(std::istream &stream, MPI_Comm communicator, std::size_t haloSize = 1);
47#else
49 SurfUnstructured(int dimension);
50 SurfUnstructured(int id, int dimension);
51 SurfUnstructured(std::istream &stream);
52#endif
53
54 // Clone
55 std::unique_ptr<PatchKernel> clone() const override;
56
57 // Setters
59
60 // Search algorithms
61 long locatePoint(const std::array<double, 3> &point) const override;
62
63 // Evaluations
65
66 // I/O routines
67 int importSTL(const std::string &filename, int PIDOffset = 0, bool PIDSquash = false);
68 int importSTL(const std::string &filename, bool isBinary, int PIDOffset = 0, bool PIDSquash = false, std::unordered_map<int, std::string> *PIDNames = nullptr);
69 int importSTL(const std::string &filename, STLReader::Format format, bool joinFactes, int PIDOffset = 0, bool PIDSquash = false, std::unordered_map<int, std::string> *PIDNames = nullptr);
70 int exportSTL(const std::string &filename, bool isBinary);
71 int exportSTL(const std::string &filename, bool isBinary, bool isMulti, std::unordered_map<int, std::string> *PIDNames = nullptr);
72 int importDGF(const std::string &filename, int PIDOffset = 0, bool PIDSquash = false);
73 int importDGF(const std::string &filename, bool joinFactes, int PIDOffset = 0, bool PIDSquash = false);
74 int exportDGF(const std::string &filename);
75
76protected:
77 int _getDumpVersion() const override;
78 void _dump(std::ostream &stream) const override;
79 void _restore(std::istream &stream) override;
80
81 static ElementType getDGFFacetType(int nFacetVertices);
82
83 int exportSTLSingle(const std::string &name, bool isBinary);
84 int exportSTLMulti(const std::string &name, std::unordered_map<int, std::string> *PIDNames = nullptr);
85
86};
87
88}
89
90#endif
The LineUnstructured class defines an unstructured line tasselation.
void setExpert(bool expert)
long locatePoint(double x, double y, double z) const
The SurfUnstructured class defines an unstructured surface triangulation.
void _dump(std::ostream &stream) const override
int importDGF(const std::string &filename, int PIDOffset=0, bool PIDSquash=false)
SurfUnstructured(MPI_Comm communicator, std::size_t haloSize=1)
void extractEdgeNetwork(LineUnstructured &net)
int exportSTL(const std::string &filename, bool isBinary)
long locatePoint(const std::array< double, 3 > &point) const override
std::unique_ptr< PatchKernel > clone() const override
int _getDumpVersion() const override
int importSTL(const std::string &filename, int PIDOffset=0, bool PIDSquash=false)
void _restore(std::istream &stream) override
int exportSTLSingle(const std::string &name, bool isBinary)
static ElementType getDGFFacetType(int nFacetVertices)
int exportSTLMulti(const std::string &name, std::unordered_map< int, std::string > *PIDNames=nullptr)
int exportDGF(const std::string &filename)
The SurfaceKernel class provides an interface for defining surface patches.
--- layout: doxygen_footer ---