diffusion.h

I'm done with the backbone of it, I haven't had feedback on it.
This commit is contained in:
2025-09-29 20:54:06 +02:00
parent 99e0f3fda4
commit a86410fda7
14 changed files with 307 additions and 140 deletions
+36
View File
@@ -0,0 +1,36 @@
#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
+2 -2
View File
@@ -1,6 +1,6 @@
#pragma once
#include <vector>
#include <omp.h>