ngsolve 6.2.2506.post216.dev0__cp314-cp314-manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngs_nvcc +22 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngs_nvlink +17 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngscxx +15 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngsld +11 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngsolve.tcl +648 -0
- ngsolve-6.2.2506.post216.dev0.data/data/bin/ngspy +2 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/analytic_integrals.hpp +10 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/arnoldi.hpp +55 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bandmatrix.hpp +334 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/basematrix.hpp +963 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/basevector.hpp +1268 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bdbequations.hpp +2807 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bdbintegrator.hpp +1660 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bem_diffops.hpp +475 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bessel.hpp +1064 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bilinearform.hpp +966 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bla.hpp +29 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/blockalloc.hpp +95 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/blockjacobi.hpp +328 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/bspline.hpp +116 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/calcinverse.hpp +141 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cg.hpp +368 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/chebyshev.hpp +44 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cholesky.hpp +720 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/clapack.h +7254 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/code_generation.hpp +296 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient.hpp +2033 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient_impl.hpp +19 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/coefficient_stdmath.hpp +167 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/commutingAMG.hpp +106 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/comp.hpp +79 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/compatibility.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/complex_wrapper.hpp +101 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/compressedfespace.hpp +110 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/contact.hpp +239 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_core.hpp +216 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_linalg.hpp +185 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_ngbla.hpp +317 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_ngstd.hpp +414 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/cuda_profiler.hpp +240 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diagonalmatrix.hpp +160 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/differentialoperator.hpp +276 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffop.hpp +1286 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffop_impl.hpp +328 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/diffopwithfactor.hpp +123 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/discontinuous.hpp +84 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/dump.hpp +949 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ectypes.hpp +121 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/eigen.hpp +60 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/eigensystem.hpp +18 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elasticity_equations.hpp +595 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementbyelement.hpp +201 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementtopology.hpp +1760 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/elementtransformation.hpp +339 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/evalfunc.hpp +405 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/expr.hpp +1693 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetfe.hpp +175 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetfespace.hpp +180 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facethofe.hpp +111 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/facetsurffespace.hpp +112 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fe_interfaces.hpp +32 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fem.hpp +87 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fesconvert.hpp +14 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/fespace.hpp +1454 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/finiteelement.hpp +286 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/globalinterfacespace.hpp +77 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/globalspace.hpp +115 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/gridfunction.hpp +525 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1amg.hpp +124 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofe.hpp +188 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofe_impl.hpp +1262 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofefo.hpp +148 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofefo_impl.hpp +185 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1hofespace.hpp +167 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1lofe.hpp +1240 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/h1lumping.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurl_equations.hpp +1381 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlcurlfe.hpp +2241 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlcurlfespace.hpp +78 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlfe.hpp +259 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlfe_utils.hpp +107 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhdiv_dshape.hpp +857 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhdivfes.hpp +308 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofe.hpp +175 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofe_impl.hpp +1871 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurlhofespace.hpp +193 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hcurllofe.hpp +1146 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdiv_equations.hpp +880 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivdivfe.hpp +2923 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivdivsurfacespace.hpp +76 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfe.hpp +206 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfe_utils.hpp +717 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivfes.hpp +75 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofe.hpp +447 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofe_impl.hpp +1107 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofefo.hpp +229 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhofespace.hpp +177 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivhosurfacefespace.hpp +106 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hdivlofe.hpp +773 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hidden.hpp +74 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/householder.hpp +181 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hypre_ams_precond.hpp +123 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/hypre_precond.hpp +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/integrator.hpp +2012 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/integratorcf.hpp +253 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/interpolate.hpp +49 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/intrule.hpp +2542 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/intrules_SauterSchwab.hpp +25 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/irspace.hpp +49 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/jacobi.hpp +153 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/kernels.hpp +724 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofe.hpp +194 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofe_impl.hpp +564 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofefo.hpp +542 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/l2hofespace.hpp +344 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/la.hpp +38 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/linalg_kernels.hpp +70 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/linearform.hpp +266 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/matrix.hpp +2145 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/memusage.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/meshaccess.hpp +1359 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mgpre.hpp +204 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mp_coefficient.hpp +145 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mptools.hpp +2281 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/multigrid.hpp +42 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/multivector.hpp +447 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mumpsinverse.hpp +187 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/mycomplex.hpp +361 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ng_lapack.hpp +1661 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngblas.hpp +1232 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_defines.hpp +30 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_stdcpp_include.hpp +106 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngs_utils.hpp +121 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngsobject.hpp +1019 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngsstream.hpp +113 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/ngstd.hpp +72 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/nodalhofe.hpp +96 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/nodalhofe_impl.hpp +141 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetfe.hpp +223 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetfespace.hpp +98 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/normalfacetsurfacefespace.hpp +84 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/order.hpp +251 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallel_matrices.hpp +222 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/paralleldofs.hpp +340 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallelngs.hpp +23 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/parallelvector.hpp +269 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pardisoinverse.hpp +200 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/periodic.hpp +129 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/plateaufespace.hpp +25 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pml.hpp +275 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/pmltrafo.hpp +631 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/postproc.hpp +142 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/potentialtools.hpp +22 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/precomp.hpp +60 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/preconditioner.hpp +602 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/prolongation.hpp +380 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_comp.hpp +107 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_fem.hpp +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_linalg.hpp +58 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/python_ngstd.hpp +386 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol.hpp +4896 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol_tet.hpp +395 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/recursive_pol_trig.hpp +492 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/reorderedfespace.hpp +81 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sample_sort.hpp +105 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/scalarfe.hpp +335 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/shapefunction_utils.hpp +113 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/simd_complex.hpp +329 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/smoother.hpp +253 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/solve.hpp +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsecholesky.hpp +317 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsefactorization_interface.hpp +159 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix.hpp +1052 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix_dyn.hpp +90 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/sparsematrix_impl.hpp +1055 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/special_matrix.hpp +463 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/specialelement.hpp +125 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/statushandler.hpp +33 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/stringops.hpp +12 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/superluinverse.hpp +136 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/symbolicintegrator.hpp +850 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/symmetricmatrix.hpp +144 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tangentialfacetfe.hpp +224 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tangentialfacetfespace.hpp +91 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensor.hpp +522 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensorcoefficient.hpp +446 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tensorproductintegrator.hpp +113 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thcurlfe.hpp +128 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thcurlfe_impl.hpp +380 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thdivfe.hpp +80 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/thdivfe_impl.hpp +492 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpdiffop.hpp +461 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpfes.hpp +133 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tpintrule.hpp +224 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/triangular.hpp +465 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tscalarfe.hpp +245 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/tscalarfe_impl.hpp +1029 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/umfpackinverse.hpp +148 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/unifiedvector.hpp +103 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vector.hpp +1452 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/voxelcoefficientfunction.hpp +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vtkoutput.hpp +198 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/vvector.hpp +208 -0
- ngsolve-6.2.2506.post216.dev0.data/data/include/netgen/webgui.hpp +92 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/NGSolveConfig.cmake +102 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/ngsolve-targets-release.cmake +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/cmake/ngsolve/ngsolve-targets.cmake +180 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngbla.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngcomp.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngfem.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngla.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngsbem.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngscudalib.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngsolve.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/netgen_mesher.libs/libngstd.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/TensorProductTools.py +210 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__console.py +94 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__expr.py +181 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/__init__.py +148 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/_scikit_build_core_dependencies.py +30 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/bvp.py +78 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/__init__.py +1 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/__main__.py +4 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/config/config.py +60 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_1d_1d.py +80 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_1d_2d.py +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_2d_1d.py +72 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/TensorProduct/tp_dg_2d_2d.py +66 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/hhj.py +44 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/hybrid_dg.py +53 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/mixed.py +30 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/nonlin.py +29 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/pickling.py +26 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/pml.py +31 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/taskmanager.py +20 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/tdnns.py +47 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDG-skeleton.py +45 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDG.py +38 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDGlap.py +42 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/howto/timeDGwave.py +61 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/adaptive.py +123 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/cmagnet.py +59 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/elasticity.py +76 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/navierstokes.py +74 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/poisson.ipynb +170 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/intro/poisson.py +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/__init__.py +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_cmagnet.py +87 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_navierstokes.py +117 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_poisson.py +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/demos/mpi/mpi_timeDG.py +82 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/directsolvers.py +14 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/eigenvalues.py +364 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/internal.py +89 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/krylovspace.py +1182 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/meshes.py +748 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngs2petsc.py +310 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngscuda.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngscxx.py +42 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/ngslib.so +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/nonlinearsolvers.py +203 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/preconditioners.py +11 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solve_implementation.py +168 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solvers/__init__.py +7 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/solvers/cudss.py +112 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/timestepping.py +185 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/timing.py +108 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/utils.py +167 -0
- ngsolve-6.2.2506.post216.dev0.data/data/lib/python3.14/site-packages/ngsolve/webgui.py +671 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/beam.geo +17 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/beam.vol +240 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/chip.in2d +41 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/chip.vol +614 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coil.geo +12 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coil.vol +2560 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coilshield.geo +24 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/coilshield.vol +3179 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/cube.geo +19 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/cube.vol +1832 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d10_DGdoubleglazing.pde +50 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d11_chip_nitsche.pde +40 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d1_square.pde +43 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d2_chip.pde +35 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d3_helmholtz.pde +22 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d4_cube.pde +46 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d5_beam.pde +74 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d6_shaft.pde +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d7_coil.pde +50 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d8_coilshield.pde +49 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/d9_hybridDG.pde +72 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/doubleglazing.in2d +27 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/doubleglazing.vol +737 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/piezo2d40round4.vol.gz +0 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/shaft.geo +73 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/shaft.vol +4291 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/square.in2d +17 -0
- ngsolve-6.2.2506.post216.dev0.data/data/share/ngsolve/square.vol +149 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/METADATA +14 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/RECORD +306 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/WHEEL +5 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/licenses/LICENSE +504 -0
- ngsolve-6.2.2506.post216.dev0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1055 @@
|
|
|
1
|
+
#ifndef FILE_NGS_SPARSEMATRIX_IMPL
|
|
2
|
+
#define FILE_NGS_SPARSEMATRIX_IMPL
|
|
3
|
+
|
|
4
|
+
/**************************************************************************/
|
|
5
|
+
/* File: sparsematrix_impl.hpp */
|
|
6
|
+
/* Author: Joachim Schoeberl */
|
|
7
|
+
/* Date: 01. Oct. 94, 15 Jan. 02 */
|
|
8
|
+
/* redesign: Lukas Kogler, July 2019 */
|
|
9
|
+
/**************************************************************************/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
#include "sparsematrix.hpp"
|
|
13
|
+
namespace ngla
|
|
14
|
+
{
|
|
15
|
+
|
|
16
|
+
template <class TM>
|
|
17
|
+
SparseMatrixTM<TM> :: ~SparseMatrixTM ()
|
|
18
|
+
{ ; }
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
template <class TM>
|
|
22
|
+
void SparseMatrixTM<TM> ::
|
|
23
|
+
PrefetchRow (size_t rownr) const
|
|
24
|
+
{
|
|
25
|
+
#ifdef NETGEN_ARCH_AMD64
|
|
26
|
+
#ifdef __GNUC__
|
|
27
|
+
size_t fi = firsti[rownr], fin = firsti[rownr+1];
|
|
28
|
+
// int * pi = &colnr[fi], * pin = &colnr[fin];
|
|
29
|
+
int *pi = colnr.Data()+fi, *pin = colnr.Data()+fin;
|
|
30
|
+
while (pi < pin)
|
|
31
|
+
{
|
|
32
|
+
_mm_prefetch (reinterpret_cast<void*>(pi), _MM_HINT_T2);
|
|
33
|
+
pi += 64/sizeof(int);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
TM * vi = &data[fi], * vin = (&data[fin-1])+1;
|
|
37
|
+
while (vi < vin)
|
|
38
|
+
{
|
|
39
|
+
_mm_prefetch (reinterpret_cast<void*>(vi), _MM_HINT_T2);
|
|
40
|
+
vi += 64/sizeof(double);
|
|
41
|
+
}
|
|
42
|
+
#endif
|
|
43
|
+
#endif // NETGEN_ARCH_AMD64
|
|
44
|
+
;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
template <class TM>
|
|
49
|
+
shared_ptr<SparseMatrixTM<TM>> SparseMatrixTM<TM> ::
|
|
50
|
+
CreateFromCOO (FlatArray<int> indi, FlatArray<int> indj,
|
|
51
|
+
FlatArray<TM> val, size_t h, size_t w)
|
|
52
|
+
{
|
|
53
|
+
static Timer t("SparseMatrix::CreateFromCOO"); RegionTimer r(t);
|
|
54
|
+
static Timer t1("SparseMatrix::CreateFromCOO 1");
|
|
55
|
+
static Timer t2("SparseMatrix::CreateFromCOO 2");
|
|
56
|
+
static Timer t3("SparseMatrix::CreateFromCOO 3");
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
{
|
|
60
|
+
Array<int> cnt(h);
|
|
61
|
+
|
|
62
|
+
t1.Start();
|
|
63
|
+
DynamicTable<int> tab(h);
|
|
64
|
+
for (size_t i = 0; i < indi.Size(); i++)
|
|
65
|
+
tab.AddUnique(indi[i], indj[i]);
|
|
66
|
+
t1.Stop();
|
|
67
|
+
for (size_t i = 0; i < h; i++)
|
|
68
|
+
cnt[i] = tab.EntrySize(i);
|
|
69
|
+
|
|
70
|
+
auto matrix = make_shared<SparseMatrix<TM>> (cnt, w);
|
|
71
|
+
t2.Start();
|
|
72
|
+
for (auto k : ngstd::Range(indi))
|
|
73
|
+
matrix->CreatePosition(indi[k], indj[k]);
|
|
74
|
+
t2.Stop();
|
|
75
|
+
matrix->SetZero();
|
|
76
|
+
|
|
77
|
+
t3.Start();
|
|
78
|
+
for (auto k : ngstd::Range(indi))
|
|
79
|
+
(*matrix)(indi[k], indj[k]) += val[k];
|
|
80
|
+
t3.Stop();
|
|
81
|
+
// return matrix;
|
|
82
|
+
}
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
Array<int> cnt(h);
|
|
86
|
+
cnt = 0;
|
|
87
|
+
for (auto i : indi)
|
|
88
|
+
cnt[i]++;
|
|
89
|
+
|
|
90
|
+
Table<int> tab(cnt);
|
|
91
|
+
cnt = 0;
|
|
92
|
+
|
|
93
|
+
for (auto [i,j] : Zip(indi, indj))
|
|
94
|
+
tab[i][cnt[i]++] = j;
|
|
95
|
+
|
|
96
|
+
cnt = 0;
|
|
97
|
+
// for (int i = 0; i < tab.Size(); i++)
|
|
98
|
+
ParallelFor (tab.Size(), [&] (size_t i)
|
|
99
|
+
{
|
|
100
|
+
QuickSort (tab[i]);
|
|
101
|
+
|
|
102
|
+
int prev = -1;
|
|
103
|
+
for (auto j : tab[i])
|
|
104
|
+
{
|
|
105
|
+
if (j != prev) cnt[i]++;
|
|
106
|
+
prev = j;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
auto matrix = make_shared<SparseMatrix<TM>> (cnt, w);
|
|
111
|
+
t2.Start();
|
|
112
|
+
// for (auto k : ngstd::Range(indi))
|
|
113
|
+
// matrix->CreatePosition(indi[k], indj[k]);
|
|
114
|
+
|
|
115
|
+
cnt = 0;
|
|
116
|
+
for (int i = 0; i < tab.Size(); i++)
|
|
117
|
+
{
|
|
118
|
+
int prev = -1;
|
|
119
|
+
for (auto j : tab[i])
|
|
120
|
+
{
|
|
121
|
+
auto cols = matrix->GetRowIndices(i);
|
|
122
|
+
if (j != prev)
|
|
123
|
+
cols[cnt[i]++] = j;
|
|
124
|
+
prev = j;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
t2.Stop();
|
|
129
|
+
matrix->SetZero();
|
|
130
|
+
|
|
131
|
+
t3.Start();
|
|
132
|
+
/*
|
|
133
|
+
for (auto k : ngstd::Range(indi))
|
|
134
|
+
(*matrix)(indi[k], indj[k]) += val[k];
|
|
135
|
+
*/
|
|
136
|
+
ParallelFor (indi.Size(), [&](size_t k)
|
|
137
|
+
{
|
|
138
|
+
AtomicAdd ( (*matrix)(indi[k], indj[k]), val[k]);
|
|
139
|
+
});
|
|
140
|
+
t3.Stop();
|
|
141
|
+
return matrix;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
template <class TM>
|
|
149
|
+
void SparseMatrixTM<TM> ::
|
|
150
|
+
AddElementMatrix(FlatArray<int> dnums1, FlatArray<int> dnums2,
|
|
151
|
+
BareSliceMatrix<TSCAL> elmat1, bool use_atomic)
|
|
152
|
+
{
|
|
153
|
+
static Timer timer_addelmat_nonsym("SparseMatrix::AddElementMatrix", NoTracing);
|
|
154
|
+
RegionTimer reg (timer_addelmat_nonsym);
|
|
155
|
+
NgProfiler::AddThreadFlops (timer_addelmat_nonsym, TaskManager::GetThreadId(), dnums1.Size()*dnums2.Size());
|
|
156
|
+
|
|
157
|
+
ArrayMem<int, 50> map(dnums2.Size());
|
|
158
|
+
for (int i = 0; i < map.Size(); i++) map[i] = i;
|
|
159
|
+
QuickSortI (dnums2, map);
|
|
160
|
+
Scalar2ElemMatrix<TM, TSCAL> elmat (elmat1);
|
|
161
|
+
// .AddSize(mat_traits<TM>::HEIGHT*dnums1.Size(),
|
|
162
|
+
// mat_traits<TM>::WIDTH*dnums2.Size()));
|
|
163
|
+
|
|
164
|
+
for (int i = 0; i < dnums1.Size(); i++)
|
|
165
|
+
if (IsRegularIndex(dnums1[i]))
|
|
166
|
+
{
|
|
167
|
+
FlatArray rowind = this->GetRowIndices(dnums1[i]);
|
|
168
|
+
FlatVector<TM> rowvals = this->GetRowValues(dnums1[i]);
|
|
169
|
+
|
|
170
|
+
int k = 0;
|
|
171
|
+
for (int j1 = 0; j1 < dnums2.Size(); j1++)
|
|
172
|
+
{
|
|
173
|
+
int j = map[j1];
|
|
174
|
+
if (IsRegularIndex(dnums2[j]))
|
|
175
|
+
{
|
|
176
|
+
while (rowind[k] != dnums2[j])
|
|
177
|
+
{
|
|
178
|
+
k++;
|
|
179
|
+
if (k >= rowind.Size())
|
|
180
|
+
throw Exception ("SparseMatrixTM::AddElementMatrix: illegal dnums");
|
|
181
|
+
}
|
|
182
|
+
if (use_atomic)
|
|
183
|
+
AtomicAdd (rowvals(k), elmat(i,j));
|
|
184
|
+
else
|
|
185
|
+
rowvals(k) += elmat(i,j);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
template <class TM>
|
|
193
|
+
void SparseMatrixTM<TM> :: SetZero ()
|
|
194
|
+
{
|
|
195
|
+
static Timer t("SparseMatrix::SetZero (taskhandler)");
|
|
196
|
+
t.AddFlops (this->NZE());
|
|
197
|
+
RegionTimer reg(t);
|
|
198
|
+
|
|
199
|
+
/*
|
|
200
|
+
ParallelFor (balance, [&](int row)
|
|
201
|
+
{
|
|
202
|
+
data.Range(firsti[row], firsti[row+1]) = TM(0.0);
|
|
203
|
+
});
|
|
204
|
+
*/
|
|
205
|
+
ParallelForRange (balance, [&](IntRange r)
|
|
206
|
+
{
|
|
207
|
+
data.Range(firsti[r.First()], firsti[r.Next()]) = TM(0.0);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
215
|
+
SparseMatrix<TM,TV_ROW,TV_COL> :: SparseMatrix (const MatrixGraph & agraph)
|
|
216
|
+
: SparseMatrixTM<TM> (agraph)
|
|
217
|
+
{ ; }
|
|
218
|
+
|
|
219
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
220
|
+
SparseMatrix<TM,TV_ROW,TV_COL> :: SparseMatrix (MatrixGraph && agraph)
|
|
221
|
+
: SparseMatrixTM<TM> (std::move(agraph))
|
|
222
|
+
{ ; }
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
227
|
+
shared_ptr<BaseJacobiPrecond> SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
228
|
+
CreateJacobiPrecond (shared_ptr<BitArray> inner) const
|
|
229
|
+
{
|
|
230
|
+
// if constexpr(mat_traits<TM>::HEIGHT != mat_traits<TM>::WIDTH) return nullptr;
|
|
231
|
+
if constexpr(ngbla::Height<TM>() != ngbla::Width<TM>()) return nullptr;
|
|
232
|
+
else if constexpr(ngbla::Height<TM>() > MAX_SYS_DIM) {
|
|
233
|
+
throw Exception(string("MAX_SYS_DIM = ")+to_string(MAX_SYS_DIM)+string(", need ")+to_string(mat_traits<TM>::HEIGHT));
|
|
234
|
+
return nullptr;
|
|
235
|
+
}
|
|
236
|
+
else return make_shared<JacobiPrecond<TM,TV_ROW,TV_COL>> ( dynamic_pointer_cast<SparseMatrix>
|
|
237
|
+
(const_cast<SparseMatrix*>(this)->shared_from_this()), inner);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
241
|
+
shared_ptr<BaseBlockJacobiPrecond> SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
242
|
+
CreateBlockJacobiPrecond (shared_ptr<Table<int>> blocks,
|
|
243
|
+
const BaseVector * constraint,
|
|
244
|
+
bool parallel,
|
|
245
|
+
shared_ptr<BitArray> freedofs) const
|
|
246
|
+
{
|
|
247
|
+
// if constexpr(mat_traits<TM>::HEIGHT != mat_traits<TM>::WIDTH) return nullptr;
|
|
248
|
+
if constexpr(ngbla::Height<TM>() != ngbla::Width<TM>()) return nullptr;
|
|
249
|
+
else if constexpr(ngbla::Height<TM>() > MAX_SYS_DIM) {
|
|
250
|
+
throw Exception(string("MAX_SYS_DIM = ")+to_string(MAX_SYS_DIM)+string(", need ")+to_string(ngbla::Height<TM>()));
|
|
251
|
+
return nullptr;
|
|
252
|
+
}
|
|
253
|
+
else
|
|
254
|
+
// return make_shared<BlockJacobiPrecond<TM,TV_ROW,TV_COL>> (*this, blocks, parallel);
|
|
255
|
+
|
|
256
|
+
return make_shared<BlockJacobiPrecond<TM,TV_ROW,TV_COL>>
|
|
257
|
+
( dynamic_pointer_cast<const SparseMatrix>
|
|
258
|
+
(this->shared_from_this()),
|
|
259
|
+
blocks, parallel);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
265
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
266
|
+
MultAdd (double s, const BaseVector & x, BaseVector & y) const
|
|
267
|
+
{
|
|
268
|
+
static Timer t("SparseMatrix::MultAdd"); RegionTimer reg(t);
|
|
269
|
+
t.AddFlops (this->NZE()*sizeof(TV_ROW)*sizeof(TV_COL)/sqr(sizeof(double)));
|
|
270
|
+
|
|
271
|
+
ParallelForRange
|
|
272
|
+
(balance, [&] (IntRange myrange)
|
|
273
|
+
{
|
|
274
|
+
FlatVector<TVX> fx = x.FV<TVX>();
|
|
275
|
+
FlatVector<TVY> fy = y.FV<TVY>();
|
|
276
|
+
|
|
277
|
+
for (auto i : myrange)
|
|
278
|
+
fy(i) += s * RowTimesVector (i, fx);
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
#ifdef OLD
|
|
282
|
+
if (task_manager)
|
|
283
|
+
{
|
|
284
|
+
FlatVector<TVX> fx = x.FV<TVX>();
|
|
285
|
+
FlatVector<TVY> fy = y.FV<TVY>();
|
|
286
|
+
|
|
287
|
+
// int ntasks = task_manager->GetNumThreads();
|
|
288
|
+
|
|
289
|
+
task_manager -> CreateJob
|
|
290
|
+
([&] (TaskInfo & ti)
|
|
291
|
+
{
|
|
292
|
+
int tasks_per_part = ti.ntasks / balance.Size();
|
|
293
|
+
int mypart = ti.task_nr / tasks_per_part;
|
|
294
|
+
int num_in_part = ti.task_nr % tasks_per_part;
|
|
295
|
+
|
|
296
|
+
auto myrange = balance[mypart].Split (num_in_part, tasks_per_part);
|
|
297
|
+
|
|
298
|
+
for (auto row : myrange)
|
|
299
|
+
fy(row) += s * RowTimesVector (row, fx);
|
|
300
|
+
|
|
301
|
+
});
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
FlatVector<TVX> fx = x.FV<TVX>();
|
|
307
|
+
FlatVector<TVY> fy = y.FV<TVY>();
|
|
308
|
+
|
|
309
|
+
int h = this->Height();
|
|
310
|
+
for (int i = 0; i < h; i++)
|
|
311
|
+
fy(i) += s * RowTimesVector (i, fx);
|
|
312
|
+
#endif
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
318
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
319
|
+
MultAdd1 (double s, const BaseVector & x, BaseVector & y,
|
|
320
|
+
const BitArray * ainner,
|
|
321
|
+
const Array<int> * acluster) const
|
|
322
|
+
{
|
|
323
|
+
if (!ainner || acluster)
|
|
324
|
+
{
|
|
325
|
+
MultAdd (s, x, y);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
FlatVector<TVX> fx = x.FV<TVX>();
|
|
330
|
+
FlatVector<TVY> fy = y.FV<TVY>();
|
|
331
|
+
|
|
332
|
+
SharedLoop2 sl(ainner->Size());
|
|
333
|
+
ParallelJob
|
|
334
|
+
( [&] (const TaskInfo & ti)
|
|
335
|
+
{
|
|
336
|
+
for (size_t row : sl)
|
|
337
|
+
if ( (*ainner).Test(row))
|
|
338
|
+
fy(row) += s * RowTimesVector (row, fx);
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
345
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
346
|
+
MultTransAdd (double s, const BaseVector & x, BaseVector & y) const
|
|
347
|
+
{
|
|
348
|
+
static Timer timer ("SparseMatrix::MultTransAdd");
|
|
349
|
+
RegionTimer reg (timer);
|
|
350
|
+
|
|
351
|
+
FlatVector<TVY> fx = x.FV<TVY>();
|
|
352
|
+
FlatVector<TVX> fy = y.FV<TVX>();
|
|
353
|
+
|
|
354
|
+
for (int i = 0; i < this->Height(); i++)
|
|
355
|
+
AddRowTransToVector (i, s*fx(i), fy);
|
|
356
|
+
|
|
357
|
+
timer.AddFlops (this->NZE());
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
/*
|
|
361
|
+
static Timer t("SparseMatrix::MultTransAdd"); RegionTimer reg(t);
|
|
362
|
+
t.AddFlops (this->NZE()*sizeof(TV_ROW)*sizeof(TV_COL)/sqr(sizeof(double)));
|
|
363
|
+
|
|
364
|
+
ParallelForRange
|
|
365
|
+
(balance, [&] (IntRange myrange)
|
|
366
|
+
{
|
|
367
|
+
FlatVector<TVY> fx = x.FV<TVY>();
|
|
368
|
+
FlatVector<TVX> fy = y.FV<TVX>();
|
|
369
|
+
|
|
370
|
+
for (auto i : myrange)
|
|
371
|
+
AddRowTransToVectorAtomic (i, s*fx(i), fy);
|
|
372
|
+
});
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
379
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
380
|
+
MultAdd (Complex s, const BaseVector & x, BaseVector & y) const
|
|
381
|
+
{
|
|
382
|
+
static Timer timer("SparseMatrix::MultAdd Complex");
|
|
383
|
+
RegionTimer reg (timer);
|
|
384
|
+
|
|
385
|
+
FlatVector<TVX> fx = x.FV<TVX> (); // (x.Size(), x.Memory());
|
|
386
|
+
FlatVector<TVY> fy = y.FV<TVY> (); // (y.Size(), y.Memory());
|
|
387
|
+
|
|
388
|
+
if constexpr (std::is_constructible<TSCAL,Complex>())
|
|
389
|
+
{
|
|
390
|
+
int h = this->Height();
|
|
391
|
+
for (int i = 0; i < h; i++)
|
|
392
|
+
fy(i) += TSCAL(s) * RowTimesVector (i, fx);
|
|
393
|
+
}
|
|
394
|
+
else
|
|
395
|
+
throw Exception("MultAdd(complex) called for real matrix");
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
400
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
401
|
+
MultTransAdd (Complex s, const BaseVector & x, BaseVector & y) const
|
|
402
|
+
{
|
|
403
|
+
static Timer timer("SparseMatrix::MultTransAdd Complex");
|
|
404
|
+
RegionTimer reg (timer);
|
|
405
|
+
|
|
406
|
+
FlatVector<TVY> fx = x.FV<TVY>(); // (x.Size(), x.Memory());
|
|
407
|
+
FlatVector<TVX> fy = y.FV<TVX>(); // (y.Size(), y.Memory());
|
|
408
|
+
|
|
409
|
+
if constexpr (std::is_constructible<TSCAL,Complex>())
|
|
410
|
+
for (int i = 0; i < this->Height(); i++)
|
|
411
|
+
AddRowTransToVector (i, TSCAL(s)*fx(i), fy);
|
|
412
|
+
else
|
|
413
|
+
throw Exception("MultTransAdd(complex) called for real matrix");
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
417
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
418
|
+
MultConjTransAdd (Complex s, const BaseVector & x, BaseVector & y) const
|
|
419
|
+
{
|
|
420
|
+
static Timer timer("SparseMatrix::MultTransAdd Complex");
|
|
421
|
+
RegionTimer reg (timer);
|
|
422
|
+
|
|
423
|
+
FlatVector<TVY> fx = x.FV<TVY>(); // (x.Size(), x.Memory());
|
|
424
|
+
FlatVector<TVX> fy = y.FV<TVX>(); // (y.Size(), y.Memory());
|
|
425
|
+
|
|
426
|
+
if constexpr (std::is_constructible<TSCAL,Complex>())
|
|
427
|
+
for (int i = 0; i < this->Height(); i++)
|
|
428
|
+
AddRowConjTransToVector (i, TSCAL(s)*fx(i), fy);
|
|
429
|
+
else
|
|
430
|
+
throw Exception("MultConjTransAdd(complex) called for real matrix");
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
434
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
435
|
+
MultAdd (FlatVector<double> alpha, const MultiVector & x, MultiVector & y) const
|
|
436
|
+
{
|
|
437
|
+
BaseMatrix::MultAdd (alpha, x, y);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
443
|
+
void SparseMatrix<TM,TV_ROW,TV_COL> :: DoArchive (Archive & ar)
|
|
444
|
+
{
|
|
445
|
+
ar & this->size;
|
|
446
|
+
ar & this->width;
|
|
447
|
+
ar & this->nze;
|
|
448
|
+
ar & firsti;
|
|
449
|
+
ar & colnr;
|
|
450
|
+
ar & data;
|
|
451
|
+
cout << "sparsemat, doarch, sizeof (firstint) = " << firsti.Size() << endl;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
459
|
+
shared_ptr<BaseMatrix> SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
460
|
+
InverseMatrix (shared_ptr<BitArray> subset) const
|
|
461
|
+
{
|
|
462
|
+
return CreateSparseMatrixInverse(dynamic_pointer_cast<const BaseSparseMatrix>(this->shared_from_this()), subset, nullptr);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// template <class TM>
|
|
466
|
+
// BaseMatrix * SparseMatrix<TM> ::
|
|
467
|
+
|
|
468
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
469
|
+
shared_ptr<BaseMatrix> SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
470
|
+
InverseMatrix (shared_ptr<const Array<int>> clusters) const
|
|
471
|
+
{
|
|
472
|
+
return CreateSparseMatrixInverse(dynamic_pointer_cast<const BaseSparseMatrix>(this->shared_from_this()), nullptr, clusters);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
476
|
+
shared_ptr<BaseMatrix> SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
477
|
+
DeleteZeroElements(double tol) const
|
|
478
|
+
{
|
|
479
|
+
static Timer t("SparseMatrix::DeleteZeroElements"); RegionTimer reg(t);
|
|
480
|
+
size_t h = this->Height();
|
|
481
|
+
size_t w = this->Width();
|
|
482
|
+
Array<int> cnt(h);
|
|
483
|
+
Array<bool> keep(data.Size());
|
|
484
|
+
cnt = 0;
|
|
485
|
+
keep = false;
|
|
486
|
+
ParallelForRange( h, [&](IntRange r)
|
|
487
|
+
{
|
|
488
|
+
for (auto i : r)
|
|
489
|
+
for (auto j : Range(firsti[i], firsti[i+1]))
|
|
490
|
+
if (ngbla::L2Norm2(data[j]) > tol*tol)
|
|
491
|
+
{
|
|
492
|
+
keep[j] = true;
|
|
493
|
+
cnt[i]++;
|
|
494
|
+
}
|
|
495
|
+
}, 5*TaskManager::GetNumThreads());
|
|
496
|
+
|
|
497
|
+
auto matrix = make_shared<SparseMatrix<TM>> (cnt, w);
|
|
498
|
+
cnt = 0;
|
|
499
|
+
|
|
500
|
+
ParallelForRange( h, [&](IntRange r)
|
|
501
|
+
{
|
|
502
|
+
for (auto i : r)
|
|
503
|
+
{
|
|
504
|
+
auto cols = matrix->GetRowIndices(i);
|
|
505
|
+
auto vals = matrix->GetRowValues(i);
|
|
506
|
+
int icol = 0;
|
|
507
|
+
// size_t firsti_new = matrix->firsti[i];
|
|
508
|
+
for (auto j : Range(firsti[i], firsti[i+1]))
|
|
509
|
+
if (keep[j])
|
|
510
|
+
{
|
|
511
|
+
cols[icol] = colnr[j];
|
|
512
|
+
vals[icol] = data[j];
|
|
513
|
+
icol++;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}, 5*TaskManager::GetNumThreads());
|
|
517
|
+
return matrix;
|
|
518
|
+
|
|
519
|
+
/*
|
|
520
|
+
// needs parallelization and testing
|
|
521
|
+
Array<int> cnt(this->Height());
|
|
522
|
+
cnt = 0;
|
|
523
|
+
size_t cnt0 = 0;
|
|
524
|
+
for (auto i : Range(this->Height()))
|
|
525
|
+
for (auto j : Range(firsti[i], firsti[i+1]))
|
|
526
|
+
if (ngbla::L2Norm2(data[j]) > tol*tol)
|
|
527
|
+
cnt[i]++;
|
|
528
|
+
else
|
|
529
|
+
cnt0++;
|
|
530
|
+
|
|
531
|
+
cout << "zero-els = " << cnt0 << endl;
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
auto matrix = make_shared<SparseMatrix<TM>> (cnt, this->Width());
|
|
535
|
+
|
|
536
|
+
for (auto i : Range(this->Height()))
|
|
537
|
+
for (auto j : Range(firsti[i], firsti[i+1]))
|
|
538
|
+
if (ngbla::L2Norm2(data[j]) > tol*tol)
|
|
539
|
+
(*matrix)(i, colnr[i]) = data[j];
|
|
540
|
+
|
|
541
|
+
return matrix;
|
|
542
|
+
*/
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
template <class TM>
|
|
546
|
+
ostream & SparseMatrixTM<TM> ::
|
|
547
|
+
Print (ostream & ost) const
|
|
548
|
+
{
|
|
549
|
+
for (int i = 0; i < size; i++)
|
|
550
|
+
{
|
|
551
|
+
ost << "Row " << i << ":";
|
|
552
|
+
|
|
553
|
+
for (size_t j = firsti[i]; j < firsti[i+1]; j++)
|
|
554
|
+
ost << " " << colnr[j] << ": " << data[j];
|
|
555
|
+
ost << "\n";
|
|
556
|
+
}
|
|
557
|
+
return ost;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
template <class TM>
|
|
562
|
+
Array<MemoryUsage> SparseMatrixTM<TM> ::
|
|
563
|
+
GetMemoryUsage () const
|
|
564
|
+
{
|
|
565
|
+
Array<MemoryUsage> mu;
|
|
566
|
+
mu += { "SparseMatrix", nze*sizeof(TM), 1 };
|
|
567
|
+
if (owner) mu += MatrixGraph::GetMemoryUsage ();
|
|
568
|
+
return mu;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
template <class TM> AutoVector SparseMatrixTM<TM> :: CreateVector () const
|
|
573
|
+
{ throw Exception("SparseMatrixTM::CreateVector"); }
|
|
574
|
+
|
|
575
|
+
template <class TM> AutoVector SparseMatrixTM<TM> :: CreateRowVector () const
|
|
576
|
+
{ throw Exception("SparseMatrixTM::CreateRowVector"); }
|
|
577
|
+
|
|
578
|
+
template <class TM> AutoVector SparseMatrixTM<TM> :: CreateColVector () const
|
|
579
|
+
{ throw Exception("SparseMatrixTM::CreateColVector"); }
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
583
|
+
shared_ptr<BaseMatrix> SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
584
|
+
CreateMatrix () const
|
|
585
|
+
{
|
|
586
|
+
return make_shared<SparseMatrix> (*this);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
590
|
+
AutoVector SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
591
|
+
CreateVector () const
|
|
592
|
+
{
|
|
593
|
+
if (this->size==this->width)
|
|
594
|
+
return make_unique<VVector<TVY>> (this->size);
|
|
595
|
+
throw Exception ("SparseMatrix::CreateVector for rectangular does not make sense, use either CreateColVector or CreateRowVector");
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
599
|
+
AutoVector SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
600
|
+
CreateRowVector () const
|
|
601
|
+
{
|
|
602
|
+
return make_unique<VVector<TVX>> (this->width);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
606
|
+
AutoVector SparseMatrix<TM,TV_ROW,TV_COL> ::
|
|
607
|
+
CreateColVector () const
|
|
608
|
+
{
|
|
609
|
+
return make_unique<VVector<TVY>> (this->size);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
template<class TM, class TV_ROW, class TV_COL>
|
|
614
|
+
shared_ptr<BaseSparseMatrix>
|
|
615
|
+
SparseMatrix<TM,TV_ROW,TV_COL> :: Restrict (const SparseMatrixTM<double> & prol,
|
|
616
|
+
shared_ptr<BaseSparseMatrix> acmat ) const
|
|
617
|
+
{
|
|
618
|
+
static Timer t ("sparsematrix - restrict");
|
|
619
|
+
static Timer tbuild ("sparsematrix - restrict, build matrix");
|
|
620
|
+
static Timer tcomp ("sparsematrix - restrict, compute matrix");
|
|
621
|
+
RegionTimer reg(t);
|
|
622
|
+
|
|
623
|
+
int n = this->Height();
|
|
624
|
+
|
|
625
|
+
auto cmat = dynamic_pointer_cast<SparseMatrixTM<TM>> (acmat);
|
|
626
|
+
|
|
627
|
+
// if no coarse matrix, build up matrix-graph!
|
|
628
|
+
if ( !cmat )
|
|
629
|
+
{
|
|
630
|
+
RegionTimer reg(tbuild);
|
|
631
|
+
|
|
632
|
+
Array<int> marks(n);
|
|
633
|
+
Array<IVec<2> > e2v;
|
|
634
|
+
for (int i = 0; i < n; i++)
|
|
635
|
+
for (int j = 0; j < this->GetRowIndices(i).Size(); j++)
|
|
636
|
+
{
|
|
637
|
+
int col = this->GetRowIndices(i)[j];
|
|
638
|
+
FlatArray<ColIdx> prol_rowind = prol.GetRowIndices(i);
|
|
639
|
+
FlatArray<ColIdx> prol_colind = prol.GetRowIndices(col);
|
|
640
|
+
|
|
641
|
+
for (int k = 0; k < prol_rowind.Size(); k++)
|
|
642
|
+
for (int l = 0; l < prol_colind.Size(); l++)
|
|
643
|
+
{
|
|
644
|
+
int kk = prol_rowind[k];
|
|
645
|
+
int ll = prol_colind[l];
|
|
646
|
+
|
|
647
|
+
// if (kk >= ll) swap (kk,ll);
|
|
648
|
+
e2v.Append (IVec<2> (kk,ll));
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
int nc = 0;
|
|
653
|
+
for (int i = 0; i < e2v.Size(); i++)
|
|
654
|
+
nc = max2 (nc, e2v[i][1]);
|
|
655
|
+
nc++;
|
|
656
|
+
|
|
657
|
+
// *testout << "e2v = " << endl << e2v << endl;
|
|
658
|
+
|
|
659
|
+
// count all entries in row with multiplicity
|
|
660
|
+
Array<int> cnt(nc);
|
|
661
|
+
cnt = 0;
|
|
662
|
+
for (int i = 0; i < e2v.Size(); i++)
|
|
663
|
+
cnt[e2v[i][1]]++;
|
|
664
|
+
|
|
665
|
+
Table<int> v2e(cnt);
|
|
666
|
+
cnt = 0;
|
|
667
|
+
for (int i = 0; i < e2v.Size(); i++)
|
|
668
|
+
{
|
|
669
|
+
int v1 = e2v[i][1];
|
|
670
|
+
v2e[v1][cnt[v1]++] = i;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
cnt = 0;
|
|
674
|
+
marks = -1;
|
|
675
|
+
|
|
676
|
+
// count all entries in row withOUT multiplicity
|
|
677
|
+
for (int i = 0; i < nc; i++)
|
|
678
|
+
for (int j = 0; j < v2e[i].Size(); j++)
|
|
679
|
+
{
|
|
680
|
+
int jj = v2e[i][j];
|
|
681
|
+
int v0 = e2v[jj][0];
|
|
682
|
+
if (marks[v0] != i)
|
|
683
|
+
{
|
|
684
|
+
cnt[i]++;
|
|
685
|
+
marks[v0] = i;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
cmat = make_shared<SparseMatrix<TM,TV_ROW,TV_COL>> (cnt);
|
|
690
|
+
|
|
691
|
+
marks = -1;
|
|
692
|
+
for (int i = 0; i < nc; i++)
|
|
693
|
+
for (int j = 0; j < v2e[i].Size(); j++)
|
|
694
|
+
{
|
|
695
|
+
int jj = v2e[i][j];
|
|
696
|
+
int v0 = e2v[jj][0];
|
|
697
|
+
if (marks[v0] != i)
|
|
698
|
+
{
|
|
699
|
+
marks[v0] = i;
|
|
700
|
+
cmat -> CreatePosition (i, v0);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
cmat->AsVector() = 0.0;
|
|
706
|
+
RegionTimer reg2(tcomp);
|
|
707
|
+
|
|
708
|
+
for (int i = 0; i < n; i++)
|
|
709
|
+
{
|
|
710
|
+
FlatArray mat_ri = this->GetRowIndices(i);
|
|
711
|
+
FlatVector<TM> mat_rval = this->GetRowValues(i);
|
|
712
|
+
|
|
713
|
+
for (int j = 0; j < mat_ri.Size(); j++)
|
|
714
|
+
{
|
|
715
|
+
int col = mat_ri[j];
|
|
716
|
+
TM mat_val = mat_rval[j];
|
|
717
|
+
|
|
718
|
+
FlatArray prol_ri_i = prol.GetRowIndices(i);
|
|
719
|
+
FlatArray prol_ri_col = prol.GetRowIndices(col);
|
|
720
|
+
FlatVector<double> prol_rval_i = prol.GetRowValues(i);
|
|
721
|
+
FlatVector<double> prol_rval_col = prol.GetRowValues(col);
|
|
722
|
+
|
|
723
|
+
for (int k = 0; k < prol_ri_i.Size(); k++)
|
|
724
|
+
for (int l = 0; l < prol_ri_col.Size(); l++)
|
|
725
|
+
{
|
|
726
|
+
int kk = prol_ri_i[k];
|
|
727
|
+
int ll = prol_ri_col[l];
|
|
728
|
+
|
|
729
|
+
if ( /*kk>=ll &&*/ kk < cmat->Height() )
|
|
730
|
+
{
|
|
731
|
+
(*cmat)(kk,ll) +=
|
|
732
|
+
prol_rval_i[k] * prol_rval_col[l] * mat_val;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
// if (ll >= kk && i != col && ll < cmat->Height() )
|
|
736
|
+
// {
|
|
737
|
+
// (*cmat)(ll,kk) +=
|
|
738
|
+
// prol_rval_col[l] * prol_rval_i[k] * Trans(mat_val);
|
|
739
|
+
// }
|
|
740
|
+
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return cmat;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
template <class TM, class TV_ROW, class TV_COL>
|
|
750
|
+
shared_ptr<BaseSparseMatrix> SparseMatrix<TM, TV_ROW, TV_COL> ::
|
|
751
|
+
Reorder (const Array<size_t> & reorder) const
|
|
752
|
+
{
|
|
753
|
+
Array<size_t> inv_reorder(reorder.Size());
|
|
754
|
+
for (size_t i : Range(reorder))
|
|
755
|
+
inv_reorder[reorder[i]] = i;
|
|
756
|
+
|
|
757
|
+
Array<int> cnt(this->Height());
|
|
758
|
+
for (size_t i : Range(cnt))
|
|
759
|
+
cnt[i] = this->GetRowIndices(reorder[i]).Size();
|
|
760
|
+
auto newmat = make_shared<SparseMatrix>(cnt);
|
|
761
|
+
for (size_t i : Range(cnt))
|
|
762
|
+
for (auto col : this->GetRowIndices(reorder[i]))
|
|
763
|
+
newmat->CreatePosition(i, inv_reorder[col]);
|
|
764
|
+
|
|
765
|
+
for (size_t i : Range(cnt))
|
|
766
|
+
for (auto col : this->GetRowIndices(reorder[i]))
|
|
767
|
+
(*newmat)(i, inv_reorder[col]) = (*this)(reorder[i], col);
|
|
768
|
+
|
|
769
|
+
return newmat;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
template <class TM>
|
|
774
|
+
shared_ptr<BaseSparseMatrix> SparseMatrixTM<TM> ::
|
|
775
|
+
CreateTransposeTM (const function<shared_ptr<SparseMatrixTM<decltype(ngbla::Trans(TM()))>>(const Array<int>&,int)> & creator,
|
|
776
|
+
bool sorted) const
|
|
777
|
+
{
|
|
778
|
+
Array<int> cnt(this->Width());
|
|
779
|
+
cnt = 0;
|
|
780
|
+
ParallelFor (this->Height(), [&] (int i)
|
|
781
|
+
{
|
|
782
|
+
for (int c : this->GetRowIndices(i))
|
|
783
|
+
AsAtomic (cnt[c]) ++;
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
auto trans = creator(cnt, this->Height());
|
|
787
|
+
|
|
788
|
+
cnt = 0;
|
|
789
|
+
ParallelFor (this->Height(), [&] (int i)
|
|
790
|
+
{
|
|
791
|
+
for (int ci : Range(this->GetRowIndices(i)))
|
|
792
|
+
{
|
|
793
|
+
int c = this->GetRowIndices(i)[ci];
|
|
794
|
+
int pos = AsAtomic(cnt[c])++;
|
|
795
|
+
trans -> GetRowIndices(c)[pos] = i;
|
|
796
|
+
trans -> GetRowValues(c)[pos] = Trans(this->GetRowValues(i)[ci]);
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
|
|
800
|
+
if (sorted)
|
|
801
|
+
ParallelFor (trans->Height(), [&] (int r)
|
|
802
|
+
{
|
|
803
|
+
auto rowvals = trans->GetRowValues(r);
|
|
804
|
+
BubbleSort (trans->GetRowIndices(r),
|
|
805
|
+
FlatArray(rowvals.Size(), rowvals.Data()));
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
return trans;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
template <class TM>
|
|
815
|
+
void SparseMatrixTM<TM> ::
|
|
816
|
+
AddElementMatrixSymmetric(FlatArray<int> dnums, BareSliceMatrix<TSCAL> elmat1, bool use_atomic)
|
|
817
|
+
{
|
|
818
|
+
static Timer timer_addelmat("SparseMatrixSymmetric::AddElementMatrix", NoTracing);
|
|
819
|
+
// static Timer timer ("SparseMatrixSymmetric::AddElementMatrix", NoTracing);
|
|
820
|
+
// RegionTimer reg (timer);
|
|
821
|
+
RegionTimer reg (timer_addelmat);
|
|
822
|
+
NgProfiler::AddThreadFlops (timer_addelmat, TaskManager::GetThreadId(), dnums.Size()*(dnums.Size()+1)/2);
|
|
823
|
+
|
|
824
|
+
// ArrayMem<int, 50> map(dnums.Size());
|
|
825
|
+
STACK_ARRAY(int, hmap, dnums.Size());
|
|
826
|
+
FlatArray<int> map(dnums.Size(), hmap);
|
|
827
|
+
|
|
828
|
+
{
|
|
829
|
+
for (int i = 0; i < dnums.Size(); i++) map[i] = i;
|
|
830
|
+
QuickSortI (dnums, map);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
STACK_ARRAY(int, dnumsmap, dnums.Size());
|
|
834
|
+
for (int i = 0; i < dnums.Size(); i++)
|
|
835
|
+
dnumsmap[i] = dnums[map[i]];
|
|
836
|
+
|
|
837
|
+
Scalar2ElemMatrix<TM, TSCAL> elmat (elmat1);
|
|
838
|
+
// .AddSize(mat_traits<TM>::HEIGHT*dnums.Size(),
|
|
839
|
+
// mat_traits<TM>::WIDTH*dnums.Size()));
|
|
840
|
+
|
|
841
|
+
int first_used = 0;
|
|
842
|
+
while (first_used < dnums.Size() && !IsRegularIndex(dnums[map[first_used]]) ) first_used++;
|
|
843
|
+
|
|
844
|
+
if (use_atomic)
|
|
845
|
+
for (int i1 = first_used; i1 < dnums.Size(); i1++)
|
|
846
|
+
{
|
|
847
|
+
// FlatArray<int> rowind = this->GetRowIndices(dnums[map[i1]]);
|
|
848
|
+
// FlatVector<TM> rowvals = this->GetRowValues(dnums[map[i1]]);
|
|
849
|
+
FlatArray rowind = this->GetRowIndices(dnumsmap[i1]);
|
|
850
|
+
FlatVector<TM> rowvals = this->GetRowValues(dnumsmap[i1]);
|
|
851
|
+
auto elmat_row = elmat.Rows(map[i1], map[i1]+1);
|
|
852
|
+
|
|
853
|
+
size_t k = 0;
|
|
854
|
+
for (int j1 = first_used; j1 <= i1; j1++, k++)
|
|
855
|
+
{
|
|
856
|
+
// while (rowind[k] != dnums[map[j1]])
|
|
857
|
+
while (rowind[k] != dnumsmap[j1])
|
|
858
|
+
{
|
|
859
|
+
k++;
|
|
860
|
+
if (k >= rowind.Size())
|
|
861
|
+
throw Exception ("SparseMatrixSymmetricTM::AddElementMatrix: illegal dnums");
|
|
862
|
+
}
|
|
863
|
+
AtomicAdd (rowvals(k), elmat_row(0, map[j1]));
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
else
|
|
867
|
+
{
|
|
868
|
+
if (first_used+1 < dnums.Size())
|
|
869
|
+
{
|
|
870
|
+
this->PrefetchRow(dnums[map[first_used+1]]);
|
|
871
|
+
// _mm_prefetch (reinterpret_cast<void*>(&this->GetRowIndices(dnums[map[first_used+1]])[0]), _MM_HINT_T2);
|
|
872
|
+
// _mm_prefetch (reinterpret_cast<void*>(&this->GetRowValues(dnums[map[first_used+1]])[0]), _MM_HINT_T2);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
for (int i1 = first_used; i1 < dnums.Size(); i1++)
|
|
876
|
+
{
|
|
877
|
+
if (i1+2 < dnums.Size())
|
|
878
|
+
this->PrefetchRow(dnums[map[i1+2]]);
|
|
879
|
+
|
|
880
|
+
// FlatArray<int> rowind = this->GetRowIndices(dnums[map[i1]]);
|
|
881
|
+
// FlatVector<TM> rowvals = this->GetRowValues(dnums[map[i1]]);
|
|
882
|
+
FlatArray rowind = this->GetRowIndices(dnumsmap[i1]);
|
|
883
|
+
FlatVector<TM> rowvals = this->GetRowValues(dnumsmap[i1]);
|
|
884
|
+
auto elmat_row = elmat.Rows(map[i1], map[i1]+1);
|
|
885
|
+
|
|
886
|
+
size_t k = 0;
|
|
887
|
+
for (int j1 = first_used; j1 <= i1; j1++, k++)
|
|
888
|
+
{
|
|
889
|
+
// while (rowind[k] != dnums[map[j1]])
|
|
890
|
+
while (rowind[k] != dnumsmap[j1])
|
|
891
|
+
{
|
|
892
|
+
k++;
|
|
893
|
+
if (unlikely(k >= rowind.Size()))
|
|
894
|
+
throw Exception ("SparseMatrixSymmetricTM::AddElementMatrix: illegal dnums");
|
|
895
|
+
}
|
|
896
|
+
rowvals(k) += elmat_row(0, map[j1]);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
template <class TM, class TV>
|
|
904
|
+
SparseMatrixSymmetric<TM,TV> ::
|
|
905
|
+
SparseMatrixSymmetric (const MatrixGraph & agraph)
|
|
906
|
+
// : SparseMatrixTM<TM> (agraph, stealgraph),
|
|
907
|
+
// SparseMatrixSymmetricTM<TM> (agraph, stealgraph),
|
|
908
|
+
: SparseMatrix<TM,TV,TV> (agraph)
|
|
909
|
+
{ ; }
|
|
910
|
+
|
|
911
|
+
template <class TM, class TV>
|
|
912
|
+
SparseMatrixSymmetric<TM,TV> ::
|
|
913
|
+
SparseMatrixSymmetric (MatrixGraph && agraph)
|
|
914
|
+
// : SparseMatrixTM<TM> (agraph, stealgraph),
|
|
915
|
+
// SparseMatrixSymmetricTM<TM> (agraph, stealgraph),
|
|
916
|
+
: SparseMatrix<TM,TV,TV> (std::move(agraph))
|
|
917
|
+
{ ; }
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
template <class TM, class TV>
|
|
921
|
+
SparseMatrixSymmetric<TM,TV> :: ~SparseMatrixSymmetric ()
|
|
922
|
+
{
|
|
923
|
+
;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
template <class TM, class TV>
|
|
928
|
+
shared_ptr<BaseJacobiPrecond>
|
|
929
|
+
SparseMatrixSymmetric<TM,TV> :: CreateJacobiPrecond (shared_ptr<BitArray> inner) const
|
|
930
|
+
{
|
|
931
|
+
return make_shared<JacobiPrecondSymmetric<TM,TV>> ( dynamic_pointer_cast<SparseMatrixSymmetric>
|
|
932
|
+
(const_cast<SparseMatrixSymmetric*>(this)->shared_from_this()), inner);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
template <class TM, class TV>
|
|
937
|
+
shared_ptr<BaseBlockJacobiPrecond>
|
|
938
|
+
SparseMatrixSymmetric<TM,TV> :: CreateBlockJacobiPrecond (shared_ptr<Table<int>> blocks,
|
|
939
|
+
const BaseVector * constraint,
|
|
940
|
+
bool parallel,
|
|
941
|
+
shared_ptr<BitArray> freedofs) const
|
|
942
|
+
{
|
|
943
|
+
// return make_shared<BlockJacobiPrecondSymmetric<TM,TV>> (*this, blocks);
|
|
944
|
+
return make_shared<BlockJacobiPrecondSymmetric<TM,TV>>
|
|
945
|
+
( dynamic_pointer_cast<const SparseMatrixSymmetric>
|
|
946
|
+
(this->shared_from_this()),
|
|
947
|
+
blocks);
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
template <class TM, class TV>
|
|
955
|
+
void SparseMatrixSymmetric<TM,TV> ::
|
|
956
|
+
MultAdd (double s, const BaseVector & x, BaseVector & y) const
|
|
957
|
+
{
|
|
958
|
+
static Timer timer("SparseMatrixSymmetric::MultAdd");
|
|
959
|
+
RegionTimer reg (timer);
|
|
960
|
+
timer.AddFlops (2*this->nze);
|
|
961
|
+
|
|
962
|
+
const FlatVector<TV_ROW> fx = x.FV<TV_ROW>();
|
|
963
|
+
FlatVector<TV_COL> fy = y.FV<TV_COL>();
|
|
964
|
+
|
|
965
|
+
for (int i = 0; i < this->Height(); i++)
|
|
966
|
+
{
|
|
967
|
+
fy(i) += s * RowTimesVector (i, fx);
|
|
968
|
+
AddRowTransToVectorNoDiag (i, s * fx(i), fy);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
template <class TM, class TV>
|
|
973
|
+
void SparseMatrixSymmetric<TM,TV> ::
|
|
974
|
+
MultAdd1 (double s, const BaseVector & x, BaseVector & y,
|
|
975
|
+
const BitArray * inner,
|
|
976
|
+
const Array<int> * cluster) const
|
|
977
|
+
{
|
|
978
|
+
const FlatVector<TV_ROW> fx = x.FV<TV_ROW> ();
|
|
979
|
+
FlatVector<TV_COL> fy = y.FV<TV_COL> ();
|
|
980
|
+
|
|
981
|
+
if (inner)
|
|
982
|
+
{
|
|
983
|
+
static Timer timer("SparseMatrixSymmetric::MultAdd1 - inner");
|
|
984
|
+
RegionTimer reg (timer);
|
|
985
|
+
|
|
986
|
+
for (int i = 0; i < this->Height(); i++)
|
|
987
|
+
if (inner->Test(i))
|
|
988
|
+
fy(i) += s * RowTimesVectorNoDiag (i, fx);
|
|
989
|
+
}
|
|
990
|
+
else if (cluster)
|
|
991
|
+
{
|
|
992
|
+
static Timer timer("SparseMatrixSymmetric::MultAdd1 - cluster");
|
|
993
|
+
RegionTimer reg (timer);
|
|
994
|
+
|
|
995
|
+
for (int i = 0; i < this->Height(); i++)
|
|
996
|
+
if ( (*cluster)[i])
|
|
997
|
+
fy(i) += s * RowTimesVectorNoDiag (i, fx);
|
|
998
|
+
}
|
|
999
|
+
else
|
|
1000
|
+
{
|
|
1001
|
+
static Timer timer("SparseMatrixSymmetric::MultAdd1");
|
|
1002
|
+
RegionTimer reg (timer);
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
for (int i = 0; i < this->Height(); i++)
|
|
1006
|
+
fy(i) += s * RowTimesVectorNoDiag (i, fx);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
template <class TM, class TV>
|
|
1012
|
+
void SparseMatrixSymmetric<TM,TV> ::
|
|
1013
|
+
MultAdd2 (double s, const BaseVector & x, BaseVector & y,
|
|
1014
|
+
const BitArray * inner,
|
|
1015
|
+
const Array<int> * cluster) const
|
|
1016
|
+
{
|
|
1017
|
+
static Timer timer("SparseMatrixSymmetric::MultAdd2");
|
|
1018
|
+
RegionTimer reg (timer);
|
|
1019
|
+
timer.AddFlops (this->NZE());
|
|
1020
|
+
|
|
1021
|
+
const FlatVector<TV_ROW> fx = x.FV<TV_ROW> ();
|
|
1022
|
+
FlatVector<TV_COL> fy = y.FV<TV_COL> ();
|
|
1023
|
+
|
|
1024
|
+
if (inner)
|
|
1025
|
+
{
|
|
1026
|
+
for (int i = 0; i < this->Height(); i++)
|
|
1027
|
+
if (inner->Test(i))
|
|
1028
|
+
AddRowTransToVector (i, s * fx(i), fy);
|
|
1029
|
+
}
|
|
1030
|
+
else if (cluster)
|
|
1031
|
+
{
|
|
1032
|
+
for (int i = 0; i < this->Height(); i++)
|
|
1033
|
+
if ( (*cluster)[i])
|
|
1034
|
+
AddRowTransToVector (i, s * fx(i), fy);
|
|
1035
|
+
}
|
|
1036
|
+
else
|
|
1037
|
+
for (int i = 0; i < this->Height(); i++)
|
|
1038
|
+
AddRowTransToVector (i, s * fx(i), fy);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
template <class TM, class TV>
|
|
1044
|
+
BaseSparseMatrix & SparseMatrixSymmetric<TM,TV> ::
|
|
1045
|
+
AddMerge (double s, const SparseMatrixSymmetric & m2)
|
|
1046
|
+
{
|
|
1047
|
+
for (int i = 0; i < m2.Height(); i++)
|
|
1048
|
+
for (int j = 0; j < m2.GetRowIndices(i).Size(); j++)
|
|
1049
|
+
(*this)(i, m2.GetRowIndices(i)[j]) += s * m2(i, m2.GetRowIndices(i)[j]);
|
|
1050
|
+
return *this;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
#endif
|