PointBatch< dim_, NT, n_fe, Extractors, Variables, with_derivatives, with_hessians > Class Template Reference#

DiFfRG: PointBatch< dim_, NT, n_fe, Extractors, Variables, with_derivatives, with_hessians > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
PointBatch< dim_, NT, n_fe, Extractors, Variables, with_derivatives, with_hessians > Class Template Reference

The solution at a set of points: values and (if gathered) derivatives and hessians of every FE function, plus position and cell width of each point. Extractors and variables are shared by all points. More...

#include <batch.hh>

Public Types

using number_type = NT
 double, or an AD type when the jacobian is computed.
 
using extractors_type = Extractors
 
template<typename NT2 >
using rebind
 The same batch in another number type, e.g. for AD.
 
using State = internal::PointState<dim, NT, n_fe>
 The copy of one point that the per-point callbacks see, see tie().
 

Public Member Functions

void reinit (const size_t n_points)
 Assembler side: resize to n_points points.
 
void set_shared (const Extractors &extractors, const Variables &variables)
 Assembler side: point the batch to the extractors and variables, which must outlive its use.
 
void clear_shared ()
 Forget the shared extractors and variables, e.g. when the call that owns them returns.
 
size_t size () const
 Number of points.
 
PointSpan< const NT > values (const size_t c) const
 Values \(u_c\) of FE function c at all points.
 
PointSpan< const NT > derivatives (const size_t c, const size_t d) const
 \(\partial_d u_c\) at all points; only if has_derivatives.
 
PointSpan< const NT > hessians (const size_t c, const size_t d1, const size_t d2) const
 \(\partial_{d_1}\partial_{d_2} u_c\) at all points; only if has_hessians.
 
PointSpan< const double > coordinates (const size_t d) const
 Coordinate d of all points.
 
dealii::Point< dim > x (const size_t i) const
 Position of point i.
 
double cell_width (const size_t i) const
 Width of the cell containing point i.
 
const Extractors & extractors () const
 The extractors \(e_b\), the same for all points.
 
const Variables & variables () const
 The variables \(v_a\), the same for all points.
 
void load (const size_t i, State &s) const
 Point i as a State; only the gathered inputs are loaded.
 
auto tie (State &s) const
 The named tuple the per-point callbacks receive for a loaded State; see batch_tie.
 
template<typename Src >
void copy_point (const size_t j, const Src &src, const size_t i)
 Point j of this batch = point i of src, which has the same inputs but may differ in number type.
 
NT & value (const size_t c, const size_t i)
 
NT & derivative (const size_t c, const size_t d, const size_t i)
 
NT & hessian (const size_t c, const size_t d1, const size_t d2, const size_t i)
 
double & coordinate (const size_t d, const size_t i)
 
double & width (const size_t i)
 

Static Public Attributes

static constexpr int dim = dim_
 Dimension of the field space.
 
static constexpr size_t n_fe_functions = n_fe
 Number of FE functions (columns per input kind).
 
static constexpr bool has_derivatives = with_derivatives
 Whether derivatives() is available.
 
static constexpr bool has_hessians = with_hessians
 Whether hessians() is available.
 
static constexpr uint extractor_index = 1 + with_derivatives + with_hessians
 Where tie() puts the extractors, i.e. the tuple index of the per-point extractor jacobians.
 

Protected Member Functions

const NT * column (const size_t col) const
 
NT * column (const size_t col)
 

Detailed Description

template<int dim_, typename NT, size_t n_fe, typename Extractors, typename Variables, bool with_derivatives, bool with_hessians>
class DiFfRG::PointBatch< dim_, NT, n_fe, Extractors, Variables, with_derivatives, with_hessians >

The solution at a set of points: values and (if gathered) derivatives and hessians of every FE function, plus position and cell width of each point. Extractors and variables are shared by all points.

Columns are contiguous over the points (see batch.hh); the order of the points carries no meaning.

Template Parameters
with_derivatives,with_hessianswhich inputs the assembler gathers. CG and DG gather what the model's batch_reads_derivatives / batch_reads_hessians ask for, KT always derivatives and hessians only with source_uses_hessians. Reading one that is not gathered does not compile; a model used with several assemblers tests if constexpr (Batch::has_derivatives).

Member Typedef Documentation

◆ extractors_type

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
using extractors_type = Extractors

◆ number_type

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
using number_type = NT

double, or an AD type when the jacobian is computed.

◆ rebind

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
template<typename NT2 >
using rebind
Initial value:
PointBatch<dim, NT2, n_fe, std::array<NT2, std::tuple_size_v<Extractors>>, Variables,
with_derivatives, with_hessians>

The same batch in another number type, e.g. for AD.

◆ State

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
using State = internal::PointState<dim, NT, n_fe>

The copy of one point that the per-point callbacks see, see tie().

Member Function Documentation

◆ cell_width()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
double cell_width ( const size_t i) const
inline

Width of the cell containing point i.

◆ clear_shared()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
void clear_shared ( )
inline

Forget the shared extractors and variables, e.g. when the call that owns them returns.

◆ column() [1/2]

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
NT * column ( const size_t col)
inlineprotected

◆ column() [2/2]

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
const NT * column ( const size_t col) const
inlineprotected

◆ coordinate()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
double & coordinate ( const size_t d,
const size_t i )
inline

◆ coordinates()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
PointSpan< const double > coordinates ( const size_t d) const
inline

Coordinate d of all points.

◆ copy_point()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
template<typename Src >
void copy_point ( const size_t j,
const Src & src,
const size_t i )
inline

Point j of this batch = point i of src, which has the same inputs but may differ in number type.

◆ derivative()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
NT & derivative ( const size_t c,
const size_t d,
const size_t i )
inline

◆ derivatives()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
PointSpan< const NT > derivatives ( const size_t c,
const size_t d ) const
inline

\(\partial_d u_c\) at all points; only if has_derivatives.

◆ extractors()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
const Extractors & extractors ( ) const
inline

The extractors \(e_b\), the same for all points.

◆ hessian()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
NT & hessian ( const size_t c,
const size_t d1,
const size_t d2,
const size_t i )
inline

◆ hessians()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
PointSpan< const NT > hessians ( const size_t c,
const size_t d1,
const size_t d2 ) const
inline

\(\partial_{d_1}\partial_{d_2} u_c\) at all points; only if has_hessians.

◆ load()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
void load ( const size_t i,
State & s ) const
inline

Point i as a State; only the gathered inputs are loaded.

◆ reinit()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
void reinit ( const size_t n_points)
inline

Assembler side: resize to n_points points.

◆ set_shared()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
void set_shared ( const Extractors & extractors,
const Variables & variables )
inline

Assembler side: point the batch to the extractors and variables, which must outlive its use.

◆ size()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
size_t size ( ) const
inline

Number of points.

◆ tie()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
auto tie ( State & s) const
inline

The named tuple the per-point callbacks receive for a loaded State; see batch_tie.

◆ value()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
NT & value ( const size_t c,
const size_t i )
inline

◆ values()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
PointSpan< const NT > values ( const size_t c) const
inline

Values \(u_c\) of FE function c at all points.

◆ variables()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
const Variables & variables ( ) const
inline

The variables \(v_a\), the same for all points.

◆ width()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
double & width ( const size_t i)
inline

◆ x()

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
dealii::Point< dim > x ( const size_t i) const
inline

Position of point i.

Member Data Documentation

◆ dim

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
int dim = dim_
staticconstexpr

Dimension of the field space.

◆ extractor_index

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
uint extractor_index = 1 + with_derivatives + with_hessians
staticconstexpr

Where tie() puts the extractors, i.e. the tuple index of the per-point extractor jacobians.

◆ has_derivatives

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
bool has_derivatives = with_derivatives
staticconstexpr

Whether derivatives() is available.

◆ has_hessians

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
bool has_hessians = with_hessians
staticconstexpr

Whether hessians() is available.

◆ n_fe_functions

template<int dim_, typename NT , size_t n_fe, typename Extractors , typename Variables , bool with_derivatives, bool with_hessians>
size_t n_fe_functions = n_fe
staticconstexpr

Number of FE functions (columns per input kind).


The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/model/batch.hh