PolyFEM
Loading...
Searching...
No Matches
MeshProcessing3D.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Mesh3DStorage.hpp"
4#include <iostream>
5#include <fstream>
6#include <array>
7
8namespace polyfem
9{
10 namespace mesh
11 {
12 namespace MeshProcessing3D
13 {
14#define Jacobian_Precision 1.e-7
15 const int hex_face_table[6][4] =
16 {
17 {0, 1, 2, 3},
18 {4, 7, 6, 5},
19 {0, 4, 5, 1},
20 {3, 2, 6, 7},
21 {0, 3, 7, 4},
22 {1, 5, 6, 2},
23 };
24 const int hex_tetra_table[8][4] =
25 {
26 {0, 3, 4, 1},
27 {1, 0, 5, 2},
28 {2, 1, 6, 3},
29 {3, 2, 7, 0},
30 {4, 7, 5, 0},
31 {5, 4, 6, 1},
32 {6, 5, 7, 2},
33 {7, 6, 4, 3},
34 };
35 const int tet_faces[4][3] = {
36 {1, 0, 2},
37 {3, 2, 0},
38 {1, 2, 3},
39 {0, 1, 3}};
40 const int tet_edges[6][2] = {
41 {0, 1},
42 {0, 2},
43 {0, 3},
44 {1, 2},
45 {1, 3},
46 {2, 3}};
47
51 double a_jacobian(Eigen::Vector3d &v0, Eigen::Vector3d &v1, Eigen::Vector3d &v2, Eigen::Vector3d &v3);
52
54 void refine_catmul_clark_polar(Mesh3DStorage &M, int iter, bool reverse, std::vector<int> &Parents);
56 // Mi is a planar surface mesh
57 void straight_sweeping(const Mesh3DStorage &Mi, int sweep_coord, double height, int nlayer, Mesh3DStorage &Mo);
58
61 void ele_subdivison_levels(const Mesh3DStorage &hmi, std::vector<int> &Ls);
62
63 // template<typename T>
64 void set_intersection_own(const std::vector<uint32_t> &A, const std::vector<uint32_t> &B, std::array<uint32_t, 2> &C, int &num);
65 } // namespace MeshProcessing3D
66 } // namespace mesh
67} // namespace polyfem
void reorder_hex_mesh_propogation(Mesh3DStorage &hmi)
void global_orientation_hexes(Mesh3DStorage &hmi)
double a_jacobian(Eigen::Vector3d &v0, Eigen::Vector3d &v1, Eigen::Vector3d &v2, Eigen::Vector3d &v3)
void set_intersection_own(const std::vector< uint32_t > &A, const std::vector< uint32_t > &B, std::array< uint32_t, 2 > &C, int &num)
void refine_red_refinement_tet(Mesh3DStorage &M, int iter)
void straight_sweeping(const Mesh3DStorage &Mi, int sweep_coord, double height, int nlayer, Mesh3DStorage &Mo)
void orient_surface_mesh(Mesh3DStorage &hmi)
void build_connectivity(Mesh3DStorage &hmi)
void orient_volume_mesh(Mesh3DStorage &hmi)
void ele_subdivison_levels(const Mesh3DStorage &hmi, std::vector< int > &Ls)
bool scaled_jacobian(Mesh3DStorage &hmi, Mesh_Quality &mq)
void refine_catmul_clark_polar(Mesh3DStorage &M, int iter, bool reverse, std::vector< int > &Parents)