Adaptive mesh refinement methods with automatic thresholding: theory, algorithm and application to tsunami propagation | Synapse