86 return static_cast<Index>(pml_cells_.size());
89 return static_cast<Index>(source_cells_.size());
93 [[nodiscard]]
bool cached() const noexcept {
return cache_.valid; }
97 Index representative = 0;
98 std::vector<Index> cells;
103 std::vector<SparseMatrix> masses;
106 [[nodiscard]] std::vector<Complex> weights(
const Group& group,
107 const ConicalScatteringSetup& setup)
const;
113 std::vector<Vector> parts;
114 std::vector<Index> pml_outer;
115 std::vector<Index> pml_inner;
116 std::vector<Index> pml_map;
117 std::vector<Index> free_index;
119 std::vector<Index> target_offsets;
120 std::vector<Index> targets;
132 using Rows = std::vector<std::vector<RowTerm>>;
133 [[nodiscard]] Rows reduction_rows(
const ConicalScattering& problem)
const;
134 void build_cache(
const ConicalScattering& problem,
const Rows& rows,
135 const assembly::ConicalSystem& pml);
141 [[nodiscard]] assembly::ConicalSystem pml_system(
const ConicalScattering& problem,
142 const ConicalScatteringSetup& setup);
145 [[nodiscard]]
Vector factor_point(
const ConicalScatteringSetup& setup,
bool assemble_load);
147 [[nodiscard]]
Vector reduce_load(
const Vector& on_free)
const;
149 [[nodiscard]]
Vector expand(
const Vector& reduced)
const;
150 [[nodiscard]] ConicalSolution finish(
const Vector& reduced,
const ConicalScatteringSetup& setup);
152 const fespace::NedelecDofMap<2>* transverse_;
153 const fespace::DofMap<2>* longitudinal_;
154 ConicalScatteringSetup base_;
155 Real beta_scale_ = 1;
156 std::vector<Index> bulk_cells_;
157 std::vector<Index> pml_cells_;
158 std::vector<Index> source_cells_;
159 std::size_t base_free_ = 0;
161 std::vector<Group> groups_;
163 std::unique_ptr<solvers::LinearSolver> solver_;
164 bool factorised_ =
false;
167 std::vector<Real> key;
170 std::optional<PmlParts> pml_parts_;
171 std::vector<Real> last_pml_key_;
172 std::unique_ptr<ConicalScattering> point_;
174 SweepTimings timings_;
Definition dof_map.hpp:51
Definition conical_scattering.hpp:165
The affine operator of a conical scattering problem for sweeps.
Definition conical_sweep.hpp:44
Matrix solve_loads(const Matrix &loads)
Index num_groups() const noexcept
Definition conical_sweep.hpp:84
const SweepTimings & timings() const noexcept
Definition conical_sweep.hpp:81
ConicalSolution solve(const ConicalScatteringSetup &setup)
const ConicalScattering & point() const
const solvers::LinearSolver & solver() const noexcept
The solver after the first point (name, details).
Definition conical_sweep.hpp:83
Index num_pml_cells() const noexcept
Definition conical_sweep.hpp:85
ConicalSweep(const fespace::NedelecDofMap< 2 > &transverse, const fespace::DofMap< 2 > &longitudinal, const ConicalScatteringSetup &base)
void factorize(const ConicalScatteringSetup &setup)
bool cached() const noexcept
Definition conical_sweep.hpp:93
Index num_source_cells() const noexcept
Definition conical_sweep.hpp:88
Factorise once, solve for many right-hand sides.
Definition linear_solver.hpp:17
Definition absorption.hpp:21
double Real
Definition types.hpp:15
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition types.hpp:22
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20
std::complex< double > Complex
Definition types.hpp:16
Description of a conical scattering problem.
Definition conical_scattering.hpp:96
Definition conical_scattering.hpp:152
Accumulated wall-clock seconds of the sweep's phases (all points) and the point count.
Definition conical_sweep.hpp:30
Real setup
the one-time assembly of the affine parts and the pattern cache
Definition conical_sweep.hpp:31
Real factorize
(re)factorisation
Definition conical_sweep.hpp:35
int points
Definition conical_sweep.hpp:37
Real reduce
constraint reduction onto the fixed reduced pattern
Definition conical_sweep.hpp:34
Real solve
triangular solve and expansion
Definition conical_sweep.hpp:36
Real total() const noexcept
Definition conical_sweep.hpp:38
Real assemble
PML and source cells per point.
Definition conical_sweep.hpp:33
Real combine
combination of the cached values
Definition conical_sweep.hpp:32