tnl-dev issueshttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues2022-01-21T12:55:19Zhttps://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/16Refactors neighbors and periodicNeighbors in DistributedGrid2020-07-29T11:50:11ZTomáš OberhuberRefactors neighbors and periodicNeighbors in DistributedGridneighbors and periodicNeighbors in DistributedGrid should be implemented using the StaticArray.neighbors and periodicNeighbors in DistributedGrid should be implemented using the StaticArray.Tomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/31Use std::swap instead of custom methods2019-08-31T11:16:33ZJakub KlinkovskýUse std::swap instead of custom methods`std::swap` works out-of-the-box for objects that are `MoveAssignable` and `MoveConstructible`, see https://stackoverflow.com/q/39675073. If it does not work out-of-the box, `std::swap` can be overloaded for custom objects. Hence, `std::...`std::swap` works out-of-the-box for objects that are `MoveAssignable` and `MoveConstructible`, see https://stackoverflow.com/q/39675073. If it does not work out-of-the box, `std::swap` can be overloaded for custom objects. Hence, `std::swap` should be preferred instead of custom `swap` methods which do just the trivial thing in most cases.
Since [C++20](https://en.cppreference.com/w/cpp/algorithm/swap) `std::swap` will be `constexpr` so it will be possible to remove even the [TNL::swap](https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/blob/a82afc32eeac15982bbb26703de621491eb9e387/src/TNL/Math.h#L159-171) function.Jakub KlinkovskýJakub Klinkovskýhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/68Remove template parameter `isBinary_` from SparseMatrixRowView2021-04-13T19:27:05ZJakub KlinkovskýRemove template parameter `isBinary_` from SparseMatrixRowViewThe method `SparseMatrixRowView::isBinary()` can be implemented by checking if `RealType` is `bool`, the same way as in `SparseMatrix`.The method `SparseMatrixRowView::isBinary()` can be implemented by checking if `RealType` is `bool`, the same way as in `SparseMatrix`.Tomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/75Fix/improve the implementation of mesh entity orientations2021-04-11T08:03:13ZJakub KlinkovskýFix/improve the implementation of mesh entity orientationsCurrently it is untested and inefficient because it is based on storing the whole subvertex permutations for each entity. We need to better understand what information is needed for FVM and improve the implementation.Currently it is untested and inefficient because it is based on storing the whole subvertex permutations for each entity. We need to better understand what information is needed for FVM and improve the implementation.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/90Refactor contains and containsOnlyValue2021-08-02T12:51:12ZJakub KlinkovskýRefactor contains and containsOnlyValue- `contains` should be changed to `find` (c.f. [std::find](https://en.cppreference.com/w/cpp/algorithm/find))
- `containsOnlyValue` should be generalized to have similar interface like `std::all_of`, `std::any_of`, `std::none_of`: https:...- `contains` should be changed to `find` (c.f. [std::find](https://en.cppreference.com/w/cpp/algorithm/find))
- `containsOnlyValue` should be generalized to have similar interface like `std::all_of`, `std::any_of`, `std::none_of`: https://en.cppreference.com/w/cpp/algorithm/all_any_none_of
- maybe we should add `operator==` for comparing an array/vector with a scalar/ValueTypehttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/94Refactor SpMV kernels using CudaBlockReduceShfl::warpReduce2021-09-28T20:35:56ZJakub KlinkovskýRefactor SpMV kernels using CudaBlockReduceShfl::warpReduceVarious SpMV kernels have "inlined" code for parallel reduction across warp, e.g. [EllpackCudaReductionKernelFull](https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/blob/TO/matrices-adaptive-csr/src/TNL/Algorithms/Segments/EllpackView...Various SpMV kernels have "inlined" code for parallel reduction across warp, e.g. [EllpackCudaReductionKernelFull](https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/blob/TO/matrices-adaptive-csr/src/TNL/Algorithms/Segments/EllpackView.hpp#L48-53). They should call [CudaBlockReduceShfl::warpReduce](https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/blob/develop/src/TNL/Algorithms/detail/CudaReductionKernel.h#L187-203) instead.Tomáš OberhuberTomáš Oberhuberhttps://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/issues/97Allocators and smart pointers2021-11-25T19:45:45ZJakub KlinkovskýAllocators and smart pointers- add `Allocator` to smart pointers
(moved from #26)- add `Allocator` to smart pointers
(moved from #26)Jakub KlinkovskýJakub Klinkovskýhttps://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/99Configurable SolverMonitor2021-12-09T04:48:09ZJakub KlinkovskýConfigurable SolverMonitorThe `SolverMonitor` class should be more configurable for different types of applications. The interface could be similar to the [BenchmarkResult](https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/blob/develop/src/TNL/Benchmarks/Bench...The `SolverMonitor` class should be more configurable for different types of applications. The interface could be similar to the [BenchmarkResult](https://mmg-gitlab.fjfi.cvut.cz/gitlab/tnl/tnl-dev/-/blob/develop/src/TNL/Benchmarks/Benchmarks.h#L28-60) class used for configuring benchmarks.Jakub KlinkovskýJakub Klinkovský