precice / micro-manager

A manager tool to facilitate two-scale coupling in multi-physics simulations using preCICE.
GNU Lesser General Public License v3.0
15 stars 10 forks source link

Add feature to find similarity tolerances automatically #103

Open Fujikawas opened 4 months ago

Fujikawas commented 4 months ago

Currently the similarity distances are computed as max(similarity_distances)*coarsening_constant or max(similarity_distances)*coarsening_constant*refining_constant. With #64, it requires less active micro-scale simulations per iteration, but sometimes much more iterations to converge when important micro-scale simulations are missed by the stricter similarity condition.

In this PR, the two similarity distances are located by looking for the max-gap in the 1D distance array which is ascending sorted. The distances could be weighted by a factor which is the exponential function of the right end distance of each gap. The exponent could be constant or some varying value computed from convergence status.

With the tests, this method could locate the threshold values relatively well: with different adaptivity constants, the runtime varied between 150s to more than 2400s. With this method it took respectively (power = 0,5) 206s and (power = 0,7) 163s.

In these tests only the runtime is compared, not the accuracy. Local adaptivity and serial run for micro-simulations are used.

ToDo: