Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
mesh_2d.hpp File Reference
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <limits>
#include <map>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include <Eigen/Dense>
#include <vtkCell.h>
#include <vtkCellArray.h>
#include <vtkIdList.h>
#include <vtkNew.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkPolyDataReader.h>
#include <vtkPolygon.h>
#include <vtkPolyhedron.h>
#include <vtkSmartPointer.h>
#include <vtkType.h>
#include <vtkUnstructuredGrid.h>
#include <vtkXMLUnstructuredGridReader.h>
#include <vtkXMLUnstructuredGridWriter.h>
#include "vulpes/datastructure/crs_map.hpp"
#include "vulpes/datastructure/kdtree.hpp"
#include "vulpes/geometry/mesh/mesh_base.hpp"
#include "vulpes/utils/profiler.hpp"
Include dependency graph for mesh_2d.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vulpes::geometry::Mesh2D< FloatType, IndexType >
 A class for a 2D mesh, inheriting from MeshBase. More...

Namespaces

namespace  vulpes
namespace  vulpes::geometry
namespace  vulpes::geometry::mesh2d
namespace  vulpes::geometry::mesh2d::internal

Functions

template<typename FloatType, typename IndexType>
std::array< std::vector< FloatType >, 2 > vulpes::geometry::mesh2d::internal::buildCartesianBbox (const Mesh2D< FloatType, IndexType > &mesh, IndexType n_cells_x, FloatType stretch)
 Builds a 2D Cartesian grid that encloses a given mesh.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::intersectCartesianGrid (const Mesh2D< FloatType, IndexType > &mesh, const std::array< std::vector< FloatType >, 2 > &grids, FloatType agglomeration_threshold=0.25)
 Creates a new mesh by intersecting an existing mesh with a Cartesian grid.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::intersectCartesianGrid (const Mesh2D< FloatType, IndexType > &mesh, IndexType n_cells_x, FloatType stretch=1, FloatType agglomeration_threshold=0.25)
 Creates a new mesh by intersecting an existing mesh with a Cartesian grid.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::mergeMeshes (const Mesh2D< FloatType, IndexType > &mesh_a, const Mesh2D< FloatType, IndexType > &mesh_b, FloatType atol=0.0, FloatType rtol=1e-4)
 Merges two separate meshes into a single mesh.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::read (const std::string &filename, bool check_vtxs_unique=true, bool add_tags=true)
 Reads a mesh from a .vtk or .vtu file and creates a Mesh2D object.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::rectangle (const Point< FloatType, 2 > &corner_a, const Point< FloatType, 2 > &corner_b, const Point< IndexType, 2 > &n_divisions, bool tria_elements=false)
 Creates a simple rectangular mesh.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::rectangle_periodic (const Point< FloatType, 2 > &corner_a, const Point< FloatType, 2 > &corner_b, const Point< IndexType, 2 > &n_divisions, bool tria_elements=false, bool x_periodic=true, bool y_periodic=true)
 Creates a rectangular mesh and directly annotates it as periodic.
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::collapseEdges (const Mesh2D< FloatType, IndexType > &mesh, FloatType edge_collapse_tol)
 Remove edges smaller than a given tolerance.
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::intersectCartesianGrid< double, int32_t > (const Mesh2D< double, int32_t > &, const std::array< std::vector< double >, 2 > &, double)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::mergeMeshes< double, int32_t > (const Mesh2D< double, int32_t > &, const Mesh2D< double, int32_t > &, double, double)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::collapseEdges (const Mesh2D< double, int32_t > &, double)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::read< double, int32_t > (const std::string &, bool, bool)
template Mesh2D< double, uint32_t > vulpes::geometry::mesh2d::read< double, uint32_t > (const std::string &, bool, bool)
template Mesh2D< double, int64_t > vulpes::geometry::mesh2d::read< double, int64_t > (const std::string &, bool, bool)
template Mesh2D< double, uint64_t > vulpes::geometry::mesh2d::read< double, uint64_t > (const std::string &, bool, bool)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::rectangle< double, int32_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< int32_t, 2 > &, bool)
template Mesh2D< double, uint32_t > vulpes::geometry::mesh2d::rectangle< double, uint32_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< uint32_t, 2 > &, bool)
template Mesh2D< double, int64_t > vulpes::geometry::mesh2d::rectangle< double, int64_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< int64_t, 2 > &, bool)
template Mesh2D< double, uint64_t > vulpes::geometry::mesh2d::rectangle< double, uint64_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< uint64_t, 2 > &, bool)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::rectangle_periodic< double, int32_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< int32_t, 2 > &, bool, bool, bool)
template Mesh2D< double, uint32_t > vulpes::geometry::mesh2d::rectangle_periodic< double, uint32_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< uint32_t, 2 > &, bool, bool, bool)
template Mesh2D< double, int64_t > vulpes::geometry::mesh2d::rectangle_periodic< double, int64_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< int64_t, 2 > &, bool, bool, bool)
template Mesh2D< double, uint64_t > vulpes::geometry::mesh2d::rectangle_periodic< double, uint64_t > (const Point< double, 2 > &, const Point< double, 2 > &, const Point< uint64_t, 2 > &, bool, bool, bool)
template<typename FloatType, typename IndexType>
bool vulpes::geometry::mesh2d::isPeriodic (const Mesh2D< FloatType, IndexType > &mesh)
template bool vulpes::geometry::mesh2d::isPeriodic< double, int32_t > (const Mesh2D< double, int32_t > &)
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::closePeriodicTopology (const Mesh2D< FloatType, IndexType > &mesh)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::closePeriodicTopology< double, int32_t > (const Mesh2D< double, int32_t > &)
template<typename FloatType, typename IndexType>
Mesh2D< FloatType, IndexType > vulpes::geometry::mesh2d::openPeriodicTopology (const Mesh2D< FloatType, IndexType > &mesh)
template Mesh2D< double, int32_t > vulpes::geometry::mesh2d::openPeriodicTopology< double, int32_t > (const Mesh2D< double, int32_t > &)
template<typename FloatType, typename IndexType>
std::vector< Point< FloatType, 2 > > vulpes::geometry::mesh2d::getCellVertexesPeriodic (const Mesh2D< FloatType, IndexType > &mesh, IndexType cell_id)
template std::vector< Point< double, 2 > > vulpes::geometry::mesh2d::getCellVertexesPeriodic< double, int32_t > (const Mesh2D< double, int32_t > &, int32_t)