Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMarchand20 committed Jul 26, 2024
1 parent 0626b23 commit ca34dbf
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions include/htool/solvers/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,30 +122,30 @@ class DDMSolverWithDenseLocalSolver {
return permuted_block_diagonal_dense_matrix_with_overlap;
};

std::function<Cluster<CoordinatePrecision>(int, const CoordinatePrecision *)> initialize_local_cluster = [this](int spatial_dimension, const CoordinatePrecision *global_geometry) {
std::function<Cluster<CoordinatePrecision>(int, const CoordinatePrecision *)> initialize_local_cluster = [this](int spatial_dimension0, const CoordinatePrecision *global_geometry0) {
// Local geometry
int local_size = local_to_global_numbering.size();
std::vector<double> local_geometry(spatial_dimension * local_size);
std::vector<double> local_geometry(spatial_dimension0 * local_size);
for (int i = 0; i < local_to_global_numbering.size(); i++) {
for (int dimension = 0; dimension < spatial_dimension; dimension++) {
local_geometry[spatial_dimension * i + dimension] = global_geometry[spatial_dimension * local_to_global_numbering[i] + dimension];
for (int dimension = 0; dimension < spatial_dimension0; dimension++) {
local_geometry[spatial_dimension0 * i + dimension] = global_geometry0[spatial_dimension0 * local_to_global_numbering[i] + dimension];
}
}

// Local cluster
ClusterTreeBuilder<double> recursive_build_strategy;
return recursive_build_strategy.create_cluster_tree(local_to_global_numbering.size(), spatial_dimension, local_geometry.data(), 2, 2, nullptr);
return recursive_build_strategy.create_cluster_tree(local_to_global_numbering.size(), spatial_dimension0, local_geometry.data(), 2, 2, nullptr);
};

std::unique_ptr<Cluster<CoordinatePrecision>> local_cluster;

std::function<HMatrix<CoefficientPrecision, CoordinatePrecision>(const VirtualGeneratorInUserNumbering<CoefficientPrecision> &, underlying_type<CoefficientPrecision>, CoordinatePrecision, char)> initialize_local_hmatrix = [this](const VirtualGeneratorInUserNumbering<CoefficientPrecision> &generator, underlying_type<CoefficientPrecision> epsilon, CoordinatePrecision eta, char symmetry) {
std::function<HMatrix<CoefficientPrecision, CoordinatePrecision>(const VirtualGeneratorInUserNumbering<CoefficientPrecision> &, underlying_type<CoefficientPrecision>, CoordinatePrecision, char)> initialize_local_hmatrix = [this](const VirtualGeneratorInUserNumbering<CoefficientPrecision> &generator0, underlying_type<CoefficientPrecision> epsilon0, CoordinatePrecision eta0, char symmetry0) {
struct LocalGeneratorInUserNumbering : public VirtualGeneratorInUserNumbering<CoefficientPrecision> {
const std::vector<int> &m_target_local_to_global_numbering;
const std::vector<int> &m_source_local_to_global_numbering;
const VirtualGeneratorInUserNumbering<CoefficientPrecision> &m_generator;

LocalGeneratorInUserNumbering(const VirtualGeneratorInUserNumbering<CoefficientPrecision> &generator, const std::vector<int> &target_local_to_global_numbering, const std::vector<int> &source_local_to_global_numbering) : m_target_local_to_global_numbering(target_local_to_global_numbering), m_source_local_to_global_numbering(source_local_to_global_numbering), m_generator(generator) {}
LocalGeneratorInUserNumbering(const VirtualGeneratorInUserNumbering<CoefficientPrecision> &generator0, const std::vector<int> &target_local_to_global_numbering, const std::vector<int> &source_local_to_global_numbering) : m_target_local_to_global_numbering(target_local_to_global_numbering), m_source_local_to_global_numbering(source_local_to_global_numbering), m_generator(generator0) {}

void copy_submatrix(int M, int N, const int *const rows, const int *const cols, CoefficientPrecision *ptr) const override {
std::vector<int> new_rows(M), new_cols(N);
Expand All @@ -160,10 +160,10 @@ class DDMSolverWithDenseLocalSolver {
};

// Local Generator
LocalGeneratorInUserNumbering local_generator(generator, local_to_global_numbering, local_to_global_numbering);
LocalGeneratorInUserNumbering local_generator(generator0, local_to_global_numbering, local_to_global_numbering);

// Local HMatrix
HMatrixTreeBuilder<CoefficientPrecision> local_hmatrix_builder(*local_cluster, *local_cluster, epsilon, eta, symmetry, symmetry != 'N' ? 'L' : 'N', -1, -1, -1);
HMatrixTreeBuilder<CoefficientPrecision> local_hmatrix_builder(*local_cluster, *local_cluster, epsilon0, eta0, symmetry0, symmetry != 'N' ? 'L' : 'N', -1, -1, -1);

return local_hmatrix_builder.build(local_generator);
};
Expand Down Expand Up @@ -221,24 +221,24 @@ class DDMSolver {
return blocks_in_overlap0;
};

std::function<Cluster<CoordinatePrecision>(int, const CoordinatePrecision *)> initialize_local_cluster = [this](int spatial_dimension, const CoordinatePrecision *global_geometry) {
std::function<Cluster<CoordinatePrecision>(int, const CoordinatePrecision *)> initialize_local_cluster = [this](int spatial_dimension0, const CoordinatePrecision *global_geometry0) {
// Local geometry
int local_size = local_to_global_numbering.size();
std::vector<double> local_geometry(spatial_dimension * local_size);
std::vector<double> local_geometry(spatial_dimension0 * local_size);
for (int i = 0; i < local_to_global_numbering.size(); i++) {
for (int dimension = 0; dimension < spatial_dimension; dimension++) {
local_geometry[spatial_dimension * i + dimension] = global_geometry[spatial_dimension * local_to_global_numbering[i] + dimension];
for (int dimension = 0; dimension < spatial_dimension0; dimension++) {
local_geometry[spatial_dimension0 * i + dimension] = global_geometry0[spatial_dimension0 * local_to_global_numbering[i] + dimension];
}
}

// Local cluster
ClusterTreeBuilder<double> recursive_build_strategy;
return recursive_build_strategy.create_cluster_tree(local_to_global_numbering.size(), spatial_dimension, local_geometry.data(), 2, 2);
return recursive_build_strategy.create_cluster_tree(local_to_global_numbering.size(), spatial_dimension0, local_geometry.data(), 2, 2);
};

std::unique_ptr<Cluster<CoordinatePrecision>> local_cluster;

std::function<HMatrix<CoefficientPrecision, CoordinatePrecision>(const VirtualGeneratorInUserNumbering<CoefficientPrecision> &, underlying_type<CoefficientPrecision>, CoordinatePrecision, char)> initialize_local_hmatrix = [this](const VirtualGeneratorInUserNumbering<CoefficientPrecision> &generator, underlying_type<CoefficientPrecision> epsilon, CoordinatePrecision eta, char symmetry) {
std::function<HMatrix<CoefficientPrecision, CoordinatePrecision>(const VirtualGeneratorInUserNumbering<CoefficientPrecision> &, underlying_type<CoefficientPrecision>, CoordinatePrecision, char)> initialize_local_hmatrix = [this](const VirtualGeneratorInUserNumbering<CoefficientPrecision> &generator0, underlying_type<CoefficientPrecision> epsilon0, CoordinatePrecision eta0, char symmetry0) {
struct LocalGeneratorInUserNumbering : public VirtualGeneratorInUserNumbering<CoefficientPrecision> {
const std::vector<int> &m_target_local_to_global_numbering;
const std::vector<int> &m_source_local_to_global_numbering;
Expand All @@ -259,10 +259,10 @@ class DDMSolver {
};

// Local Generator
LocalGeneratorInUserNumbering local_generator(generator, local_to_global_numbering, local_to_global_numbering);
LocalGeneratorInUserNumbering local_generator(generator0, local_to_global_numbering, local_to_global_numbering);

// Local HMatrix
HMatrixTreeBuilder<CoefficientPrecision> local_hmatrix_builder(*local_cluster, *local_cluster, epsilon, eta, symmetry, symmetry != 'N' ? 'L' : 'N', -1, -1, -1);
HMatrixTreeBuilder<CoefficientPrecision> local_hmatrix_builder(*local_cluster, *local_cluster, epsilon0, eta0, symmetry0, symmetry0 != 'N' ? 'L' : 'N', -1, -1, -1);

return local_hmatrix_builder.build(local_generator);
};
Expand Down

0 comments on commit ca34dbf

Please sign in to comment.