| 3697 | {} |
| 3698 | |
| 3699 | void mapElements(Domain *d, bool has_region, const std::vector<int> &subset) { |
| 3700 | /* |
| 3701 | utilties |
| 3702 | */ |
| 3703 | auto lam_get_num_ext_nodes = [](Element* elem) { |
| 3704 | switch (elem->getClassTag()) { |
| 3705 | case ELE_TAG_SFI_MVLEM_3D: return 4; |
| 3706 | default: return elem->getNumExternalNodes(); |
| 3707 | } |
| 3708 | }; |
| 3709 | /* |
| 3710 | clear previous mappings |
| 3711 | */ |
| 3712 | registered_custom_rules.clear(); |
| 3713 | items.clear(); |
| 3714 | /* |
| 3715 | quick return |
| 3716 | */ |
| 3717 | if (d == 0) return; |
| 3718 | /* |
| 3719 | auxiliary map to register custom rules |
| 3720 | */ |
| 3721 | std::map<ElementIntegrationRule, int> aux_map_custom_rules; |
| 3722 | /* |
| 3723 | loop over all elements in the domain |
| 3724 | */ |
| 3725 | size_t subset_elem_counter(0); |
| 3726 | ElementIter* element_iter = &(d->getElements()); |
| 3727 | Element* current_element = 0; |
| 3728 | //while ((current_element = (*element_iter)()) != 0) { |
| 3729 | while (true) { |
| 3730 | /* |
| 3731 | get next element |
| 3732 | */ |
| 3733 | if (has_region) { |
| 3734 | if (subset_elem_counter == subset.size()) |
| 3735 | break; |
| 3736 | current_element = d->getElement(subset[subset_elem_counter++]); |
| 3737 | if (current_element == 0) |
| 3738 | continue; // skip null and go to next iteration |
| 3739 | } |
| 3740 | else { |
| 3741 | current_element = (*element_iter)(); |
| 3742 | if (current_element == 0) |
| 3743 | break; |
| 3744 | } |
| 3745 | /* |
| 3746 | get class tag, geometry and integration rule type |
| 3747 | */ |
| 3748 | int elem_type = current_element->getClassTag(); |
| 3749 | /* |
| 3750 | skip element classes that we don't want to record |
| 3751 | */ |
| 3752 | if (elem_type == ELE_TAG_Subdomain || |
| 3753 | elem_type == ELE_TAG_ASDEmbeddedNodeElement) |
| 3754 | { |
| 3755 | continue; |
| 3756 | } |
no test coverage detected