6#include <deal.II/base/vectorization.h>
7#include <deal.II/matrix_free/matrix_free.h>
8#include <deal.II/matrix_free/operators.h>
21#include <prismspf/config.h>
25#if DEAL_II_VERSION_MAJOR >= 9 && DEAL_II_VERSION_MINOR >= 7
26# include <deal.II/base/enable_observer_pointer.h>
27# define MATRIX_FREE_OPERATOR_BASE dealii::EnableObserverPointer
29# include <deal.II/base/subscriptor.h>
30# define MATRIX_FREE_OPERATOR_BASE dealii::Subscriptor
48template <
unsigned int dim,
unsigned int degree,
typename number>
61 template <TensorRank Rank>
66 template <TensorRank Rank>
79 for (
int i = 0; i < Value<Rank>::n_independent_components; ++i)
88 template <TensorRank Rank>
109 const std::vector<FieldAttributes> &_field_attributes,
111 unsigned int _relative_level,
145 for (
unsigned int field_index :
solve_block.field_indices)
169 const std::pair<unsigned int, unsigned int> &cell_range)
const;
210 dealii::types::global_dof_index
219 el(
const unsigned int &row,
const unsigned int &col)
const;
238 const MatrixFree<dim, number> *
244 const std::shared_ptr<dealii::DiagonalMatrix<SolutionVector<number>>> &
327 const MatrixFree<dim, number> *
data;
342 std::shared_ptr<dealii::DiagonalMatrix<SolutionVector<number>>>
346PRISMS_PF_END_NAMESPACE
This class permits the access of a subset of indexed fields and gives an error if any non-allowed fie...
Definition field_container.h:47
Class that manages solution initialization and swapping with old solutions.
Definition group_solution_handler.h:72
const SolveBlock & get_solve_block() const
Get the underlying solve block object.
Definition group_solution_handler.cc:151
MatrixFree< dim, number > & get_matrix_free(unsigned int relative_level=0)
Get the matrix_free object at a level.
Definition group_solution_handler.cc:128
const std::vector< unsigned int > & get_global_to_block_index() const
Get the block index from the global index.
Definition group_solution_handler.cc:158
dealii::types::global_dof_index m() const
Return the number of DoFs.
Definition mf_operator.cc:212
Value< Rank > identity()
Definition mf_operator.h:68
Operator pde_op
The actual PDE operator function ptr (eg. compute_rhs) for user defined PDEs.
Definition mf_operator.h:288
Value< Rank > zero()
Definition mf_operator.h:90
std::shared_ptr< dealii::DiagonalMatrix< SolutionVector< number > > > diagonal_entries
The diagonal matrix.
Definition mf_operator.h:337
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.
Definition mf_operator.cc:32
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.
Definition mf_operator.h:107
void Tvmult(BlockVector< number > &dst, const BlockVector< number > &src) const
Transpose matrix-vector multiplication.
Definition mf_operator.cc:293
dealii::VectorizedArray< number > ScalarValue
Definition mf_operator.h:52
std::shared_ptr< dealii::DiagonalMatrix< SolutionVector< number > > > inverse_diagonal_entries
The inverse diagonal matrix.
Definition mf_operator.h:343
unsigned int relative_level
Level so that correct fields are read from indexer.
Definition mf_operator.h:297
const std::shared_ptr< dealii::DiagonalMatrix< SolutionVector< number > > > & get_matrix_diagonal_inverse() const
Get read access to the inverse diagonal of this operator.
Definition mf_operator.cc:274
DependencyMap dependency_map
Which fields should be available to the solve.
Definition mf_operator.h:302
std::vector< const SolutionVector< number > * > scaling_diagonal
Result of operator gets scaled by this (invm for explicit fields)
Definition mf_operator.h:312
dealii::Tensor< 1, dim, ScalarValue > VectorValue
Definition mf_operator.h:53
SolveBlock solve_block
The block being solved.
Definition mf_operator.h:279
std::vector< unsigned int > field_to_block_index
Mapping from field index to block index (only for dst).
Definition mf_operator.h:322
void clear()
Release all memory and return to state like having called the default constructor.
Definition mf_operator.cc:240
void initialize(const GroupSolutionHandler< dim, number > &dst_solution)
Initialize.
Definition mf_operator.h:140
std::conditional_t< Rank==TensorRank::Scalar, ScalarValue, dealii::Tensor< int(Rank), dim, ScalarValue > > Value
Definition mf_operator.h:62
const SimulationTimer * sim_timer
Simulation timer.
Definition mf_operator.h:307
std::vector< std::vector< unsigned int > > edge_constrained_indices
Indices of DoFs on edge in case the operator is used in GMG context.
Definition mf_operator.h:332
const MatrixFree< dim, number > * get_matrix_free() const
Set constrained entries to one.
Definition mf_operator.cc:267
void compute_operator(BlockVector< number > &dst, const BlockVector< number > &src=BlockVector< number >()) const
Calls cell_loop on function that calls user-defined operator.
Definition mf_operator.cc:17
void(PDEOperatorBase< dim, degree, number >::*)( FieldContainer< dim, degree, number > &, const SimulationTimer &, unsigned int) const Operator
Definition mf_operator.h:55
const PDEOperatorBase< dim, degree, number > * pde_operator
PDE operator object (owning class instance of pde_op) for user defined PDEs.
Definition mf_operator.h:284
void set_scaling_diagonal(bool scale, const std::vector< const SolutionVector< number > * > &diagonal)
Compute the diagonal of this operator.
Definition mf_operator.h:200
bool read_plain
Whether to read plain dof values from src, otherwise applies homogeneous part of constraints to the r...
Definition mf_operator.h:268
bool scale_by_diagonal
Whether or not to scale after operator result.
Definition mf_operator.h:317
const SolutionIndexer< dim, number > * solution_indexer
Read-access to fields.
Definition mf_operator.h:293
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 diagon...
Definition mf_operator.cc:231
const MatrixFree< dim, number > * data
Matrix-free object.
Definition mf_operator.h:327
void vmult(BlockVector< number > &dst, const BlockVector< number > &src) const
Matrix-vector multiplication.
Definition mf_operator.cc:283
std::vector< FieldAttributes > field_attributes
The attribute list of the relevant variables.
Definition mf_operator.h:274
This class contains the user implementation of each PDE operator.
Definition pde_operator_base.h:24
Definition simulation_timer.h:13
Class that provides access to solution vectors spread across different groups.
Definition solution_indexer.h:20
Structure to hold the attributes of a solve-block.
Definition solve_block.h:56
std::map< Types::Index, Dependency > DependencyMap
Definition dependencies.h:129
@ Value
Use value of the variable as a criterion for refinement.
Definition grid_refiner_criterion.h:31
typename BlockVector< number >::BlockType SolutionVector
Typedef for solution vector.
Definition group_solution_handler.h:35
dealii::LinearAlgebra::distributed::BlockVector< number > BlockVector
Typedef for solution block vector.
Definition group_solution_handler.h:29
#define MATRIX_FREE_OPERATOR_BASE
Definition mf_operator.h:30
Definition conditional_ostreams.cc:20
Definition vectorized_operations.h:17
@ Scalar
Definition type_enums.h:54