Wildmeshing Toolkit
wmtk::utils Namespace Reference

Namespaces

 detail
 
 metaprogramming
 

Classes

class  DynamicArray
 
class  EigenMatrixWriter
 
class  Hashable
 
class  MerkleTreeInteriorNode
 
struct  mesh_type_from_primitive_type
 
struct  mesh_type_from_primitive_type< PrimitiveType::Vertex >
 
struct  mesh_type_from_primitive_type< PrimitiveType::Edge >
 
struct  mesh_type_from_primitive_type< PrimitiveType::Triangle >
 
struct  mesh_type_from_primitive_type< PrimitiveType::Tetrahedron >
 
struct  mesh_type_from_dimension
 
class  RandomSeedSingleton
 
class  StopWatch
 
class  TupleCellLessThan
 
class  TupleInspector
 

Typedefs

template<PrimitiveType pt>
using mesh_type_from_primitive_type_t = typename mesh_type_from_primitive_type< pt >::type
 
template<int8_t DIM>
using mesh_type_from_dimension_t = typename mesh_type_from_dimension< DIM >::type
 

Functions

template<typename T , int R, int C>
auto array_to_map (const T(&a)[R][C])
 
template<typename T , int R, int C>
auto array_to_map (T(&a)[R][C])
 
template<typename T , int R>
auto array_to_map (const T(&a)[R])
 
template<typename T , int R>
auto array_to_map (T(&a)[R])
 
template<typename T >
void cast_attribute (const wmtk::attribute::MeshAttributeHandle &original_handle, const wmtk::attribute::MeshAttributeHandle &new_handle)
 
template<typename T >
wmtk::attribute::MeshAttributeHandle cast_attribute (const wmtk::attribute::MeshAttributeHandle &original_handle, Mesh &m, const std::string &new_attribute_name)
 
bool segment_intersection_rational (const Vector2r &P1, const Vector2r &P2, const Vector2r &Q1, const Vector2r &Q2, Vector2r &intersection)
 
template<typename Base , typename Derived >
auto filter_pointers_to_derived (const std::vector< std::shared_ptr< Base >> &edges) -> std::vector< std::shared_ptr< Derived >>
 
nlohmann::json merkle_tree (const Hashable &hashable)
 
std::optional< nlohmann::jsonmerkle_tree_diff (const Hashable &a, const Hashable &b, bool detailed)
 
vol_rem::interval_number rational_to_interval (const Rational &r)
 
void exactinit ()
 
int wmtk_orient3d (const Eigen::Ref< const Eigen::Vector3< Rational >> &p0, const Eigen::Ref< const Eigen::Vector3< Rational >> &p1, const Eigen::Ref< const Eigen::Vector3< Rational >> &p2, const Eigen::Ref< const Eigen::Vector3< Rational >> &p3)
 
int wmtk_orient3d (const Eigen::Ref< const Eigen::Vector3< double >> &p0, const Eigen::Ref< const Eigen::Vector3< double >> &p1, const Eigen::Ref< const Eigen::Vector3< double >> &p2, const Eigen::Ref< const Eigen::Vector3< double >> &p3)
 
int wmtk_orient2d (double p0x, double p0y, double p1x, double p1y, double p2x, double p2y)
 
int wmtk_orient2d (const Eigen::Ref< const Eigen::Vector2< Rational >> &p0, const Eigen::Ref< const Eigen::Vector2< Rational >> &p1, const Eigen::Ref< const Eigen::Vector2< Rational >> &p2)
 
int wmtk_orient2d (const Eigen::Ref< const Eigen::Vector2< double >> &p0, const Eigen::Ref< const Eigen::Vector2< double >> &p1, const Eigen::Ref< const Eigen::Vector2< double >> &p2)
 
int wmtk_orient1d (const Rational &p0, const Rational &p1)
 
int wmtk_orient1d (double p0, double p1)
 
template<typename Derived >
int wmtk_orient3d (const Eigen::MatrixBase< Derived > &A)
 
std::vector< PrimitiveTypeprimitive_range (PrimitiveType pt0, PrimitiveType pt1)
 
std::vector< PrimitiveTypeprimitive_above (PrimitiveType pt, bool lower_to_upper)
 
std::vector< PrimitiveTypeprimitive_below (PrimitiveType pt, bool lower_to_upper)
 
template<PrimitiveType Start, PrimitiveType End>
auto primitive_range ()
 
template<PrimitiveType Start, bool LowerToUpper = true>
auto primitive_above ()
 
template<PrimitiveType End, bool LowerToUpper = true>
auto primitive_below ()
 
unsigned int get_random_seed ()
 
void set_random_seed (uint64_t val)
 
template<typename ADerived , typename BDerived , typename CDerived >
auto triangle_3d_area (const Eigen::MatrixBase< ADerived > &a, const Eigen::MatrixBase< BDerived > &b, const Eigen::MatrixBase< CDerived > &c) -> typename ADerived::Scalar
 
template<typename ADerived , typename BDerived , typename CDerived >
auto triangle_signed_2d_area (const Eigen::MatrixBase< ADerived > &a, const Eigen::MatrixBase< BDerived > &b, const Eigen::MatrixBase< CDerived > &c) -> typename ADerived::Scalar
 
template<typename ADerived , typename BDerived , typename CDerived >
auto triangle_unsigned_2d_area (const Eigen::MatrixBase< ADerived > &a, const Eigen::MatrixBase< BDerived > &b, const Eigen::MatrixBase< CDerived > &c) -> typename ADerived::Scalar
 
std::size_t vector_hash (const std::vector< size_t > &data)
 
std::size_t vector_hash (const std::vector< int64_t > &data)
 
std::size_t vector_hash (const std::vector< double > &data)
 
std::size_t vector_hash (const std::vector< char > &data)
 
std::size_t vector_hash (const std::vector< Rational > &data)
 
std::size_t vector_hash (const std::vector< std::size_t > &data)
 
std::tuple< std::shared_ptr< wmtk::TetMesh >, std::vector< std::array< bool, 4 > > > generate_raw_tetmesh_from_input_surface (const RowVectors3d &V, const RowVectors3l &F, const RowVectors3d &bgV, const RowVectors4l &bgT)
 input a triangle surface mesh, embed it into a background tet mesh, track the input surfaces on the tetmesh More...
 

Typedef Documentation

◆ mesh_type_from_dimension_t

template<int8_t DIM>
using wmtk::utils::mesh_type_from_dimension_t = typedef typename mesh_type_from_dimension<DIM>::type

Definition at line 55 of file mesh_type_from_primitive_type.hpp.

◆ mesh_type_from_primitive_type_t

template<PrimitiveType pt>
using wmtk::utils::mesh_type_from_primitive_type_t = typedef typename mesh_type_from_primitive_type<pt>::type

Definition at line 22 of file mesh_type_from_primitive_type.hpp.

Function Documentation

◆ array_to_map() [1/4]

template<typename T , int R>
auto wmtk::utils::array_to_map ( const T(&)  a[R])

Definition at line 16 of file array_to_map.hpp.

◆ array_to_map() [2/4]

template<typename T , int R, int C>
auto wmtk::utils::array_to_map ( const T(&)  a[R][C])

Definition at line 6 of file array_to_map.hpp.

Referenced by wmtk::autogen::edge_mesh::SimplexDart::valid_indices(), wmtk::autogen::tet_mesh::SimplexDart::valid_indices(), and wmtk::autogen::tri_mesh::SimplexDart::valid_indices().

Here is the caller graph for this function:

◆ array_to_map() [3/4]

template<typename T , int R>
auto wmtk::utils::array_to_map ( T(&)  a[R])

Definition at line 21 of file array_to_map.hpp.

◆ array_to_map() [4/4]

template<typename T , int R, int C>
auto wmtk::utils::array_to_map ( T(&)  a[R][C])

Definition at line 11 of file array_to_map.hpp.

◆ cast_attribute() [1/2]

template<typename T >
void wmtk::utils::cast_attribute ( const wmtk::attribute::MeshAttributeHandle original_handle,
const wmtk::attribute::MeshAttributeHandle new_handle 
)

Definition at line 8 of file cast_attribute.hpp.

References wmtk::attribute::MeshAttributeHandle::handle(), and wmtk::operations::AttributeTransferStrategyBase::run_on_all().

Here is the call graph for this function:

◆ cast_attribute() [2/2]

template<typename T >
wmtk::attribute::MeshAttributeHandle wmtk::utils::cast_attribute ( const wmtk::attribute::MeshAttributeHandle original_handle,
Mesh m,
const std::string &  new_attribute_name 
)

Definition at line 25 of file cast_attribute.hpp.

References wmtk::attribute::MeshAttributeHandle::dimension(), wmtk::attribute::MeshAttributeHandle::primitive_type(), and wmtk::Mesh::register_attribute().

Here is the call graph for this function:

◆ exactinit()

void wmtk::utils::exactinit ( )

Definition at line 28 of file orient.cpp.

Referenced by wmtk::io::MshReader::validate(), wmtk_orient2d(), and wmtk_orient3d().

Here is the caller graph for this function:

◆ filter_pointers_to_derived()

template<typename Base , typename Derived >
auto wmtk::utils::filter_pointers_to_derived ( const std::vector< std::shared_ptr< Base >> &  edges) -> std::vector<std::shared_ptr<Derived>>

Definition at line 10 of file filter_pointers_to_derived.hpp.

References wmtk::simplex::edges().

Here is the call graph for this function:

◆ generate_raw_tetmesh_from_input_surface()

std::tuple< std::shared_ptr< wmtk::TetMesh >, std::vector< std::array< bool, 4 > > > wmtk::utils::generate_raw_tetmesh_from_input_surface ( const RowVectors3d V,
const RowVectors3l F,
const RowVectors3d bgV,
const RowVectors4l bgT 
)

input a triangle surface mesh, embed it into a background tet mesh, track the input surfaces on the tetmesh

Parameters
Vinput vertex coordinates
Finput FV matrix
bgVinput background vertex coordinates
bgTinput background TV (tets) matrix
Returns
[tetmesh ptr, tet local faces on input surface]

Definition at line 25 of file VolumeRemesherTriangleInsertion.cpp.

References wmtk::logger(), wmtk::mesh_utils::set_matrix_attribute(), and wmtk::Vertex.

Referenced by wmtk::components::triangle_insertion::triangle_insertion().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_random_seed()

unsigned int wmtk::utils::get_random_seed ( )
inline

Definition at line 30 of file random_seed.hpp.

References wmtk::utils::RandomSeedSingleton::get_seed(), and wmtk::utils::RandomSeedSingleton::instance().

Referenced by wmtk::Scheduler::run_operation_on_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ merkle_tree()

nlohmann::json wmtk::utils::merkle_tree ( const Hashable hashable)

Definition at line 6 of file merkle_tree.cpp.

References wmtk::utils::Hashable::child_hashes().

Here is the call graph for this function:

◆ merkle_tree_diff()

std::optional< nlohmann::json > wmtk::utils::merkle_tree_diff ( const Hashable a,
const Hashable b,
bool  detailed 
)

Definition at line 81 of file merkle_tree_diff.cpp.

References wmtk::utils::Hashable::child_hashes(), and wmtk::utils::Hashable::hash().

Here is the call graph for this function:

◆ primitive_above() [1/2]

template<PrimitiveType Start, bool LowerToUpper = true>
auto wmtk::utils::primitive_above ( )

Definition at line 93 of file primitive_range_iter.hpp.

References wmtk::Tetrahedron.

◆ primitive_above() [2/2]

std::vector< PrimitiveType > wmtk::utils::primitive_above ( PrimitiveType  pt,
bool  lower_to_upper 
)

Definition at line 21 of file primitive_range.cpp.

References primitive_range(), and wmtk::Tetrahedron.

Here is the call graph for this function:

◆ primitive_below() [1/2]

template<PrimitiveType End, bool LowerToUpper = true>
auto wmtk::utils::primitive_below ( )

Definition at line 107 of file primitive_range_iter.hpp.

References wmtk::Vertex.

◆ primitive_below() [2/2]

std::vector< PrimitiveType > wmtk::utils::primitive_below ( PrimitiveType  pt,
bool  lower_to_upper 
)

Definition at line 29 of file primitive_range.cpp.

References primitive_range(), and wmtk::Vertex.

Referenced by wmtk::multimesh::utils::MapValidator::check_child_switch_homomorphism(), wmtk::components::internal::MultiMeshFromTag::compute_substructure_ids(), wmtk::components::internal::MultiMeshFromTag::compute_substructure_mesh(), wmtk::simplex::faces(), wmtk::components::gather_attributes(), wmtk::components::utils::get_attribute(), wmtk::components::multimesh::utils::detail::get_attribute(), and TEST_CASE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primitive_range() [1/2]

template<PrimitiveType Start, PrimitiveType End>
auto wmtk::utils::primitive_range ( )

Definition at line 84 of file primitive_range_iter.hpp.

◆ primitive_range() [2/2]

std::vector< PrimitiveType > wmtk::utils::primitive_range ( PrimitiveType  pt0,
PrimitiveType  pt1 
)

Definition at line 3 of file primitive_range.cpp.

References wmtk::get_primitive_type_from_id(), and wmtk::get_primitive_type_id().

Referenced by wmtk::simplex::cofaces_single_dimension_tuples(), wmtk::simplex::faces(), primitive_above(), primitive_below(), and wmtk::simplex::tuples_preserving_primitive_types().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rational_to_interval()

vol_rem::interval_number wmtk::utils::rational_to_interval ( const Rational r)

Definition at line 14 of file orient.cpp.

References wmtk::Rational::is_rounded(), and wmtk::Rational::to_double().

Referenced by wmtk_orient2d(), and wmtk_orient3d().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ segment_intersection_rational()

bool wmtk::utils::segment_intersection_rational ( const Vector2r P1,
const Vector2r P2,
const Vector2r Q1,
const Vector2r Q2,
Vector2r intersection 
)

Definition at line 5 of file edge_insertion.cpp.

References wmtk::Rational::get_sign().

Here is the call graph for this function:

◆ set_random_seed()

void wmtk::utils::set_random_seed ( uint64_t  val)
inline

Definition at line 35 of file random_seed.hpp.

References wmtk::utils::RandomSeedSingleton::instance(), and wmtk::utils::RandomSeedSingleton::set_seed().

Here is the call graph for this function:

◆ triangle_3d_area()

template<typename ADerived , typename BDerived , typename CDerived >
auto wmtk::utils::triangle_3d_area ( const Eigen::MatrixBase< ADerived > &  a,
const Eigen::MatrixBase< BDerived > &  b,
const Eigen::MatrixBase< CDerived > &  c 
) -> typename ADerived::Scalar

Definition at line 10 of file triangle_areas.hpp.

◆ triangle_signed_2d_area()

template<typename ADerived , typename BDerived , typename CDerived >
auto wmtk::utils::triangle_signed_2d_area ( const Eigen::MatrixBase< ADerived > &  a,
const Eigen::MatrixBase< BDerived > &  b,
const Eigen::MatrixBase< CDerived > &  c 
) -> typename ADerived::Scalar

Definition at line 22 of file triangle_areas.hpp.

◆ triangle_unsigned_2d_area()

template<typename ADerived , typename BDerived , typename CDerived >
auto wmtk::utils::triangle_unsigned_2d_area ( const Eigen::MatrixBase< ADerived > &  a,
const Eigen::MatrixBase< BDerived > &  b,
const Eigen::MatrixBase< CDerived > &  c 
) -> typename ADerived::Scalar

Definition at line 33 of file triangle_areas.hpp.

References wmtk::abs().

Here is the call graph for this function:

◆ vector_hash() [1/6]

std::size_t wmtk::utils::vector_hash ( const std::vector< char > &  data)

Definition at line 40 of file vector_hash.cpp.

◆ vector_hash() [2/6]

std::size_t wmtk::utils::vector_hash ( const std::vector< double > &  data)

Definition at line 36 of file vector_hash.cpp.

◆ vector_hash() [3/6]

std::size_t wmtk::utils::vector_hash ( const std::vector< int64_t > &  data)

Definition at line 32 of file vector_hash.cpp.

◆ vector_hash() [4/6]

std::size_t wmtk::utils::vector_hash ( const std::vector< Rational > &  data)

Definition at line 44 of file vector_hash.cpp.

References vector_hash().

Here is the call graph for this function:

◆ vector_hash() [5/6]

std::size_t wmtk::utils::vector_hash ( const std::vector< size_t > &  data)

◆ vector_hash() [6/6]

std::size_t wmtk::utils::vector_hash ( const std::vector< std::size_t > &  data)

◆ wmtk_orient1d() [1/2]

int wmtk::utils::wmtk_orient1d ( const Rational p0,
const Rational p1 
)

Definition at line 267 of file orient.cpp.

Referenced by wmtk::SimplexInversionInvariant< T >::after().

Here is the caller graph for this function:

◆ wmtk_orient1d() [2/2]

int wmtk::utils::wmtk_orient1d ( double  p0,
double  p1 
)

Definition at line 272 of file orient.cpp.

◆ wmtk_orient2d() [1/3]

int wmtk::utils::wmtk_orient2d ( const Eigen::Ref< const Eigen::Vector2< double >> &  p0,
const Eigen::Ref< const Eigen::Vector2< double >> &  p1,
const Eigen::Ref< const Eigen::Vector2< double >> &  p2 
)

Definition at line 247 of file orient.cpp.

References exactinit().

Here is the call graph for this function:

◆ wmtk_orient2d() [2/3]

int wmtk::utils::wmtk_orient2d ( const Eigen::Ref< const Eigen::Vector2< Rational >> &  p0,
const Eigen::Ref< const Eigen::Vector2< Rational >> &  p1,
const Eigen::Ref< const Eigen::Vector2< Rational >> &  p2 
)

Definition at line 194 of file orient.cpp.

References wmtk::components::internal::det(), wmtk::Rational::get_sign(), rational_to_interval(), and wmtk_orient2d().

Here is the call graph for this function:

◆ wmtk_orient2d() [3/3]

int wmtk::utils::wmtk_orient2d ( double  p0x,
double  p0y,
double  p1x,
double  p1y,
double  p2x,
double  p2y 
)

Definition at line 178 of file orient.cpp.

References exactinit().

Referenced by wmtk::SimplexInversionInvariant< T >::after(), wmtk::components::internal::is_colinear(), wmtk::operations::AMIPSOptimizationSmoothing::WMTKAMIPSProblem< S >::is_step_valid(), wmtk::operations::AMIPSOptimizationSmoothingPeriodic::WMTKAMIPSProblem< S >::is_step_valid(), wmtk::function::Tri_AMIPS_energy_aux(), wmtk::components::internal::wildmeshing2d(), and wmtk_orient2d().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wmtk_orient3d() [1/3]

template<typename Derived >
int wmtk::utils::wmtk_orient3d ( const Eigen::MatrixBase< Derived > &  A)

Definition at line 32 of file orient.hpp.

References wmtk_orient3d().

Here is the call graph for this function:

◆ wmtk_orient3d() [2/3]

int wmtk::utils::wmtk_orient3d ( const Eigen::Ref< const Eigen::Vector3< double >> &  p0,
const Eigen::Ref< const Eigen::Vector3< double >> &  p1,
const Eigen::Ref< const Eigen::Vector3< double >> &  p2,
const Eigen::Ref< const Eigen::Vector3< double >> &  p3 
)

Definition at line 155 of file orient.cpp.

References exactinit().

Here is the call graph for this function:

◆ wmtk_orient3d() [3/3]

int wmtk::utils::wmtk_orient3d ( const Eigen::Ref< const Eigen::Vector3< Rational >> &  p0,
const Eigen::Ref< const Eigen::Vector3< Rational >> &  p1,
const Eigen::Ref< const Eigen::Vector3< Rational >> &  p2,
const Eigen::Ref< const Eigen::Vector3< Rational >> &  p3 
)