Skip to content
Snippets Groups Projects
Commit ab699046 authored by Bastian Telgen's avatar Bastian Telgen
Browse files

Merge ae108-meshing/main into '132-merge-ae108-meshing-into-ae108'

parent 6a0fe0d6
No related branches found
No related tags found
No related merge requests found
Pipeline #167914 failed
Showing
with 832 additions and 0 deletions
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#include "ae108/meshing/cppgmsh/write_file.h"
#include <gmsh.h>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
void write_file(const std::string &fname) noexcept { gmsh::write(fname); }
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <set>
#include <vector>
namespace ae108 {
namespace meshing {
template <class SizeType_, class ValueType_, SizeType_ Dimension_>
struct BoundaryRepresentation {
using Point = std::array<ValueType_, Dimension_>;
/**
* @brief The position per vertex.
*/
using Vertices = std::vector<Point>;
/**
* @brief Indicies of two vertices that form an edge.
*/
using Edge = std::array<SizeType_, 2>;
/**
* @brief Vector of all edges.
*/
using Edges = std::vector<Edge>;
/**
* @brief Edges that enclose a face.
*/
using Faces = std::vector<std::vector<SizeType_>>;
/**
* @brief Returns the dimension.
*/
static constexpr SizeType_ dimension() noexcept { return Dimension_; }
/**
* @brief Returns all vertices of an edge.
*/
std::vector<Point> vertices_of_edge(SizeType_ edge) const noexcept {
std::vector<Point> edge_vertices;
for (const auto &vertex : edges[edge])
edge_vertices.push_back(vertices[vertex]);
return edge_vertices;
};
/**
* @brief Returns all vertices of a face.
*/
std::vector<Point> vertices_of_face(SizeType_ index) const noexcept {
std::set<SizeType_> face_vertex_indices;
for (const auto &edge : faces[index])
for (const auto &vertex : edges[edge])
face_vertex_indices.insert(vertex);
std::vector<Point> face_vertices;
face_vertices.reserve(face_vertex_indices.size());
for (const auto &vertex_index : face_vertex_indices)
face_vertices.push_back(vertices[vertex_index]);
return face_vertices;
};
Vertices vertices;
Edges edges;
Faces faces;
};
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
namespace ae108 {
namespace meshing {
template <class Point> struct BoundingBox {
Point min;
Point max;
};
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include "ae108/meshing/BoundingBox.h"
#include <cassert>
#include <vector>
namespace ae108 {
namespace meshing {
/**
* @brief Returns the bounding box of points
*
* @param points A vector of points.
*/
template <class Point>
BoundingBox<Point> bounding_box_of(const std::vector<Point> &points) noexcept {
assert(points.size());
Point min(points[0]);
Point max(points[0]);
for (const auto &point : points)
for (std::size_t i = 0; i < point.size(); i++) {
min[i] = std::min(point[i], min[i]);
max[i] = std::max(point[i], max[i]);
}
return {min, max};
}
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <vector>
namespace ae108 {
namespace meshing {
/**
* @brief Returns a vector of points that is spanned by a set of discrete
* translations around the origin. It is also known as Bravais lattice.
*
* In 3D, each point is defined by
*
* R = n1 x a1 + n2 x a2 + n3 x a3,
*
* where ai is a translation vector and ni assumes any of the integers in set.
*
* @param translations An array containing the translation vectors.
* @param origin Location of the origin.
* @param set A set of integer permutations
* @note https://en.wikipedia.org/wiki/Bravais_lattice
*/
template <std::size_t Dimension>
std::vector<std::array<double, Dimension>> construct_periodic_point_cloud(
const std::array<std::array<double, Dimension>, Dimension> &translations,
std::array<double, Dimension> origin,
std::vector<double> set = {-1, 0, 1}) noexcept;
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <vector>
namespace ae108 {
namespace meshing {
/**
* @brief Constructs a d-dimensional rectilinear grid based on the (non-)uniform
* input coordinates. Returns points and edges.
*
* @param coordinates d sets of coordinates that span the grid.
* @note https://en.wikipedia.org/wiki/Regular_grid
*/
template <std::size_t Dimension>
std::tuple<std::vector<std::array<double, Dimension>>,
std::vector<std::array<std::size_t, 2>>>
construct_rectilinear_grid(
const std::array<std::vector<double>, Dimension> &coordinates) noexcept;
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include "ae108/meshing/BoundaryRepresentation.h"
namespace ae108 {
namespace meshing {
/**
* @brief Returns the boundary representation of the Voronoi cell spanned by a
* point cloud around the origin. The Voronoi cell is defined as the locus of
* all points closer to the origin than to any other point in the point cloud.
*
* @param point_cloud A vector of points, a.k.a. sites, forming the point cloud.
* @param periodic_faces A vector containing all periodic face pairs.
* @note https://en.wikipedia.org/wiki/Voronoi_diagram
*/
template <class SizeType, class ValueType, SizeType Dimension>
BoundaryRepresentation<SizeType, ValueType, Dimension> construct_voronoi_cell(
const std::vector<std::array<ValueType, Dimension>> &point_cloud,
std::vector<std::pair<SizeType, SizeType>> *periodic_faces =
nullptr) noexcept;
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <memory>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
class Context {
public:
/**
* @brief Initializes Gmsh. Gmsh is finalized automatically when the
* instance of Context is destroyed.
*
* @param argc `argc` as provided to main().
* @param argv `argv` as provided to main().
* @param readConfigFiles Option to read config file.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L63
*/
explicit Context(int const argc, char **const argv,
const bool readConfigFiles = true,
const bool verbose = false);
private:
/**
* @brief Initializes Gmsh.
*/
static void initialize(int const argc, char **const argv,
const bool readConfigFiles, const bool verbose);
/**
* @brief Finalizes Gmsh.
*/
static void finalize(void *);
using Token = std::unique_ptr<Context, decltype(&finalize)>;
Token token_;
};
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
template <std::size_t Dimension> struct Node {
using Index = std::size_t;
using Position = std::array<double, Dimension>;
Index id;
Position position;
bool operator<(const Node<Dimension> &another) const {
return id < another.id;
}
bool operator==(const Node<Dimension> &another) const {
return id == another.id;
}
};
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Returns affine transform (16 entries of a 4x4 matrix, by row) based on
* translation.
*
* @param translation The translation.
*/
std::array<double, 16>
as_affine_transform(const std::array<double, 3> &translation) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Constructs a parallelepipedic box using gmsh. Returns the entity.
*
* @param origin Position of the box origin
* @param side_lengths Side lengths of x-, y-, and z-side.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2398
*/
std::pair<int, int>
construct_box(const std::array<double, 3> origin,
const std::array<double, 3> side_lengths) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Constructs cylinders of differing radius from each segment using gmsh.
* Returns the entity.
*
* @param nodes Node positions.
* @param connectivity Nodal connectivity of each segment.
* @param radii Radii of all segments.
* @param capped Option to add a cap on each cylinder end.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2414
*/
std::vector<std::pair<int, int>>
construct_cylinders(const std::vector<std::array<double, 3>> &nodes,
const std::vector<std::array<std::size_t, 2>> &connectivity,
const std::vector<double> &radii,
const bool capped = true) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include "ae108/meshing/BoundaryRepresentation.h"
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Constructs a solid polyhedron from a BoundaryRepresentation using
* gmsh. Returns the gmsh entity.
*
* @param brep A boundary representation containing the polyhedron.
*
*/
template <class SizeType, class ValueType>
std::pair<int, int> construct_polyhedron(
const BoundaryRepresentation<SizeType, ValueType, 3> &brep) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Constructs a rectangle, with lower left corner at {x, y, z} and
* upper right corner at {x+dx,y+dy,z}. Returns the gmsh entity.
*
* @param origin Position of the rectangle origin {x,y,z}.
* @param side_lengths Side lengths: {dx,dy}, {dy,dz} or {dx,dz}, according to
* plane.
* @param rounded_radius If > 0 the corners are rounded.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2229
*/
std::pair<int, int>
construct_rectangle(const std::array<double, 3> origin,
const std::array<double, 2> side_lengths,
const double rounded_radius = 0.) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2022 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Copies the given entities and returns the copies.
*
* @param entities Original entities.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2729
*/
std::vector<std::pair<int, int>>
copy_entities(const std::vector<std::pair<int, int>> &entities) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <map>
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Extract mesh from Gmsh.
*
* @param element_dimension dimension of the elements of interest.
*/
template <std::size_t coordinate_dimension>
std::tuple<std::vector<std::array<double, coordinate_dimension>>,
std::vector<std::vector<std::size_t>>,
std::map<std::size_t, std::size_t>,
std::map<std::size_t, std::size_t>>
extract_mesh(
const std::size_t element_dimension = coordinate_dimension) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2022 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Extrudes the given entities along a translation vector. Returns the
* extruded entities.
* @param entities Entities to extrude_entities.
* @param translation Extrusion vector.
* @param extrude_mesh If true, the mesh of the base area of the extruded bodies
* will be extruded as well, i.e. the same layer of 3D elements will be repeated
* several times. Otherwise, The bodies are meshed as general 3D bodies.
* @param number_of_layers Number of element layers (if extrude_mesh is true).
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2514
*/
std::vector<std::pair<int, int>>
extrude_entities(const std::vector<std::pair<int, int>> &entities,
const std::array<double, 3> &translation,
const bool extrude_mesh = false,
const int number_of_layers = 1) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <array>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Extrudes the surface entity from origin to target.
*
* @param surface_tag Tag of the surface defining the cross-section in xy-plane.
* @param from Position of the origin.
* @param to Position of the target.
* @param surface_normal Normal of the surface.
*/
std::pair<int, int> extrude_surface(
const int surface_tag, const std::array<double, 3> &from,
const std::array<double, 3> &to,
const std::array<double, 3> &surface_normal = {{0, 0, 1}}) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2022 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Fuses the given entities, while keeping/creating a separate entity for
* each boolean fragment. All interfaces among the fragments are made conformal.
*
* @param entities Separate entities.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2651
*/
std::vector<std::pair<int, int>>
fragment_entities(const std::vector<std::pair<int, int>> &entities) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2021 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Returns vector of fused entities.
*
* @param entities Seperate entities.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2600
*/
std::vector<std::pair<int, int>>
fuse_entities(const std::vector<std::pair<int, int>> &entities) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment