![]() |
PRISMS-PF Manual
|
This class exists to evaluate a single user-defined operator for the matrix-free implementation of some PDE. More...
#include <mf_operator.h>
Public Types | |
| using | ScalarValue = dealii::VectorizedArray<number> |
| using | VectorValue = dealii::Tensor<1, dim, ScalarValue> |
| using | Operator |
| template<TensorRank Rank> | |
| using | Value |
Public Member Functions | |
| MFOperator ()=default | |
| Constructor. | |
| void | init (const PDEOperatorBase< dim, degree, number > &operator_owner, Operator oper, std::vector< FieldAttributes > _field_attributes, const SolutionIndexer< dim, number > &_solution_indexer, const MatrixFreeManager< dim, number > &_matrix_free_manager, const SimulationTimer &_sim_timer, SolveBlock _solve_block, DependencyMap _dependency_map) |
| Initialize. | |
| void | set_relative_level (unsigned int _relative_level) |
| void | compute_operator (BlockVector< number > &dst, const BlockVector< number > &src=BlockVector< number >()) const |
| Calls cell_loop on function that calls user-defined operator. | |
| void | compute_diagonal (BlockVector< number > &dst, const BlockVector< number > &src) const |
| Compute the diagonal of this operator. | |
| void | set_scaling_diagonal (bool scale, const std::vector< const SolutionVector< number > * > &diagonal) |
| Set scaling diagonal. | |
| dealii::types::global_dof_index | m () const |
| Return the number of DoFs. | |
| number | el (const unsigned int &row, const unsigned int &col) const |
| Return the value of the matrix entry. This function is only valid when row == col and when the diagonal is initialized. Additionally, this is only used so that we may compile. Trying to use this function will throw an error. | |
| void | clear () |
| Release all memory and return to state like having called the default constructor. | |
| const MatrixFree< dim, number > * | get_matrix_free () const |
| Get read access to the MatrixFree<dim, number> object stored with this operator. | |
| const std::shared_ptr< dealii::DiagonalMatrix< BlockVector< number > > > & | get_matrix_diagonal_inverse () const |
| Get read access to the inverse diagonal of this operator. | |
| void | vmult (BlockVector< number > &dst, const BlockVector< number > &src) const |
| Matrix-vector multiplication. | |
| void | Tvmult (BlockVector< number > &dst, const BlockVector< number > &src) const |
| Transpose matrix-vector multiplication. | |
| void | reinit_matrix_diagonal () |
| Reinit diagonal matrix to have the correct shape. | |
| void | eval_matrix_diagonal () |
| Evaluate matrix diagonal (and inverse). | |
Static Public Member Functions | |
| template<TensorRank Rank> | |
| static Value< Rank > | identity () |
| template<TensorRank Rank> | |
| static Value< Rank > | zero () |
Public Attributes | |
| bool | read_plain = false |
| Whether to read plain dof values from src, otherwise applies homogeneous part of constraints to the read of src. | |
Private Member Functions | |
| void | compute_local_operator (const MatrixFree< dim, number > &_data, BlockVector< number > &dst, const BlockVector< number > &src, const std::pair< unsigned int, unsigned int > &cell_range) const |
| Calls user-defined operator. | |
| void | compute_local_diagonal (const MatrixFree< dim, number > &_data, BlockVector< number > &diagonal, const BlockVector< number > &dummy_src, const std::pair< unsigned int, unsigned int > &cell_range) const |
| Local computation of the diagonal of the operator. | |
| template<TensorRank Rank> | |
| void | compute_local_field_diagonal (FieldContainer< dim, degree, number > &variable_list, BlockVector< number > &diagonal, unsigned int field_index) const |
Private Attributes | |
| std::vector< FieldAttributes > | field_attributes |
| The attribute list of the relevant variables. | |
| SolveBlock | solve_block |
| The block being solved. | |
| const PDEOperatorBase< dim, degree, number > * | pde_operator = nullptr |
| PDE operator object (owning class instance of pde_op) for user defined PDEs. | |
| Operator | pde_op = nullptr |
| The actual PDE operator function ptr (eg. compute_rhs) for user defined PDEs. | |
| const SolutionIndexer< dim, number > * | solution_indexer = nullptr |
| Read-access to fields. | |
| const MatrixFreeManager< dim, number > * | matrix_free_manager = nullptr |
| Matrix-free manager. | |
| const MatrixFree< dim, number > * | data = nullptr |
| Matrix-free object. | |
| unsigned int | relative_level = -1 |
| Level so that correct fields are read from indexer. | |
| DependencyMap | dependency_map |
| Which fields should be available to the solve. | |
| const SimulationTimer * | sim_timer = nullptr |
| Simulation timer. | |
| std::vector< const SolutionVector< number > * > | scaling_diagonal |
| Result of operator gets scaled by this (invm for explicit fields) | |
| bool | scale_by_diagonal = false |
| Whether or not to scale after operator result. | |
| std::vector< unsigned int > | field_to_block_index |
| Mapping from field index to block index (only for dst). | |
| std::vector< std::vector< unsigned int > > | edge_constrained_indices |
| Indices of DoFs on edge in case the operator is used in GMG context. | |
| std::shared_ptr< dealii::DiagonalMatrix< BlockVector< number > > > | diagonal_entries |
| The diagonal matrix. | |
| std::shared_ptr< dealii::DiagonalMatrix< BlockVector< number > > > | inverse_diagonal_entries |
| The inverse diagonal matrix. | |
This class exists to evaluate a single user-defined operator for the matrix-free implementation of some PDE.
| dim | The number of dimensions in the problem. |
| degree | The polynomial degree of the shape functions. |
| number | Datatype to use for LinearAlgebra::distributed::Vector<number>. Either double or float. |
| using MFOperator< dim, degree, number >::Operator |
| using MFOperator< dim, degree, number >::ScalarValue = dealii::VectorizedArray<number> |
| using MFOperator< dim, degree, number >::Value |
| using MFOperator< dim, degree, number >::VectorValue = dealii::Tensor<1, dim, ScalarValue> |
|
default |
Constructor.
| void MFOperator< dim, degree, number >::clear | ( | ) |
Release all memory and return to state like having called the default constructor.
| void MFOperator< dim, degree, number >::compute_diagonal | ( | BlockVector< number > & | dst, |
| const BlockVector< number > & | src ) const |
Compute the diagonal of this operator.
|
private |
Local computation of the diagonal of the operator.
|
private |
|
private |
Calls user-defined operator.
| PRISMS_PF_BEGIN_NAMESPACE void MFOperator< dim, degree, number >::compute_operator | ( | BlockVector< number > & | dst, |
| const BlockVector< number > & | src = BlockVector<number>() ) const |
Calls cell_loop on function that calls user-defined operator.
| number MFOperator< dim, degree, number >::el | ( | const unsigned int & | row, |
| const unsigned int & | col ) const |
Return the value of the matrix entry. This function is only valid when row == col and when the diagonal is initialized. Additionally, this is only used so that we may compile. Trying to use this function will throw an error.
| void MFOperator< dim, degree, number >::eval_matrix_diagonal | ( | ) |
Evaluate matrix diagonal (and inverse).
| const std::shared_ptr< dealii::DiagonalMatrix< BlockVector< number > > > & MFOperator< dim, degree, number >::get_matrix_diagonal_inverse | ( | ) | const |
Get read access to the inverse diagonal of this operator.
| const MatrixFree< dim, number > * MFOperator< dim, degree, number >::get_matrix_free | ( | ) | const |
Get read access to the MatrixFree<dim, number> object stored with this operator.
|
inlinestatic |
|
inline |
Initialize.
| dealii::types::global_dof_index MFOperator< dim, degree, number >::m | ( | ) | const |
Return the number of DoFs.
| void MFOperator< dim, degree, number >::reinit_matrix_diagonal | ( | ) |
Reinit diagonal matrix to have the correct shape.
|
inline |
|
inline |
Set scaling diagonal.
| void MFOperator< dim, degree, number >::Tvmult | ( | BlockVector< number > & | dst, |
| const BlockVector< number > & | src ) const |
Transpose matrix-vector multiplication.
| void MFOperator< dim, degree, number >::vmult | ( | BlockVector< number > & | dst, |
| const BlockVector< number > & | src ) const |
Matrix-vector multiplication.
|
inlinestatic |
|
private |
Matrix-free object.
|
private |
Which fields should be available to the solve.
|
private |
The diagonal matrix.
|
private |
Indices of DoFs on edge in case the operator is used in GMG context.
|
private |
The attribute list of the relevant variables.
|
private |
Mapping from field index to block index (only for dst).
|
private |
The inverse diagonal matrix.
|
private |
Matrix-free manager.
|
private |
The actual PDE operator function ptr (eg. compute_rhs) for user defined PDEs.
|
private |
PDE operator object (owning class instance of pde_op) for user defined PDEs.
| bool MFOperator< dim, degree, number >::read_plain = false |
Whether to read plain dof values from src, otherwise applies homogeneous part of constraints to the read of src.
|
private |
Level so that correct fields are read from indexer.
|
private |
Whether or not to scale after operator result.
|
private |
Result of operator gets scaled by this (invm for explicit fields)
|
private |
Simulation timer.
|
private |
Read-access to fields.
|
private |
The block being solved.