|
Wildmeshing Toolkit
|
Public Types | |
| using | Tuple = typename AppMesh::Tuple |
Public Member Functions | |
| ExecutePass () | |
| Construct a new Execute Pass object. It contains the name-to-operation map and the functions that define the rules for operations. | |
| ExecutePass (ExecutePass &)=delete | |
| bool | operator() (AppMesh &m, const std::vector< std::pair< Op, Tuple > > &operation_tuples) |
| Executes the operations for an application when the lambda function is invoked. The rules that are customizly defined for applications are applied. | |
| int | get_cnt_success () const |
| int | get_cnt_fail () const |
Public Attributes | |
| std::map< Op, std::function< std::optional< std::vector< Tuple > >(AppMesh &, const Tuple &)> > | edit_operation_maps |
| A dictionary that registers names with operations. | |
| std::function< double(const AppMesh &, Op op, const Tuple &)> | priority |
| Priority function (default to edge length) | |
| std::function< bool(double)> | should_renew = [](auto) { return true; } |
| check on wheather new operations should be added to the priority queue | |
| std::function< std::vector< std::pair< Op, Tuple > >(const AppMesh &, Op, const std::vector< Tuple > &)> | renew_neighbor_tuples |
| renew neighboring Tuples after each operation depends on the operation | |
| std::function< bool(AppMesh &, const Tuple &, int task_id)> | lock_vertices |
| lock the vertices concerned depends on the operation | |
| std::function< bool(const AppMesh &)> | stopping_criterion |
| Stopping Criterion based on the whole mesh For efficiency, not every time is checked. In serial, this may go over all the elements. For parallel, this involves synchronization. So there is a checking frequency. | |
| size_t | stopping_criterion_checking_frequency = std::numeric_limits<size_t>::max() |
| checking frequency to decide whether to stop execution given the stopping criterion | |
| std::function< bool(const AppMesh &, const std::tuple< double, Op, Tuple > &t)> | is_weight_up_to_date |
| Should Process drops some Tuple from being processed. For example, if the energy is out-dated. This is in addition to calling tuple valid. | |
| std::function< void(const AppMesh &, Op, const Tuple &t)> | on_fail = [](auto&, auto, auto&) {} |
| used to collect operations that are not finished and used for later re-execution | |
| int | num_threads = 1 |
| size_t | max_retry_limit = 10 |
Private Member Functions | |
| void | operation_cleanup (AppMesh &m) |
| size_t | get_partition_id (const AppMesh &m, const Tuple &e) |
Private Attributes | |
| std::atomic_int | cnt_update = 0 |
| std::atomic_int | cnt_success = 0 |
| std::atomic_int | cnt_fail = 0 |
|
inline |
Construct a new Execute Pass object. It contains the name-to-operation map and the functions that define the rules for operations.
|
inline |
Executes the operations for an application when the lambda function is invoked. The rules that are customizly defined for applications are applied.
| m | |
| operation_tuples | a vector of pairs of operation's name and the Tuple to be operated on |
| std::function<bool(const AppMesh&, const std::tuple<double, Op, Tuple>& t)> wmtk::ExecutePass< AppMesh, policy >::is_weight_up_to_date |
Should Process drops some Tuple from being processed. For example, if the energy is out-dated. This is in addition to calling tuple valid.
| std::function<bool(AppMesh&, const Tuple&, int task_id)> wmtk::ExecutePass< AppMesh, policy >::lock_vertices |
lock the vertices concerned depends on the operation
| size_t wmtk::ExecutePass< AppMesh, policy >::max_retry_limit = 10 |
To Avoid mutual locking, retry limit is set, and then put in a serial queue in the end.
| std::function<double(const AppMesh&, Op op, const Tuple&)> wmtk::ExecutePass< AppMesh, policy >::priority |
Priority function (default to edge length)
| std::function<std::vector<std::pair<Op, Tuple> >(const AppMesh&, Op, const std::vector<Tuple>&)> wmtk::ExecutePass< AppMesh, policy >::renew_neighbor_tuples |
renew neighboring Tuples after each operation depends on the operation
| std::function<bool(const AppMesh&)> wmtk::ExecutePass< AppMesh, policy >::stopping_criterion |
Stopping Criterion based on the whole mesh For efficiency, not every time is checked. In serial, this may go over all the elements. For parallel, this involves synchronization. So there is a checking frequency.