SolutionSample< dim, NumberType > Class Template Reference#

DiFfRG: DiFfRG::SolutionSample< dim, NumberType > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
DiFfRG::SolutionSample< dim, NumberType > Class Template Reference

A read-only snapshot of the discrete solution, one sample per active cell. More...

#include <solution_sample.hh>

Public Types

using Entry = SolutionSampleEntry<dim, NumberType>
 

Public Member Functions

 SolutionSample ()=default
 
 SolutionSample (std::vector< Entry > entries, const uint n_components)
 
size_t size () const
 
bool empty () const
 
uint n_components () const
 
const Entry & operator[] (const size_t i) const
 
auto begin () const
 
auto end () const
 
void compute_central_difference_gradients ()
 Fill the gradients by central differences between neighbouring samples.
 

Private Attributes

std::vector< Entry > entries
 
uint m_n_components = 0
 

Detailed Description

template<int dim, typename NumberType>
class DiFfRG::SolutionSample< dim, NumberType >

A read-only snapshot of the discrete solution, one sample per active cell.

Exists so a model can answer questions about the solution that are not pointwise. The EoM machinery in common/eom.hh drives everything from a pointwise field EoM(x, u), which is enough to locate a minimum but cannot express a feature defined by comparing a cell with its neighbours – a shock, a kink, the edge of a plateau. A model that needs one of those overrides extractor_point (see model/model.hh) and is handed one of these.

Sampling is at cell centres, one entry per active cell, which is the resolution such features are defined at in the first place. Entries are sorted lexicographically by coordinate, so in one dimension they simply run left to right and neighbouring entries are neighbouring cells. In higher dimensions the ordering is well-defined but adjacency is the model's problem.

Like the rest of discretization/common, this assumes the replicated-mesh rung: the mesh is whole on every rank and the solution reaches it through a SolutionView that holds every index, so the sample is built rank-locally and is identical on every rank without communicating.

Member Typedef Documentation

◆ Entry

template<int dim, typename NumberType >
using DiFfRG::SolutionSample< dim, NumberType >::Entry = SolutionSampleEntry<dim, NumberType>

Constructor & Destructor Documentation

◆ SolutionSample() [1/2]

template<int dim, typename NumberType >
DiFfRG::SolutionSample< dim, NumberType >::SolutionSample ( )
default

◆ SolutionSample() [2/2]

template<int dim, typename NumberType >
DiFfRG::SolutionSample< dim, NumberType >::SolutionSample ( std::vector< Entry > entries,
const uint n_components )
inline

Member Function Documentation

◆ begin()

template<int dim, typename NumberType >
auto DiFfRG::SolutionSample< dim, NumberType >::begin ( ) const
inline

◆ compute_central_difference_gradients()

template<int dim, typename NumberType >
void DiFfRG::SolutionSample< dim, NumberType >::compute_central_difference_gradients ( )
inline

Fill the gradients by central differences between neighbouring samples.

For a builder that can supply values cheaply but not gradients – a finite-volume assembler, whose piecewise-constant shape functions have none – this recovers a usable gradient in O(n) without touching the scheme's reconstruction machinery. It is a plain difference, not the limited slope the scheme itself uses, so it is deliberately NOT what the flux path sees.

Only meaningful in one dimension, where the sorted order is the mesh order; a no-op otherwise.

◆ empty()

template<int dim, typename NumberType >
bool DiFfRG::SolutionSample< dim, NumberType >::empty ( ) const
inline

◆ end()

template<int dim, typename NumberType >
auto DiFfRG::SolutionSample< dim, NumberType >::end ( ) const
inline

◆ n_components()

template<int dim, typename NumberType >
uint DiFfRG::SolutionSample< dim, NumberType >::n_components ( ) const
inline

◆ operator[]()

template<int dim, typename NumberType >
const Entry & DiFfRG::SolutionSample< dim, NumberType >::operator[] ( const size_t i) const
inline

◆ size()

template<int dim, typename NumberType >
size_t DiFfRG::SolutionSample< dim, NumberType >::size ( ) const
inline

Member Data Documentation

◆ entries

template<int dim, typename NumberType >
std::vector<Entry> DiFfRG::SolutionSample< dim, NumberType >::entries
private

◆ m_n_components

template<int dim, typename NumberType >
uint DiFfRG::SolutionSample< dim, NumberType >::m_n_components = 0
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_sample.hh