SolutionView< VectorType > Class Template Reference#

DiFfRG: DiFfRG::SolutionView< VectorType > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
DiFfRG::SolutionView< VectorType > Class Template Reference

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

template<typename VectorType>
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

template<typename VectorType >
using DiFfRG::SolutionView< VectorType >::NumberType = get_type::NumberType<VectorType>

◆ size_type

template<typename VectorType >
using DiFfRG::SolutionView< VectorType >::size_type = dealii::types::global_dof_index

Constructor & Destructor Documentation

◆ SolutionView()

template<typename VectorType >
DiFfRG::SolutionView< VectorType >::SolutionView ( )
default

Member Function Documentation

◆ get()

template<typename VectorType >
const VectorType & DiFfRG::SolutionView< VectorType >::get ( ) const
inline

◆ operator const VectorType &()

template<typename VectorType >
DiFfRG::SolutionView< VectorType >::operator const VectorType & ( ) const
inline

◆ operator[]()

template<typename VectorType >
NumberType DiFfRG::SolutionView< VectorType >::operator[] ( const size_type i) const
inline

◆ refresh()

template<typename VectorType >
void DiFfRG::SolutionView< VectorType >::refresh ( const VectorType & owned)
inline

Make the view reflect owned.

◆ reinit()

template<typename VectorType >
void DiFfRG::SolutionView< VectorType >::reinit ( const dealii::IndexSet & ,
const dealii::IndexSet & ,
MPI_Comm  )
inline

Establish the layout. No-op for the serial policy.

◆ size()

template<typename VectorType >
size_type DiFfRG::SolutionView< VectorType >::size ( ) const
inline

Member Data Documentation

◆ source

template<typename VectorType >
const VectorType* DiFfRG::SolutionView< VectorType >::source = nullptr
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