Skip to content

Commit e7f50e6

Browse files
fixup
1 parent 9121a5a commit e7f50e6

File tree

5 files changed

+8
-69
lines changed

5 files changed

+8
-69
lines changed

example/use_block_jacobi_solver_with_default_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797

9898
ax1.set_title("cluster at depth 1")
9999
ax2.set_title("cluster at depth 2")
100-
ax4.set_title("Hmatrix on rank 0")
100+
ax3.set_title("Hmatrix on rank 0")
101101
ax4.set_title("Block diagonal Hmatrix on rank 0")
102102
Htool.plot(ax1, cluster, points, 1)
103103
Htool.plot(ax2, cluster, points, 2)

src/htool/hmatrix/interfaces/virtual_generator.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ class VirtualGeneratorWithPermutationPython : public htool::VirtualGeneratorWith
4747
VirtualGeneratorWithPermutationPython(const py::array_t<int> &target_permutation, const py::array_t<int> &source_permutation) : VirtualGeneratorWithPermutation<CoefficientPrecision>(target_permutation.data(), source_permutation.data()) {}
4848

4949
void copy_submatrix_from_user_numbering(int M, int N, const int *const rows, const int *const cols, CoefficientPrecision *ptr) const override {
50+
if (M * N > 0) {
51+
py::array_t<CoefficientPrecision, py::array::f_style> mat(std::array<long int, 2>{M, N}, ptr, py::capsule(ptr));
5052

51-
py::array_t<CoefficientPrecision, py::array::f_style> mat(std::array<long int, 2>{M, N}, ptr, py::capsule(ptr));
52-
py::array_t<int> py_rows(std::array<long int, 2>{M, 1}, rows, py::capsule(rows));
53-
py::array_t<int> py_cols(std::array<long int, 2>{N, 1}, cols, py::capsule(cols));
53+
py::array_t<int> py_rows(std::array<long int, 2>{M, 1}, rows, py::capsule(rows));
54+
py::array_t<int> py_cols(std::array<long int, 2>{N, 1}, cols, py::capsule(cols));
5455

55-
build_submatrix(py_rows, py_cols, mat);
56+
build_submatrix(py_rows, py_cols, mat);
57+
}
5658
}
5759

5860
// lcov does not see it because of trampoline I assume

tests/conftest.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -357,62 +357,3 @@ def load_data_solver(symmetry, mu):
357357
ovr_subdomain_to_global,
358358
local_neumann_matrix,
359359
]
360-
361-
362-
@pytest.fixture(
363-
params=[True, False],
364-
ids=["block_jacobi_solver", "ddm_solver"],
365-
)
366-
def setup_solver_dependencies(request, load_data_solver, epsilon, eta):
367-
[
368-
A,
369-
x_ref,
370-
f,
371-
cluster,
372-
neighbors,
373-
intersections,
374-
symmetry,
375-
UPLO,
376-
cluster_to_ovr_subdomain,
377-
ovr_subdomain_to_global,
378-
local_neumann_matrix,
379-
] = load_data_solver
380-
381-
generator = GeneratorFromMatrix(cluster.get_permutation(), A)
382-
default_approximation = Htool.ComplexDefaultApproximationBuilder(
383-
generator,
384-
cluster,
385-
cluster,
386-
epsilon,
387-
eta,
388-
symmetry,
389-
UPLO,
390-
mpi4py.MPI.COMM_WORLD,
391-
)
392-
393-
solver = None
394-
if request.param:
395-
default_solver_builder = Htool.ComplexDefaultSolverBuilder(
396-
default_approximation.distributed_operator,
397-
default_approximation.block_diagonal_hmatrix,
398-
)
399-
solver = default_solver_builder.solver
400-
else:
401-
default_solver_builder = Htool.ComplexDefaultDDMSolverBuilder(
402-
default_approximation.distributed_operator,
403-
default_approximation.block_diagonal_hmatrix,
404-
generator,
405-
ovr_subdomain_to_global,
406-
cluster_to_ovr_subdomain,
407-
neighbors,
408-
intersections,
409-
)
410-
solver = default_solver_builder.solver
411-
412-
return (
413-
solver,
414-
x_ref,
415-
f,
416-
default_approximation.distributed_operator,
417-
local_neumann_matrix,
418-
)

tests/test_ddm_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_ddm_solver(
124124
+ restart
125125
+ " -hpddm_schwarz_method "
126126
+ hpddm_schwarz_method
127-
+ " -hpddm_max_it 200 -hpddm_variant right -hpddm_compute_residual l2 -hpddm_tol "
127+
+ " -hpddm_max_it 200 -hpddm_variant right -hpddm_tol "
128128
+ str(tol)
129129
)
130130

tests/test_hmatrix.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)