feat(libmeanfield): variadic refactor
also added normaliztion operator
This commit is contained in:
@@ -292,7 +292,8 @@ export namespace mean_field::preconditioning {
|
||||
};
|
||||
|
||||
template <equilibrium::DiscretizedStellarEquilibriumProblem Problem, SpecificationBorderBlockType Block>
|
||||
requires EquilibriumCoordinateComponentFor<Block, typename std::remove_cvref_t<Problem>::FormType>
|
||||
requires EquilibriumCoordinateComponentFor<Block, typename std::remove_cvref_t<Problem>::FormType> &&
|
||||
SpecificationBorderPreparableFor<Problem, Block>
|
||||
class PreparedStellarPreconditioner final : public mfem::Solver {
|
||||
private:
|
||||
using ProblemType = std::remove_cvref_t<Problem>;
|
||||
@@ -324,6 +325,9 @@ export namespace mean_field::preconditioning {
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStellarPreconditioner(ProblemType &&, BlockType) = delete;
|
||||
PreparedStellarPreconditioner(const ProblemType &&, BlockType) = delete;
|
||||
|
||||
PreparedStellarPreconditioner(const PreparedStellarPreconditioner &) = delete;
|
||||
PreparedStellarPreconditioner &operator=(const PreparedStellarPreconditioner &) = delete;
|
||||
PreparedStellarPreconditioner(PreparedStellarPreconditioner &&) = delete;
|
||||
@@ -367,6 +371,10 @@ export namespace mean_field::preconditioning {
|
||||
return m_grouped.GetBlock();
|
||||
}
|
||||
|
||||
[[nodiscard]] const ProblemType &GetProblem() const noexcept {
|
||||
return m_grouped.GetProblem();
|
||||
}
|
||||
|
||||
[[nodiscard]] const GroupedPreconditioner &GetGroupedPreconditioner() const noexcept {
|
||||
return m_grouped;
|
||||
}
|
||||
@@ -392,11 +400,26 @@ export namespace mean_field::preconditioning {
|
||||
SpecificationBorderBlockType Block>
|
||||
requires EquilibriumCoordinateComponentFor<
|
||||
Block,
|
||||
typename std::remove_cvref_t<Problem>::FormType>
|
||||
typename std::remove_cvref_t<Problem>::FormType> &&
|
||||
SpecificationBorderPreparableFor<Problem, Block>
|
||||
[[nodiscard]] auto prepare(
|
||||
const Problem &problem,
|
||||
Block block
|
||||
) {
|
||||
return PreparedStellarPreconditioner<Problem, Block>{problem, std::move(block)};
|
||||
}
|
||||
|
||||
template <typename Problem, SpecificationBorderBlockType Block>
|
||||
requires (!std::is_lvalue_reference_v<Problem>) &&
|
||||
equilibrium::DiscretizedStellarEquilibriumProblem<std::remove_cvref_t<Problem>> &&
|
||||
EquilibriumCoordinateComponentFor<
|
||||
Block,
|
||||
typename std::remove_cvref_t<Problem>::FormType> &&
|
||||
SpecificationBorderPreparableFor<std::remove_cvref_t<Problem>, Block>
|
||||
[[nodiscard]] auto prepare(
|
||||
Problem &&,
|
||||
Block
|
||||
) -> PreparedStellarPreconditioner<
|
||||
std::remove_cvref_t<Problem>,
|
||||
std::remove_cvref_t<Block>> = delete;
|
||||
} // namespace mean_field::preconditioning
|
||||
|
||||
Reference in New Issue
Block a user