Skip to content

Commit

Permalink
Merge pull request #847 from PowerGridModel/feature/only-important-in…
Browse files Browse the repository at this point in the history
…tegration-tests-4

keep only important integration tests: step 4
  • Loading branch information
TonyXiang8787 authored Nov 29, 2024
2 parents 67b0f30 + 155dfd8 commit e6b075d
Show file tree
Hide file tree
Showing 22 changed files with 1,696 additions and 1,488 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ namespace power_grid_model::math_solver {
namespace iterative_current_pf {

// solver
template <symmetry_tag sym>
class IterativeCurrentPFSolver : public IterativePFSolver<sym, IterativeCurrentPFSolver<sym>> {
template <symmetry_tag sym_type>
class IterativeCurrentPFSolver : public IterativePFSolver<sym_type, IterativeCurrentPFSolver<sym_type>> {
public:
using sym = sym_type;

using SparseSolverType = SparseLUSolver<ComplexTensor<sym>, ComplexValue<sym>, ComplexValue<sym>>;
using BlockPermArray = typename SparseSolverType::BlockPermArray;

static constexpr auto is_iterative = true;

IterativeCurrentPFSolver(YBus<sym> const& y_bus, std::shared_ptr<MathModelTopology const> const& topo_ptr)
: IterativePFSolver<sym, IterativeCurrentPFSolver>{y_bus, topo_ptr},
rhs_u_(y_bus.size()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ template <symmetry_tag sym> class ILSEGainBlock : public Block<DoubleComplex, sy
GetterType<1, 1> r() { return this->template get_val<1, 1>(); }
};

template <symmetry_tag sym> class IterativeLinearSESolver {
template <symmetry_tag sym_type> class IterativeLinearSESolver {
public:
using sym = sym_type;

static constexpr auto is_iterative = true;

private:
// block size 2 for symmetric, 6 for asym
static constexpr Idx bsr_block_size_ = is_symmetric_v<sym> ? 2 : 6;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if there are sources

#include "../calculation_parameters.hpp"
#include "../common/common.hpp"
#include "../common/enum.hpp"
#include "../common/exception.hpp"
#include "../common/three_phase_tensor.hpp"
#include "../common/timer.hpp"
Expand All @@ -42,13 +43,17 @@ namespace power_grid_model::math_solver {

namespace linear_pf {

template <symmetry_tag sym> class LinearPFSolver {
template <symmetry_tag sym_type> class LinearPFSolver {

public:
using sym = sym_type;

using SparseSolverType = SparseLUSolver<ComplexTensor<sym>, ComplexValue<sym>, ComplexValue<sym>>;
using BlockPermArray =
typename SparseLUSolver<ComplexTensor<sym>, ComplexValue<sym>, ComplexValue<sym>>::BlockPermArray;

static constexpr auto is_iterative = false;

LinearPFSolver(YBus<sym> const& y_bus, std::shared_ptr<MathModelTopology const> const& topo_ptr)
: n_bus_{y_bus.size()},
load_gens_per_bus_{topo_ptr, &topo_ptr->load_gens_per_bus},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,17 @@ template <symmetry_tag sym> class PFJacBlock : public Block<double, sym, true, 2
};

// solver
template <symmetry_tag sym> class NewtonRaphsonPFSolver : public IterativePFSolver<sym, NewtonRaphsonPFSolver<sym>> {
template <symmetry_tag sym_type>
class NewtonRaphsonPFSolver : public IterativePFSolver<sym_type, NewtonRaphsonPFSolver<sym_type>> {
public:
using sym = sym_type;

using SparseSolverType = SparseLUSolver<PFJacBlock<sym>, ComplexPower<sym>, PolarPhasor<sym>>;
using BlockPermArray =
typename SparseLUSolver<PFJacBlock<sym>, ComplexPower<sym>, PolarPhasor<sym>>::BlockPermArray;

static constexpr auto is_iterative = true;

NewtonRaphsonPFSolver(YBus<sym> const& y_bus, std::shared_ptr<MathModelTopology const> const& topo_ptr)
: IterativePFSolver<sym, NewtonRaphsonPFSolver>{y_bus, topo_ptr},
data_jac_(y_bus.nnz_lu()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ template <symmetry_tag sym> class NRSEGainBlock : public Block<double, sym, true
};

// solver
template <symmetry_tag sym> class NewtonRaphsonSESolver {
template <symmetry_tag sym_type> class NewtonRaphsonSESolver {
public:
using sym = sym_type;

static constexpr auto is_iterative = true;

private:
enum class Order { row_major = 0, column_major = 1 };

struct NRSEVoltageState {
Expand Down
1 change: 0 additions & 1 deletion tests/cpp_integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
set(PROJECT_SOURCES
"test_entry_point.cpp"
"test_main_model.cpp"
"test_math_solver.cpp"
)

add_executable(power_grid_model_integration_tests ${PROJECT_SOURCES})
Expand Down
Loading

0 comments on commit e6b075d

Please sign in to comment.