hyteg merge requestshttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests2024-03-21T20:22:08+01:00https://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/729Add p2_epsilonvar_affine_q4 form.2024-03-21T20:22:08+01:00Daniel BauerAdd p2_epsilonvar_affine_q4 form.Intended as reference for testing the generated operators.
Taken from cedd60aafcaae697ebd555d6a71cb30a19c5610c and reformatted.
Co-Authored-By: vy28quve <Fabian.Boehm@fau.de>Intended as reference for testing the generated operators.
Taken from cedd60aafcaae697ebd555d6a71cb30a19c5610c and reformatted.
Co-Authored-By: vy28quve <Fabian.Boehm@fau.de>Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/710New generated Stokes operators2024-03-06T08:34:39+01:00Nils KohlNew generated Stokes operatorsSee #246 for extended discussion
----
## Checklist:
- [x] `hyteg-operators` submodule needs to be updated as soon as https://i10git.cs.fau.de/hyteg/hyteg-operators/-/merge_requests/3 is merged
- [x] fix unused variable warnings in gen...See #246 for extended discussion
----
## Checklist:
- [x] `hyteg-operators` submodule needs to be updated as soon as https://i10git.cs.fau.de/hyteg/hyteg-operators/-/merge_requests/3 is merged
- [x] fix unused variable warnings in generated operators
- [x] [move divergence, gradient, viscous directories out of the stokes directory and under `hyteg_operators_composites` instead](https://i10git.cs.fau.de/hyteg/hyteg/-/issues/246#note_28717)
- [x] fix issues for `real_t = float` (single precision builds)
- [x] blending operators test
----
## New module `hyteg_operators_composites`
This MR adds a new module `hyteg_operators_composites` that contains composite operators that are built from generated operators.
For now, three variants of Stokes operators have been added:
* P2P1StokesConstantOperator
* P2P1StokesEpsilonOperator
* P2P1StokesFullOperator
including the necessary viscous, divergence and gradient operators plus their `IcosahedralShellMap` blending versions.
The new module also comes with a short README.
## Testing
The MR extends and modifies
* P2P1ElementwiseStokesOperatorTest (Stokes constant, 2D + 3D)
* P2P1ElementwiseStokesOperatorTest (full Stokes w/ blending, 3D)
* ElementwiseEpsilonMinResConvergenceTest (Stokes epsilon, 2D + 3D)
* DivergenceOperatorTest (divergence, 2D + 3D)
* ViscousOperatorsTest (epsilon + full viscous block, 2D )
to test the new composites.
At least the 2D versions of all non-blending Stokes operators are now tested to some extent.Nils KohlNils Kohlhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/713Extend geometry getter functions of Face and Cell class2024-02-29T15:25:13+01:00Marcus MohrExtend geometry getter functions of Face and Cell classThis MR adds three new functions:
- `Face::getIncircleRadius()`
- `Cell::getVolume()`
- `Cell::getInsphereRadius()`
We test these together with the existing `Face::getArea()` function in the new **Face+CellGeometryTest**.This MR adds three new functions:
- `Face::getIncircleRadius()`
- `Cell::getVolume()`
- `Cell::getInsphereRadius()`
We test these together with the existing `Face::getArea()` function in the new **Face+CellGeometryTest**.Marcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/632Draft: Convection Model Operators, SUPG Stabilisation Operators, Elementwise ...2024-02-21T17:05:49+01:00Andreas BurkhartDraft: Convection Model Operators, SUPG Stabilisation Operators, Elementwise DoFValueOperators (+Tests), Second derivatives for the Blending Maps, PETScHDF5 Function Saving, Projection subclasses for Smoothers and Restriction/Prolongation**Preface: Our pipeline seems to be broken right now, so we should probably wait until it works again.**
This merge request contains several new operators and features aimed at the TerraNeo application.
A few comments on the content o...**Preface: Our pipeline seems to be broken right now, so we should probably wait until it works again.**
This merge request contains several new operators and features aimed at the TerraNeo application.
A few comments on the content of the various diffs:
**composites/P2P1TaylorHoodCompStokesOperator.hpp:** Implements a P2P1 Block Operator for the compressible Stokes (both ALA and TALA are available) with potentially temperature dependent viscosity. It can also generate an appropriate right hand side. You can also activate or deactivate the frozen velocity approach (i.e. if the compressible term in the mass conservation equation is made explicit).
LHS velocity:
$$2 \int_{\Omega} \eta(x,T) \sigma(u) : \sigma(v) \text{ } dx - \frac{2}{\text{dim}} \int_{\Omega}{\eta(x,T) (\nabla \cdot u) \cdot (\nabla \cdot v)} \text{ } dx - \int_{\Omega} \text{div}(v)p_d \text{ } dx - \int_\Omega \frac{\text{Di}}{\Gamma_0} \rho(x) (K_T)^{-1} p_d g \cdot v \text{ } dx$$
RHS velocity:
$$-\int_\Omega \frac{\text{Ra}}{\text{Pe}} \rho(x) \alpha T_d g \cdot v \text{ } dx$$
LHS pressure (here without frozen velocity):
$$ -\int_\Omega \left (\frac{\nabla \rho(x)}{\rho(x)} \cdot u \right ) q \text{ } dx - \int_\Omega (\nabla \cdot u) q \text{ } dx$$
RHS pressure: 0
**src/p2functionspace/P2CompTransportOperator.hpp:** Implements a P2 Operator for the time (in-)dependent energy conservation equation with optional SUPG Stabilisation. Various time stepping schemes (implicit Euler, BDF2, Crank-Nicolson) are available (some additional function calls from outside might be required, e.g. the operator provides a method to save the previous time step right hand side for crank nicolson). Can also be used for the diffusion solve step when using the MMOC operator splitting approach. It can also generate an appropriate right hand side.
LHS temperature (here for the adiabatic heat on the lhs, but can be also be made explicit):
$$ \int_\Omega \frac{\partial T}{\partial t} w \text{ } dx + \int_\Omega (u \cdot \nabla T) w \text{ } dx + \int_\Omega \frac{k }{\text{Pe} \text{ } C_p}\nabla T \cdot \nabla \left ( \frac{w}{\rho(x)} \right ) \text{ } dx - \int_\Omega \text{Di} \text{ } \frac{\alpha}{C_p} T (u \cdot g )w \text{ } dx + \text{SUPG Terms (if used)}$$
RHS temperature:
$$ - \int_\Omega \frac{1}{C_p} H w \text{ } dx -\int_\Omega \frac{\text{Pe}}{\rho(x) C_p}\frac{\text{Di}}{\text{Ra}} \left (\tau\left (u,\eta\left (x,T \right )\right ) : {\varepsilon(u)}\right ) w \text{ } dx + \text{SUPG Terms (if used)}$$
The lhs and rhs above are consequently also dependent on the chosen time discretisation.
**src/hyteg/p2functionspace/P2FullViscousTDependentOperator.hpp, src/hyteg/p2functionspace/P2GradRhoRho_P2_Operator.hpp, src/hyteg/p2functionspace/P2ScaledMassDiffusionOperator.hpp, src/hyteg/p2functionspace/P2VariableBlendingKMassScalarToVectorOperator.hpp, src/hyteg/gridtransferoperators/P2toP1GradRhoRho_P2_Operator.hpp, src/hyteg/gridtransferoperators/P1toP2VariableBlendingKMassScalarToVectorOperator.hpp:** Various operators that conveniently combine the usage of multiple other operators (e.g. if we apply one on every component).
**src/elementwiseoperators:** Added all combinations of P1/P2 ElementwiseDoFValueOperator classes. These operators can be inherited from and provide a way (via the DoFValues_ vector) to access the DoFs of another FEM function during the evaluation of a form. This allows us for the creation of operators like an advection operator that takes a velocity field as an additional input.
Added a setConstantScaling function to all elementwise operators. This can be used to scale your operators by a constant on the fly (without having to create for example a linear combination form).
There are some bug fixes and the ability to use a custom form for P2ToP1 and P1ToP2 elementwise operators included.
**src/elementwiseoperators/generated:** Folder containing all of the generated ElementwiseDoFValueOperators. In particular it adds operators for adiabatic heating, advection, diffusion (only supg), temperature dep. stokes, the grad(rho)/rho * u compressible term in the mass conservation equation, div_k_grad scaled by rho^-1, mass(only supg), shear heat and respective SUPG Stabilisation terms.
**src/p1functionspace/VertexDoFFunction, src/edgedofspace/EdgeDoFFunction, src/functions/DoFValueFunctions:** Added a DoFValueFunction class that both VertexDoFFunction and EdgeDoFFunction inherit from. No previous functionality of VertexDoFFunction and EdgeDoFFunction was changed, I just implemented the additional functions defined in the DoFValueFunction base class. The defined functions are required for the DoFValueOperators to work.
**src/hyteg/composites/VelocityOperator_T_Wrapper, src/hyteg/solvers/SubstituteSolver.hpp:** Some convenient wrappers, allowing you to wrap a operator with a different VelocityOperator_T type and to use a solver for a different operator type (e.g. if you want to solve Laplace as a preconditioner, but the preconditioner is expected to be a solver for a different operator).
**src/petsc/PETScHDF5FunctionSave.hpp:** Functions that allow you to save functions and paramters via creating a PETSc Vector and saving it in parallel to a binary file via HDF5. Has some limitations since you can only reload your functions in the same configuration as you saved it.
**src/solvers/preconditioners/stokes:** Two preconditioner classes used for benchmarks and the convection model
**src/solvers/solvertemplates/StokesSolverTemplates.hpp:** Pulled over some changes to the StokesSolverTemplates solver used in the other Terraneo branches. No functionality is changed but you can now distinguish between absolute and relative tolerance.
**src/solvers/ChebyshevSmoother.hpp:** Added a subclass of the Chebyshev Smoother that contains a normal projection at an appropriate spot for the freeslip boundary conditions.
**src/solvers/GMRESSolver.hpp:** Serveral bug fixes and additional functions from Andreas Wagner to the GMRES solver which we found during our testing of the GMRES.
**src/solvers/MinResSolver.hpp:** Pulled over some changes to the MinRes solver used in the other Terraneo branches. No functionality is changed but you can now define an absolute tolerance.
**src/solvers/UzawaSmoother.hpp, /src/hyteg/composites/P2P1UzawaDampingFactorEstimationOperator.hpp:** Added functions for the estimation of the Uzawa Omega paramter also in case of the P2CompStokesOperator and added a subclass of the UzawaSmoother that contains a normal projection at an appropriate spot for the freeslip boundary conditions.
**src/hyteg/gridtransferoperators/P2P1StokesToP2P1StokesProlongation.hpp, src/hyteg/gridtransferoperators/P2P1StokesToP2P1StokesRestriction.hpp:** Restriction and Prolongation operator subclasses that contains a normal projection at an appropriate spot for the freeslip boundary conditions.
**data/meshes:** Just some additional meshes which are offset from the origin (are used for testing with the sphericalCoordinateMap blending map.
**src/forms:** Just some additional generated blending forms.
**src/geometry:** Added second derivative functions (needed for SUPG Stabilisiation) for all blending maps and a new spherical coordinate map.
**tests/hyteg/operators:** Added tests checking if the various DoFValueOperators are calculating the correct integrals and if the diagonal calculation for the temperature dependent stokes works.
Hopefully I haven't forgotten anything and these are all changes.Andreas BurkhartAndreas Burkharthttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/701Draft: Adding an app for analytical benchmarking v22024-02-21T09:52:11+01:00Ponsuganth Ilangovan Ponkumar IlangoDraft: Adding an app for analytical benchmarking v2This is in relation to !688
As I wasn't sure what caused the pipeline to fail, I branched out from master and added the app again and the pipeline passes, so we could complete this merge request and delete !688This is in relation to !688
As I wasn't sure what caused the pipeline to fail, I branched out from master and added the app again and the pipeline passes, so we could complete this merge request and delete !688Ponsuganth Ilangovan Ponkumar IlangoPonsuganth Ilangovan Ponkumar Ilangohttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/688Draft: Adding an app for analytical benchmarking2024-02-21T09:51:24+01:00Ponsuganth Ilangovan Ponkumar IlangoDraft: Adding an app for analytical benchmarkingThis extra app under the folder `2024-convbench` basically solves the Stokes system for freeslip-freeslip and noslip-freeslip boundary condition cases on a thick spherical shell and calculates the L2 error with the analytical solution. I...This extra app under the folder `2024-convbench` basically solves the Stokes system for freeslip-freeslip and noslip-freeslip boundary condition cases on a thick spherical shell and calculates the L2 error with the analytical solution. It calls python routines inside the `interpolate` function to get the analytical solutions from the `assess` python package. More details on using the app is in `readme.md`.
Major additions would be
1. [`P2P1ElementwiseBlendingFullViscousStokesOperator`](https://i10git.cs.fau.de/hyteg/hyteg/-/blob/ponsuganth/analytical-benchmark-minimal/src/hyteg/elementwiseoperators/P2P1ElementwiseBlendingStokesOperator.hpp?ref_type=heads#L123), which basically uses the full viscous operator forms for the velocity block
- $\eta\left((\nabla u + \nabla u^\top) - \frac{2}{3}\nabla\cdot u\right)$
2. [`PythonCallingWrapper`](https://i10git.cs.fau.de/hyteg/hyteg/-/blob/ponsuganth/analytical-benchmark-minimal/src/hyteg/PythonCallingWrapper.hpp), a simple class to call a Python function which returns a `list` and is returned as an `std::vector`
The next step would be to create a test with this.Ponsuganth Ilangovan Ponkumar IlangoPonsuganth Ilangovan Ponkumar Ilangohttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/671Enable float16 support for the P1 functionspace2024-02-13T18:29:24+01:00Michael ZikeliEnable float16 support for the P1 functionspaceHyTeG was not able to work with float16 types. This merge request fixes this by adding the missing functionality for the P1 functionspace.
Necessary changes:
- [x] Template and explicit instantiate the following kernels that have been ...HyTeG was not able to work with float16 types. This merge request fixes this by adding the missing functionality for the P1 functionspace.
Necessary changes:
- [x] Template and explicit instantiate the following kernels that have been generated at some point <add, apply, assign, communicate>. The other two kernel types <GS and SOR> have not been templated yet, since they are not used for the generated operators.
- [x] Set standard to C++23 if half precision support is enabled, otherwise some basic asserts like `is_floating_point` will fail.
- [x] Add test that check if all necessary functionality of float16 is working properly.
- [x] Update walberla to support float16 support.
- [x] Make sure that `WALBERLA_BUILD_WITH_HALF_PRECISION_SUPPORT` is enabled in the pipeline.
- [x] Make sure that the remote on the submodule walberla is the walberla repo and not a local fork.
- [x] Test the implementation and float16SupportTest for older compilers as well.
- [x] Some of the now templated kernels use copy by value, while reference is sufficient. Go back and add references.
- [x] Update the license in the modified files.
---
This merge request is dependent on the walberla merge request [!643](https://i10git.cs.fau.de/walberla/walberla/-/merge_requests/643).Michael ZikeliMichael Zikelihttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/672Extend OpGen tests to allow operators of different precision/ValueType2024-01-31T11:04:49+01:00Michael ZikeliExtend OpGen tests to allow operators of different precision/ValueTypeThis MR should enable testing for operators of different precision than float64.
To do so,
* Compatibility checks must consider a function from the same space but with different precision as the same function, i.e. `is_same` check.
* ...This MR should enable testing for operators of different precision than float64.
To do so,
* Compatibility checks must consider a function from the same space but with different precision as the same function, i.e. `is_same` check.
* For each `ValueType`, an individual error acceptance limit must be chosen.
**Note**: Testing for different precisions is done only for `P1` function space, since this is the only function space for which other precisions than `float` and `double` are working yet. Also, Only `apply` and `invDiag` are tested.
_(The `invDiag` Test in `2D` for `float32` and `float16` returns exactly zero, not a really small number. This is not reasonable, but no reason for this can be found. Thus, this behavior is accepted right now, since at the moment only apply is needed for mixed precision investigations and with those everything works. This behavior should be kept in mind, though.)_
---
TODO:
- [ ] Merge the changes from [pystencils !2](https://i10git.cs.fau.de/terraneo/pystencils/-/merge_requests/2) and [HFG !57](https://i10git.cs.fau.de/terraneo/hyteg-form-generator/-/merge_requests/57), so that all necessary functionality can be generated.
- [ ] ~~Find a more scientific way to choose an acceptance limit for the individual errors.~~
- [x] Add the generated operators that need testing to the repository and the respective `.cpp` files.
---
Note: all changes that are done before the 20.12.2023 are related to !671 which is currently in the process of merging. **So don't mind any commit that is older than c9f959db76610cf32ad4c67505bc3ceba31086ac!**Michael ZikeliMichael Zikelihttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/650Temporarily deactivate ADIOS2 tests for old ICC compiler2023-09-14T13:38:18+02:00Marcus MohrTemporarily deactivate ADIOS2 tests for old ICC compilerSee discussion of issue #228 for details.See discussion of issue #228 for details.Marcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/645Enable ADIOS2-based tests in pipepline2023-09-11T17:18:57+02:00Marcus MohrEnable ADIOS2-based tests in pipeplineI recently recognised that, while we prepared the images for the pipeline jobs to include ADIOS2, the actual tests were not running, because `HYTEG_BUILD_WITH_ADIOS2` had not been activated. This MR will change this. By default jobs will...I recently recognised that, while we prepared the images for the pipeline jobs to include ADIOS2, the actual tests were not running, because `HYTEG_BUILD_WITH_ADIOS2` had not been activated. This MR will change this. By default jobs will now build with ADIOS2. The only current exception is the `clang_15_mpionly_petsc_trilinos` in the **pretest** stage. IMHO at least one job should not include ADIOS2 to ensure we can build without this optional dependency.Implement basic Checkpointing FunctionalityMarcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/644Enable ADIOS2-based tests in pipepline2023-09-11T12:34:10+02:00Marcus MohrEnable ADIOS2-based tests in pipeplineI recently recognised that, while we prepared the images for the pipeline jobs to include ADIOS2, the actual tests were not running, because `HYTEG_BUILD_WITH_ADIOS2` had not been activated. This MR will change this. By default jobs will...I recently recognised that, while we prepared the images for the pipeline jobs to include ADIOS2, the actual tests were not running, because `HYTEG_BUILD_WITH_ADIOS2` had not been activated. This MR will change this. By default jobs will now build with ADIOS2. The only current exception is the `clang_15_mpionly_petsc_trilinos` in the **pretest** stage. IMHO at least one job should not include ADIOS2 to ensure we can build without this optional dependency.Marcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/633Add test for FEFunctionRegistry class2023-07-25T23:05:06+02:00Marcus MohrAdd test for FEFunctionRegistry classImplement basic Checkpointing FunctionalityMarcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/631Add testing of export of 2D surfaces in 3D with AdiosWriter2023-07-25T21:27:52+02:00Marcus MohrAdd testing of export of 2D surfaces in 3D with AdiosWriterExtend capabilities for exporting data by adding support for ADIOS2Marcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/590Extend VTKOutputTest2023-04-28T14:17:35+02:00Marcus MohrExtend VTKOutputTestExtend `VTKOutputTest` to also check that exporting works for objects of type
| type | dimensions | ValueType |
| ------------ | ---------- | ----------------- |
| P0Function | 2D + 3D | real_t + integral |
| DG1Fun...Extend `VTKOutputTest` to also check that exporting works for objects of type
| type | dimensions | ValueType |
| ------------ | ---------- | ----------------- |
| P0Function | 2D + 3D | real_t + integral |
| DG1Function | 2D + 3D | real_t |
| EGFunction | 2D | real_t |
| N1E1Function | 3D | real_t |
and make `VTKOutput` abort for `EGFunction` on a 3D mesh. With respect to integral ValueType see also the discussion in issue #210 and for the `EGFunction` export see issue #211.Nils KohlNils Kohlhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/554Add N1curlFenicsForm class and n1Curl_tet_mass form for testing2022-12-21T10:42:26+01:00Marcus MohrAdd N1curlFenicsForm class and n1Curl_tet_mass form for testingCommit extends the FFC build files to allow generation of a mass form for
3D for Nedelec H(curl) elements (of the first kind). It also adds the
resulting form. The latter, is integrated into the HyTeG code structure
by adding a correspon...Commit extends the FFC build files to allow generation of a mass form for
3D for Nedelec H(curl) elements (of the first kind). It also adds the
resulting form. The latter, is integrated into the HyTeG code structure
by adding a corresponding class and included into the HyTeGVsFenicsFormTest
to compare it to the N1E1FormMass form.Marcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/529Implement AffineMap[23]D::evalFinv() amd fix/extend AffineMap3DTest2022-10-25T21:55:36+02:00Marcus MohrImplement AffineMap[23]D::evalFinv() amd fix/extend AffineMap3DTestMarcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/516Adds test for interpolation with extended expression2022-06-14T17:04:37+02:00Marcus MohrAdds test for interpolation with extended expressionMarcus MohrMarcus Mohrhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/504DG apply testing2022-04-12T09:40:22+02:00Nils KohlDG apply testingNils KohlNils Kohlhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/482Bumping code coverage a little by adding untested forms to fenics comparison ...2022-02-04T12:44:29+01:00Nils KohlBumping code coverage a little by adding untested forms to fenics comparison test.Fixes https://i10git.cs.fau.de/hyteg/hyteg/-/issues/168.Fixes https://i10git.cs.fau.de/hyteg/hyteg/-/issues/168.Nils KohlNils Kohlhttps://i10git.cs.fau.de/hyteg/hyteg/-/merge_requests/379MacroFaceIndexing fix2020-11-27T14:38:35+01:00Daniel DrzisgaMacroFaceIndexing fixWhile trying out different permutations of vertex orderings in a macro face, I noticed some kind of anomaly. Andreas dug deeper and managed to find a bug in `MacroFaceIndexing.hpp`. It seems like the tests had a mistake as well and that ...While trying out different permutations of vertex orderings in a macro face, I noticed some kind of anomaly. Andreas dug deeper and managed to find a bug in `MacroFaceIndexing.hpp`. It seems like the tests had a mistake as well and that is why the bug went unnoticed. We are still unsure why we have never noticed this error in any of our experiments. We can discuss more about this later in our meeting.Nils KohlNils Kohl