feat(probe): vector overload for glVisView

glVisView can now also be called with a vector and finite element space as opposed to just a grid function and mesh
This commit is contained in:
2025-02-28 09:47:15 -05:00
parent 974842c633
commit 83ee05272c
3 changed files with 23 additions and 4 deletions

View File

@@ -15,6 +15,8 @@
#include "config.h"
#include "probe.h"
#include "warning_control.h"
namespace Probe {
@@ -43,6 +45,15 @@ void glVisView(mfem::GridFunction& u, mfem::Mesh& mesh,
}
}
void glVisView(mfem::Vector &vec, mfem::FiniteElementSpace &fes, const std::string &windowTitle) {
mfem::GridFunction gf(&fes);
DEPRECATION_WARNING_OFF
gf.SetData(vec);
DEPRECATION_WARNING_ON
glVisView(gf, *fes.GetMesh(), windowTitle);
}
double getMeshRadius(mfem::Mesh& mesh) {
int numVertices = mesh.GetNV(); // Number of vertices
double maxRadius = 0.0;