diff --git a/CHANGELOG b/CHANGELOG index 6bdf0c0f..1b6eaba9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,8 +9,18 @@ https://glvis.org -Version 4.2.1 (development) -=========================== +Version 4.3 released on Aug 7, 2024 +=================================== + +- Added visualization of quadrature data (QuadratureFunction in MFEM). Both + loading from file, with the new command line argument '-q', or from a socket + stream, with the keyword 'quadrature', are supported. Three visualization + options are provided: piece-wise constants on a refined mesh (LOR), L2 field + with DOFs collocated (interpolation), or projection to discontinuous elements + (L2 projection). Use 'Q' to switch between them. High-order quadrature data is + supported only for tensor finite elements with the first two options. With the + first option, only the mesh lines of the original mesh are visualized. This + feature is also supported for the element-wise cutting plane in 3D (cplane=2). - The GLVis auto refinement algorithm now takes into account the order of the data (mesh and grid function). The new refinement is chosen to be sufficient @@ -19,9 +29,13 @@ Version 4.2.1 (development) user may still need to press 'o' to fully resolve the data. For more details, see the section Auto-refinement in README.md. -- Significantly improved memory usage. +- Added option to specify the floating point number formatting in GLVis axes and + colorbar. Use 'Alt+a' for the axes and 'Alt+c' for the colorbar. Formatting + can also be specified in socket stream or glvis script with axis_numberformat + or colorbar_numberformat, followed by a C-like formatting string, for example + "colorbar_numberformat '%+06.1f'". -- Add support to visualize solutions on 1D elements embedded in 2D and 3D. +- Added a building option for setting the default font size. - Added support for scalar integral finite elements, where calculation of the surface normals was not implemented and was crashing GLVis. The normals are @@ -30,23 +44,11 @@ Version 4.2.1 (development) - Added two new modes for visualization of vector fields in 2D, placing the arrows above the plotted surface and using a single color. -- Added a compilation parameter for the default font size. +- Added support to visualize solutions on 1D elements embedded in 2D and 3D. -- Added option to specify the floating point number formatting in GLVis axes and - colorbar. Use 'Alt+a' for the axes and 'Alt+c' for the colorbar. Formatting - can also be specified in socket stream or glvis script with axis_numberformat - or colorbar_numberformat, followed by a C-like formatting string, for example - "colorbar_numberformat '%+06.1f'". +- Significantly improved memory usage. -- Added visualization of quadrature data (QuadratureFunction in MFEM). Both - loading from file, with the new command line argument '-q', or from a socket - stream, with the keyword 'quadrature', are supported. Three visualization - options are provided: piece-wise constants on a refined mesh (LOR), L2 field - with DOFs collocated (interpolation), or projection to discontinuous elements - (L2 projection). Use 'Q' to switch between them. High-order quadrature data is - supported only for tensor finite elements with the first two options. With the - first option, only the mesh lines of the original mesh are visualized. This - feature is also supported for the element-wise cutting plane (cplane=2). +- Various other bugfixes and improvements. Version 4.2 released on May 23, 2022 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4b1ed97..c55d7beb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@

-Release +Release Build License Doxygen diff --git a/README.md b/README.md index ad287e42..346f2033 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ https://glvis.org -Release +Release Build License Doxygen @@ -165,7 +165,7 @@ Key commands functions and curvilinear elements (use o / O to control subdivisions) - \\ – Set light source position (see Right + Shift) - * / / – Zoom in/out -- + / - – Stretch/compree in `z`-direction +- + / - – Stretch/compress in `z`-direction - [ / ] – Shrink/enlarge the bounding box (relative to the colorbar) - ( / ) – Shrink/enlarge the visualization window - . – Start/stop `z`-spinning (speed/direction can be controlled with 0 / Enter) diff --git a/glvis.cpp b/glvis.cpp index 0906603e..ee513574 100644 --- a/glvis.cpp +++ b/glvis.cpp @@ -1525,7 +1525,7 @@ int main (int argc, char *argv[]) return 0; } - //turn off the server mode if other options are present + // turn off the server mode if other options are present if (input & ~INPUT_SERVER_MODE) { input &= ~INPUT_SERVER_MODE; } // print help for wrong input diff --git a/lib/aux_js.cpp b/lib/aux_js.cpp index 1b1004eb..5cc0efae 100644 --- a/lib/aux_js.cpp +++ b/lib/aux_js.cpp @@ -237,7 +237,7 @@ using StringArray = std::vector; int processParallelStreams(StreamState & state, const StringArray & streams, std::stringstream * commands = nullptr) { - //std::cerr << "got " << streams.size() << " streams" << std::endl; + // std::cerr << "got " << streams.size() << " streams" << std::endl; // HACK: match unique_ptr interface for ReadStreams: std::vector sstreams(streams.size()); StreamCollection istreams(streams.size()); @@ -248,7 +248,7 @@ int processParallelStreams(StreamState & state, const StringArray & streams, std::string word; int nproc, rank; sstreams[i] >> word >> nproc >> rank; - //std::cerr << "packing " << rank+1 << "/" << nproc << std::endl; + // std::cerr << "packing " << rank+1 << "/" << nproc << std::endl; istreams[i] = std::unique_ptr(&sstreams[i]); } diff --git a/lib/aux_vis.cpp b/lib/aux_vis.cpp index a0c6206d..b54faaec 100644 --- a/lib/aux_vis.cpp +++ b/lib/aux_vis.cpp @@ -232,6 +232,18 @@ void SendKeySequence(const char *seq) case '7': // F7 wnd->signalKeyDown(SDLK_F7); break; + case '1': // F11 or F12 + key++; + switch (*key) + { + case '1': // F11 + wnd->signalKeyDown(SDLK_F11); + break; + case '2': // F12 + wnd->callKeyDown(SDLK_F12); + break; + } + break; case '.': // Keypad ./Del wnd->signalKeyDown(SDLK_PERIOD); break; @@ -291,6 +303,18 @@ void CallKeySequence(const char *seq) case '7': // F7 wnd->callKeyDown(SDLK_F7); break; + case '1': // F11 or F12 + key++; + switch (*key) + { + case '1': // F11 + wnd->callKeyDown(SDLK_F11); + break; + case '2': // F12 + wnd->callKeyDown(SDLK_F12); + break; + } + break; case '.': // Keypad ./Del wnd->callKeyDown(SDLK_PERIOD); break; @@ -1156,7 +1180,7 @@ inline GL2PSvertex CreatePrintVtx(gl3::FeedbackVertex v) void PrintCaptureBuffer(gl3::CaptureBuffer& cbuf) { - //print lines + // print lines for (size_t i = 0; i < cbuf.lines.size(); i += 2) { GL2PSvertex lineOut[2] = @@ -1214,7 +1238,7 @@ void KeyCtrlP() // GL2PS_OCCLUSION_CULL | // GL2PS_BEST_ROOT | GL2PS_SILENT | - //GL2PS_DRAW_BACKGROUND | + // GL2PS_DRAW_BACKGROUND | GL2PS_NO_BLENDING | GL2PS_NO_OPENGL_CONTEXT, GL_RGBA, 0, NULL, 16, 16, 16, 0, fp, "a" ); diff --git a/lib/gl/renderer_ff.cpp b/lib/gl/renderer_ff.cpp index dee8241f..01a2d398 100644 --- a/lib/gl/renderer_ff.cpp +++ b/lib/gl/renderer_ff.cpp @@ -336,7 +336,7 @@ void FFGLDevice::captureXfbBuffer(PaletteState& pal, CaptureBuffer& cbuf, if (disp_lists[hnd].layout == VertexTex::layout || disp_lists[hnd].layout == VertexNormTex::layout) { - //capture texture values too + // capture texture values too // [ X Y Z ] [ R G B A ] [ U V - - ] fbType = GL_3D_COLOR_TEXTURE; fbStride = 11; diff --git a/lib/sdl.hpp b/lib/sdl.hpp index 846c3e6a..347b3b1d 100644 --- a/lib/sdl.hpp +++ b/lib/sdl.hpp @@ -122,7 +122,7 @@ class SdlWindow bool update_before_expose{false}; - //bool requiresExpose; + // bool requiresExpose; bool takeScreenshot{false}; std::string screenshot_file; bool screenshot_convert; diff --git a/lib/stream_reader.cpp b/lib/stream_reader.cpp index f5cf61e2..fa7afbd7 100644 --- a/lib/stream_reader.cpp +++ b/lib/stream_reader.cpp @@ -140,9 +140,9 @@ void StreamState::Extrude1DMeshAndSolution() void StreamState::CollectQuadratures(QuadratureFunction *qf_array[], int npieces) { - //assume the same vdim + // assume the same vdim const int vdim = qf_array[0]->GetVDim(); - //assume the same quadrature rule + // assume the same quadrature rule QuadratureSpace *qspace = new QuadratureSpace(*mesh, qf_array[0]->GetIntRule(0)); SetQuadFunction(new QuadratureFunction(qspace, vdim)); @@ -213,16 +213,16 @@ void StreamState::SetMeshSolution() void StreamState::SetQuadSolution(QuadSolution type) { - //assume identical order - const int order = quad_f->GetIntRule(0).GetOrder()/2;//<---Gauss-Legendre - //use the original mesh when available + // assume identical order + const int order = quad_f->GetIntRule(0).GetOrder()/2; // <-- Gauss-Legendre + // use the original mesh when available if (mesh_quad.get()) { internal.mesh.swap(internal.mesh_quad); internal.mesh_quad.reset(); } - //check for tensor-product basis + // check for tensor-product basis if (order > 0 && type != QuadSolution::HO_L2_projected) { Array geoms; @@ -245,7 +245,7 @@ void StreamState::SetQuadSolution(QuadSolution type) const int ref_factor = order + 1; if (ref_factor <= 1) { - SetQuadSolution(QuadSolution::HO_L2_collocated);//low-order + SetQuadSolution(QuadSolution::HO_L2_collocated); // low-order return; } Mesh *mesh_lor = new Mesh(Mesh::MakeRefined(*mesh, ref_factor, @@ -767,7 +767,7 @@ void StreamState::ResetMeshAndSolution(StreamState &ss, VisualizationScene* vs) QuadratureFunction *Extrude1DQuadFunction(Mesh *mesh, Mesh *mesh2d, QuadratureFunction *qf, int ny) { - //assume identical orders + // assume identical orders const int order = qf->GetIntRule(0).GetOrder(); const int vdim = qf->GetVDim(); QuadratureSpace *qspace2d = new QuadratureSpace(mesh2d, order); diff --git a/lib/stream_reader.hpp b/lib/stream_reader.hpp index bc7d48ba..c55a83e1 100644 --- a/lib/stream_reader.hpp +++ b/lib/stream_reader.hpp @@ -94,7 +94,7 @@ struct StreamState /// Set the quadrature function representation producing a proxy grid function void SetQuadSolution(QuadSolution type = QuadSolution::LOR_ClosedGL); - /// Switch the quadrature function represenation and update the visualization + /// Switch the quadrature function representation and update the visualization void SwitchQuadSolution(QuadSolution type, VisualizationScene* vs); /// Get the current representation of quadrature solution diff --git a/lib/vsdata.cpp b/lib/vsdata.cpp index 37338acd..b5c578e7 100644 --- a/lib/vsdata.cpp +++ b/lib/vsdata.cpp @@ -681,11 +681,9 @@ void Key_Mod_a_Pressed(GLenum state) int precision = prompt("Enter precision (4): ", &default_precision, [](int p) { return p>=0; }); - char format = prompt("Enter format [(d)efault, (f)ixed, (s)cientific] (d): ", &default_format, [](char c) { return c=='d' || c=='f' || c=='s'; }); - bool showsign = prompt("Show sign? [(1)true, (0)false] (0): ", &default_showsign); vsdata->SetAxisNumberFormat(precision, format, showsign); @@ -1438,15 +1436,15 @@ void VisualizationSceneScalarData::Init() wnd->setOnKeyDown(SDLK_EXCLAIM, KeyToggleTexture); } - //Set_Light(); + // Set_Light(); - //glEnable (GL_COLOR_MATERIAL); - //glShadeModel (GL_SMOOTH); + // glEnable (GL_COLOR_MATERIAL); + // glShadeModel (GL_SMOOTH); - //gl->enableLight(); - //gl->enableDepthTest(); - //glEnable(GL_AUTO_NORMAL); - //glEnable(GL_NORMALIZE); + // gl->enableLight(); + // gl->enableDepthTest(); + // glEnable(GL_AUTO_NORMAL); + // glEnable(GL_NORMALIZE); if (GetMultisample() > 0) { diff --git a/lib/vssolution.cpp b/lib/vssolution.cpp index a529d47f..be19f29d 100644 --- a/lib/vssolution.cpp +++ b/lib/vssolution.cpp @@ -757,7 +757,7 @@ int VisualizationSceneSolution::GetRefinedValuesAndNormals( { const IntegrationPoint &ip = nodes.IntPoint(n); Trans->SetIntPoint(&ip); - lval(n) /= Trans->Weight();//value = dof / |J| + lval(n) /= Trans->Weight(); // value = dof / |J| } // Gradient calculation @@ -1725,10 +1725,9 @@ void VisualizationSceneSolution::PrepareLines() MFEM_ASSERT(pointmat.Size() == 4, "Not a quadrilateral!"); - //we assume that mesh_course is used only for tensor finite elements, - //like for representation of quadratures, so in 2D it is square - const int geom = - Geometry::Type::SQUARE; //ref.embeddings[i].geom; //<---- bugged!? + // we assume that mesh_course is used only for tensor finite elements, + // like for representation of quadratures, so in 2D it is square + const int geom = Geometry::Type::SQUARE; const int mat = ref.embeddings[i].matrix; const DenseMatrix &emb_mat = ref.point_matrices[geom](mat); trans.SetPointMat(emb_mat); @@ -1741,7 +1740,7 @@ void VisualizationSceneSolution::PrepareLines() emb_pointmat.GetColumnReference(j, emb_ip1); emb_pointmat.GetColumnReference(jp1, emb_ip2); - //check if we are on the parent edge + // check if we are on the parent edge if (!(( emb_ip1(0) == 0. && emb_ip2(0) == 0.) || (emb_ip1(0) == 1. && emb_ip2(0) == 1.) || (emb_ip1(1) == 0. && emb_ip2(1) == 0.) @@ -1925,8 +1924,8 @@ void VisualizationSceneSolution::PrepareVertexNumbering1() DenseMatrix pointmat; Array vertices; - // Draw the vertices for each element. This is redundant, except - // when the elements or domains are shrunk. + // Draw the vertices for each element. This is redundant, except when the + // elements or domains are shrunk. const int ne = mesh->GetNE(); for (int k = 0; k < ne; k++) @@ -2204,10 +2203,9 @@ void VisualizationSceneSolution::PrepareLines3() if (mesh_coarse) { auto &ref = mesh->GetRefinementTransforms(); - //we assume that mesh_course is used only for tensor finite elements, - //like for representation of quadratures, so in 2D it is square - const int geom = - Geometry::Type::SQUARE; //ref.embeddings[i].geom; //<---- bugged!? + // we assume that mesh_course is used only for tensor finite elements, + // like for representation of quadratures, so in 2D it is square + const int geom = Geometry::Type::SQUARE; const int mat = ref.embeddings[i].matrix; const DenseMatrix &emb_mat = ref.point_matrices[geom](mat); IsoparametricTransformation trans; @@ -2220,7 +2218,7 @@ void VisualizationSceneSolution::PrepareLines3() trans.Transform(RefG->RefPts[RE[2*k]], emb_ip1); trans.Transform(RefG->RefPts[RE[2*k+1]], emb_ip2); - //check if we are on the parent edge + // check if we are on the parent edge if (!(( emb_ip1(0) == 0. && emb_ip2(0) == 0.) || (emb_ip1(0) == 1. && emb_ip2(0) == 1.) || (emb_ip1(1) == 0. && emb_ip2(1) == 0.) diff --git a/lib/vssolution3d.cpp b/lib/vssolution3d.cpp index 20452f3a..43959bce 100644 --- a/lib/vssolution3d.cpp +++ b/lib/vssolution3d.cpp @@ -1456,10 +1456,9 @@ void VisualizationSceneSolution3d::DrawCoarseSurfEdges( trans.SetFE(&fe); DenseMatrix emb_pointmat; - //we assume that mesh_course is used only for tensor finite elements, - //like for representation of quadratures, so in 2D it is square - const int geom = (dim == 3)?(Geometry::Type::CUBE) - :(Geometry::Type::SQUARE); //ref.embeddings[e1].geom; //<---- bugged!? + // we assume that mesh_course is used only for tensor finite elements, + // like for representation of quadratures, so in 2D it is square + const int geom = (dim == 3)?(Geometry::Type::CUBE):(Geometry::Type::SQUARE); const int mat = ref.embeddings[e1].matrix; const DenseMatrix &emb_mat = ref.point_matrices[geom](mat); trans.SetPointMat(emb_mat); @@ -1511,7 +1510,7 @@ void VisualizationSceneSolution3d::DrawCoarseSurfEdges( emb_pointmat.GetColumnReference(jp1, emb_ip2); } - //check if we are on the outer edge + // check if we are on the outer edge int inter = 0; for (int d = 0; d < 3; d++) if ((emb_ip1(d) != 0. && emb_ip1(d) != 1.) @@ -4116,7 +4115,7 @@ void VisualizationSceneSolution3d::PrepareLevelSurf() { const IntegrationPoint &ip = nodes.IntPoint(n); Trans->SetIntPoint(&ip); - lval(n) /= Trans->Weight();//value = dof / |J| + lval(n) /= Trans->Weight(); // value = dof / |J| } // Gradient calculation diff --git a/share/Info.cmake.plist.in b/share/Info.cmake.plist.in index 8606902f..72cccb8c 100644 --- a/share/Info.cmake.plist.in +++ b/share/Info.cmake.plist.in @@ -11,7 +11,7 @@ CFBundleIconFile GLVis.icns CFBundleShortVersionString - 4.2 + 4.3 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/share/Info.plist b/share/Info.plist index 069b6226..df1d57ee 100644 --- a/share/Info.plist +++ b/share/Info.plist @@ -11,7 +11,7 @@ CFBundleIconFile GLVis.icns CFBundleShortVersionString - 4.2 + 4.3 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 13477ade..dd10aea9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,6 +40,7 @@ set(stream_tests "mobius-strip" "navier" "quad" + "quadrature-lor" "remhos" "shaper" "shifted" diff --git a/tests/data b/tests/data index 75f1a071..62d1614c 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit 75f1a0714b7176a3c9445bd83d2a90e52e1bde48 +Subproject commit 62d1614cec24f539a0ddd4499250a9343cb20bee diff --git a/vcpkg.json b/vcpkg.json index 898650d9..05fd3282 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", "name": "glvis", - "version": "4.2", + "version": "4.3", "dependencies": [ "fontconfig", "freetype",