Skip to content

New VectorFunction classes and hierarchy

Marcus Mohr requested to merge mohr/issue142-mc into master

The merge will resolve issue #142 (closed). Especially it will bring a new class hierarchy for vector-valued functions. The associated base class provides most of the methods we find in our P1Function and P2Function classes, but allow to directly operate on vector functions, which means we can e.g. write

f.uvw.multElementwise( { f.uvw, outwardNormal.uvw }, l );
f.uvw.assign( { rayleighNumber }, { f.uvw }, l, All );

instead of the previous

f.uvw.u.multElementwise( {f.uvw.u, outwardNormal.uvw.u}, l );
f.uvw.v.multElementwise( {f.uvw.v, outwardNormal.uvw.v}, l );
f.uvw.w.multElementwise( {f.uvw.w, outwardNormal.uvw.w}, l );
f.uvw.u.assign( {rayleighNumber}, {f.uvw.u}, l, All );
f.uvw.v.assign( {rayleighNumber}, {f.uvw.v}, l, All );
f.uvw.w.assign( {rayleighNumber}, {f.uvw.w}, l, All );

Access to indiviudal scalar component functions is supported, e.g. via operator[]. This allows implementing loops based on the return value of the getDimension() method.

for ( uint_t k = 0; k < function.uvw.getDimension(); k++ )
  prolongationOperator_.prolongate( function.uvw[k], sourceLevel, flag );

which is important, since we do not provide a dummy third component for 2D vector functions.

The implementation relies on CRTP as our scalar functions do and as we discussed for the proposed block functions.

There is a first draft for a VectorToVector operator. But that only provides apply() as method and is not really used, yet.

This merge will bring many changes, so please take a look at it (and approve 😅)


Merge request reports