Evaluating local functionals
See original GitHub issueI did again some stuff related to adaptive finite element methods.
I ended up writing stuff like this for evaluating local error estimators:
# interior estimator
basis = InteriorBasis(m, e)
hK = basis.mesh_parameters()
xK, yK = basis.global_coordinates()
eta_K = np.sum(hK**2 / k(xK, yK) * load_func(xK, yK)**2 * basis.dx, axis=1)
and
# facet estimator
fbasis = [FacetBasis(m, e, side=i) for i in [0, 1]]
u1, du1 = fbasis[0].interpolate(u, derivative=True)
u2, du2 = fbasis[1].interpolate(u, derivative=True)
hE = fbasis[0].mesh_parameters()
xE, yE = fbasis[0].global_coordinates()
eps = 1e-6
n = fbasis[0].normals
xE1 = xE - eps*n[0]
yE1 = yE - eps*n[1]
xE2 = xE + eps*n[0]
yE2 = yE + eps*n[1]
eta_E = np.sum(hE / k(xE, yE) *\
((k(xE1, yE1)*du1[0] - k(xE2, yE2)*du2[0])*n[0] +\
(k(xE1, yE1)*du1[1] - k(xE2, yE2)*du2[1])*n[1])**2 * fbasis[0].dx, axis=1)
# add eta_E to elements
tmp = np.zeros(m.facets.shape[1])
np.add.at(tmp, fbasis[0].find, eta_E)
eta_E = np.sum(0.5*tmp[m.t2f], axis=0)
This looks pretty similar to what one does in skfem.assembly.asm
. Maybe we could add skfem.assembly.evaluate
(or similar) for evaluating functionals.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Evaluation of Local Hybrid Functionals for Electric Properties
Here, we present a systematic evaluation of earlier and recent local hybrid functionals for large test sets of dipole moments and static ...
Read more >Assessing locally range-separated hybrid functionals from a ...
We propose a non-empirical scheme based on a detailed scaling analysis with respect to a uniform coordinate scaling and on a short-range expansion...
Read more >Local hybrid functionals: Theory, implementation, and ...
Local hybrid functionals generalize the idea of hybrid functionals in density ... This requires modified integral evaluation techniques, ...
Read more >Assessment of a new local exchange functional OPTX
In this study, we examined the performance of the new local exchange functional OPTX which is based on the inherent non-separability of exchange ......
Read more >5.7.1 Non-Local Correlation (NLC) Functionals
Unlike local (LSDA) and semi-local (GGA and meta-GGA) functionals, for non-local functionals evaluation of the correlation energy requires a double integral ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did some quasi-cool stuff yesterday. Finally added adaptive refinement of triangular meshes.
This solves Poisson equation adaptively.
Note that the function eval_estimator relates to this issue.
I guess this can be closed now.