SolutionView< VectorType > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
A read-only, fully-replicated view of the solution. More...
#include <solution_view.hh>
Public Types | |
| using | NumberType = get_type::NumberType<VectorType> |
| using | size_type = dealii::types::global_dof_index |
Public Member Functions | |
| SolutionView ()=default | |
| void | reinit (const dealii::IndexSet &, const dealii::IndexSet &, MPI_Comm) |
| Establish the layout. No-op for the serial policy. | |
| void | refresh (const VectorType &owned) |
Make the view reflect owned. | |
| const VectorType & | get () const |
| operator const VectorType & () const | |
| NumberType | operator[] (const size_type i) const |
| size_type | size () const |
Private Attributes | |
| const VectorType * | source = nullptr |
Detailed Description
class DiFfRG::SolutionView< VectorType >
A read-only, fully-replicated view of the solution.
A large amount of code under discretization/ reads the solution at arbitrary global dof indices: the EoM search (common/eom.hh), the KT reconstruction caches (FV/assembler/reconstruction_cache.hh), the output path (data/fe_output.cc) and the support point lookups. None of that is expressible against a vector that only holds this rank's rows.
Rather than rewrite all of it, this class maintains one replica holding every index, refreshed once per residual/Jacobian evaluation. Those call sites then read the replica and need no logic change at all. At replicated-mesh sizes the replica is exactly today's memory footprint.
The serial specialization is a pure passthrough – it stores a pointer, copies nothing, and compiles to the same code as passing the vector directly – so a serial build pays nothing for the abstraction.
- Warning
- The two policies differ in one respect that matters if you hold a view across a write: the serial view aliases the source vector, so it observes later mutations, while the distributed view is a snapshot taken at refresh(). Always refresh() immediately before reading and never hold a view across an assembly step, and the two behave identically.
Narrowing the replica from "everything" to the locally relevant dofs is the defining step of the fully-distributed rung. It is deliberately confined to this one class so that step has a single place to happen, and so the call sites that will need real work are exactly the ones that name this type.
Member Typedef Documentation
◆ NumberType
| using DiFfRG::SolutionView< VectorType >::NumberType = get_type::NumberType<VectorType> |
◆ size_type
| using DiFfRG::SolutionView< VectorType >::size_type = dealii::types::global_dof_index |
Constructor & Destructor Documentation
◆ SolutionView()
|
default |
Member Function Documentation
◆ get()
|
inline |
◆ operator const VectorType &()
|
inline |
◆ operator[]()
|
inline |
◆ refresh()
|
inline |
Make the view reflect owned.
◆ reinit()
|
inline |
Establish the layout. No-op for the serial policy.
◆ size()
|
inline |
Member Data Documentation
◆ source
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/common/solution_view.hh
Generated by