feat(topology): Added TMOP support

Meshes generated purley algebraically tend to be poorly conditioned. Incorporated MFEM's TMOP support based on a metric of ideal shape and unit size
This commit is contained in:
2026-04-07 12:19:58 -04:00
parent a5ddf6a62f
commit 5a82311251
22 changed files with 545 additions and 101 deletions

View File

@@ -9,6 +9,8 @@
#include <print>
#include "stroid/topology/optimize.h"
struct SandboxConfig {
std::string host = "localhost";
int port = 19916;
@@ -22,14 +24,20 @@ int main() {
MeshConfig mesh_cfg;
mesh_cfg.load("default.toml");
UserConfig user_cfg;
const UserConfig user_cfg;
std::unique_ptr<mfem::Mesh> mesh = stroid::topology::BuildSkeleton(mesh_cfg);
stroid::topology::Finalize(*mesh, mesh_cfg);
stroid::topology::PromoteToHighOrder(*mesh, mesh_cfg);
stroid::topology::ProjectMesh(*mesh, mesh_cfg);
if (mesh_cfg->optimization_methods.has_value() && mesh_cfg->optimization_methods.value().tmop.has_value() && mesh_cfg->optimization_methods.value().tmop.value()) {
stroid::topology::ApplyTMOP(*mesh, mesh_cfg);
}
stroid::IO::ViewMesh(*mesh, "Sandbox Mesh", stroid::IO::VISUALIZATION_MODE::ELEMENT_ID, user_cfg->host, user_cfg->port);
stroid::IO::SaveMesh(*mesh, "sandbox.mesh");
return 0;