SpECTRE  v2026.11.11
Loading...
Searching...
No Matches
LinearSolver::Actions::BuildMatrix< FieldsTag, FixedSourcesTag, OperandTag, OperatorAppliedToOperandTag, CoordsTag, ArraySectionIdTag > Struct Template Reference

Build the explicit matrix representation of the linear operator and optionally solve the problem directly with it. More...

#include <BuildMatrix.hpp>

Public Types

template<typename Metavariables>
using component_list
template<typename ApplyOperatorActions>
using actions
using amr_projectors = tmpl::list<ProjectBuildMatrix<BuildMatrixMetavars>>
using register_actions
 Add to the register phase to enable observations.
using reset_actions = tmpl::list<ResetBuiltMatrix<BuildMatrixMetavars>>
 Add to the action list to reset the matrix.

Detailed Description

template<typename FieldsTag, typename FixedSourcesTag, typename OperandTag, typename OperatorAppliedToOperandTag, typename CoordsTag, typename ArraySectionIdTag = void>
struct LinearSolver::Actions::BuildMatrix< FieldsTag, FixedSourcesTag, OperandTag, OperatorAppliedToOperandTag, CoordsTag, ArraySectionIdTag >

Build the explicit matrix representation of the linear operator and optionally solve the problem directly with it.

The matrix is built by applying the linear operator to unit vectors, so it takes as many operator applications as there are points. Each element stores the rows of the matrix that correspond to its points. The matrix is built once and kept until it is reset (see reset_actions) or AMR changes the grid.

If direct solve is enabled, the elements send their rows of the matrix and the source to a singleton. The singleton assembles the full matrix, computes its LU factorization, and broadcasts the solution back to the elements. The LU factorization is reused for subsequent solves until the matrix changes, so these solves only cost two triangular solves on the singleton. This is useful as bottom solver in a multigrid setting, where the coarsest grid is small and the same linear operator is inverted in every V-cycle.

Add the actions to the action list to build the matrix. The ApplyOperatorActions template parameter are the actions that apply the linear operator to the OperandTag. Also add the amr_projectors to the list of AMR projectors and the register_actions

Template Parameters
FieldsTagThe solution will be stored here (if direct solve is enabled).
FixedSourcesTagThe source b in the problem Ax = b. Only used if direct solve is enabled.
OperandTagWill be set to unit vectors, with the '1' moving through all points over the course of the iteration.
OperatorAppliedToOperandTagWhere the ApplyOperatorActions store the result of applying the linear operator to the OperandTag.
CoordsTagThe tag of the coordinates observed alongside the matrix for volume data visualization.
ArraySectionIdTagCan identify a subset of elements that this algorithm should run over, e.g. in a multigrid setting.

Member Typedef Documentation

◆ actions

template<typename FieldsTag, typename FixedSourcesTag, typename OperandTag, typename OperatorAppliedToOperandTag, typename CoordsTag, typename ArraySectionIdTag = void>
template<typename ApplyOperatorActions>
using LinearSolver::Actions::BuildMatrix< FieldsTag, FixedSourcesTag, OperandTag, OperatorAppliedToOperandTag, CoordsTag, ArraySectionIdTag >::actions
Initial value:
tmpl::list<CollectTotalNumPoints<BuildMatrixMetavars>,
SetUnitVector<BuildMatrixMetavars>, ApplyOperatorActions,
ApplyOperatorActions,
Labels a location in the action list that can be jumped to using Goto.
Definition Goto.hpp:40
Definition BuildMatrix.hpp:596
Set the operand to a unit vector with a '1' at the current grid point. Applying the operator to this ...
Definition BuildMatrix.hpp:440
Write result out to disk, reset operand back to zero, and keep iterating.
Definition BuildMatrix.hpp:474

◆ component_list

template<typename FieldsTag, typename FixedSourcesTag, typename OperandTag, typename OperatorAppliedToOperandTag, typename CoordsTag, typename ArraySectionIdTag = void>
template<typename Metavariables>
using LinearSolver::Actions::BuildMatrix< FieldsTag, FixedSourcesTag, OperandTag, OperatorAppliedToOperandTag, CoordsTag, ArraySectionIdTag >::component_list
Initial value:
tmpl::list<BuildMatrixSingleton<Metavariables, BuildMatrixMetavars>>

◆ register_actions

template<typename FieldsTag, typename FixedSourcesTag, typename OperandTag, typename OperatorAppliedToOperandTag, typename CoordsTag, typename ArraySectionIdTag = void>
using LinearSolver::Actions::BuildMatrix< FieldsTag, FixedSourcesTag, OperandTag, OperatorAppliedToOperandTag, CoordsTag, ArraySectionIdTag >::register_actions
Initial value:
detail::RegisterWithVolumeObserver<ArraySectionIdTag>>>
Register an observation ID with the observers.
Definition RegisterWithObservers.hpp:53

Add to the register phase to enable observations.


The documentation for this struct was generated from the following file:
  • src/ParallelAlgorithms/LinearSolver/Actions/BuildMatrix.hpp