tnl-dev issueshttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues2021-04-13T19:33:38Zhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/2Python-like string methods2021-04-13T19:33:38ZJakub KlinkovskýPython-like string methodsThe `TNL::String` class should be expanded to include methods inspired by the [Python `str` class](https://docs.python.org/3/library/stdtypes.html#string-methods). Without that, there is no reason to keep using `TNL::String` instead of `...The `TNL::String` class should be expanded to include methods inspired by the [Python `str` class](https://docs.python.org/3/library/stdtypes.html#string-methods). Without that, there is no reason to keep using `TNL::String` instead of `std::string`.
Most important methods:
- [x] replace
- [x] strip
- [ ] lstrip
- [ ] rstrip
- [x] startswith
- [x] endswith
- [ ] count
- [ ] find
- [ ] rfind
- [ ] join
- [x] substr (Python does it with the `string[start:end+1]` syntax)https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/8Sparse matrices todo list2022-01-21T12:55:19ZJakub KlinkovskýSparse matrices todo list- vyjasnit si rvalue references a implementovat move constructor, move assignment operator
- definovat a otestovat (benchmarkem) základní operátory (+, -, *scalar, *vector, ...) pomocí move konstructoru/přiřazení
- zúplnit + otestovat + ...- vyjasnit si rvalue references a implementovat move constructor, move assignment operator
- definovat a otestovat (benchmarkem) základní operátory (+, -, *scalar, *vector, ...) pomocí move konstructoru/přiřazení
- zúplnit + otestovat + benchmarkovat kopírování mezi jednotlivými formáty a různými Device - bylo by hezké, kdyby to šlo udělat pomocí přiřazovacího operátoru (kdysi jsem napsal funkci `copySparseMatrix` - viz `Sparse{,_impl}.h`)
- kernely pro násobení řídkých matic (v ILU se dá struktura pro zaplnění určit pomocí mocnin binární matice - powers of binary matrix (PBM) strategie - mám na to nějaký článek) (a taky se to hodí v multigridu)
- výpočet maticových norem (hodilo by se např. pro testování `||A - LU||` kde LU je neúplný rozklad)
- nějak promyslet `MatrixOperations` (třída pro operace nezávislé na formátu matice)
- smysl je oddělit high-level algoritmy (=matematika) od storage a základních operací
- solvery pro trojúhelníkové matice - sekvenční algoritmy jsou natvrdo v ILU0 (algoritmy pro CUDA jsou ale na samostatné téma...)
- husté matice by měly být použitelné i v CUDA kernelech
- proxy třídy pro submatice (např. diagonální blok - hodí se v distribuovaných výpočtech)
- proxy třídy pro trojúhelníkové submatice (a navíc implicitní 1 na diagonále) - aby se daly ukládat faktory L a U "v jednom" a použít na ně trojúhelníkový solver
- transpozice - jednak proxy, ale i materializovaná
- Pro husté matice se dá zjednodušit přístup k prvkům pomocí `operator()` místo `getElementFast`/`setElementFast` (běžně se to používá v lepších knihovnách). Pro řídké matice by se takto dal zjednodušit read-only přístup, ale asi ne zápis (nelze vrátit referenci na neexistující prvek). I když, aktuální implementace `setElementFast` stejně funguje z kernelu jen když se nemusí měnit sloupcový index, takže by se klidně mohl používat `operator()` i pro přepsání existující hodnoty...
- metoda `getRowLength` vrací číslo včetně padding zeros u ellpack formátů, což je nešikovné - často se hodí znát přesně reálnou délku řádku. Chtělo by to buď ukládat nebo umět rychle spočítat. Rozhodně je to potřeba pro metodu `getCompressedRowLengths`...
- implementovat `MatrixTypeResolver` pro načítání matic ze souboru (analogie k `MeshTypeResolver`)
- bug: některé atributy nejsou inicializované pro matice načtené ze souboru (např. `getMaxRowLength()` vrací 0, protože se nevolala metoda `setCompressedRowLengths`)
- implementovat `tnl-matrix-converter` - nástroj pro konverzi mezi libovolnými maticovými formáty - hodilo by se hlavně pro export do texťáků (gnuplot a mtx)
- implementovat metodu pro seřazení hodnot v každém řádku dle sloupcových indexů (viz https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.sort_indices.html)https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/17Update GridTraverser for vertexes to support distributed grid overlaps2020-07-29T11:50:36ZTomáš OberhuberUpdate GridTraverser for vertexes to support distributed grid overlapsTomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/33Implement segmented prefix-sum in CUDA2019-08-14T20:39:39ZTomáš OberhuberImplement segmented prefix-sum in CUDAhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/38Reimplement StaticVectorExpressions using StaticFor.2019-08-14T18:13:43ZTomáš OberhuberReimplement StaticVectorExpressions using StaticFor.Reimplement StaticVectorExpressions using StaticFor as it is done in StaticArray and StaticVector.Reimplement StaticVectorExpressions using StaticFor as it is done in StaticArray and StaticVector.Tomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/44Extended NDArray operations2021-11-23T19:08:29ZJakub KlinkovskýExtended NDArray operationsAfter !18 the following things remain to be implemented:
## Features
- [ ] implement generic assignment operator
- [x] support any value, device and index types
- [ ] support any permutation
- [ ] support copies to and from...After !18 the following things remain to be implemented:
## Features
- [ ] implement generic assignment operator
- [x] support any value, device and index types
- [ ] support any permutation
- [ ] support copies to and from non-contiguous memory (e.g. subarrays)
- [x] add support for different allocators (c.f. `Array` implementation)
## Applications
- [ ] storage for `VectorField` in TNL
- [ ] subarrays: writing 1D and 2D slices into VTK
## Operations
- [ ] `reduce_along_axis`, `reduce_along_axes` - generalized multireductions - see also https://bitbucket.org/eigen/eigen/src/default/unsupported/Eigen/CXX11/src/Tensor/README.md?at=default&fileviewer=file-view-default#markdown-header-reduction-operations
- [ ] `apply_along_axis` - apply a function to all 1D slices along given axis (challenge: parallelization of outer or inner function)
- Note that unlike [numpy.apply_along_axis](https://docs.scipy.org/doc/numpy/reference/generated/numpy.apply_along_axis.html), the inner function cannot change the array dimension/shape.
- Note that the similar NumPy function, [apply_over_axes](https://docs.scipy.org/doc/numpy/reference/generated/numpy.apply_over_axes.html), is not applicable to NDArray because the slices along different axes have different type so a single function cannot be applied to them. Also, even in NumPy it is interesting only with the change of dimension/shape.
- [ ] reordering of ND arrays along any axis (currently hardcoded in `tnl-mhfem` only for one specific layout of dofs)
- [ ] other [NumPy array manipulation routines](https://docs.scipy.org/doc/numpy/reference/routines.array-manipulation.html) - logical re-shaping and transpose-like operations (i.e. return a view with different sizes or permutation of axes without changing the data)
- [ ] [Eigen geometrical operations on tensors](https://bitbucket.org/eigen/eigen/src/default/unsupported/Eigen/CXX11/src/Tensor/README.md?at=default&fileviewer=file-view-default#markdown-header-geometrical-operations)
## Benchmarks
- [ ] compilation time depending on the number of dimensions, number of ndarrays in code, ...
- [ ] overhead of the indexing calculation for high-dimensional array
- [ ] operations
- [ ] comparison with [RAJA](https://github.com/LLNL/RAJA)
identity perm, set: 1D bandwidth: 9.4718 GB/s, 6D bandwidth: 8.52481 GB/s (9% difference)
identity perm, assign: 1D bandwidth: 11.503 GB/s, 6D bandwidth: 11.0063 GB/s (4.5% loss compared to 1D)
reverse perm, assign: 6D bandwidth: 9.58735 GB/s (13% loss compared to identity 6D)
- [ ] comparison with OpenFOAM - `ScalarField`, `VectorField`, `TensorField`, operations like tensor*vector (locally on mesh cells)Jakub KlinkovskýJakub Klinkovskýhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/51Wrappers for STL compatibility2021-04-13T19:30:42ZTomáš OberhuberWrappers for STL compatibilityMake wrappers for easier porting of STL code to TNL. It means, for example, wrapper for TNL::Array which has the same methods as STL vector and so on.Make wrappers for easier porting of STL code to TNL. It means, for example, wrapper for TNL::Array which has the same methods as STL vector and so on.https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/74Implement MeshView and maybe DistributedMeshView2020-06-24T12:30:48ZJakub KlinkovskýImplement MeshView and maybe DistributedMeshViewThere should be support for sub-configurations, so that light views could be initialized by a full mesh, e.g. a view including only cells, vertices and links from cells to their subvertices. The same can be done with `Mesh`'s copy-constr...There should be support for sub-configurations, so that light views could be initialized by a full mesh, e.g. a view including only cells, vertices and links from cells to their subvertices. The same can be done with `Mesh`'s copy-constructor.Jakub KlinkovskýJakub Klinkovskýhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/76Grids todo list2021-09-28T19:58:15ZJakub KlinkovskýGrids todo listContinuing #52...
- [x] use `.vti` files for the storage of grids, drop `TNLReader`
- [ ] `getEntityIndex()` should be removed from grid - users should call `entity.getIndex()`
- [ ] `getEntity()` and `getEntitiesCount()` should have `i...Continuing #52...
- [x] use `.vti` files for the storage of grids, drop `TNLReader`
- [ ] `getEntityIndex()` should be removed from grid - users should call `entity.getIndex()`
- [ ] `getEntity()` and `getEntitiesCount()` should have `int Dimension` template parameter
- [ ] `isBoundaryEntity()` should be moved from `GridEntity` to `Grid` - it is not only an entity attribute, it is always bound to the particular mesh.
Generally, entities might be shared between multiple submeshes, so the method does not make sense in the general interface.
There might also be read-only views for partitions of the mesh (see vienna-grid).
- <s>[ ] the `getMesh()` method should be removed from `GridEntity` - for the same reason as `isBoundaryEntity()`
(it is also an optimization because the size of the entity structure will be smaller)</s>
- [ ] `getCenter()` and `getMeasure()` should be plain functions taking a `Mesh` and `MeshEntity` as parameters.
This is because general MeshEntity stores only indices of the subvertices, the points have to be accessed via Mesh class.
See also [Effective C++ Item 23 Prefer non-member non-friend functions to member functions](https://stackoverflow.com/questions/5989734/effective-c-item-23-prefer-non-member-non-friend-functions-to-member-functions) and the [Open-closed principle](https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle).https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/80Silence of unused variable warning2020-07-12T10:22:44ZTomáš JakubecSilence of unused variable warningIt would be nice to silence the warnings caused by unused variables. There are several ways to do it:
1. do not name the unused argument (not preferable),
2. use [[maybe_unused]] (since C++17) in function definition,
3. typecast the unus...It would be nice to silence the warnings caused by unused variables. There are several ways to do it:
1. do not name the unused argument (not preferable),
2. use [[maybe_unused]] (since C++17) in function definition,
3. typecast the unused variable (void) var. This approach is used in Qt.
For example consider the following function:
```c++
static std::string name( CudaStatusType error_code )
{
#ifdef HAVE_CUDA
return cudaGetErrorName( error_code );
#else
(void) error_code;
throw CudaSupportMissing();
#endif
}
```
The approach in [Qt](https://doc.qt.io/qt-5/qtglobal.html#Q_UNUSED) discussed [here](https://stackoverflow.com/questions/19576884/does-q-unused-have-any-side-effects) is the following:
```c++
#define UNUSED(var) (void) var
```
Then, the warning can be silenced by `UNUSED(error_code);`.Tomáš JakubecTomáš Jakubechttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/84Assertions for correct definitions of lambda functions2021-02-04T21:27:49ZTomáš OberhuberAssertions for correct definitions of lambda functionsBased on the following concept
https://en.cppreference.com/w/cpp/types/is_invocable (C++-17)
https://www.boost.org/doc/libs/develop/libs/callable_traits/doc/html/callable_traits/reference.html#callable_traits.reference.ref_is_invocabl...Based on the following concept
https://en.cppreference.com/w/cpp/types/is_invocable (C++-17)
https://www.boost.org/doc/libs/develop/libs/callable_traits/doc/html/callable_traits/reference.html#callable_traits.reference.ref_is_invocable (boost in C++-11)
methods accepting lambda fucntions should check them by static_assert if they have correct definition of parameters.Tomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/92Sparse matrices with 64-bit indices for addressing values, but 32-bit storage...2021-09-28T19:29:14ZJakub KlinkovskýSparse matrices with 64-bit indices for addressing values, but 32-bit storage for column indicesE.g. PE has a matrix 471526400 x 471526400 with 3099301688 non-zeros. A 64-bit type is necessary to address the non-zero values and column indices in the global arrays, but we can store the column indices as 32-bit only. This would save ...E.g. PE has a matrix 471526400 x 471526400 with 3099301688 non-zeros. A 64-bit type is necessary to address the non-zero values and column indices in the global arrays, but we can store the column indices as 32-bit only. This would save about 25% of space (`double` + `int` vs `double` + `long int`).
See also https://github.com/pyamg/pyamg/issues/277Tomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/98Structured logger for solvers2021-11-25T19:46:53ZJakub KlinkovskýStructured logger for solvers- the `TNL::Logger` class should be structured, i.e. like the inverse of the `ParameterContainer`
- then it will be possible to make serialization classes (JSON, yaml or pretty-format) or let it pass to Python
- idea: the `writeProlog` m...- the `TNL::Logger` class should be structured, i.e. like the inverse of the `ParameterContainer`
- then it will be possible to make serialization classes (JSON, yaml or pretty-format) or let it pass to Python
- idea: the `writeProlog` method just serializes `ParameterContainer` into `Logger`, it should be possible to do that automatically
- some logging library like [spdlog](https://github.com/gabime/spdlog) or [Easylogging++](https://github.com/muflihun/easyloggingpp) could be used
(moved from #26)Jakub KlinkovskýJakub Klinkovskýhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/101Update tnl-decompose-mesh for polyhedral meshes2022-07-03T19:38:32ZJakub KlinkovskýUpdate tnl-decompose-mesh for polyhedral meshesWe need to collect also faces on each subdomain and add them to the mesh builder.We need to collect also faces on each subdomain and add them to the mesh builder.Jakub KlinkovskýJakub Klinkovský