feat(mean_field): added dimensions, discritization, and start of eos
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
This commit is contained in:
48
src/include/serif/discretization/blocks/base.hpp
Normal file
48
src/include/serif/discretization/blocks/base.hpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#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;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user