GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
263 stars 53 forks source link

Quadrature visualization support for glvis-js #314

Closed justinlaughlin closed 2 months ago

justinlaughlin commented 2 months ago

Eventually, we should refactor aux_js.cpp a bit so that there isn't so much repeated code with glvis.cpp. For now, this is just following the same design pattern to see if we can get quadrature support in glvis-js.

justinlaughlin commented 2 months ago

I think this fixed it? To test

git clone git@github.com:GLVis/glvis-js.git
cd glvis-js
git checkout ci-build-10626571587
open examples/basic.html # or open with a browser
# open glvis-data/streams/quadrature-lor.saved and press Q

image

tzanio commented 2 months ago

I can confirm Q works now. Thanks @justinlaughlin!

justinlaughlin commented 2 months ago

Yes, works for me too 😉 🚀 I agree it would be better to unify the code with glvis.cpp, but there are some subtleties different, so it is not that easy. However, I noticed that updateStream() has a hardcoded check for solution, so that needs to be fixed for mesh and quadrature 🤔

updateStream() uses StreamState::SetNewMeshAndSolution which it looks like you updated already 🙂. I went ahead and removed the check; I don't see any downstream calls specific to data_type. I tested the build ci-build-10706880188 and it seems okay to me.