Wildmeshing Toolkit
wmtk::operations::Operation Class Referenceabstract

#include <Operation.hpp>

Inheritance diagram for wmtk::operations::Operation:
[legend]
Collaboration diagram for wmtk::operations::Operation:
[legend]

Public Member Functions

 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 ()
 
virtual PrimitiveType primitive_type () const =0
 
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

virtual std::vector< simplex::Simplexexecute (const simplex::Simplex &simplex)=0
 returns an empty vector in case of failure More...
 
virtual std::vector< simplex::Simplexunmodified_primitives (const simplex::Simplex &simplex) const =0
 Returns all simplices that will be potentially affected by the operation. More...
 
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)
 

Protected Attributes

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
 

Private Attributes

Meshm_mesh
 
bool m_use_random_priority = false
 

Detailed Description

Definition at line 23 of file Operation.hpp.

Constructor & Destructor Documentation

◆ Operation()

wmtk::operations::Operation::Operation ( Mesh mesh)

Definition at line 18 of file Operation.cpp.

◆ ~Operation()

wmtk::operations::Operation::~Operation ( )
virtualdefault

Member Function Documentation

◆ add_invariant()

void wmtk::operations::Operation::add_invariant ( std::shared_ptr< Invariant invariant)
inline

Definition at line 48 of file Operation.hpp.

References wmtk::invariants::InvariantCollection::add(), and m_invariants.

Referenced by wmtk::components::Marching::process(), wmtk::components::internal::RegularSpace::regularize_tags(), wmtk::components::wildmeshing(), and wmtk::components::internal::wildmeshing2d().

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

◆ add_transfer_strategy()

void wmtk::operations::Operation::add_transfer_strategy ( const std::shared_ptr< const operations::AttributeTransferStrategyBase > &  other)

Definition at line 59 of file Operation.cpp.

References m_attr_transfer_strategies.

Referenced by wmtk::components::Marching::process(), wmtk::components::wildmeshing(), and wmtk::components::internal::wildmeshing2d().

Here is the caller graph for this function:

◆ after()

bool wmtk::operations::Operation::after ( const std::vector< simplex::Simplex > &  unmods,
const std::vector< simplex::Simplex > &  mods 
) const
protectedvirtual

Reimplemented in wmtk::operations::EdgeCollapse.

Definition at line 135 of file Operation.cpp.

References wmtk::invariants::InvariantCollection::directly_modified_after(), and m_invariants.

Referenced by wmtk::operations::EdgeCollapse::after(), and operator()().

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

◆ apply_attribute_transfer()

void wmtk::operations::Operation::apply_attribute_transfer ( const std::vector< simplex::Simplex > &  direct_mods)
protected

Definition at line 142 of file Operation.cpp.

References wmtk::simplex::IdSimplexCollection::add(), wmtk::simplex::closed_star_iterable(), wmtk::Mesh::get_const_flag_accessor(), wmtk::Mesh::get_simplex(), wmtk::Mesh::is_valid(), m_attr_transfer_strategies, m_mesh, wmtk::Mesh::map(), wmtk::simplex::IdSimplexCollection::reserve(), wmtk::simplex::IdSimplexCollection::simplex_vector(), and wmtk::simplex::IdSimplexCollection::sort_and_clean().

Referenced by operator()(), and wmtk::operations::OperationSequence::operator()().

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

◆ before()

bool wmtk::operations::Operation::before ( const simplex::Simplex simplex) const
protectedvirtual

Definition at line 97 of file Operation.cpp.

References wmtk::invariants::InvariantCollection::before(), m_invariants, m_mesh, wmtk::Mesh::map(), wmtk::invariants::Invariant::mesh(), mesh(), and wmtk::simplex::Simplex::tuple().

Referenced by operator()(), and wmtk::operations::OperationSequence::operator()().

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

◆ clear_attribute_transfer_strategies()

void wmtk::operations::Operation::clear_attribute_transfer_strategies ( )

Definition at line 38 of file Operation.cpp.

References m_attr_transfer_strategies.

Referenced by wmtk::operations::AttributeTransferConfiguration::apply().

Here is the caller graph for this function:

◆ execute()

◆ get_transfer_strategy()

std::shared_ptr< const operations::AttributeTransferStrategyBase > wmtk::operations::Operation::get_transfer_strategy ( const attribute::MeshAttributeHandle attribute)

Definition at line 26 of file Operation.cpp.

References wmtk::attribute::MeshAttributeHandle::is_same_mesh(), m_attr_transfer_strategies, and mesh().

Here is the call graph for this function:

◆ mesh() [1/2]

Mesh& wmtk::operations::Operation::mesh ( )
inline

Definition at line 46 of file Operation.hpp.

References m_mesh.

◆ mesh() [2/2]

const Mesh& wmtk::operations::Operation::mesh ( ) const
inline

Definition at line 45 of file Operation.hpp.

References m_mesh.

Referenced by wmtk::operations::EdgeCollapse::after(), before(), wmtk::operations::EdgeCollapse::EdgeCollapse(), wmtk::operations::EdgeSplit::EdgeSplit(), wmtk::operations::AMIPSOptimizationSmoothing::execute(), wmtk::operations::AMIPSOptimizationSmoothingPeriodic::execute(), wmtk::operations::AttributesUpdate::execute(), wmtk::operations::AttributesUpdateWithFunction::execute(), wmtk::operations::composite::ProjectOperation::execute(), wmtk::operations::composite::TetCellSplit::execute(), wmtk::operations::composite::TetEdgeSwap::execute(), wmtk::operations::composite::TetFaceSwap::execute(), wmtk::operations::composite::TriEdgeSwap::execute(), wmtk::operations::composite::TriFaceSplit::execute(), wmtk::operations::EdgeCollapse::execute(), wmtk::operations::EdgeSplit::execute(), wmtk::operations::OptimizationSmoothing::execute(), wmtk::operations::Rounding::execute(), wmtk::operations::TetWildTangentialLaplacianSmoothing::execute(), wmtk::operations::AndOperationSequence::execute_operations(), get_transfer_strategy(), wmtk::operations::EdgeSplit::new_spine_edges(), operator()(), wmtk::operations::composite::ProjectOperation::ProjectOperation(), reserve_enough_simplices(), wmtk::Scheduler::run_operation_on_all(), wmtk::Scheduler::run_operation_on_all_coloring(), set_transfer_strategy(), wmtk::operations::TetWildTangentialLaplacianSmoothing::TetWildTangentialLaplacianSmoothing(), and wmtk::operations::EdgeCollapse::unmodified_primitives().

Here is the caller graph for this function:

◆ operator()()

std::vector< simplex::Simplex > wmtk::operations::Operation::operator() ( const simplex::Simplex simplex)
virtual

Reimplemented in wmtk::operations::OperationSequence.

Definition at line 66 of file Operation.cpp.

References after(), apply_attribute_transfer(), before(), wmtk::Mesh::create_scope(), execute(), mesh(), wmtk::simplex::Simplex::primitive_type(), primitive_type(), and unmodified_primitives().

Here is the call graph for this function:

◆ primitive_type()

◆ priority()

virtual double wmtk::operations::Operation::priority ( const simplex::Simplex simplex) const
inlinevirtual

Reimplemented in wmtk::operations::OperationSequence.

Definition at line 35 of file Operation.hpp.

References m_priority.

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

Here is the caller graph for this function:

◆ reserve_enough_simplices()

void wmtk::operations::Operation::reserve_enough_simplices ( )
virtual

Reimplemented in wmtk::operations::OperationSequence.

Definition at line 195 of file Operation.cpp.

References wmtk::multimesh::MultiMeshVisitor< NodeFunctor_ >::execute_from_root(), and mesh().

Here is the call graph for this function:

◆ set_priority()

void wmtk::operations::Operation::set_priority ( const std::function< double(const simplex::Simplex &)> &  func)
inline

Definition at line 50 of file Operation.hpp.

References m_priority.

Referenced by wmtk::components::wildmeshing(), and wmtk::components::internal::wildmeshing2d().

Here is the caller graph for this function:

◆ set_transfer_strategy()

void wmtk::operations::Operation::set_transfer_strategy ( const attribute::MeshAttributeHandle attribute,
const std::shared_ptr< const operations::AttributeTransferStrategyBase > &  other 
)

Definition at line 43 of file Operation.cpp.

References wmtk::attribute::MeshAttributeHandle::is_same_mesh(), m_attr_transfer_strategies, and mesh().

Referenced by wmtk::operations::AttributeTransferConfiguration::apply().

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

◆ unmodified_primitives()

virtual std::vector<simplex::Simplex> wmtk::operations::Operation::unmodified_primitives ( const simplex::Simplex simplex) const
protectedpure virtual

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

Implemented in wmtk::operations::OperationSequence, wmtk::operations::EdgeSplit, wmtk::operations::EdgeCollapse, wmtk::operations::composite::TriFaceSplit, wmtk::operations::composite::TriEdgeSwap, wmtk::operations::composite::TetFaceSwap, wmtk::operations::composite::TetEdgeSwap, wmtk::operations::composite::TetCellSplit, and wmtk::operations::AttributesUpdate.

Referenced by operator()().

Here is the caller graph for this function:

◆ use_random_priority() [1/2]

virtual bool& wmtk::operations::Operation::use_random_priority ( )
inlinevirtual

Reimplemented in wmtk::operations::OperationSequence.

Definition at line 41 of file Operation.hpp.

References m_use_random_priority.

◆ use_random_priority() [2/2]

virtual bool wmtk::operations::Operation::use_random_priority ( ) const
inlinevirtual

Reimplemented in wmtk::operations::OperationSequence.

Definition at line 40 of file Operation.hpp.

References m_use_random_priority.

Referenced by wmtk::Scheduler::run_operation_on_all(), and wmtk::operations::OperationSequence::use_random_priority().

Here is the caller graph for this function:

Member Data Documentation

◆ m_attr_transfer_strategies

std::vector<std::shared_ptr<const operations::AttributeTransferStrategyBase> > wmtk::operations::Operation::m_attr_transfer_strategies
protected

◆ m_invariants

◆ m_mesh

Mesh& wmtk::operations::Operation::m_mesh
private

Definition at line 94 of file Operation.hpp.

Referenced by apply_attribute_transfer(), before(), and mesh().

◆ m_priority

std::function<double(const simplex::Simplex&)> wmtk::operations::Operation::m_priority = nullptr
protected

◆ m_use_random_priority

bool wmtk::operations::Operation::m_use_random_priority = false
private

Definition at line 95 of file Operation.hpp.

Referenced by use_random_priority().


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