![]() |
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 = void(PDEOperatorBase< dim, degree, number >::*)(FieldContainer< dim, degree, number > &, const SimulationTimer &, unsigned int) const |
| template<TensorRank Rank> | |
| using | Value = std::conditional_t< Rank==TensorRank::Scalar, ScalarValue, dealii::Tensor< int(Rank), dim, ScalarValue > > |
Public Member Functions | |
| template<TensorRank Rank> | |
| Value< Rank > | identity () |
| template<TensorRank Rank> | |
| Value< Rank > | zero () |
| MFOperator (const PDEOperatorBase< dim, degree, number > &operator_owner, Operator oper, const std::vector< FieldAttributes > &_field_attributes, const SolutionIndexer< dim, number > &_solution_indexer, unsigned int _relative_level, DependencyMap _dependency_map, const SimulationTimer &_sim_timer) | |
| Constructor. | |
| void | initialize (const GroupSolutionHandler< dim, number > &dst_solution) |
| Initialize. | |
| void | compute_operator (BlockVector< number > &dst, const BlockVector< number > &src=BlockVector< number >()) const |
| Calls cell_loop on function that calls user-defined 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 |
| Set constrained entries to one. | |
| const std::shared_ptr< dealii::DiagonalMatrix< SolutionVector< 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. | |
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. | |
Private Attributes | |
| std::vector< FieldAttributes > | field_attributes |
| The attribute list of the relevant variables. | |
| SolveGroup | solve_group |
| The group being solved. | |
| const PDEOperatorBase< dim, degree, number > * | pde_operator |
| PDE operator object (owning class instance of pde_op) for user defined PDEs. | |
| Operator | pde_op |
| The actual PDE operator function ptr (eg. compute_rhs) for user defined PDEs. | |
| const SolutionIndexer< dim, number > * | solution_indexer |
| Read-access to fields. | |
| unsigned int | relative_level |
| Level so that correct fields are read from indexer. | |
| DependencyMap | dependency_map |
| Which fields should be available to the solve. | |
| const SimulationTimer * | sim_timer |
| 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). | |
| const MatrixFree< dim, number > * | data |
| Matrix-free object. | |
| 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< SolutionVector< number > > > | diagonal_entries |
| The diagonal matrix. | |
| std::shared_ptr< dealii::DiagonalMatrix< SolutionVector< 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 = void (PDEOperatorBase<dim, degree, number>::*)( FieldContainer<dim, degree, number> &, const SimulationTimer &, unsigned int ) const |
| using MFOperator< dim, degree, number >::ScalarValue = dealii::VectorizedArray<number> |
| using MFOperator< dim, degree, number >::Value = std::conditional_t<Rank == TensorRank::Scalar, ScalarValue, dealii::Tensor<int(Rank), dim, ScalarValue> > |
| using MFOperator< dim, degree, number >::VectorValue = dealii::Tensor<1, dim, ScalarValue> |
|
inlineexplicit |
Constructor.
| void MFOperator< dim, degree, number >::clear | ( | ) |
Release all memory and return to state like having called the default constructor.
|
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.
| const std::shared_ptr< dealii::DiagonalMatrix< SolutionVector< number > > > & MFOperator< dim, degree, number >::get_matrix_diagonal_inverse | ( | ) | const |
Get read access to the inverse diagonal of this operator.
Set constrained entries to one.
Get read access to the MatrixFree<dim, number> object stored with this operator.
|
inline |
|
inline |
Initialize.
vmult(VectorType &dst, const VectorType &src). Because we are using block vectors, for the MFOperator to work, it needs to have access to the index mapping in addition to the matrix_free object. Both are stored in the solution handler.Additionally, we modify dependency_map to include an entry for every field being solved. This is to avoid a troublesome problem downstream in FieldContainer, where we only want to initialize FEEvals for what is needed. (There could be a better way of handling this, but this is the least complicated for now.)
| dealii::types::global_dof_index MFOperator< dim, degree, number >::m | ( | ) | const |
Return the number of DoFs.
|
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.
|
inline |
|
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 |
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.
|
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 group being solved.