From 290c7e7170ad47a52c0bbe4569ba34b9102cd761 Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Tue, 18 Jun 2024 17:52:26 -0700
Subject: [PATCH 01/11] glvis-4.3 is planned for Jul 15th, 2024
---
CHANGELOG | 4 ++--
README.md | 2 +-
share/Info.cmake.plist.in | 2 +-
share/Info.plist | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 5b74e135..13b8296b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,8 +9,8 @@
https://glvis.org
-Version 4.2.1 (development)
-===========================
+Version 4.3 released on Jul 15, 2024
+====================================
- Significantly improved memory usage.
diff --git a/README.md b/README.md
index a63fed92..28d82129 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
https://glvis.org
-
+
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
From 535ee3cab8fb48a900edeb341f104fb4993b7e6c Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Thu, 20 Jun 2024 11:31:39 -0700
Subject: [PATCH 02/11] Updated CHANGELOG
---
CHANGELOG | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 13b8296b..3b83205e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,9 +14,9 @@ Version 4.3 released on Jul 15, 2024
- Significantly improved memory usage.
-- Add support to visualize solutions on 1D elements embedded in 2D and 3D.
+- Added support to visualize solutions on 1D elements embedded in 2D and 3D.
-- Added a compilation parameter for the default font size.
+- Added a compilation parameter for setting the default font size.
Version 4.2 released on May 23, 2022
From 693d2242fc179f55edd2c340c9cc19aa91dbd8f8 Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Thu, 20 Jun 2024 12:40:10 -0700
Subject: [PATCH 03/11] typo
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 28d82129..24732801 100644
--- a/README.md
+++ b/README.md
@@ -155,7 +155,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)
From c697e0b465988d5a0c082edf0813705ffac75131 Mon Sep 17 00:00:00 2001
From: Tzanio
Date: Thu, 25 Jul 2024 08:57:39 -0700
Subject: [PATCH 04/11] make style
---
lib/aux_vis.cpp | 20 +++++++-------
lib/aux_vis.hpp | 69 +++++++++++++++++++++++++------------------------
lib/sdl.cpp | 4 +--
lib/threads.cpp | 6 +++--
lib/vsdata.cpp | 18 +++++++------
5 files changed, 62 insertions(+), 55 deletions(-)
diff --git a/lib/aux_vis.cpp b/lib/aux_vis.cpp
index 12c15b4f..a0c6206d 100644
--- a/lib/aux_vis.cpp
+++ b/lib/aux_vis.cpp
@@ -1785,24 +1785,26 @@ void SetFont(const std::string& fn)
#endif
}
-function NumberFormatter(int precision, char format, bool showsign)
+function NumberFormatter(int precision, char format,
+ bool showsign)
{
return [precision, format, showsign](double x) -> string
{
ostringstream oss;
- switch (format) {
+ switch (format)
+ {
case 'f':
- oss << fixed;
- break;
+ oss << fixed;
+ break;
case 's':
- oss << scientific;
- break;
+ oss << scientific;
+ break;
case 'd':
- oss << defaultfloat;
- break;
+ oss << defaultfloat;
+ break;
default:
MFEM_WARNING("Unknown formatting type. Using default. "
- << "Valid options include: ['f', 's', 'd']" << endl);
+ << "Valid options include: ['f', 's', 'd']" << endl);
oss << defaultfloat;
break;
};
diff --git a/lib/aux_vis.hpp b/lib/aux_vis.hpp
index e1b8c259..27ce2cab 100644
--- a/lib/aux_vis.hpp
+++ b/lib/aux_vis.hpp
@@ -136,7 +136,8 @@ bool SetFont(const vector& patterns, int height);
void SetFont(const std::string& fn);
void SetUseHiDPI(bool status);
-function NumberFormatter(int precision=4, char format='d', bool showsign=false);
+function NumberFormatter(int precision=4, char format='d',
+ bool showsign=false);
function NumberFormatter(string formatting);
bool isValidNumberFormatting(const string& formatting);
@@ -148,40 +149,40 @@ bool isValidNumberFormatting(const string& formatting);
template
T prompt(const string question,
const T* default_value = nullptr,
- function validator = [](T) { return true; })
+function validator = [](T) { return true; })
{
- T input;
- string strInput;
-
- while (true)
- {
- cout << question << " ";
- getline(cin, strInput);
- stringstream buf(strInput);
-
- if (strInput.empty() && default_value != nullptr)
- {
- cout << "Input empty. Using default value: " << *default_value << endl;
- return *default_value;
- }
-
- if (buf >> input)
- {
- if (validator(input))
- {
- return input;
- }
- else
- {
- cout << "Input is not valid. Please try again." << endl;
- }
- }
- else
- {
- cout << "Input can not be casted to expected type. Please try again." << endl;
- }
- }
- return input;
+ T input;
+ string strInput;
+
+ while (true)
+ {
+ cout << question << " ";
+ getline(cin, strInput);
+ stringstream buf(strInput);
+
+ if (strInput.empty() && default_value != nullptr)
+ {
+ cout << "Input empty. Using default value: " << *default_value << endl;
+ return *default_value;
+ }
+
+ if (buf >> input)
+ {
+ if (validator(input))
+ {
+ return input;
+ }
+ else
+ {
+ cout << "Input is not valid. Please try again." << endl;
+ }
+ }
+ else
+ {
+ cout << "Input can not be casted to expected type. Please try again." << endl;
+ }
+ }
+ return input;
}
#endif
diff --git a/lib/sdl.cpp b/lib/sdl.cpp
index 958389e6..1149a79d 100644
--- a/lib/sdl.cpp
+++ b/lib/sdl.cpp
@@ -382,8 +382,8 @@ void SdlWindow::mainIter()
keep_going = true;
break;
case SDL_KEYDOWN:
-// For debugging: uncomment the next line to track key events.
-// #define TRACK_KEY_EVENTS
+ // For debugging: uncomment the next line to track key events.
+ // #define TRACK_KEY_EVENTS
#ifdef TRACK_KEY_EVENTS
cout << "Event: SDL_KEYDOWN sym=" << e.key.keysym.sym
<< " mod=" << e.key.keysym.mod << endl;
diff --git a/lib/threads.cpp b/lib/threads.cpp
index 4e964ee9..e961c5f7 100644
--- a/lib/threads.cpp
+++ b/lib/threads.cpp
@@ -1256,7 +1256,8 @@ void communication_thread::execute()
string formatting;
*is[0] >> ws >> c; // read the opening char
- getline(*is[0], formatting, c); // read formatting string & use c for termination
+ getline(*is[0], formatting,
+ c); // read formatting string & use c for termination
// all processors sent the command
for (size_t i = 1; i < is.size(); i++)
@@ -1277,7 +1278,8 @@ void communication_thread::execute()
string formatting;
*is[0] >> ws >> c; // read the opening char
- getline(*is[0], formatting, c); // read formatting string & use c for termination
+ getline(*is[0], formatting,
+ c); // read formatting string & use c for termination
// all processors sent the command
for (size_t i = 1; i < is.size(); i++)
diff --git a/lib/vsdata.cpp b/lib/vsdata.cpp
index adca19b6..b0351f18 100644
--- a/lib/vsdata.cpp
+++ b/lib/vsdata.cpp
@@ -571,10 +571,11 @@ void KeycPressed(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'; });
+ [](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->SetColorbarNumberFormat(precision, format, showsign);
@@ -628,10 +629,11 @@ 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'; });
+ [](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);
From 349767aa92bbdcd5f77f96b48c43e4dc9d0f0022 Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Tue, 30 Jul 2024 10:32:24 -0700
Subject: [PATCH 05/11] Updated CHANGELOG
---
CHANGELOG | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index d281d98c..fe0512c4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -12,9 +12,21 @@
Version 4.3 released on Jul 15, 2024
====================================
-- 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 in 3D (cplane=2).
-- 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'".
- Added a building option for setting the default font size.
@@ -25,21 +37,9 @@ Version 4.3 released on Jul 15, 2024
- Added two new modes for visualization of vector fields in 2D, placing the
arrows above the plotted surface and using a single color.
-- 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'".
+- Added support to visualize solutions on 1D elements embedded in 2D and 3D.
-- 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).
+- Significantly improved memory usage.
Version 4.2 released on May 23, 2022
From 4d8b06eaf008fc365270888d170de5c6c9dccffb Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Sun, 4 Aug 2024 18:19:11 -0700
Subject: [PATCH 06/11] Styling and typos
---
glvis.cpp | 2 +-
lib/aux_js.cpp | 4 ++--
lib/aux_vis.cpp | 4 ++--
lib/gl/renderer_ff.cpp | 2 +-
lib/sdl.hpp | 2 +-
lib/stream_reader.cpp | 16 ++++++++--------
lib/stream_reader.hpp | 2 +-
lib/vsdata.cpp | 14 +++++++-------
lib/vssolution.cpp | 22 +++++++++++-----------
lib/vssolution3d.cpp | 10 +++++-----
10 files changed, 39 insertions(+), 39 deletions(-)
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..40d1587a 100644
--- a/lib/aux_vis.cpp
+++ b/lib/aux_vis.cpp
@@ -1156,7 +1156,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 +1214,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 a30b814a..b5c578e7 100644
--- a/lib/vsdata.cpp
+++ b/lib/vsdata.cpp
@@ -1436,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..762f5483 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,10 @@ 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
+ // 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!?
+ Geometry::Type::SQUARE; // ref.embeddings[i].geom; // <-- bugged!?
const int mat = ref.embeddings[i].matrix;
const DenseMatrix &emb_mat = ref.point_matrices[geom](mat);
trans.SetPointMat(emb_mat);
@@ -1741,7 +1741,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 +1925,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 +2204,10 @@ 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
+ // 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!?
+ Geometry::Type::SQUARE; // ref.embeddings[i].geom; // <-- bugged!?
const int mat = ref.embeddings[i].matrix;
const DenseMatrix &emb_mat = ref.point_matrices[geom](mat);
IsoparametricTransformation trans;
@@ -2220,7 +2220,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..d8c8df57 100644
--- a/lib/vssolution3d.cpp
+++ b/lib/vssolution3d.cpp
@@ -1456,10 +1456,10 @@ 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
+ // 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!?
+ :(Geometry::Type::SQUARE); // ref.embeddings[e1].geom; // <-- bugged!?
const int mat = ref.embeddings[e1].matrix;
const DenseMatrix &emb_mat = ref.point_matrices[geom](mat);
trans.SetPointMat(emb_mat);
@@ -1511,7 +1511,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 +4116,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
From 4713fec7e768dba6d54cf1eaff17a9bf6f15f21f Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Sun, 4 Aug 2024 18:19:44 -0700
Subject: [PATCH 07/11] CHANGELOG
---
CHANGELOG | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CHANGELOG b/CHANGELOG
index 7ba4f54c..1b6eaba9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -48,6 +48,8 @@ Version 4.3 released on Aug 7, 2024
- Significantly improved memory usage.
+- Various other bugfixes and improvements.
+
Version 4.2 released on May 23, 2022
====================================
From 0958881d90de30a2aae9a5b0db45e31e4f597267 Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Sun, 4 Aug 2024 18:53:52 -0700
Subject: [PATCH 08/11] Support F11/F12 in keys strings as ~11/~12
---
lib/aux_vis.cpp | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/lib/aux_vis.cpp b/lib/aux_vis.cpp
index 40d1587a..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;
From 3876fd7a26d0dc417a27e016c5d1740d3632b1c2 Mon Sep 17 00:00:00 2001
From: Jan Nikl
Date: Mon, 5 Aug 2024 11:41:03 -0700
Subject: [PATCH 09/11] Removed comments about bugged embbedings.
---
lib/vssolution.cpp | 6 ++----
lib/vssolution3d.cpp | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/lib/vssolution.cpp b/lib/vssolution.cpp
index 762f5483..be19f29d 100644
--- a/lib/vssolution.cpp
+++ b/lib/vssolution.cpp
@@ -1727,8 +1727,7 @@ void VisualizationSceneSolution::PrepareLines()
// 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!?
+ 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);
@@ -2206,8 +2205,7 @@ void VisualizationSceneSolution::PrepareLines3()
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!?
+ const int geom = Geometry::Type::SQUARE;
const int mat = ref.embeddings[i].matrix;
const DenseMatrix &emb_mat = ref.point_matrices[geom](mat);
IsoparametricTransformation trans;
diff --git a/lib/vssolution3d.cpp b/lib/vssolution3d.cpp
index d8c8df57..43959bce 100644
--- a/lib/vssolution3d.cpp
+++ b/lib/vssolution3d.cpp
@@ -1458,8 +1458,7 @@ void VisualizationSceneSolution3d::DrawCoarseSurfEdges(
// 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!?
+ 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);
From 33d9ff08e1d9b2387bd1a910da50b086925f0a6d Mon Sep 17 00:00:00 2001
From: Jan Nikl
Date: Tue, 6 Aug 2024 16:20:19 -0700
Subject: [PATCH 10/11] Add quadrature LOR test.
---
tests/CMakeLists.txt | 1 +
tests/data | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
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
From bca01cc925adf5e4fd4a850f5c0a7173562218a7 Mon Sep 17 00:00:00 2001
From: Tzanio Kolev
Date: Wed, 7 Aug 2024 10:04:23 -0700
Subject: [PATCH 11/11] Updated two instances of the old version (4.2 -> 4.3).
---
CONTRIBUTING.md | 2 +-
vcpkg.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e4b1ed97..c55d7beb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,7 +3,7 @@
-
+
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",