The full rewrite of mean_field into something maintainable is progressing. dimensions is mostly done, discritization (domain, blocks, and fields) is done, and eos is progressing quickly
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
#pragma once
|
|
|
|
namespace serif::discretization::blocks {
|
|
inline constexpr int DYNAMIC_BLOCK_SIZE = -1;
|
|
|
|
struct block {};
|
|
|
|
struct residual_block_base : block {
|
|
static constexpr int static_block_size = DYNAMIC_BLOCK_SIZE;
|
|
};
|
|
|
|
struct value_block_base : block {
|
|
static constexpr int static_block_size = DYNAMIC_BLOCK_SIZE;
|
|
};
|
|
|
|
template <typename GeneratedValue>
|
|
struct generated_value_block final : value_block_base {
|
|
using GeneratedType = GeneratedValue;
|
|
static constexpr int static_block_size = static_cast<int>(GeneratedValue::scalarArity);
|
|
};
|
|
|
|
template <typename GeneratedResidual>
|
|
struct generated_residual_block final : residual_block_base {
|
|
using GeneratedType = GeneratedResidual;
|
|
static constexpr int static_block_size = static_cast<int>(GeneratedResidual::scalarArity);
|
|
};
|
|
|
|
template <int index_value>
|
|
struct residual_block final : residual_block_base {
|
|
static constexpr int index = index_value;
|
|
|
|
// ReSharper disable once CppNonExplicitConversionOperator
|
|
constexpr operator int() const noexcept {
|
|
return index;
|
|
}
|
|
};
|
|
|
|
template <int index_value>
|
|
struct value_block final : value_block_base {
|
|
static constexpr int index = index_value;
|
|
|
|
// ReSharper disable once CppNonExplicitConversionOperator
|
|
constexpr operator int() const noexcept {
|
|
return index;
|
|
}
|
|
};
|
|
|
|
} |