|
Wildmeshing Toolkit
|
Classes | |
| struct | ExportStruct |
| struct | TriangleInsertionLocalInfoCache |
| struct | VertexExtras |
| tetwild's per-vertex additions to the shared VertexAttributes. More... | |
Public Types | |
| using | TetAttCol = wmtk::AttributeCollection< TetAttributes > |
Public Types inherited from wmtk::TetOptimizerMesh | |
| using | FaceAttributes = wmtk::SurfaceTagAttributes |
| using | VertAttCol = AttributeCollection< VertexAttributes > |
| using | FaceAttCol = AttributeCollection< FaceAttributes > |
| using | SurfaceTopoSignature = wmtk::utils::SurfaceTopoSignature |
Public Types inherited from wmtk::TetMesh | |
| enum class | OpKind : int { split , collapse , swap_32 , swap_44 , swap_56 , swap_face , COUNT } |
| enum class | OpEvent : int { attempt , before_hook , link_condition , no_return_tet , duplicate_tet , topology , valence , boundary , exists , no_case_allowed , no_better_case , out_of_slots , after_hook , invariants , committed , COUNT } |
| template<typename T > | |
| using | vector = std::vector< T > |
| using | VertexMutex = wmtk::threading::VertexMutex |
Public Member Functions | |
| double | cell_quality (const size_t tid) const override |
The quality of cell tid, and how to write it. | |
| void | set_cell_quality (const size_t tid, const double q) override |
| bool | allow_surface_swap () const override |
| bool | check_surface_topology () const override |
| void | split_after_vertex (const size_t vid, const bool is_open_boundary) override |
| Application metadata not represented by the shared vertex attributes. | |
| bool | collapse_before_vertex (size_t v1, size_t v2, double edge_length) override |
| bool | collapse_is_order_2_edge (const std::array< size_t, 2 > &e) override |
| bool | collapse_after_connectivity (size_t v1, size_t v2, const std::vector< std::array< size_t, 2 > > &) override |
| void | collapse_after_vertex (size_t, size_t v2) override |
| std::shared_ptr< SampleEnvelope > | smoothing_energy_envelope (const size_t vid) const override |
| Envelope a vertex is pulled toward while smoothing. | |
| TetWildMesh (Parameters &_m_params, std::shared_ptr< SampleEnvelope > _m_envelope, int _num_threads=1) | |
| void | create_mesh_attributes (const std::vector< VertexAttributes > &_vertex_attribute, const std::vector< TetAttributes > &_tet_attribute) |
| void | output_mesh (std::string file) |
| void | init_from_delaunay_box_mesh (const std::vector< Eigen::Vector3d > &vertices) |
| bool | is_vertex_on_boundary (const size_t vid) |
| void | mesh_improvement_legacy (int max_its=80) |
| Call the original TetWild code. | |
| Eigen::MatrixXd | tet_barycenters (const std::vector< Tuple > &tets) const |
| Compute the winding number. | |
| void | compute_winding_number (const std::vector< Tuple > &tets, const Eigen::MatrixXd &barycenters, const std::vector< Vector3d > &vertices={}, const std::vector< std::array< size_t, 3 > > &faces={}) |
| void | compute_winding_numbers (const std::vector< std::string > &input_paths, const std::vector< Tuple > &tets, const Eigen::MatrixXd &barycenters, const std::vector< Vector3d > &in_vertices={}, const std::vector< std::array< size_t, 3 > > &in_faces={}) |
| void | filter_with_input_surface_winding_number () |
| void | filter_with_tracked_surface_winding_number () |
| void | filter_with_flood_fill () |
| void | insertion_by_volumeremesher (const std::vector< Vector3d > &vertices, const std::vector< std::array< size_t, 3 > > &faces, std::vector< Vector3r > &v_rational, std::vector< std::array< size_t, 3 > > &facets_after, std::vector< bool > &is_v_on_input, std::vector< std::array< size_t, 4 > > &tets_after, std::vector< bool > &tet_face_on_input_surface) |
| Conformally insert the input surface into a background tet mesh, via the exact arrangement (vol_rem::embed_tri_in_poly_mesh). | |
| void | init_from_Volumeremesher (const std::vector< Vector3r > &v_rational, const std::vector< std::array< size_t, 3 > > &facets, const std::vector< bool > &is_v_on_input, const std::vector< std::array< size_t, 4 > > &tets, const std::vector< bool > &tet_face_on_input_surface) |
| void | init_from_file (std::string input_dir) |
| size_t | refine_sizing_around_worst (double max_energy) override |
| Escape a stuck max energy by refining the sizing field around the worst elements. | |
| void | find_open_boundary () |
| bool | is_open_boundary_edge (const Tuple &e) override |
| bool | is_open_boundary_edge (const std::array< size_t, 2 > &e) |
| void | init_vertex_order () |
| Compute the vertex order for every vertex. | |
| int | flood_fill () |
| void | save_paraview (const std::string &path, const bool use_hdf5) |
| void | write_optimization_debug_output (const std::string &path) override |
| void | optimization_sanity_checks_extra () override |
| void | init_sizing_field () |
| ExportStruct | export_mesh_data () const |
Public Member Functions inherited from wmtk::TetOptimizerMesh | |
| bool | is_force_split_edge (const size_t v1, const size_t v2) const |
| TetOptimizerMesh (OptimizerParameters ¶ms, std::shared_ptr< SampleEnvelope > env) | |
| virtual double | quality_rel (const size_t tid) const |
| A cell's quality relative to the quality it is required to reach; <= 1 means it meets it. | |
| void | compute_vertex_partition () |
| void | compute_vertex_partition_morton () |
| size_t | get_partition_id (const Tuple &loc) const |
| double | get_length2 (const Tuple &l) const |
| bool | is_inverted (const std::array< size_t, 4 > &vs) const |
| bool | is_inverted (const Tuple &loc) const |
| bool | is_inverted_f (const Tuple &loc) const |
| Inversion check using only the double positions. | |
| double | get_quality (const std::array< size_t, 4 > &vs) const |
| double | get_quality (const Tuple &loc) const |
| std::tuple< double, double > | get_max_avg_energy () |
| virtual void | update_attributes () |
| Update the attributes of the mesh after an iteration of operations. | |
| void | mesh_improvement (int max_its=80) |
| std::tuple< double, double > | local_operations (const std::array< int, 4 > &ops, bool collapse_limit_length=true) |
| bool | round (const Tuple &v) |
| Round a vertex position to floating point, if that inverts no incident tet. | |
| bool | is_edge_on_surface (const Tuple &loc) |
| bool | is_edge_on_bbox (const Tuple &loc) |
| int | edge_incident_surface_face_count (const Tuple &e) |
How many of the faces incident to edge e are on the tracked surface. | |
| virtual std::shared_ptr< SampleEnvelope > | surface_envelope_for_face (const std::array< size_t, 3 > &vids) const |
Envelope the tracked-surface triangle vids must stay inside. | |
| bool | surface_triangle_is_outside (const size_t a, const size_t b, const size_t c) const |
| bool | vertex_is_on_surface (const size_t vid) const override |
| Is a vertex part of the substructure. | |
| bool | face_is_on_surface (const size_t fid) const override |
| Is a face part of the substructure. | |
| size_t | get_order_of_vertex (const size_t vid) const override |
| Get the order of a vertex. | |
| std::vector< std::array< size_t, 3 > > | get_faces_by_condition (std::function< bool(const FaceAttributes &)> cond) const |
| void | output_faces (std::string file, std::function< bool(const FaceAttributes &)> cond) |
| void | gradation_smooth_sizing (double grade, const std::vector< size_t > &seeds) |
| Grade the refined sizing region into its surroundings (monotone, only lowers). | |
| double | active_quality_threshold () const |
| Cell-quality threshold above which a tet is "active" (worth operating on) for the skip-good-regions filter. | |
| virtual std::vector< size_t > | active_vertices () const |
| void | split_all_edges () |
| bool | split_edge_before (const Tuple &t) override |
| User specified preparations and desideratas for an edge split before changing the connectivity. | |
| bool | split_edge_after (const Tuple &loc) override |
| This function computes the attributes for the added simplices. User specified modifications and desideratas for after an edge split. | |
| void | collapse_all_edges (bool is_limit_length=true) |
| bool | collapse_edge_before (const Tuple &t) override |
| User specified preparations and desideratas for an edge collapse before changing the connectivity. | |
| bool | collapse_edge_after (const Tuple &t) override |
| User specified modifications and desideratas for after an edge collapse. | |
| size_t | coarsen_mesh () |
| Coarsen the mesh without letting the max energy rise. | |
| bool | coarsen_collapse_edge (const Tuple &e, std::vector< Tuple > &new_tets) |
| One collapse under the coarsening rules, outside a coarsening pass. | |
| size_t | swap_all_edges_32 () |
| bool | swap_edge_before (const Tuple &t) override |
| User specified preparations and desideratas for an 3-2 edge swap before changing the conenctivity. | |
| bool | swap_edge_after (const Tuple &t) override |
| User specified modifications and desideratas for after a 3-2 edge swap. | |
| size_t | swap_all_edges_44 () |
| bool | swap_edge_44_before (const Tuple &t) override |
| User specified preparations and desideratas for an 4-4 edge swap before changing the connectivity. | |
| bool | swap_edge_44_accept_case (const std::array< size_t, 2 > &new_edge) override |
| Filter which of the 4-4 orientations may be chosen. | |
| bool | swap_edge_44_after (const Tuple &t) override |
| User specified modifications and desideratas for after a 4-4 edge swap. | |
| size_t | swap_all_edges_56 () |
| bool | swap_edge_56_before (const Tuple &t) override |
| User specified preparations and desideratas for a 5-6 edge swap before changing the connectivity. | |
| bool | swap_edge_56_accept_case (const std::array< size_t, 3 > &new_face) override |
| Filter which of the 5-6 orientations may be chosen. | |
| bool | swap_edge_56_after (const Tuple &t) override |
| User specified modifications and desideratas for after a 5-6 edge swap. | |
| size_t | swap_all_faces () |
| bool | swap_face_before (const Tuple &t) override |
| User specified preparations and desideratas for an 2-3 face swap befroe changing the geometry. | |
| bool | swap_face_after (const Tuple &t) override |
| User specified modifications and desideratas for after a 2-3 face swap. | |
| size_t | swap_all_edges_all () |
| bool | prepare_surface_flip (const Tuple &t, const std::vector< size_t > &incident_tets) |
| SurfaceTopoSignature | surface_topology_signature () const |
| void | warn_if_surface_topology_changed (const SurfaceTopoSignature &before, const char *where) const |
| double | swap_edge_44_energy (const std::vector< std::array< size_t, 4 > > &tets, const int op_case) override |
| User specified energy to decide which of the 4 possible orientations should be chosen. | |
| double | swap_edge_56_energy (const std::vector< std::array< size_t, 4 > > &tets, const int op_case) override |
| User specified energy to decide which of the 5 possible orientations should be chosen. | |
| virtual std::shared_ptr< SampleEnvelope > | smoothing_containment_envelope (const size_t vid) const |
| Envelope the resulting surface triangles are checked against. | |
| virtual std::shared_ptr< polysolve::nonlinear::Problem > | smoothing_extra_energy (const size_t) const |
| An extra term the application adds to this vertex's smoothing objective, or null. | |
| bool | smooth_before (const Tuple &t) override |
| User specified preparations and desideratas for smoothing a vertex. | |
| bool | smooth_after (const Tuple &t) override |
| User specified modifications and desideratas for after smoothing a vertex. | |
| void | smooth_all_vertices (const size_t n_iters=1) |
| virtual void | log_smoothing_pass_accounting () |
| bool | invariants (const std::vector< Tuple > &t) override |
Public Member Functions inherited from wmtk::TetMesh | |
| size_t | vert_capacity () const |
| get the current largest global vid | |
| size_t | tet_capacity () const |
| get the current largest global tid | |
| size_t | vertex_size () const |
| get the number of unremoved verticies | |
| size_t | tet_size () const |
| get the number of unremoved tets | |
| void | init (size_t n_vertices, const std::vector< std::array< size_t, 4 > > &tets) |
| void | init_with_isolated_vertices (size_t n_vertices, const std::vector< std::array< size_t, 4 > > &tets) |
| void | init (const MatrixXi &T) |
| Generate the connectivity of the mesh from an IGL-style T matrix. | |
| bool | split_edge (const Tuple &t, std::vector< Tuple > &new_tets) |
| virtual bool | collapse_edge (const Tuple &t, std::vector< Tuple > &new_tets) |
| bool | link_condition (const Tuple &t) |
| bool | collapse_edge_conn (const Tuple &loc0, size_t &v1_id, Tuple &new_loc, std::map< size_t, wmtk::TetMesh::VertexConnectivity > &rollback_vert_conn, std::vector< size_t > &n1_t_ids_copy, std::vector< size_t > &new_tet_id, std::vector< TetrahedronConnectivity > &old_tets) |
| bool | collapse_edge_check_topology (const std::vector< size_t > &new_tet_id) |
| Check topology after collapse connectivity change. This is a sanity check and should not be necessary. | |
| void | collapse_edge_rollback (size_t &v1_id, std::map< size_t, wmtk::TetMesh::VertexConnectivity > &rollback_vert_conn, std::vector< size_t > &n1_t_ids, std::vector< size_t > &new_tet_id, std::vector< TetrahedronConnectivity > &old_tets) |
| bool | swap_edge_56 (const Tuple &t, std::vector< Tuple > &new_tets) |
| bool | swap_edge_44 (const Tuple &t, std::vector< Tuple > &new_tets) |
| bool | swap_edge (const Tuple &t, std::vector< Tuple > &new_tets) |
| 3-2 edge swap | |
| bool | swap_face (const Tuple &t, std::vector< Tuple > &new_tets) |
| 2-3 face swap | |
| bool | smooth_vertex (const Tuple &t) |
| bool | split_tet (const Tuple &t, std::vector< Tuple > &new_tets) |
| Split a tet in 4 tets. | |
| bool | split_face (const Tuple &t, std::vector< Tuple > &new_tets) |
| Split a face in 3 faces. | |
| void | triangle_insertion (const std::vector< Tuple > &intersected_tets, const std::vector< Tuple > &intersected_edges, std::vector< size_t > &new_edge_vids, std::vector< size_t > &new_center_vids, std::vector< std::array< size_t, 4 > > ¢er_split_tets) |
| Insert a triangle into a tetmesh, with known intersection information. | |
| bool | insert_point (const Tuple &t, std::vector< Tuple > &new_tets) |
| Insert a point into a tetmesh inside a tet. In general position, this split a tet into 4. In face position, split two tets. In edge position, In point position, do nothing. | |
| virtual bool | insert_point_before (const Tuple &t) |
| virtual bool | insert_point_after (std::vector< Tuple > &new_tets) |
| void | consolidate_mesh () |
| cleans up the deleted vertices or tetrahedra, fixes the corresponding indices, and reset the version number. WARNING: it invalidates all tuples! | |
| std::vector< Tuple > | get_edges () const |
| std::vector< Tuple > | get_faces () const |
| std::vector< Tuple > | get_vertices () const |
| std::vector< Tuple > | get_tets () const |
| virtual void | for_each_face (const std::function< void(const TetMesh::Tuple &)> &) |
| looping through all the unique edges and perform the given function | |
| void | set_preallocation_factor (double factor) |
| Preallocation factor: init/consolidate reserve capacity = max(floor, ceil(factor * live_count)) so operations can grab fresh slots without resizing the storage. When a pass exhausts the reserved capacity the affected operations fail (and are retried later after a consolidate). Tune per application (e.g. from JSON); values < 1 are clamped to 1. | |
| double | preallocation_factor () const |
| bool | slots_exhausted () const |
| void | clear_slots_exhausted () |
| size_t | request_tet_slots (size_t n) |
| size_t | request_vert_slots (size_t n) |
| void | ensure_free_tet_capacity (size_t extra) |
| void | ensure_free_vert_capacity (size_t extra) |
| bool | op_refused (const OpKind k, const OpEvent e) const |
op_event() for a refusal, returning false so a site reads return op_refused(...). | |
| Tuple | tuple_from_edge (size_t tid, int local_eid) const |
| get a Tuple from global tetra index and local edge index (from 0-5). | |
| Tuple | tuple_from_edge (const std::array< size_t, 2 > &vids) const |
| get a Tuple from global vids of the 2 end of an edge | |
| Tuple | tuple_from_face (size_t tid, int local_fid) const |
| get a Tuple from global tetra index and local face index (from 0-3). | |
| std::tuple< Tuple, size_t > | tuple_from_face (const std::array< size_t, 3 > &vids) const |
| get a Tuple and the global face index from global vertex index of the face. | |
| std::optional< std::tuple< Tuple, size_t > > | try_tuple_from_face (const std::array< size_t, 3 > &vids) const |
| tuple_from_face for callers where a missing face is an answer, not a bug. | |
| size_t | lowest_common_tet (size_t v0_id, size_t v1_id, size_t v2_id) const |
| Lowest tet id incident to all three vertices, or size_t(-1) if there is none. | |
| size_t | vertex_valence (const size_t vid) const |
| Number of tets incident to a vertex, in O(1). | |
| std::tuple< Tuple, size_t > | tuple_from_face (const simplex::Face &f) const |
| Tuple | tuple_from_vertex (size_t vid) const |
| get a Tuple from global vertex index | |
| Tuple | tuple_from_tet (size_t tid) const |
| get a Tuple from global tetra index | |
| Tuple | tuple_from_vids (size_t vid0, size_t vid1, size_t vid2, size_t vid3) const |
| Get a Tuple from global vertex IDs. | |
| simplex::Tet | simplex_from_tet (const Tuple &t) const |
| simplex::Tet | simplex_from_tet (const size_t tid) const |
| simplex::Face | simplex_from_face (const Tuple &t) const |
| simplex::Edge | simplex_from_edge (const Tuple &t) const |
| Tuple | switch_vertex (const Tuple &t) const |
| wrapper function from Tuple::switch_vertex | |
| Tuple | switch_edge (const Tuple &t) const |
| wrapper function from Tuple::switch_edge | |
| Tuple | switch_face (const Tuple &t) const |
| wrapper function from Tuple::switch_face | |
| std::optional< Tuple > | switch_tetrahedron (const Tuple &t) const |
| wrapper function from Tuple::switch_tetrahedron | |
| std::vector< Tuple > | get_one_ring_tets_for_vertex (const Tuple &t) const |
| Get the one ring tets for a vertex. | |
| const std::vector< size_t > & | get_one_ring_tids_for_vertex (const Tuple &t) const |
| Get the one ring tids for vertex. | |
| const std::vector< size_t > & | get_one_ring_tids_for_vertex (const size_t vid) const |
| std::vector< Tuple > | get_one_ring_vertices_for_vertex (const Tuple &t) const |
| Get the one ring vertices for a vertex. | |
| std::vector< size_t > | get_one_ring_vids_for_vertex (size_t vid, std::vector< size_t > &cache) |
| Get the one ring vids for vertex. | |
| std::vector< size_t > | get_one_ring_vids_for_vertex (size_t vid) const |
| Get the one ring vids for vertex. | |
| std::vector< size_t > | get_one_ring_vids_for_vertex_adj (size_t vid) const |
| Duplicate of the function TetMesh::get_one_ring_vids_for_vertex. | |
| std::vector< size_t > | get_one_ring_vids_for_vertex_adj (size_t vid, std::vector< size_t > &cache) |
| Duplicate of the function TetMesh::get_one_ring_vids_for_vertex. | |
| std::vector< Tuple > | get_incident_tets_for_edge (const Tuple &t) const |
| Get the incident tets for edge. | |
| std::vector< Tuple > | get_incident_tets_for_edge (const size_t vid0, const size_t vid1) const |
| std::vector< size_t > | get_incident_tids_for_edge (const Tuple &t) const |
| std::vector< size_t > | get_incident_tids_for_edge (const size_t vid0, const size_t vid1) const |
| std::vector< Tuple > | get_one_ring_tets_for_edge (const Tuple &t) const |
| Get the one ring tets for edge. | |
| std::vector< std::array< size_t, 3 > > | vertex_adjacent_boundary_faces (const Tuple &t) const |
| std::array< Tuple, 4 > | oriented_tet_vertices (const Tuple &t) const |
| std::array< size_t, 4 > | oriented_tet_vids (const Tuple &t) const |
| std::array< size_t, 4 > | oriented_tet_vids (const size_t tid) const |
| std::array< Tuple, 3 > | get_face_vertices (const Tuple &t) const |
| Get the 3 vertices of a face represented by Tuple. | |
| std::array< size_t, 3 > | get_face_vids (const Tuple &t) const |
| std::array< Tuple, 6 > | tet_edges (const Tuple &t) const |
| get the 6 edges of a tet represented by Tuples | |
| void | check_tuple_validity (const Tuple &t) const |
| bool | check_mesh_connectivity_validity () const |
| checks the validity of the connectivity of the mesh. Including the validity of each Tuple | |
| void | remove_tets_by_ids (const std::vector< size_t > &tids) |
| remove the tetrahedrons in the mesh that have given tet ids | |
| void | start_protect_attributes () |
| void | release_protect_attributes () |
| void | rollback_protected_attributes () |
| int | release_vertex_mutex_in_stack () |
| int | release_vertex_mutex_to (size_t mark) |
Release the mutexes taken since the release stack held mark entries. | |
| bool | try_set_vertex_mutex_n_ring (const Tuple &v, int threadid, int n) |
Lock every vertex within graph distance n of v, the seed included. | |
| bool | try_set_vertex_mutex_n_ring (size_t vid, int threadid, int n) |
| bool | try_set_edge_mutex_n_ring (const Tuple &e, int threadid, int n) |
| try_set_vertex_mutex_n_ring seeded from both ends of an edge. | |
| bool | try_set_face_mutex_n_ring (size_t v1, size_t v2, size_t v3, int threadid, int n) |
| try_set_vertex_mutex_n_ring seeded from the three vertices of a face. | |
| void | for_each_edge (const std::function< void(const TetMesh::Tuple &)> &) |
| perform the given function for each edge | |
| void | for_each_vertex (const std::function< void(const TetMesh::Tuple &)> &) |
| perform the given function for each vertex | |
| void | for_each_tetra (const std::function< void(const TetMesh::Tuple &)> &) |
| perform the given function for each tet | |
| simplex::SimplexCollection | get_surface_faces_for_vertex (const size_t vid) const |
| Get all faces on the surface that are incident to vid. | |
| simplex::SimplexCollection | get_surface_faces_for_edge (const std::array< size_t, 2 > &vids) const |
| Get all faces on the surface that are incident to the edge. | |
| size_t | get_num_surface_faces_for_edge (const std::array< size_t, 2 > &vids) const |
| Get the number of surface faces incident to the edge. | |
| size_t | compute_vertex_order (const size_t vid) const |
| Compute the vertex order for a single vertex. | |
| size_t | get_order_of_edge (const std::array< size_t, 2 > &vids) const |
| Compute the order of an edge. | |
| bool | substructure_link_condition (const Tuple &e_tuple) const |
| Link condition that also considers substructures. | |
| size_t | tet_storage_capacity () const |
| size_t | vert_storage_capacity () const |
| bool | try_set_vertex_mutex_two_ring (const Tuple &v, int threadid) |
| Lock v's one-ring and, partially, its two-ring. See the note above. | |
| bool | try_set_vertex_mutex_two_ring_vid (const Tuple &v, int threadid) |
| try_set_vertex_mutex_two_ring reached through vids rather than Tuples. | |
| bool | try_set_vertex_mutex_two_ring_vid (size_t v, int threadid) |
| try_set_vertex_mutex_two_ring reached through vids rather than Tuples. | |
| bool | try_set_edge_mutex_two_ring (const Tuple &e, int threadid=0) |
| Lock the edge's one-ring and, partially, its two-ring. See the note above. | |
| bool | try_set_face_mutex_two_ring (const Tuple &f, int threadid=0) |
| Lock the face's one-ring and, partially, its two-ring. See the note above. | |
| bool | try_set_face_mutex_two_ring (const Tuple &v1, const Tuple &v2, const Tuple &v3, int threadid=0) |
| Lock the face's one-ring and, partially, its two-ring. See the note above. | |
| bool | try_set_face_mutex_two_ring (size_t v1, size_t v2, size_t v3, int threadid=0) |
| Lock the face's one-ring and, partially, its two-ring. See the note above. | |
| bool | try_set_vertex_mutex_one_ring (const Tuple &v, int threadid=0) |
| Lock v and its one-ring. Complete, unlike the two-ring family. | |
| size_t | cell_capacity () const |
| Tuple | tuple_from_cell (size_t cid) const |
Public Member Functions inherited from wmtk::RationalPositions | |
| size_t | round_all_vertices () |
| Try to round every un-rounded vertex; returns the number reclaimed. | |
| bool | round_and_check_all_rounded () |
| Run the sweep, then report whether the mesh is now fully rounded. | |
Public Attributes | |
| wmtk::AttributeCollection< VertexExtras > | m_vertex_extra |
| Parameters & | m_tet_params |
| std::shared_ptr< SampleEnvelope > | m_order2_envelope |
| std::vector< std::string > | m_input_names |
| TetAttCol | m_tet_attribute |
| std::atomic< int > | cnt_split = 0 |
| std::atomic< int > | cnt_collapse = 0 |
Public Attributes inherited from wmtk::TetOptimizerMesh | |
| VertAttCol | m_vertex_attribute |
| FaceAttCol | m_face_attribute |
| AttributeContainerGroup | m_vertex_attr_group |
| What p_vertex_attrs points at, so a derived class can register more. | |
| AttributeContainerGroup | m_face_attr_group |
| What p_face_attrs points at, so a derived class can register more. | |
| OptimizerParameters & | m_params |
| std::shared_ptr< SampleEnvelope > | m_envelope |
| Surface envelope: what a surface vertex is pulled toward and checked against. | |
| double | m_s_amips = 1. |
| double | m_s_envelope = -1. |
| double | time_env = 0.0 |
| igl::Timer | isout_timer |
| wmtk::threading::enumerable_thread_specific< std::unique_ptr< polysolve::nonlinear::Solver > > | m_solver |
| Per-thread Newton solver for smoothing; created on first use. | |
| optimization::SmoothRejectCounters | m_smooth_rejects |
| Why smoothing attempts were refused, reported once per pass. | |
| optimization::NewtonCounters | m_newton |
| bool | m_collapse_limit_length = true |
| std::set< simplex::Edge > | m_force_split_edges |
| size_t | m_force_split_count = 0 |
| Force-splits taken in the current split pass. Diagnostic only. | |
| std::unique_ptr< std::atomic< int >[]> | m_high_valence_claim |
| Per-pass claims for the shared high-valence split gate. | |
| size_t | m_high_valence_claim_size = 0 |
| std::atomic< size_t > | m_high_valence_rejects = 0 |
| int | m_iterations_used = 0 |
| Shared TetWild/SimWild outer optimization schedule. | |
| int | m_debug_print_counter = 0 |
| std::string | m_debug_pass_name |
| CoarsenStats | m_coarsen_stats |
| std::atomic< int > | cnt_swap = 0 |
| std::atomic< int > | cnt_surface_swap = 0 |
| std::atomic< int > | cnt_surface_swap_32 = 0 |
| std::atomic< int > | cnt_surface_swap_44 = 0 |
| std::atomic< int > | cnt_surface_swap_56 = 0 |
Public Attributes inherited from wmtk::TetMesh | |
| AbstractAttributeContainer * | p_vertex_attrs = nullptr |
| AbstractAttributeContainer * | p_edge_attrs = nullptr |
| AbstractAttributeContainer * | p_face_attrs = nullptr |
| AbstractAttributeContainer * | p_tet_attrs = nullptr |
| bool | m_collapse_check_link_condition = true |
| bool | m_collapse_check_topology = false |
| bool | m_collapse_check_manifold = true |
| wmtk::threading::enumerable_thread_specific< std::vector< size_t > > | mutex_release_stack |
| wmtk::threading::enumerable_thread_specific< std::vector< size_t > > | get_one_ring_cache |
| int | NUM_THREADS = 0 |
Private Attributes | |
| wmtk::threading::concurrent_map< std::array< size_t, 3 >, std::vector< int > > | tet_face_tags |
| wmtk::threading::enumerable_thread_specific< TriangleInsertionLocalInfoCache > | triangle_insertion_local_cache |
Additional Inherited Members | |
Static Public Attributes inherited from wmtk::TetOptimizerMesh | |
| static constexpr double | MAX_ENERGY = 1e50 |
| The sentinel get_quality returns for an element AMIPS cannot score. | |
Static Public Attributes inherited from wmtk::TetMesh | |
| static constexpr int | EDGES_PER_CELL = 6 |
| static constexpr int | FACES_PER_CELL = 4 |
Protected Types inherited from wmtk::TetOptimizerMesh | |
| enum class | SwapReject : int { base_before , base_after , valence , bbox , surface_not_allowed , prepare_flip , interior_hook , flip_open_boundary , flip_not_two_surf , flip_nonmanifold_edge , flip_cd_nonmanifold , flip_new_face_surface , flip_app_refused , flip_wrong_case , app_capture_label , app_capture_tag , app_fid_missing , app_class_mismatch , app_mask_mismatch , app_sag_raised , after_inverted , after_quality , after_cells , app_after_side_conflict , app_after_no_side , after_envelope , face_tracked_surface , face_tracked_bbox , face_inverted , face_not_better , COUNT } |
| enum class | SwapStage : int { attempt , surface_attempt , before_pass , after_enter , accepted , COUNT } |
| enum class | CollapseReject : int { coarsen_length , bbox , surface_leaves_envelope , inverted , quality , substructure_link , app_both_surfaces , app_front_unlimited , app_leaves_input , app_leaves_offset , app_leaves_region , app_order2 , app_substructure_link , app_ops_guard , after_base , after_connectivity , after_envelope , after_face_attribute , after_coarsen_region , COUNT } |
| enum class | SwapRejectRole { before_leaf , after_leaf , wrapper , per_case } |
Protected Member Functions inherited from wmtk::TetOptimizerMesh | |
| std::vector< size_t > | all_vertex_ids () const override |
| Every live vertex, in the mesh's own iteration order. | |
| bool | vertex_is_rounded (const size_t vid) const override |
| Whether this vertex's double position is currently trusted. | |
| bool | round_vertex (const size_t vid) override |
| virtual std::tuple< double, double > | optimization_quality_stats () |
| virtual double | optimization_stop_metric () const |
| virtual bool | optimization_bare_coarsen_passes () const |
| Whether the loop opens with an UNLIMITED-LENGTH collapse pass. | |
| virtual bool | optimization_stop_at_float () const |
| virtual bool | optimization_stalled (double prev, double cur) |
Whether an iteration that moved the metric from prev to cur is stalled, and the sizing refinement should therefore fire. | |
| virtual bool | collapse_quality_allowed (size_t v1, double quality, double ring_max) const |
| virtual bool | split_before_cells (const Tuple &, const std::vector< Tuple > &) |
| Cache application cell data before a split. TetWild needs none; SimWild caches tags. | |
| virtual bool | split_after_cells (size_t, size_t, size_t, const std::vector< Tuple > &) |
| Restore application cell data on the children made by a split. | |
| virtual bool | split_adjust_position (size_t, const std::vector< Tuple > &) |
| virtual bool | swap_before_interior (const std::vector< size_t > &) |
| Application data attached to the old cells. TetWild has none; SimWild caches tags. | |
| virtual bool | swap_before_surface (const std::vector< size_t > &, size_t, size_t, size_t, size_t) |
| virtual bool | swap_after_cells (const std::vector< size_t > &, bool) |
| Propagate application data to the cells made by a successful topological swap. | |
| bool | swap_reject (SwapReject r) const |
| bool | swap_reject_kind_only (SwapReject r) const |
| void | swap_stage (SwapStage s) const |
| void | swap_counters_reset () |
| std::string | swap_reject_report () const |
| One line per nonzero counter, for a per-turn log. Does not reset. | |
| bool | collapse_reject (CollapseReject r) const |
| void | op_event (OpKind k, OpEvent e) const override |
| std::string | op_accounting_report (OpKind k) const |
| bool | op_accounting_unexplained (OpKind k) const |
True when the report for k has a nonzero remainder: a refusal no counter named. | |
| void | op_accounting_reset () |
| OpHookReasons | op_hook_reasons (OpKind k) const |
| long | op_event_count (const OpKind k, const OpEvent e) const |
| long | op_unaccounted (OpKind k) const |
| Attempts minus every outcome: 0 unless an exit of the TetMesh operation reports nothing. | |
| virtual bool | swap_quality_allowed (double after, double before, bool) const |
Protected Member Functions inherited from wmtk::TetMesh | |
| virtual bool | triangle_insertion_before (const std::vector< Tuple > &faces) |
| virtual bool | triangle_insertion_after (const std::vector< std::vector< Tuple > > &) |
| virtual bool | split_face_before (const Tuple &t) |
| User specified preparations and desideratas for a face split before changing the connectivity. | |
| virtual bool | split_face_after (const Tuple &t) |
| Compute the attributes for the added simplices. | |
| virtual bool | split_tet_before (const Tuple &t) |
| User specified preparations and desideratas for a tet split before changing the connectivity. | |
| virtual bool | split_tet_after (const Tuple &t) |
| Compute the attributes for the added simplices. | |
| void | resize_vertex_mutex (size_t v) |
Static Protected Member Functions inherited from wmtk::TetOptimizerMesh | |
| static const char * | swap_reject_name (SwapReject r) |
| static const char * | swap_stage_name (SwapStage s) |
| static const char * | collapse_reject_name (CollapseReject r) |
| static OpKind & | current_op_kind () |
| static const char * | op_kind_name (OpKind k) |
| static const char * | op_event_name (OpEvent e) |
| static SwapRejectRole | swap_reject_role (SwapReject r) |
Protected Attributes inherited from wmtk::TetOptimizerMesh | |
| uint32_t | m_op_epoch = 0 |
| std::array< std::atomic< long >, size_t(SwapReject::COUNT)> | m_swap_reject {} |
| std::array< std::atomic< long >, size_t(SwapStage::COUNT)> | m_swap_stage {} |
| std::array< std::atomic< long >, size_t(CollapseReject::COUNT)> | m_collapse_reject {} |
| std::array< std::array< std::atomic< long >, size_t(OpEvent::COUNT)>, size_t(OpKind::COUNT)> | m_op_events {} |
| std::array< std::array< std::atomic< long >, size_t(SwapReject::COUNT)>, size_t(OpKind::COUNT)+1 > | m_swap_reject_by_kind {} |
| wmtk::threading::enumerable_thread_specific< SwapInfoCache > | swap_cache |
| wmtk::threading::enumerable_thread_specific< SplitInfoCache > | split_cache |
| wmtk::threading::enumerable_thread_specific< CollapseInfoCache > | collapse_cache |
| bool | m_coarsen_mode = false |
| Set for the duration of coarsen_mesh(); read-only while a pass is running. | |
Protected Attributes inherited from wmtk::RationalPositions | |
| std::atomic< bool > | m_all_rounded = false |
| True when every vertex is known to be rounded. | |
|
inlineoverridevirtual |
Implements wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
The quality of cell tid, and how to write it.
The cell attribute types differ between the applications, so the base reaches the one field it shares through these. Both are AMIPS^3; see MAX_ENERGY. Topological operations and smoothing use the accessors so the shared algorithms remain independent of each application's cell-attribute type.
Implements wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Implements wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Reimplemented from wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Reimplemented from wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Non-const: an override may cache what it measured before the collapse so its after counterpart can tell a regression from a defect that was already there.
Reimplemented from wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Reimplemented from wmtk::TetOptimizerMesh.
| void wmtk::components::tetwild::TetWildMesh::init_from_delaunay_box_mesh | ( | const std::vector< Eigen::Vector3d > & | vertices | ) |
points for delaunay
| void wmtk::components::tetwild::TetWildMesh::insertion_by_volumeremesher | ( | const std::vector< Vector3d > & | vertices, |
| const std::vector< std::array< size_t, 3 > > & | faces, | ||
| std::vector< Vector3r > & | v_rational, | ||
| std::vector< std::array< size_t, 3 > > & | facets_after, | ||
| std::vector< bool > & | is_v_on_input, | ||
| std::vector< std::array< size_t, 4 > > & | tets_after, | ||
| std::vector< bool > & | tet_face_on_input_surface | ||
| ) |
Conformally insert the input surface into a background tet mesh, via the exact arrangement (vol_rem::embed_tri_in_poly_mesh).
This is the insertion path. See the banner in VolumemesherInsertion.cpp.
|
overridevirtual |
tetwild's surface is the input mesh, which may be non-watertight, so the base's "no open boundary" default does not hold here. See TetOptimizerMesh.
Reimplemented from wmtk::TetOptimizerMesh.
| bool wmtk::components::tetwild::TetWildMesh::is_vertex_on_boundary | ( | const size_t | vid | ) |
brief Check if the vertex has an incident boundary edge. This performs a topological check.
| void wmtk::components::tetwild::TetWildMesh::mesh_improvement_legacy | ( | int | max_its = 80 | ) |
Call the original TetWild code.
This is a bit ugly but we need to assign all bbox faces and edges a unique ID
|
overridevirtual |
Reimplemented from wmtk::TetOptimizerMesh.
|
overridevirtual |
Escape a stuck max energy by refining the sizing field around the worst elements.
Finds the m_params.stuck_refine_num_worst tets with the highest energy, gathers all vertices within m_params.stuck_refine_rings graph rings of them, and multiplies each such vertex's m_sizing_scalar by m_params.stuck_refine_factor (clamped at m_params.stuck_refine_min_scalar). Then runs gradation_smooth_sizing so the refined region blends smoothly into the surrounding resolution. Replaces the old global adjust_sizing_field mechanism. Returns the number of vertices refined.
Implements wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Implements wmtk::TetOptimizerMesh.
|
overridevirtual |
Envelope a vertex is pulled toward while smoothing.
Implements wmtk::TetOptimizerMesh.
|
inlineoverridevirtual |
Application metadata not represented by the shared vertex attributes.
Reimplemented from wmtk::TetOptimizerMesh.
| Eigen::MatrixXd wmtk::components::tetwild::TetWildMesh::tet_barycenters | ( | const std::vector< Tuple > & | tets | ) | const |
Compute the winding number.
If vertices and faces are empty, compute the winding number for the tracked surface. Otherwise, compute the winding number for the input surface given by vertices and faces.
Barycenter (row per tet) of each tet in tets. Computed once and passed to the winding-number passes so they do not each rebuild it.
|
inlineoverridevirtual |
Implements wmtk::TetOptimizerMesh.
| std::vector<std::string> wmtk::components::tetwild::TetWildMesh::m_input_names |
Optional per-input names (JSON "input_names"), used to label the per-input winding-number output fields. Empty => the fields are numbered.
| std::shared_ptr<SampleEnvelope> wmtk::components::tetwild::TetWildMesh::m_order2_envelope |
Envelope for order-2 vertices, i.e. those on a surface boundary or a non-manifold edge. Named for the order rather than for "open boundary" because that is what TetMesh::compute_vertex_order actually reports, and it is the broader set.
| Parameters& wmtk::components::tetwild::TetWildMesh::m_tet_params |
The base holds only wmtk::OptimizerParameters; this is the same object, typed, for the tetwild-only fields.