37 lines
902 B
C++
37 lines
902 B
C++
#pragma once
|
|
|
|
|
|
namespace core{
|
|
|
|
enum class GridKind { Uniform, NonUniform };
|
|
enum class FDKind { Central, Forward, Backward };
|
|
enum class BCKind { Dirichlet, Neumann /*, Robin*/ };
|
|
enum class SolverKind { LU, Inverse /*, CG*/ };
|
|
|
|
template <typename T>
|
|
struct BC {
|
|
FDKind fd{FDKind::Forward};
|
|
BCKind kind{BCKind::Dirichlet};
|
|
T value{T(0)};
|
|
};
|
|
|
|
|
|
// Global default config holder
|
|
template <typename T>
|
|
struct Configs {
|
|
GridKind grid{GridKind::Uniform};
|
|
FDKind fd{FDKind::Central};
|
|
BC<T> left{FDKind::Forward, BCKind::Dirichlet, T(0) };
|
|
BC<T> right{FDKind::Backward, BCKind::Dirichlet, T(0) };
|
|
SolverKind solver{SolverKind::LU};
|
|
|
|
static Configs& defaults() {
|
|
static Configs g{}; // process-wide defaults
|
|
return g;
|
|
}
|
|
};
|
|
|
|
|
|
|
|
} // namespace core
|