Suggested changes to new VectorFunctions
Hi,
I like the new P[12]VectorFunction
classes. However, I'd like to suggest some changes:
- I don't think that it is very flexible to have the scalar subfunctions be defined as follows:
P2Function< ValueType > u;
P2Function< ValueType > v;
P2Function< ValueType > w;
For one the naming is closely tied to the current use with CFD velocity fields. Second you cannot access them in an automated fashion by indexing. Hence I suggest to change this to
std::array< P2Function< ValueType >, 3 > component;
P2Function< ValueType >& u = component[0];
P2Function< ValueType >& v = component[1];
P2Function< ValueType >& w = component[2];
The constructors then would have change also
P2VectorFunction( const std::string& _name,
const std::shared_ptr< PrimitiveStorage >& storage,
size_t minLevel,
size_t maxLevel )
: component( {{
{ _name + "_u", storage, minLevel, maxLevel },
{ _name + "_v", storage, minLevel, maxLevel },
{ storage->hasGlobalCells() ? P2Function< ValueType >( _name + "_w", storage, minLevel, maxLevel ) : P2Function< ValueType >( _name + "_w_dummy", storage ) }}} )
{}
-
I'd prefer to place the header files in
src/hyteg/p[12]functionspace
instead ofsrc/hyteg/composites
. For me this feels more natural. Also the scalarP2Function
is already a composite of a VectorDoF and an EdgeDoFFunction. -
Is there any reason why the VectorFunctions do not inherit from Function?
Cheers
Marcus