Struct WGSContext

Inheritance Relationships

Base Type

Derived Type

Struct Documentation

struct WGSContext : public opensn::LinearSystemContext

Subclassed by opensn::SweepWGSContext

Public Types

using SourceScopeModifier = std::function<void(SourceFlags &lhs_scope, SourceFlags &rhs_scope)>

Public Functions

WGSContext(DiscreteOrdinatesProblem &do_problem, LBSGroupset &groupset, const SetSourceFunction &set_source_function, SourceFlags lhs_scope, SourceFlags rhs_scope, bool log_info)
inline virtual void PreSetupCallback()
inline virtual void SetPreconditioner(KSP &solver)
inline virtual void PostSetupCallback()
inline virtual void PreSolveCallback()
virtual int MatrixAction(Mat &matrix, Vec &action_vector, Vec &action) override
virtual std::pair<int64_t, int64_t> GetSystemSize() = 0
virtual void ApplyInverseTransportOperator(SourceFlags scope) = 0

This operation applies the inverse of the transform operator in the form Ay = x where the the vector x’s underlying implementing is always LBS’s q_moments_local vextor.

inline virtual void PostSolveCallback()
inline SourceFlags GetLHSSourceScope() const

Sources treated implicitly (in the operator) by the within-group solve.

inline SourceFlags GetRHSSourceScope() const

Sources treated explicitly (on the right-hand side) by the within-group solve.

Public Members

DiscreteOrdinatesProblem &do_problem
LBSGroupset &groupset
const SetSourceFunction &set_source_function
bool log_info = true
size_t counter_applications_of_inv_op = 0
IterationSummary last_solve

Public Static Functions

static ScopedRestore OverrideSourceScopes(DiscreteOrdinatesProblem &do_problem, const SourceScopeModifier &modify)

Applies modify to the source scopes of every WGS context of do_problem until the returned guard is destroyed.

This is the only way to change the scopes after construction.