Open ddundo opened 6 months ago
By the way, compute_weighted_hessian_metric
seems to give reasonable meshes:
weighted_hessian_metric = metric.copy(deepcopy=True)
weighted_hessian_metric.compute_weighted_hessian_metric([h_ind, u_ind], [hessian_h, hessian_u])
weighted_hessian_metric.normalise()
amsh_weighted = adapt(msh, weighted_hessian_metric)
Hi @ddundo, thanks for reporting this. Sorry to hear you're having issues. The code looks fine to me.
I'm afraid RiemannianMetric.compute_anisotropic_dwr_metric
is not at all well-tested. Currently, the only tests we have are (a) error handling, (b) a test in the case of a uniform indicator, and (c) any demos it appears in. Sadly, these are not enough to check it is doing everything we expect. It's on the to do list but I'm afraid it won't be addressed any time soon.
By the way,
compute_weighted_hessian_metric
seems to give reasonable meshes:
Note that the weighted Hessian metric is meant to be used a bit differently. The error indicator parts don't mean the same thing. See (Power et al., 2006) or (Wallwork et al., 2020) for details.
Thanks @jwallwork23!
I mentioned on the meeting yesterday that I am getting strange meshes when using
RiemannianMetric.compute_anisotropic_dwr_metric
and I haven't been able to get to the bottom of it.I have 2 prognostic fields: thickness
h
and velocityu
, and corresponding error indicatorsh_ind
andu_ind
. Computingcompute_isotropic_dwr_metric(indicator)
and adapting the mesh gives expected results. But when I compute hessians ofh
andu
, and intersect them to computecompute_anisotropic_dwr_metric(indicator, intersected_hessian)
, I get an adapted mesh which looks as if the hessian acts against the indicator. Fine resolution gets prescribed in the right-hand side of the domain, where the hessian metric density is lowest.Here is the code used to get the above:
Could you please take a look if I did something wrong? :)