New concept for local object
Concept:
The local view of any localizable object o
(e.g. discrete function, operators, quadratures) are constructed using a free standing function, e.g.
lv=localView(o, tags...)
The local views lv
all have a bind(entity)
and unbind()
method.
Corollary:
-
df.localFunction
: stays as is (or will be deprecated). The newlv
object is a new class. Idea:
- If no
tag
is used aConstLocalFunction
like object is returned. - the tag can also be used to describe the write through operation (either
directly or during
unbind
). Tags would includeadd
andset
(ref. petsc) - we can possibly also switch to returning results
-
localOperators
: could use similar tags tolocalFunctions
. Thebind
method would need two entities - We could add more
localizable
objects, e.g.,Quadratures
,BasisFunctionSets
,Models
etc.
Syntactical Sugar
To avoid code like
for (entity : range) {
lv1.bind(entity);
...
lvN.bind(entity);
// one line of code
lvN.unbind();
....
lv1.unbind();
}
we introduce a "binding" range:
for (entity : localBind( range, lv1,....,lvN ) )
// one line of code
PS: for local operators this would use bind(entity,entity)
. Perhaps we could something like this also for intersections binding to entity,neighbor
.
PPS: we could also add the entity.geometry()
to the bind
method to avoid multiple calls in the local object.
PPPS: the local objects can with this approach also contain doftransformations (twists) and other transformation (piola)
Edited by Andreas Dedner