- 15 Sep, 2021 2 commits
-
-
Marcus Mohr authored
For completeness we commit also adds a new fule FaceDoFPetsc.hpp. Like DGPetsc.hpp it only contains dummy implementations for - createVectorFromFunction() - createFunctionFromVector()
-
Marcus Mohr authored
The commit introduces implementations of - createVectorFromFunction() - createFunctionFromVector() for functions of type GenericFunction< PetscReal >. The two free functions reside in the new file GenericFunctionPetsc.hpp. Because of the peculiarities of GenericFunctions these free functions are, however, only wrappers that call the corresponding one of the two new member functions - GenericFunction::toVector() - GenericFunction::fromVector() As usual these are pure virtual and the actual work happens inside the member functions of the FunctionWrapper class. We extend the FunctionWrapperTest to check compilation and execution for various kinds of wrapped functions. Note that due to instantiation requirements the commit also implements - createVectorFromFunction() - createFunctionFromVector() for functions of type DGFunction. However, these implementations are pseudo only and will abort.
-
- 17 Aug, 2021 1 commit
-
-
Marcus Mohr authored
The previous implementation relied on directly using the templated free function numberOfLocalDoFs(). In order to call the correct one a switch statement was used based on the FunctionKind of the corresponding sub-function. Consequently we would need to update this code piece for every new type of sub-function that we want to use. The new implementation is directly using GenericFunction::getNumberOfLocalDoFs().
-
- 16 Aug, 2021 2 commits
-
-
Marcus Mohr authored
The FunctionWrapper class no longer typedefs FunctionType to its func_t argument. IMHO that was pretty useless. Instead we get a ``` template< typename VType > using WrappedFuncKind = typename WrappedFuncType::template FunctionType< VType >; ``` For this to work functions the get wrapped need to provide a templated FunctionType. So this is added to - DGFunction - and all already exisiting children of the BlockFunction class.
-
Marcus Mohr authored
Our usual tag-based approach to the numberOfLocalDoFs() free functions cannot work with Generic- and BlockFunctions, as for those we need an object instance of the class to determine that value. In order to remain somewhat compatible with the current approach this commit adds a version of numberOfLocalDoFs() that takes as input a function object. For our standard function classes work is then delegated to the existing free functions by determining the function tag. For the Generic- and BlockFunction we have special implementations that call their getNumberOfLocalDoFs() member function. For the case of the GenericFunction this member function is implemented by this commit. As usual it is purely virtual and the actual implementation happens in the FunctionWrapper class. We use this new function variant in the construction of PETScVector for testing and as this is where we will need it when converting GenericFunction objects to PETScVector objects. Additionally this commit implements enumerate() without an offset in GenericFunction and FunctionWrapper.
-
- 09 Aug, 2021 1 commit
-
-
Marcus Mohr authored
In order to implement enumerate for the BlockFunction class, we needed to also implement enumerate( level, offset ) in the GenericFunction and the FunctionWrapper class. Commit extends BlockFunctionBasicTest to check enumeration works for the case of a P2P1TaylorHoodBlockFunction.
-
- 20 May, 2021 8 commits
-
-
Marcus Mohr authored
The new enumeration allows to implement a query method GenericFunction::getFunctionKind() that can be used to obtain information on the underlying (wrapped) function. The previous type traits do not help here, because we cannot return a datatype (and working with string from getTypeName() feels a little clumsy. We use the FunctionKind value inside VTKOutput::add() in case of a GenericFunction argument to find out the single type cast we should attempt.
-
Marcus Mohr authored
* VTKOutput can now also handle objects of type GenericFunction and BlockFunction * There are two new versions of unwrap in FunctionWrapper.hpp which are free-functions (more of a template exercise)
-
Marcus Mohr authored
-
Marcus Mohr authored
Double free does not really point to having forgotten "return" in dotGlobal :(
-
Marcus Mohr authored
-
Marcus Mohr authored
Note that also the scalar functions with this commit offer an interpolate method that accepts as input a vector of std::functions.
-
Marcus Mohr authored
-
Marcus Mohr authored
-