## 2 Methods
### Marking Strategies
```
0:\(\text{conform\_refinement}(\mathcal{P}_{\text{R}})\quad\triangleright\) Process of conformation to avoid hanging nodes
0:\(\text{order\_residual}(\mathcal{R}_{k})\triangleright\) Order elements from highest to lowest local residual \(\mathcal{R}_{k}^{(m)}\)
0:\(\mathcal{R}_{k}^{(m)}\)\(\triangleright\) Evaluation of (12)
0:\(\theta\)\(\triangleright\) Percentage of elements to be refined
0:\(\mathcal{P}\)\(\triangleright\) Set of original elements (of size \(N\))
0:\(\mathcal{P}_{\text{R}}\)\(\triangleright\) Set of elements marked to be refined (of size \(N_{\text{R}}\))
1:proceduremark_QUantile(\(\mathcal{R}_{k}^{(m)}\),\(\theta\),\(\mathcal{P}\),\(\mathcal{P}_{\text{R}}\))
2:\(\theta_{\text{R}}\leftarrow\theta\)
3:\(\mathcal{P}_{\text{ord}}\leftarrow\text{order\_residual}(\mathcal{R}_{k})\)\(\triangleright\) Get an ordered set of elements
4:while\(N_{\text{R}}<\theta N\)do
5:for all\(e\leq\theta_{\text{R}}\cdot N_{\text{R}}\)do
6:\(e\in\mathcal{P}_{\text{R}}\)\(\triangleright\) Add to the set of marked elements
7:endfor
8:\(\mathcal{P}_{\text{R}}\leftarrow\text{conform\_refinement}(\mathcal{P}_{ \text{R}})\)\(\triangleright\) Conform marked elements
9:\(\theta_{\text{R}}\leftarrow\theta-0.05\)\(\triangleright\) Try with a smaller set
10:endwhile
11:endprocedure
```  
**Algorithm 2** Quantile marking strategy based on [39]  
```
0:\(\text{conform\_refinement}(\mathcal{P}_{\text{R}})\quad\triangleright\) Process of conformation to avoid hanging nodes
0:\(\mathcal{R}_{k}^{(m)}\)\(\triangleright\) Evaluation of (12)
0:\(\theta\)\(\triangleright\) Percentage to set threshold
0:\(\mathcal{P}\)\(\triangleright\) Set of original elements (of size \(N\))
0:\(\mathcal{P}_{\text{R}}\)\(\triangleright\) Set of elements marked to be refined (of size \(N_{\text{R}}\))
1:proceduremark_maximum(\(\mathcal{R}_{k}^{(m)}\),\(\theta\),\(\mathcal{P}\),\(\mathcal{P}_{\text{R}}\))
2:\(\xi_{\text{cut}}\leftarrow\theta\cdot\max\{\mathcal{R}_{k}^{(1)},\dots, \mathcal{R}_{k}^{(N)}\}\)\(\triangleright\) Threshold to be marked
3:for all\(e\in\mathcal{P}\)do
4:if\(\mathcal{R}_{k}^{(e)}\geq\xi_{\text{cut}}\)then
5:\(e\in\mathcal{P}_{\text{R}}\)\(\triangleright\) Add to the set of marked elements
6:endif
7:endfor
8:\(\mathcal{P}_{\text{R}}\leftarrow\text{conform\_refinement}(\mathcal{P}_{ \text{R}})\)\(\triangleright\) Conform marked elements
9:endprocedure
```  
**Algorithm 3** Maximum marking strategy  
```
0:\(\text{conform\_refinement}(\mathcal{P}_{\text{R}})\quad\triangleright\) Process of conformation to avoid hanging nodes
0:\(\mathcal{R}_{k}^{(m)}\)\(\triangleright\) Evaluation of (12)
0:\(\theta\)\(\triangleright\) Percentage to set threshold
0:\(\mathcal{P}\)\(\triangleright\) Set of original elements (of size \(N\))
0:\(\mathcal{P}_{\text{R}}\)\(\triangleright\) Set of elements marked to be refined (of size \(N_{\text{R}}\))
1:proceduremark_maximum(\(\mathcal{R}_{k}^{(m)}\),\(\theta\),\(\mathcal{P}\),\(\mathcal{P}_{\text{R}}\))
2:\(\xi_{\text{cut}}\leftarrow\theta\cdot\max\{\mathcal{R}_{k}^{(1)},\dots, \mathcal{R}_{k}^{(N)}\}\)\(\triangleright\) Threshold to be marked
3:for all\(e\in\mathcal{P}\)do
4:if\(\mathcal{R}_{k}^{(e)}\geq\xi_{\text{cut}}\)then
5:\(e\in\mathcal{P}_{\text{R}}\)\(\triangleright\) Add to the set of marked elements
6:endif
7:endfor
8:\(\mathcal{P}_{\text{R}}\leftarrow\text{conform\_refinement}(\mathcal{P}_{ \text{R}})\)\(\triangleright\) Conform marked elements
9:endprocedure
```  
**Algorithm 4** Maximum marking strategy  
```
0:\(\text{conform\_refinement}(\mathcal{P}_{\text{R}})\quad\triangleright\) Process of conformation to avoid hanging nodes
0:\(\mathcal{R}_{k}^{(m)}\)\(\triangleright\) Evaluation of (12)
0:\(\theta\)\(\triangleright\) Percentage to set threshold
0:\(\mathcal{P}\)\(\triangleright\) Set of original elements (of size \(N\))
0:\(\mathcal{P}_{\text{R}}\)\(\triangleright\) Set of elements marked to be refined (of size \(N_{\text{R}}\))
1:proceduremark_maximum(\(\mathcal{R}_{k}^{(m)}\),\(\theta\),\
```
1:\(\text{conform\_refinement}(\mathcal{P}_{\text{R}})\)\(\triangleright\) Process of conformation to avoid hanging nodes
2:\(\text{order\_residual}(\mathcal{R}_{k})\)\(\triangleright\) Order elements from highest to lowest \(\mathcal{R}_{k}^{(m)}\)
3:\(\mathcal{R}_{k}^{(m)}\)\(\triangleright\) Evaluation of (12)
4:\(\theta\)\(\triangleright\) Percentage to set amount of energy of \(\mathcal{P}_{\text{R}}\)
5:\(\mathcal{P}\)\(\triangleright\) Set of original elements (of size \(N\))
6:\(\mathcal{P}_{\text{R}}\)\(\triangleright\) Set of elements marked to be refined (of size \(N_{\text{R}}\))
7:
8:\(\text{procedure\_mark\_fixedenergy}(\mathcal{R}_{k}^{(m)},\theta,\mathcal{P}, \mathcal{P}_{\text{R}})\)
9:\(\xi_{\text{cut}}\leftarrow\theta\cdot\sum_{m=1}^{N}\mathcal{R}_{k}^{(m)}\)\(\triangleright\) Threshold to be marked in energy
10:\(\mathcal{P}_{\text{ord}}\leftarrow\text{order\_residual}(\mathcal{R}_{k})\)\(\triangleright\) Get an ordered set of elements
11:\(N_{\text{ref}}\gets 1\)\(\triangleright\) Initialize number of elements to mark.