Wildmeshing Toolkit
wmtk::operations::composite::TetFaceSwap Class Reference

A FaceSwap (or a Swap 2-3) performs a swap a face sharing by two tets to an edge split the volume of the two tets into three new tets. More...

#include <TetFaceSwap.hpp>

Inheritance diagram for wmtk::operations::composite::TetFaceSwap:
[legend]
Collaboration diagram for wmtk::operations::composite::TetFaceSwap:
[legend]

Public Member Functions

 TetFaceSwap (Mesh &m)
 
PrimitiveType primitive_type () const override
 
EdgeSplitsplit ()
 
EdgeCollapsecollapse ()
 
- Public Member Functions inherited from wmtk::operations::Operation
 Operation (Mesh &mesh)
 
virtual ~Operation ()
 
virtual std::vector< simplex::Simplexoperator() (const simplex::Simplex &simplex)
 
virtual double priority (const simplex::Simplex &simplex) const
 
virtual bool use_random_priority () const
 
virtual bool & use_random_priority ()
 
const Meshmesh () const
 
Meshmesh ()
 
void add_invariant (std::shared_ptr< Invariant > invariant)
 
void set_priority (const std::function< double(const simplex::Simplex &)> &func)
 
std::shared_ptr< const operations::AttributeTransferStrategyBaseget_transfer_strategy (const attribute::MeshAttributeHandle &attribute)
 
void add_transfer_strategy (const std::shared_ptr< const operations::AttributeTransferStrategyBase > &other)
 
void set_transfer_strategy (const attribute::MeshAttributeHandle &attribute, const std::shared_ptr< const operations::AttributeTransferStrategyBase > &other)
 
void clear_attribute_transfer_strategies ()
 
virtual void reserve_enough_simplices ()
 

Protected Member Functions

std::vector< simplex::Simplexunmodified_primitives (const simplex::Simplex &simplex) const override
 Returns all simplices that will be potentially affected by the operation. More...
 
std::vector< simplex::Simplexexecute (const simplex::Simplex &simplex) override
 returns an empty vector in case of failure More...
 
- Protected Member Functions inherited from wmtk::operations::Operation
virtual bool before (const simplex::Simplex &simplex) const
 
virtual bool after (const std::vector< simplex::Simplex > &unmods, const std::vector< simplex::Simplex > &mods) const
 
void apply_attribute_transfer (const std::vector< simplex::Simplex > &direct_mods)
 

Private Attributes

EdgeSplit m_split
 
EdgeCollapse m_collapse
 

Additional Inherited Members

- Protected Attributes inherited from wmtk::operations::Operation
std::function< double(const simplex::Simplex &)> m_priority = nullptr
 
invariants::InvariantCollection m_invariants
 
std::vector< std::shared_ptr< const operations::AttributeTransferStrategyBase > > m_attr_transfer_strategies
 

Detailed Description

A FaceSwap (or a Swap 2-3) performs a swap a face sharing by two tets to an edge split the volume of the two tets into three new tets.

This is the reverse operation of a EdgeSwap 3-2.

FaceSwap executes two splits then two collapses.

FaceSwap cannot be performed on boundary faces.

  • 0 -------— 4 / \ / / \ \ / / \ \ / / \ \ 3 1 ------— 2/ input: (0, 0-2, 0-2-3, 0-2-3-1)
   0 ---------- 4
  / \\     _- /
 /   \ \ _-  /
/   __\- \  /

/_– \ \ 3 1 ------— 2/ output: (4, 4-1, 4-1-3, 4-1-3-2)

Definition at line 37 of file TetFaceSwap.hpp.

Constructor & Destructor Documentation

◆ TetFaceSwap()

wmtk::operations::composite::TetFaceSwap::TetFaceSwap ( Mesh m)

Definition at line 5 of file TetFaceSwap.cpp.

Member Function Documentation

◆ collapse()

EdgeCollapse& wmtk::operations::composite::TetFaceSwap::collapse ( )
inline

Definition at line 45 of file TetFaceSwap.hpp.

References m_collapse.

◆ execute()

std::vector< simplex::Simplex > wmtk::operations::composite::TetFaceSwap::execute ( const simplex::Simplex simplex)
overrideprotectedvirtual

returns an empty vector in case of failure

Implements wmtk::operations::Operation.

Definition at line 11 of file TetFaceSwap.cpp.

References wmtk::Edge, wmtk::simplex::Simplex::edge(), m_collapse, m_split, wmtk::operations::Operation::mesh(), wmtk::PE, PF, PT, wmtk::PV, wmtk::Mesh::switch_tuples(), wmtk::Tetrahedron, wmtk::Triangle, wmtk::simplex::Simplex::tuple(), and wmtk::Vertex.

Here is the call graph for this function:

◆ primitive_type()

PrimitiveType wmtk::operations::composite::TetFaceSwap::primitive_type ( ) const
inlineoverridevirtual

Implements wmtk::operations::Operation.

Definition at line 42 of file TetFaceSwap.hpp.

References wmtk::Triangle.

◆ split()

EdgeSplit& wmtk::operations::composite::TetFaceSwap::split ( )
inline

Definition at line 44 of file TetFaceSwap.hpp.

References m_split.

◆ unmodified_primitives()

std::vector< simplex::Simplex > wmtk::operations::composite::TetFaceSwap::unmodified_primitives ( const simplex::Simplex simplex) const
overrideprotectedvirtual

Returns all simplices that will be potentially affected by the operation.

Implements wmtk::operations::Operation.

Definition at line 64 of file TetFaceSwap.cpp.

Member Data Documentation

◆ m_collapse

EdgeCollapse wmtk::operations::composite::TetFaceSwap::m_collapse
private

Definition at line 54 of file TetFaceSwap.hpp.

Referenced by collapse(), and execute().

◆ m_split

EdgeSplit wmtk::operations::composite::TetFaceSwap::m_split
private

Definition at line 53 of file TetFaceSwap.hpp.

Referenced by execute(), and split().


The documentation for this class was generated from the following files: