From 9534aca0531b4005ab1a1b6ee0b0fb80b1590b93 Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Thu, 29 Sep 2022 09:44:05 +0200 Subject: [PATCH 01/11] Resolved build warnings --- range/Range/Range.pro | 6 +- range/Range/doc/RELEASE_NOTES.txt | 8 + .../Range/src/application_settings_dialog.cpp | 11 +- range/Range/src/application_settings_dialog.h | 10 +- range/Range/src/draw_input_tree.cpp | 2 +- range/Range/src/draw_input_tree.h | 2 +- range/Range/src/draw_input_widget.cpp | 2 +- range/Range/src/gl_arrow.cpp | 1 + range/Range/src/gl_axis.cpp | 1 + range/Range/src/gl_cut_plane.cpp | 1 + range/Range/src/gl_element_base.cpp | 3 +- range/Range/src/gl_element_group.cpp | 1 + range/Range/src/gl_functions.cpp | 1 - range/Range/src/gl_functions.h | 4 +- range/Range/src/gl_grid.cpp | 1 + range/Range/src/gl_interpolated_element.cpp | 1 + range/Range/src/gl_interpolated_entity.cpp | 1 + range/Range/src/gl_line.cpp | 1 + range/Range/src/gl_list.cpp | 1 + range/Range/src/gl_list.h | 6 +- range/Range/src/gl_node.cpp | 1 + range/Range/src/gl_object.cpp | 1 + range/Range/src/gl_point.cpp | 1 + range/Range/src/gl_rotation_sphere.cpp | 1 + range/Range/src/gl_scalar_field.cpp | 1 + range/Range/src/gl_simplex_point.cpp | 1 + range/Range/src/gl_simplex_polygon.cpp | 1 + range/Range/src/gl_simplex_segment.cpp | 1 + range/Range/src/gl_simplex_tetrahedra.cpp | 1 + range/Range/src/gl_vector_field.cpp | 1 + range/Range/src/gl_widget.cpp | 2 +- range/Range/src/gl_widget.h | 6 +- range/Range/src/graph_widget.cpp | 2 +- range/Range/src/graph_widget.h | 2 +- range/Range/src/main_window.cpp | 48 +-- range/Range/src/main_window.h | 48 +-- range/Range/src/model.cpp | 2 +- range/Range/src/model_action.cpp | 27 +- range/Range/src/pick_list.cpp | 37 +- range/RangeModel/include/rml_model.h | 404 ++++++++---------- range/RangeModel/include/rml_problem.h | 48 +-- range/RangeModel/include/rml_results.h | 56 ++- range/RangeModel/src/rml_model.cpp | 201 ++++----- range/RangeModel/src/rml_problem.cpp | 32 +- range/RangeModel/src/rml_results.cpp | 24 +- range/range.pri | 3 + scripts/create_mac_app.sh | 44 +- scripts/create_package.sh | 20 +- 48 files changed, 506 insertions(+), 574 deletions(-) diff --git a/range/Range/Range.pro b/range/Range/Range.pro index c2d629c1..cca5e7d6 100644 --- a/range/Range/Range.pro +++ b/range/Range/Range.pro @@ -26,7 +26,7 @@ else { !win* { CONFIG += link_pkgconfig - PKGCONFIG += libavutil libavformat libswscale + PKGCONFIG += libavformat libswscale } } @@ -494,7 +494,9 @@ INCLUDEPATH += $${_PRO_FILE_PWD_}/../TetGen INCLUDEPATH += $${_PRO_FILE_PWD_}/../RangeBase/include INCLUDEPATH += $${_PRO_FILE_PWD_}/../RangeModel/include INCLUDEPATH += $${_PRO_FILE_PWD_}/../RangeSolverLib/include -INCLUDEPATH += $${_PRO_FILE_PWD_}/../../ffmpeg/ffmpeg-4.3.2-win64/include +win* { + INCLUDEPATH += $${_PRO_FILE_PWD_}/../../ffmpeg/ffmpeg-4.3.2-win64/include +} RESOURCES += \ range.qrc diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index eaf947e2..196d97fe 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -1,3 +1,11 @@ +------------------------------------------------------------------ +Version 3.2.8 + +* ALL: Resolved build warnings + +Bug fixes: + + ------------------------------------------------------------------ Version 3.2.7 diff --git a/range/Range/src/application_settings_dialog.cpp b/range/Range/src/application_settings_dialog.cpp index a07e8010..8b1f171b 100644 --- a/range/Range/src/application_settings_dialog.cpp +++ b/range/Range/src/application_settings_dialog.cpp @@ -21,7 +21,6 @@ #include "application_settings_dialog.h" #include "keyboard_shortcuts_edit.h" -#include "main_settings.h" ApplicationSettingsDialog::ApplicationSettingsDialog(ApplicationSettings *applicationSettings, QWidget *parent) : QDialog(parent), @@ -70,7 +69,7 @@ ApplicationSettingsDialog::ApplicationSettingsDialog(ApplicationSettings *applic QObject::connect(this->okButton,&QPushButton::clicked,this,&QDialog::accept); } -int ApplicationSettingsDialog::exec(void) +int ApplicationSettingsDialog::exec() { int retVal = QDialog::exec(); @@ -94,7 +93,7 @@ int ApplicationSettingsDialog::exec(void) return retVal; } -QWidget *ApplicationSettingsDialog::createGeneralTab(void) +QWidget *ApplicationSettingsDialog::createGeneralTab() { QWidget *widget = new QWidget; @@ -173,7 +172,7 @@ QWidget *ApplicationSettingsDialog::createGeneralTab(void) return widget; } -QWidget *ApplicationSettingsDialog::createShortcutsTab(void) +QWidget *ApplicationSettingsDialog::createShortcutsTab() { QWidget *widget = new QWidget; @@ -191,7 +190,7 @@ QWidget *ApplicationSettingsDialog::createShortcutsTab(void) return widget; } -QWidget *ApplicationSettingsDialog::createRangeAccountTab(void) +QWidget *ApplicationSettingsDialog::createRangeAccountTab() { QWidget *widget = new QWidget; @@ -283,7 +282,7 @@ void ApplicationSettingsDialog::onRangeApiServerChanged(const QString &) this->okButton->setEnabled(true); } -void ApplicationSettingsDialog::onDefaultClicked(void) +void ApplicationSettingsDialog::onDefaultClicked() { this->solverFileChooserButton->setFileName(ApplicationSettings::getDefaultRangeSolverExecutable()); this->helpFileChooserButton->setFileName(ApplicationSettings::getDefaultHelpDir()); diff --git a/range/Range/src/application_settings_dialog.h b/range/Range/src/application_settings_dialog.h index eebb50b2..683568be 100644 --- a/range/Range/src/application_settings_dialog.h +++ b/range/Range/src/application_settings_dialog.h @@ -62,18 +62,18 @@ class ApplicationSettingsDialog : public QDialog explicit ApplicationSettingsDialog(ApplicationSettings *applicationSettings, QWidget *parent = nullptr); //! Execute dialog. - int exec(void); + int exec(); private: //! Create tab containing general settings. - QWidget *createGeneralTab(void); + QWidget *createGeneralTab(); //! Create tab short-cut settings. - QWidget *createShortcutsTab(void); + QWidget *createShortcutsTab(); //! Create tab containing Range account settings. - QWidget *createRangeAccountTab(void); + QWidget *createRangeAccountTab(); protected slots: @@ -108,7 +108,7 @@ class ApplicationSettingsDialog : public QDialog void onRangeApiServerChanged(const QString &); //! Default button was clicked. - void onDefaultClicked(void); + void onDefaultClicked(); }; diff --git a/range/Range/src/draw_input_tree.cpp b/range/Range/src/draw_input_tree.cpp index cab069da..b02ce058 100644 --- a/range/Range/src/draw_input_tree.cpp +++ b/range/Range/src/draw_input_tree.cpp @@ -455,5 +455,5 @@ void DrawInputTree::onItemChanged(QTreeWidgetItem *item, int column) void DrawInputTree::onItemSelectionChanged() { - emit this->selectionChanged(this->getSelectedObjectIDs()); + emit this->objectSelectionChanged(this->getSelectedObjectIDs()); } diff --git a/range/Range/src/draw_input_tree.h b/range/Range/src/draw_input_tree.h index 4edc2248..91b28224 100644 --- a/range/Range/src/draw_input_tree.h +++ b/range/Range/src/draw_input_tree.h @@ -80,7 +80,7 @@ class DrawInputTree : public QTreeWidget signals: //! Emit selection changed signal. - void selectionChanged(const QList&objectIDs); + void objectSelectionChanged(const QList&objectIDs); //! Position request signal. void positionRequest(const RR3Vector &position); diff --git a/range/Range/src/draw_input_widget.cpp b/range/Range/src/draw_input_widget.cpp index cdf0dccf..52098608 100644 --- a/range/Range/src/draw_input_widget.cpp +++ b/range/Range/src/draw_input_widget.cpp @@ -73,7 +73,7 @@ DrawInputWidget::DrawInputWidget(QWidget *parent) : layout->addWidget(this->tree,0,0,1,2); QObject::connect(this->tree, - &DrawInputTree::selectionChanged, + &DrawInputTree::objectSelectionChanged, this, &DrawInputWidget::onSelectionChanged); QObject::connect(this->tree, diff --git a/range/Range/src/gl_arrow.cpp b/range/Range/src/gl_arrow.cpp index ad5ff1f1..2c796a55 100644 --- a/range/Range/src/gl_arrow.cpp +++ b/range/Range/src/gl_arrow.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL arrow class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_arrow.h" #include "gl_line.h" diff --git a/range/Range/src/gl_axis.cpp b/range/Range/src/gl_axis.cpp index 96ed1d42..a5b6eb41 100644 --- a/range/Range/src/gl_axis.cpp +++ b/range/Range/src/gl_axis.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL axis class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_axis.h" void GLAxis::_init(const GLAxis *pGlAxis) diff --git a/range/Range/src/gl_cut_plane.cpp b/range/Range/src/gl_cut_plane.cpp index 9349330b..5b9adc4d 100644 --- a/range/Range/src/gl_cut_plane.cpp +++ b/range/Range/src/gl_cut_plane.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL cut plane class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_cut_plane.h" #include "gl_arrow.h" diff --git a/range/Range/src/gl_element_base.cpp b/range/Range/src/gl_element_base.cpp index 4a2d9d12..3f26af01 100644 --- a/range/Range/src/gl_element_base.cpp +++ b/range/Range/src/gl_element_base.cpp @@ -10,9 +10,8 @@ #include +#include "gl_functions.h" #include "gl_element_base.h" -#include "gl_texture.h" -#include "session.h" void GLElementBase::_init(const GLElementBase *pGlElement) { diff --git a/range/Range/src/gl_element_group.cpp b/range/Range/src/gl_element_group.cpp index 9ecc44b9..2655ed82 100644 --- a/range/Range/src/gl_element_group.cpp +++ b/range/Range/src/gl_element_group.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL element group class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_element_group.h" #include "gl_element.h" #include "model.h" diff --git a/range/Range/src/gl_functions.cpp b/range/Range/src/gl_functions.cpp index 64bab4a2..27eadf85 100644 --- a/range/Range/src/gl_functions.cpp +++ b/range/Range/src/gl_functions.cpp @@ -8,7 +8,6 @@ * DESCRIPTION: OpenGL functions definitions * *********************************************************************/ -#include #include #include diff --git a/range/Range/src/gl_functions.h b/range/Range/src/gl_functions.h index 0c914938..0cf1712e 100644 --- a/range/Range/src/gl_functions.h +++ b/range/Range/src/gl_functions.h @@ -11,7 +11,9 @@ #ifndef GL_FUNCTIONS_H #define GL_FUNCTIONS_H -#include +#ifdef __APPLE__ +#define GL_SILENCE_DEPRECATION +#endif #include diff --git a/range/Range/src/gl_grid.cpp b/range/Range/src/gl_grid.cpp index 47e1ffdf..c30bc291 100644 --- a/range/Range/src/gl_grid.cpp +++ b/range/Range/src/gl_grid.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL grid class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_grid.h" #include "gl_line.h" #include "gl_node.h" diff --git a/range/Range/src/gl_interpolated_element.cpp b/range/Range/src/gl_interpolated_element.cpp index 742ff66f..295a4151 100644 --- a/range/Range/src/gl_interpolated_element.cpp +++ b/range/Range/src/gl_interpolated_element.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL interpolated element class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_interpolated_element.h" void GLInterpolatedElement::_init(const GLInterpolatedElement *pGlElement) diff --git a/range/Range/src/gl_interpolated_entity.cpp b/range/Range/src/gl_interpolated_entity.cpp index da220f14..0f4cd46e 100644 --- a/range/Range/src/gl_interpolated_entity.cpp +++ b/range/Range/src/gl_interpolated_entity.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL interpolated entity class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_interpolated_entity.h" #include "gl_interpolated_element.h" #include "session.h" diff --git a/range/Range/src/gl_line.cpp b/range/Range/src/gl_line.cpp index 1eaf5388..05a8d6c2 100644 --- a/range/Range/src/gl_line.cpp +++ b/range/Range/src/gl_line.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL line class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_line.h" diff --git a/range/Range/src/gl_list.cpp b/range/Range/src/gl_list.cpp index 4425a1d5..7b31ec26 100644 --- a/range/Range/src/gl_list.cpp +++ b/range/Range/src/gl_list.cpp @@ -10,6 +10,7 @@ #include +#include "gl_functions.h" #include "gl_list.h" GLList::GLList(GLuint nLists) diff --git a/range/Range/src/gl_list.h b/range/Range/src/gl_list.h index 15b5d52e..99b3183b 100644 --- a/range/Range/src/gl_list.h +++ b/range/Range/src/gl_list.h @@ -13,9 +13,11 @@ #include -#include +#ifdef __APPLE__ +#define GL_SILENCE_DEPRECATION +#endif -#include "gl_functions.h" +#include class GLList { diff --git a/range/Range/src/gl_node.cpp b/range/Range/src/gl_node.cpp index b7dede72..7440a534 100644 --- a/range/Range/src/gl_node.cpp +++ b/range/Range/src/gl_node.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL node class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_node.h" GLNode::GLNode(GLWidget *glWidget) : GLObject(glWidget) diff --git a/range/Range/src/gl_object.cpp b/range/Range/src/gl_object.cpp index 766ac00c..efeb6059 100644 --- a/range/Range/src/gl_object.cpp +++ b/range/Range/src/gl_object.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL object class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_object.h" GLObject::GLObject(GLWidget *glWidget) : diff --git a/range/Range/src/gl_point.cpp b/range/Range/src/gl_point.cpp index 47d5229f..77acf5d5 100644 --- a/range/Range/src/gl_point.cpp +++ b/range/Range/src/gl_point.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL point class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_point.h" void GLPoint::_init(const GLPoint *pGlPoint) diff --git a/range/Range/src/gl_rotation_sphere.cpp b/range/Range/src/gl_rotation_sphere.cpp index 386844b6..8fd19783 100644 --- a/range/Range/src/gl_rotation_sphere.cpp +++ b/range/Range/src/gl_rotation_sphere.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL rotation sphere class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_rotation_sphere.h" diff --git a/range/Range/src/gl_scalar_field.cpp b/range/Range/src/gl_scalar_field.cpp index 93114f0b..ef6840a5 100644 --- a/range/Range/src/gl_scalar_field.cpp +++ b/range/Range/src/gl_scalar_field.cpp @@ -13,6 +13,7 @@ #include +#include "gl_functions.h" #include "gl_scalar_field.h" #include "gl_point.h" #include "session.h" diff --git a/range/Range/src/gl_simplex_point.cpp b/range/Range/src/gl_simplex_point.cpp index 3aaa3fde..c1551cfd 100644 --- a/range/Range/src/gl_simplex_point.cpp +++ b/range/Range/src/gl_simplex_point.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL simplex point class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_simplex_point.h" #include "draw_engine_sphere.h" diff --git a/range/Range/src/gl_simplex_polygon.cpp b/range/Range/src/gl_simplex_polygon.cpp index 6d635c2c..919f528a 100644 --- a/range/Range/src/gl_simplex_polygon.cpp +++ b/range/Range/src/gl_simplex_polygon.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL simplex polygon class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_simplex_polygon.h" diff --git a/range/Range/src/gl_simplex_segment.cpp b/range/Range/src/gl_simplex_segment.cpp index df416a3c..4f6d5206 100644 --- a/range/Range/src/gl_simplex_segment.cpp +++ b/range/Range/src/gl_simplex_segment.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL simplex segment class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_simplex_segment.h" void GLSimplexSegment::_init(const GLSimplexSegment *pGlSegment) diff --git a/range/Range/src/gl_simplex_tetrahedra.cpp b/range/Range/src/gl_simplex_tetrahedra.cpp index 0d4e10f2..ccde5c87 100644 --- a/range/Range/src/gl_simplex_tetrahedra.cpp +++ b/range/Range/src/gl_simplex_tetrahedra.cpp @@ -8,6 +8,7 @@ * DESCRIPTION: OpenGL simplex tetrahedra class definition * *********************************************************************/ +#include "gl_functions.h" #include "gl_simplex_tetrahedra.h" void GLSimplexTetrahedra::_init(const GLSimplexTetrahedra *pGlTetrahedra) diff --git a/range/Range/src/gl_vector_field.cpp b/range/Range/src/gl_vector_field.cpp index 117b1bfb..ff39384a 100644 --- a/range/Range/src/gl_vector_field.cpp +++ b/range/Range/src/gl_vector_field.cpp @@ -12,6 +12,7 @@ #include +#include "gl_functions.h" #include "gl_vector_field.h" #include "gl_arrow.h" #include "session.h" diff --git a/range/Range/src/gl_widget.cpp b/range/Range/src/gl_widget.cpp index 09608dad..bb169d66 100644 --- a/range/Range/src/gl_widget.cpp +++ b/range/Range/src/gl_widget.cpp @@ -1044,7 +1044,7 @@ void GLWidget::mouseMoveEvent(QMouseEvent *mouseEvent) R_LOG_TRACE_OUT; } -void GLWidget::enterEvent(QEvent *) +void GLWidget::enterEvent(QEnterEvent *) { R_LOG_TRACE_IN; this->setFocus(); diff --git a/range/Range/src/gl_widget.h b/range/Range/src/gl_widget.h index de9b3fdf..6d7cc3eb 100644 --- a/range/Range/src/gl_widget.h +++ b/range/Range/src/gl_widget.h @@ -13,6 +13,10 @@ #include +#ifdef __APPLE__ +#define GL_SILENCE_DEPRECATION +#endif + #include #include "gl_display_properties.h" @@ -219,7 +223,7 @@ class GLWidget : public QOpenGLWidget void mouseMoveEvent(QMouseEvent *mouseEvent); //! Process enter event. - void enterEvent(QEvent *); + void enterEvent(QEnterEvent *); //! Process leave event. void leaveEvent(QEvent *); diff --git a/range/Range/src/graph_widget.cpp b/range/Range/src/graph_widget.cpp index 66194580..c025f4d0 100644 --- a/range/Range/src/graph_widget.cpp +++ b/range/Range/src/graph_widget.cpp @@ -177,7 +177,7 @@ void GraphWidget::mouseMoveEvent(QMouseEvent *mouseEvent) } } -void GraphWidget::enterEvent(QEvent *) +void GraphWidget::enterEvent(QEnterEvent *) { this->setFocus(); } diff --git a/range/Range/src/graph_widget.h b/range/Range/src/graph_widget.h index 103f855e..8cd187e0 100644 --- a/range/Range/src/graph_widget.h +++ b/range/Range/src/graph_widget.h @@ -78,7 +78,7 @@ class GraphWidget : public QWidget void mouseMoveEvent(QMouseEvent *mouseEvent); //! Mouse enter event. - void enterEvent(QEvent *); + void enterEvent(QEnterEvent *); //! Mouse leave event. void leaveEvent(QEvent *); diff --git a/range/Range/src/main_window.cpp b/range/Range/src/main_window.cpp index badb300f..12529456 100644 --- a/range/Range/src/main_window.cpp +++ b/range/Range/src/main_window.cpp @@ -177,14 +177,14 @@ MainWindow::MainWindow (QWidget *parent) } } -MainWindow *MainWindow::getInstance(void) +MainWindow *MainWindow::getInstance() { R_LOG_TRACE; static MainWindow *mainWindow = new MainWindow; return mainWindow; } -void MainWindow::showTransformGeometryWidget(void) +void MainWindow::showTransformGeometryWidget() { R_LOG_TRACE; QString dockName = QString::fromUtf8("dockTransform"); @@ -202,32 +202,32 @@ void MainWindow::showTransformGeometryWidget(void) this->showCustomDockWidget(transformGeometryWidget,dockName,tr("Transform geometry")); } -void MainWindow::hideTransformGeometryWidget(void) +void MainWindow::hideTransformGeometryWidget() { R_LOG_TRACE; this->hideCustomDockWidget(QString::fromUtf8("dockTransform")); } -void MainWindow::showDrawWidget(void) +void MainWindow::showDrawWidget() { R_LOG_TRACE; QString dockName = QString::fromUtf8("dockDraw"); this->showCustomDockWidget((findCustomDockWidget(dockName) ? nullptr : new DrawInputWidget),dockName,tr("Draw object")); } -void MainWindow::hideDrawWidget(void) +void MainWindow::hideDrawWidget() { R_LOG_TRACE; this->hideCustomDockWidget(QString::fromUtf8("dockDraw")); } -void MainWindow::progressAutoHideEnable(void) +void MainWindow::progressAutoHideEnable() { R_LOG_TRACE; this->mainProgressBar->setAutoHide(true); } -void MainWindow::progressAutoHideDisable(void) +void MainWindow::progressAutoHideDisable() { R_LOG_TRACE; this->mainProgressBar->setAutoHide(false); @@ -283,7 +283,7 @@ void MainWindow::hideCustomDockWidget(const QString &name) } } -void MainWindow::createMenus(void) +void MainWindow::createMenus() { R_LOG_TRACE; QMenuBar *menubar = new QMenuBar(this); @@ -478,7 +478,7 @@ void MainWindow::createMenus(void) menubar->addAction(menuHelp->menuAction()); } -void MainWindow::createToolBars(void) +void MainWindow::createToolBars() { R_LOG_TRACE; QString key, actionName; @@ -598,7 +598,7 @@ void MainWindow::createToolBars(void) } } -void MainWindow::createStatusBar(void) +void MainWindow::createStatusBar() { R_LOG_TRACE; QStatusBar *statusbar; @@ -624,13 +624,13 @@ void MainWindow::createStatusBar(void) progressBarLayout->addWidget(this->downloadProgressBar); } -void MainWindow::createDownloadBar(void) +void MainWindow::createDownloadBar() { R_LOG_TRACE; } -void MainWindow::createCentralWidget(void) +void MainWindow::createCentralWidget() { R_LOG_TRACE; this->centralTabWidget = new CentralTabWidget(this); @@ -789,7 +789,7 @@ QWidget *MainWindow::createResultsTab() return layoutResults; } -QMenu * MainWindow::createPopupMenu (void) +QMenu * MainWindow::createPopupMenu () { R_LOG_TRACE; QMenu *popupMenu = this->QMainWindow::createPopupMenu(); @@ -799,7 +799,7 @@ QMenu * MainWindow::createPopupMenu (void) return popupMenu; } -void MainWindow::readSettings(void) +void MainWindow::readSettings() { R_LOG_TRACE; ApplicationSettings *pApplicationSettings = MainSettings::getInstance().getApplicationSettings(); @@ -856,7 +856,7 @@ void MainWindow::readSettings(void) MainSettings::getInstance().sync(); } -void MainWindow::writeSettings(void) const +void MainWindow::writeSettings() const { R_LOG_TRACE; QList actionList; @@ -921,13 +921,13 @@ void MainWindow::writeSettings(void) const MainSettings::getInstance().sync(); } -uint MainWindow::getNToolBars(void) const +uint MainWindow::getNToolBars() const { R_LOG_TRACE; return uint(this->toolBars.size()); } -QList MainWindow::getSelectedModelIDs(void) const +QList MainWindow::getSelectedModelIDs() const { R_LOG_TRACE; return this->modelManagerTree->getSelectedModelIDs(); @@ -1021,13 +1021,13 @@ void MainWindow::setEnabled(bool enabled) } } -void MainWindow::enable(void) +void MainWindow::enable() { R_LOG_TRACE; this->setEnabled(true); } -void MainWindow::disable(void) +void MainWindow::disable() { R_LOG_TRACE; this->setEnabled(false); @@ -1099,13 +1099,13 @@ void MainWindow::onDownloadProgressFinalize(uint) this->progressBarFinalize(this->downloadProgressBar,tr("Download complete")); } -void MainWindow::onDrawObjectAdded(void) +void MainWindow::onDrawObjectAdded() { R_LOG_TRACE; this->showDrawWidget(); } -void MainWindow::onDrawObjectRemoved(void) +void MainWindow::onDrawObjectRemoved() { R_LOG_TRACE; if (Session::getInstance().getDrawEngine()->getNObjects() == 0) @@ -1127,12 +1127,12 @@ void MainWindow::onJobBlocking(bool blocking) } } -void MainWindow::onJobStarted(void) +void MainWindow::onJobStarted() { R_LOG_TRACE; } -void MainWindow::onJobEnded(void) +void MainWindow::onJobEnded() { R_LOG_TRACE; } @@ -1205,7 +1205,7 @@ void MainWindow::onEntityVisibilityChanged(uint modelID, REntityGroupType, uint, } } -void MainWindow::onGeometryTransformFinalize(void) +void MainWindow::onGeometryTransformFinalize() { R_LOG_TRACE; this->hideTransformGeometryWidget(); diff --git a/range/Range/src/main_window.h b/range/Range/src/main_window.h index 1beb2b26..b30e8830 100644 --- a/range/Range/src/main_window.h +++ b/range/Range/src/main_window.h @@ -74,25 +74,25 @@ class MainWindow : public QMainWindow public: //! Get instance of singleton. - static MainWindow *getInstance(void); + static MainWindow *getInstance(); //! Show transform geometry dock widget. - void showTransformGeometryWidget(void); + void showTransformGeometryWidget(); //! Hide transform geometry dock widget. - void hideTransformGeometryWidget(void); + void hideTransformGeometryWidget(); //! Show draw dock widget. - void showDrawWidget(void); + void showDrawWidget(); //! Hide draw dock widget. - void hideDrawWidget(void); + void hideDrawWidget(); //! Enable progress-bar autohide. - void progressAutoHideEnable(void); + void progressAutoHideEnable(); //! Disable progress-bar autohide. - void progressAutoHideDisable(void); + void progressAutoHideDisable(); protected: @@ -108,25 +108,25 @@ class MainWindow : public QMainWindow protected: //! Return number of toolbars. - uint getNToolBars(void) const; + uint getNToolBars() const; //! Return list of selected model IDs. - QList getSelectedModelIDs(void) const; + QList getSelectedModelIDs() const; //! Create all menu items. - void createMenus(void); + void createMenus(); //! Create all tool bars. - void createToolBars(void); + void createToolBars(); //! Create status bar. - void createStatusBar(void); + void createStatusBar(); //! Create download bar. - void createDownloadBar(void); + void createDownloadBar(); //! Create central widget. - void createCentralWidget(void); + void createCentralWidget(); //! Create model tab. QWidget *createModelTab(); @@ -156,13 +156,13 @@ class MainWindow : public QMainWindow QWidget *createResultsTab(); //! Create custom popup menu. - QMenu * createPopupMenu (void); + QMenu * createPopupMenu (); //! Write application settings. - void writeSettings(void) const; + void writeSettings() const; //! Read application settings. - void readSettings(void); + void readSettings(); //! Overloaded closeEvent function to catch close event. void closeEvent(QCloseEvent *event); @@ -185,10 +185,10 @@ class MainWindow : public QMainWindow void setEnabled(bool enabled); //! Enable whole window. - void enable(void); + void enable(); //! Disable whole window. - void disable(void); + void disable(); //! Set main progress fraction. void onMainProgress(double fraction); @@ -209,19 +209,19 @@ class MainWindow : public QMainWindow void onDownloadProgressFinalize(uint); //! Draw object was added. - void onDrawObjectAdded(void); + void onDrawObjectAdded(); //! Draw object was removed. - void onDrawObjectRemoved(void); + void onDrawObjectRemoved(); //! Job is blocking. void onJobBlocking(bool blocking); //! New job has started. - void onJobStarted(void); + void onJobStarted(); //! Job has ended. - void onJobEnded(void); + void onJobEnded(); //! New model has been added. void onModelAdded(uint position); @@ -242,7 +242,7 @@ class MainWindow : public QMainWindow void onEntityVisibilityChanged(uint modelID, REntityGroupType, uint, bool visible); //! Finalize geometry transform widget. - void onGeometryTransformFinalize(void); + void onGeometryTransformFinalize(); //! Called when number of history records has changed. void onNHistoryRecordsChanged(uint); diff --git a/range/Range/src/model.cpp b/range/Range/src/model.cpp index 2df31fa3..a09f2598 100644 --- a/range/Range/src/model.cpp +++ b/range/Range/src/model.cpp @@ -13,9 +13,9 @@ #include #include "model.h" -#include "variable_data.h" #include "color.h" #include "color_scale.h" +#include "gl_functions.h" #include "gl_element.h" #include "gl_element_group.h" #include "gl_line.h" diff --git a/range/Range/src/model_action.cpp b/range/Range/src/model_action.cpp index a431ad18..b3ad3443 100644 --- a/range/Range/src/model_action.cpp +++ b/range/Range/src/model_action.cpp @@ -433,20 +433,19 @@ void ModelAction::removeElements(const ModelActionInput &modelActionInput) } } - int consolidateActionMask = Model::ConsolidateEdgeNodes | Model::ConsolidateEdgeElements | Model::ConsolidateHoleElements | Model::ConsolidateMeshInput | Model::ConsolidateSliverElements; - - if (nSurfaceElements > 0) - { - consolidateActionMask |= Model::ConsolidateSurfaceNeighbors; - if (rModel.getNIntersected() > 0) - { - consolidateActionMask |= Model::ConsolidateIntersectedElements; - } - } - if (nVolumeElements > 0) - { - consolidateActionMask |= Model::ConsolidateVolumeNeighbors; - } +// int consolidateActionMask = Model::ConsolidateEdgeNodes | Model::ConsolidateEdgeElements | Model::ConsolidateHoleElements | Model::ConsolidateMeshInput | Model::ConsolidateSliverElements; +// if (nSurfaceElements > 0) +// { +// consolidateActionMask |= Model::ConsolidateSurfaceNeighbors; +// if (rModel.getNIntersected() > 0) +// { +// consolidateActionMask |= Model::ConsolidateIntersectedElements; +// } +// } +// if (nVolumeElements > 0) +// { +// consolidateActionMask |= Model::ConsolidateVolumeNeighbors; +// } rModel.removeElements(modelActionInput.getElementIDs(),modelActionInput.getCloseHole()); rModel.consolidate(Model::ConsolidateActionAll); diff --git a/range/Range/src/pick_list.cpp b/range/Range/src/pick_list.cpp index ffa5a65f..e19e0858 100644 --- a/range/Range/src/pick_list.cpp +++ b/range/Range/src/pick_list.cpp @@ -45,8 +45,7 @@ QVector PickList::getItems(uint modelID) const while (iter != this->items.end()) { - const PickItem *pPickItem = iter; - if (pPickItem->getEntityID().getMid() == modelID) + if (iter->getEntityID().getMid() == modelID) { modelItems.append(*iter); } @@ -64,10 +63,9 @@ uint PickList::getNItems(PickItemType type, uint modelID) const while (iter != this->items.end()) { - const PickItem *pPickItem = iter; - if (pPickItem->getItemType() == type) + if (iter->getItemType() == type) { - if (modelID == RConstants::eod || modelID == pPickItem->getEntityID().getMid()) + if (modelID == RConstants::eod || modelID == iter->getEntityID().getMid()) { nItems++; } @@ -90,10 +88,9 @@ bool PickList::isEmpty(uint modelID, REntityGroupType elementGroupType) const while (iter != this->items.end()) { - const PickItem *pPickItem = iter; - if (pPickItem->getEntityID().getMid() == modelID) + if (iter->getEntityID().getMid() == modelID) { - if (elementGroupType == R_ENTITY_GROUP_NONE || pPickItem->getEntityID().getType() == elementGroupType) + if (elementGroupType == R_ENTITY_GROUP_NONE || iter->getEntityID().getType() == elementGroupType) { return false; } @@ -114,8 +111,7 @@ QList PickList::getModelIDs(void) const iter = this->items.begin(); while (iter != this->items.end()) { - const PickItem *pPickItem = iter; - modelID = pPickItem->getEntityID().getMid(); + modelID = iter->getEntityID().getMid(); modelIDcnt[modelID]++; if (modelIDcnt[modelID] == 1) { @@ -136,8 +132,7 @@ bool PickList::registerItem(const PickItem &pickItem) while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if ((*pPickItem) == pickItem) + if ((*iter) == pickItem) { this->items.erase(iter); itemErased = true; @@ -153,8 +148,7 @@ bool PickList::registerItem(const PickItem &pickItem) iter = this->items.begin(); while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if (pPickItem->getEntityID().getMid() == pickItem.getEntityID().getMid()) + if (iter->getEntityID().getMid() == pickItem.getEntityID().getMid()) { iter = this->items.erase(iter); } @@ -182,8 +176,7 @@ void PickList::addItem(const PickItem &pickItem) while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if ((*pPickItem) == pickItem) + if ((*iter) == pickItem) { return; } @@ -198,8 +191,7 @@ void PickList::addItem(const PickItem &pickItem) iter = this->items.begin(); while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if (pPickItem->getEntityID().getMid() == pickItem.getEntityID().getMid()) + if (iter->getEntityID().getMid() == pickItem.getEntityID().getMid()) { iter = this->items.erase(iter); } @@ -222,8 +214,7 @@ void PickList::removeItem(const PickItem &pickItem) while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if ((*pPickItem) == pickItem) + if ((*iter) == pickItem) { this->items.erase(iter); } @@ -243,8 +234,7 @@ void PickList::removeItems(uint modelID) while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if (pPickItem->getEntityID().getMid() == modelID) + if (iter->getEntityID().getMid() == modelID) { this->items.erase(iter); } @@ -264,8 +254,7 @@ bool PickList::hasItem(const PickItem &pickItem) while (iter != this->items.end()) { - PickItem *pPickItem = iter; - if ((*pPickItem) == pickItem) + if ((*iter) == pickItem) { return true; } diff --git a/range/RangeModel/include/rml_model.h b/range/RangeModel/include/rml_model.h index d51b6942..d5d2aa3f 100644 --- a/range/RangeModel/include/rml_model.h +++ b/range/RangeModel/include/rml_model.h @@ -17,7 +17,6 @@ #include "rml_cut.h" #include "rml_element.h" -#include "rml_interpolated_entity.h" #include "rml_iso.h" #include "rml_line.h" #include "rml_node.h" @@ -56,11 +55,11 @@ class RModel : public RProblem, public RResults private: //! Internal initialization function. - void _init ( const RModel *pModel = nullptr ); + void _init(const RModel *pModel = nullptr); //! Add element to element group. - void addElementToGroup ( uint elementID, - uint groupID = 0 ); + void addElementToGroup(uint elementID, + uint groupID = 0); protected: @@ -103,58 +102,56 @@ class RModel : public RProblem, public RResults RModel (); //! Copy constructor. - RModel ( const RModel &model ); + RModel(const RModel &model); //! Convert constructor from MSH (old range) model. - RModel ( const RModelMsh &modelMsh ); + RModel(const RModelMsh &modelMsh); //! Convert constructor from RAW model. - RModel ( const RModelRaw &modelRaw, - const QString &name = QString(), - const QString &description = QString() ); + RModel(const RModelRaw &modelRaw, const QString &name = QString(), const QString &description = QString()); //! Convert constructor from STL model. - RModel ( const RModelStl &modelStl ); + RModel(const RModelStl &modelStl); //! Destructor. virtual ~RModel (); //! Assignment operator. - RModel & operator = ( const RModel &model ); + RModel &operator =(const RModel &model); //! Update model data. - void update ( const RModel &rModel ); + void update(const RModel &rModel); //! Read mesh from the file. - void read ( const QString &fileName ); + void read(const QString &fileName); //! Write mesh to the file. //! Return actual filename to which the model was saved. - QString write ( const QString &fileName, bool writeLinkFile = true ) const; + QString write(const QString &fileName, bool writeLinkFile = true) const; //! Export model to MSH (old range) model. - void exportTo ( RModelMsh &modelMsh ) const; + void exportTo(RModelMsh &modelMsh) const; //! Export model to RAW model. - void exportTo ( RModelRaw &modelRaw ) const; + void exportTo(RModelRaw &modelRaw) const; //! Export model to STL model. - void exportTo ( RModelStl &modelStl ) const; + void exportTo(RModelStl &modelStl) const; //! Get model name. - QString getName ( void ) const; + QString getName() const; //! Set model name. - void setName ( const QString &name ); + void setName(const QString &name); //! Get model description. - QString getDescription ( void ) const; + QString getDescription() const; //! Set model description. - void setDescription ( const QString &name ); + void setDescription(const QString &name); //! Set problem task tree. - void setProblemTaskTree ( const RProblemTaskItem &taskTree ); + void setProblemTaskTree(const RProblemTaskItem &taskTree); /************************************************************* * Variable interface * @@ -171,49 +168,36 @@ class RModel : public RProblem, public RResults *************************************************************/ //! Return number of nodes. - uint getNNodes ( void ) const; + uint getNNodes() const; //! Set number of nodes. - void setNNodes ( uint nnodes ); + virtual void setNNodes(uint nnodes); //! Return pointer to node in model at given position. - const RNode * getNodePtr ( uint position ) const; + const RNode * getNodePtr(uint position) const; //! Return pointer to node in model at given position. - RNode * getNodePtr ( uint position ); + RNode * getNodePtr(uint position); //! Return reference to node in model at given position. - const RNode & getNode ( uint position ) const; + const RNode &getNode(uint position) const; //! Return reference to node in model at given position. - RNode & getNode ( uint position ); + RNode &getNode(uint position); //! Return const reference to array of all nodes. - const std::vector & getNodes ( void ) const; + const std::vector &getNodes() const; //! Add node to model. - void addNode ( const RNode &node, - double value = 0.0 ); - - //! Add node specified by its coordinates to model. - void addNode ( double x, - double y, - double z, - double value = 0.0 ); + void addNode(const RNode &node); //! Set node in model at given position. - void setNode ( uint position, - const RNode &node ); + void setNode(uint position, const RNode &node); //! Remove node from model at given position. //! If specified return vecor of indexes of removed elements and //! element groups in ascending order. - void removeNode ( uint position, - std::vector * removedElements = 0, - std::vector * removedPoints = 0, - std::vector * removedLines = 0, - std::vector * removedSurfaces = 0, - std::vector * removedVolumes = 0 ); + void removeNode(uint position); //! Remove list of nodes. //! If closeHole is set to true resulting hole will be patched with new elements. @@ -235,9 +219,9 @@ class RModel : public RProblem, public RResults uint removeDuplicateElements(); //! Find node limits. - void findNodeLimits( double &xmin, double &xmax, - double &ymin, double &ymax, - double &zmin, double &zmax ) const; + void findNodeLimits(double &xmin, double &xmax, + double &ymin, double &ymax, + double &zmin, double &zmax) const; //! Find node limits. RLimitBox findNodeLimits() const; @@ -246,10 +230,10 @@ class RModel : public RProblem, public RResults //! Scale represent real number that its inverse multiplication //! with model coordinates will result in maximum size //! to be equal 1. - double findNodeScale( void ) const; + double findNodeScale() const; //! Return center of all nodes (geometric center). - void findNodeCenter( double &xc, double &yc, double &zc ) const; + void findNodeCenter(double &xc, double &yc, double &zc) const; //! Find node distance statistics. RStatistics findNodeDistanceStatistics() const; @@ -267,53 +251,42 @@ class RModel : public RProblem, public RResults //! Return number of elements. //! If element type is specified number of elements of that //! type will be returned. - uint getNElements ( RElementType elementType = R_ELEMENT_NONE ) const; + uint getNElements(RElementType elementType = R_ELEMENT_NONE) const; //! Return number of elements. //! If element group type is specified number of elements of that //! type will be returned. - uint getNElements ( REntityGroupType elementGroupType ) const; + uint getNElements(REntityGroupType elementGroupType) const; //! Set number of elements. - void setNElements ( uint nelements ); + void setNElements(uint nelements); //! Return pointer to element in model at given position. - const RElement * getElementPtr ( uint position ) const; + const RElement *getElementPtr(uint position) const; //! Return pointer to element in model at given position. - RElement * getElementPtr ( uint position ); + RElement * getElementPtr(uint position); //! Return reference to element in model at given position. - const RElement & getElement ( uint position ) const; + const RElement &getElement(uint position) const; //! Return reference to element in model at given position. - RElement & getElement ( uint position ); + RElement &getElement(uint position); //! Return const reference to array of all elements. - const std::vector & getElements ( void ) const; + const std::vector &getElements() const; //! Return reference to array of all elements. - std::vector & getElements ( void ); + std::vector &getElements(); //! Add element to model. - void addElement ( const RElement &element, - bool addToGroup = false, - uint groupID = 0); + void addElement(const RElement &element, bool addToGroup = false, uint groupID = 0); //! Set element in model at given position. - void setElement ( uint position, - const RElement &element, - bool addToGroup = true); + void setElement(uint position, const RElement &element, bool addToGroup = true); //! Remove element from model at given position. - //! If specified return vecor of indexes of removed - //! element groups in ascending order. - void removeElement ( uint position, - bool removeGroups = true, - std::vector * removedPoints = 0, - std::vector * removedLines = 0, - std::vector * removedSurfaces = 0, - std::vector * removedVolumes = 0 ); + void removeElement(uint position, bool removeGroups); //! Remove list of elements. //! If closeHole is set to true resulting hole will be patched with new elements. @@ -322,8 +295,7 @@ class RModel : public RProblem, public RResults //! Return vector of possitions of elements containing given //! node. - std::vector findElementPositionsByNodeId - ( uint nodeID ) const; + std::vector findElementPositionsByNodeId(uint nodeID) const; //! Find line element size statistics. RStatistics findLineElementSizeStatistics() const; @@ -354,54 +326,45 @@ class RModel : public RProblem, public RResults *************************************************************/ //! Return number of elements in given entity. - uint getNEntityElements ( REntityGroupType entityType ) const; + uint getNEntityElements(REntityGroupType entityType) const; //! Return number of element groups. - uint getNElementGroups ( void ) const; + uint getNElementGroups() const; //! Return number of entity groups. - uint getNEntityGroups ( bool onlyElements = false ) const; + uint getNEntityGroups(bool onlyElements = false) const; //! Return const pointer to element group. - const RElementGroup * getElementGroupPtr ( uint groupID ) const; + const RElementGroup * getElementGroupPtr(uint groupID) const; //! Return pointer to element group. - RElementGroup * getElementGroupPtr ( uint groupID ); + RElementGroup * getElementGroupPtr(uint groupID); //! Return const pointer to entity group. - const REntityGroup * getEntityGroupPtr ( uint groupID, - bool onlyElements = false ) const; + const REntityGroup * getEntityGroupPtr(uint groupID, bool onlyElements = false) const; //! Return pointer to entity group. - REntityGroup * getEntityGroupPtr ( uint groupID, - bool onlyElements = false ); + REntityGroup * getEntityGroupPtr(uint groupID, bool onlyElements = false); //! Return entity group type. - REntityGroupType getEntityGroupType ( uint groupID, - bool onlyElements = false ) const; + REntityGroupType getEntityGroupType(uint groupID, bool onlyElements = false) const; //! Return position of group within the list of its type. - uint getEntityGroupPosition ( uint groupID, - bool onlyElements = false ) const; + uint getEntityGroupPosition(uint groupID, bool onlyElements = false) const; //! Convert entity type and ID to element group ID. - uint getElementGroupID ( REntityGroupType entityType, - uint entityID ) const; + uint getElementGroupID(REntityGroupType entityType, uint entityID) const; //! Convert entity type and ID to entity group ID. - uint getEntityGroupID ( REntityGroupType entityType, - uint entityID, - bool onlyElements = false ) const; + uint getEntityGroupID(REntityGroupType entityType, uint entityID, bool onlyElements = false) const; //! Return list of entity group IDs for given entity type. - std::vector getEntityGroupIDs ( REntityGroupType entityType ) const; + std::vector getEntityGroupIDs(REntityGroupType entityType) const; QMap getEntityIDMap() const; //! Convert entity group ID to entity type and entity ID. - bool getEntityID ( uint groupID, - REntityGroupType &entityType, - uint &entityID ) const; + bool getEntityID(uint groupID, REntityGroupType &entityType, uint &entityID) const; //! Return element ID for given entity ID and element position. uint findElementID(REntityGroupType entityType, uint entityID, uint elementPosition) const; @@ -423,96 +386,93 @@ class RModel : public RProblem, public RResults *************************************************************/ //! Return number of points. - uint getNPoints ( void ) const; + uint getNPoints() const; //! Set number of points. - void setNPoints ( uint npoints ); + void setNPoints(uint npoints); //! Return pointer to point in model at given position. - const RPoint * getPointPtr ( uint position ) const; + const RPoint * getPointPtr(uint position) const; //! Return pointer to point in model at given position. - RPoint * getPointPtr ( uint position ); + RPoint * getPointPtr(uint position); //! Return reference to point in model at given position. - const RPoint & getPoint ( uint position ) const; + const RPoint &getPoint(uint position) const; //! Return reference to point in model at given position. - RPoint & getPoint ( uint position ); + RPoint &getPoint(uint position); //! Add point to model. - void addPoint ( const RPoint &point = RPoint() ); + void addPoint(const RPoint &point = RPoint()); //! Set point in model at given position. - void setPoint ( uint position, - const RPoint &point ); + void setPoint(uint position, const RPoint &point); //! Remove point from model at given position. - void removePoint ( uint position ); + void removePoint(uint position); /************************************************************* * Line interface * *************************************************************/ //! Return number of lines. - uint getNLines ( void ) const; + uint getNLines() const; //! Set number of lines. - void setNLines ( uint nlines ); + void setNLines(uint nlines); //! Return pointer to line in model at given position. - const RLine * getLinePtr ( uint position ) const; + const RLine * getLinePtr(uint position) const; //! Return pointer to line in model at given position. - RLine * getLinePtr ( uint position ); + RLine * getLinePtr(uint position); //! Return reference to line in model at given position. - const RLine & getLine ( uint position ) const; + const RLine &getLine(uint position) const; //! Return reference to line in model at given position. - RLine & getLine ( uint position ); + RLine &getLine(uint position); //! Add line to model. - void addLine ( const RLine &line ); + void addLine(const RLine &line); //! Set line in model at given position. - void setLine ( uint position, - const RLine &line ); + void setLine(uint position, const RLine &line); //! Remove line from model at given position. - void removeLine ( uint position ); + void removeLine(uint position); /************************************************************* * Surface interface * *************************************************************/ //! Return number of surfaces. - uint getNSurfaces ( void ) const; + uint getNSurfaces() const; //! Set number of surfaces. - void setNSurfaces ( uint nsurfaces ); + void setNSurfaces(uint nsurfaces); //! Return pointer to surface in model at given position. - const RSurface * getSurfacePtr ( uint position ) const; + const RSurface *getSurfacePtr(uint position) const; //! Return pointer to surface in model at given position. - RSurface * getSurfacePtr ( uint position ); + RSurface *getSurfacePtr(uint position); //! Return reference to surface in model at given position. - const RSurface & getSurface ( uint position ) const; + const RSurface &getSurface(uint position) const; //! Return ireference to surface in model at given position. - RSurface & getSurface ( uint position ); + RSurface &getSurface(uint position); //! Add surface to model. - void addSurface ( const RSurface &surface ); + void addSurface(const RSurface &surface); //! Set surface in model at given position. - void setSurface ( uint position, - const RSurface &surface ); + void setSurface(uint position, const RSurface &surface); //! Remove surface from model at given position. - void removeSurface ( uint position ); + void removeSurface(uint position); //! Check if given surface forms closed surface. bool checkIfSurfaceIsClosed(uint surfaceID) const; @@ -528,211 +488,205 @@ class RModel : public RProblem, public RResults *************************************************************/ //! Return number of volumes. - uint getNVolumes ( void ) const; + uint getNVolumes() const; //! Set number of volumes. - void setNVolumes ( uint nvolumes ); + void setNVolumes(uint nvolumes); //! Return pointer to volume in model at given position. - const RVolume * getVolumePtr ( uint position ) const; + const RVolume *getVolumePtr(uint position) const; //! Return pointer to volume in model at given position. - RVolume * getVolumePtr ( uint position ); + RVolume *getVolumePtr(uint position); //! Return reference to volume in model at given position. - const RVolume & getVolume ( uint position ) const; + const RVolume &getVolume(uint position) const; //! Return reference to volume in model at given position. - RVolume & getVolume ( uint position ); + RVolume &getVolume(uint position); //! Add volume to model. - void addVolume ( const RVolume &volume ); + void addVolume(const RVolume &volume); //! Set volume in model at given position. - void setVolume ( uint position, - const RVolume &volume ); + void setVolume(uint position, const RVolume &volume); //! Remove volume from model at given position. - void removeVolume ( uint position ); + void removeVolume(uint position); /************************************************************* * Vector field interface * *************************************************************/ //! Return number of vector fields. - uint getNVectorFields ( void ) const; + uint getNVectorFields() const; //! Set number of vector fields. - void setNVectorFields ( uint nVectorFields ); + void setNVectorFields(uint nVectorFields); //! Return pointer to vector field in model at given position. - const RVectorField * getVectorFieldPtr ( uint position ) const; + const RVectorField *getVectorFieldPtr(uint position) const; //! Return pointer to vector field in model at given position. - RVectorField * getVectorFieldPtr ( uint position ); + RVectorField *getVectorFieldPtr(uint position); //! Return reference to vector field in model at given position. - const RVectorField & getVectorField ( uint position ) const; + const RVectorField &getVectorField(uint position) const; //! Return reference to vector field in model at given position. - RVectorField & getVectorField ( uint position ); + RVectorField &getVectorField(uint position); //! Add vector field to model. - void addVectorField ( const RVectorField &vectorField ); + void addVectorField(const RVectorField &vectorField); //! Set vector field in model at given position. - void setVectorField ( uint position, - const RVectorField &vectorField ); + void setVectorField(uint position, const RVectorField &vectorField); //! Remove vector field from model at given position. - void removeVectorField ( uint position ); + void removeVectorField(uint position); /************************************************************* * Scalar field interface * *************************************************************/ //! Return number of scalar fields. - uint getNScalarFields ( void ) const; + uint getNScalarFields() const; //! Set number of scalar fields. - void setNScalarFields ( uint nScalarFields ); + void setNScalarFields(uint nScalarFields); //! Return pointer to scalar field in model at given position. - const RScalarField * getScalarFieldPtr ( uint position ) const; + const RScalarField *getScalarFieldPtr(uint position) const; //! Return pointer to scalar field in model at given position. - RScalarField * getScalarFieldPtr ( uint position ); + RScalarField *getScalarFieldPtr(uint position); //! Return reference to scalar field in model at given position. - const RScalarField & getScalarField ( uint position ) const; + const RScalarField &getScalarField(uint position) const; //! Return reference to scalar field in model at given position. - RScalarField & getScalarField ( uint position ); + RScalarField &getScalarField(uint position); //! Add scalar field to model. - void addScalarField ( const RScalarField &scalarField ); + void addScalarField(const RScalarField &scalarField); //! Set scalar field in model at given position. - void setScalarField ( uint position, - const RScalarField &scalarField ); + void setScalarField(uint position, const RScalarField &scalarField); //! Remove scalar field from model at given position. - void removeScalarField ( uint position ); + void removeScalarField(uint position); /************************************************************* * Stream line interface * *************************************************************/ //! Return number of stream lines. - uint getNStreamLines ( void ) const; + uint getNStreamLines() const; //! Set number of stream lines. - void setNStreamLines ( uint nStreamLines ); + void setNStreamLines(uint nStreamLines); //! Return pointer to stream line in model at given position. - const RStreamLine * getStreamLinePtr ( uint position ) const; + const RStreamLine *getStreamLinePtr(uint position) const; //! Return pointer to stream line in model at given position. - RStreamLine * getStreamLinePtr ( uint position ); + RStreamLine *getStreamLinePtr(uint position); //! Return reference to stream line in model at given position. - const RStreamLine & getStreamLine ( uint position ) const; + const RStreamLine &getStreamLine(uint position) const; //! Return reference to stream line in model at given position. - RStreamLine & getStreamLine ( uint position ); + RStreamLine &getStreamLine(uint position); //! Add stream line to model. - void addStreamLine ( const RStreamLine &streamLine ); + void addStreamLine(const RStreamLine &streamLine); //! Set stream line in model at given position. - void setStreamLine ( uint position, - const RStreamLine &streamLine ); + void setStreamLine(uint position, const RStreamLine &streamLine); //! Remove stream line from model at given position. - void removeStreamLine ( uint position ); + void removeStreamLine(uint position); /************************************************************* * Cut interface * *************************************************************/ //! Return number of cuts. - uint getNCuts ( void ) const; + uint getNCuts() const; //! Set number of cuts. - void setNCuts ( uint nCuts ); + void setNCuts(uint nCuts); //! Return pointer to cut in model at given position. - const RCut * getCutPtr ( uint position ) const; + const RCut *getCutPtr(uint position) const; //! Return pointer to cut in model at given position. - RCut * getCutPtr ( uint position ); + RCut *getCutPtr(uint position); //! Return reference to cut in model at given position. - const RCut & getCut ( uint position ) const; + const RCut &getCut(uint position) const; //! Return reference to cut in model at given position. - RCut & getCut ( uint position ); + RCut &getCut(uint position); //! Add cut to model. - void addCut ( const RCut &cut ); + void addCut(const RCut &cut); //! Set cut in model at given position. - void setCut ( uint position, - const RCut &cut ); + void setCut(uint position, const RCut &cut); //! Remove cut from model at given position. - void removeCut ( uint position ); + void removeCut(uint position); /************************************************************* * Iso interface * *************************************************************/ //! Return number of isos. - uint getNIsos ( void ) const; + uint getNIsos() const; //! Set number of isos. - void setNIsos ( uint nIsos ); + void setNIsos(uint nIsos); //! Return pointer to iso in model at given position. - const RIso * getIsoPtr ( uint position ) const; + const RIso *getIsoPtr(uint position) const; //! Return pointer to iso in model at given position. - RIso * getIsoPtr ( uint position ); + RIso *getIsoPtr(uint position); //! Return reference to iso in model at given position. - const RIso & getIso( uint position ) const; + const RIso &getIso(uint position) const; //! Return reference to iso in model at given position. - RIso & getIso( uint position ); + RIso &getIso(uint position); //! Add iso to model. - void addIso( const RIso &iso ); + void addIso(const RIso &iso); //! Set iso in model at given position. - void setIso( uint position, - const RIso &iso ); + void setIso(uint position, const RIso &iso); //! Remove iso from model at given position. - void removeIso( uint position ); + void removeIso(uint position); /************************************************************* * Model data interface * *************************************************************/ //! Return const reference to data object. - inline const RModelData & getData( void ) const + inline const RModelData &getData() const { return this->modelData; } //! Return reference to data object. - inline RModelData & getData( void ) + inline RModelData &getData() { return this->modelData; } //! Set data object. - inline void setData( const RModelData &modelData ) + inline void setData(const RModelData &modelData) { this->modelData = modelData; } @@ -748,38 +702,36 @@ class RModel : public RProblem, public RResults //! Return vector of results vector for given element ID. //! If variable applies on nodes vector will have a size of number of nodes. //! If results vector is scalar then its size will be 1. - std::vector getElementResultsValues( RVariableType variableType, - uint elementID ) const; + std::vector getElementResultsValues(RVariableType variableType, uint elementID) const; //! Return vector of results vector for given node ID. //! If results vector is scalar then its size will be 1. - RRVector getNodeResultsValues( RVariableType variableType, - uint nodeID ) const; + RRVector getNodeResultsValues(RVariableType variableType, uint nodeID) const; //! Return vector of results vectors for given interpolated element ID. //! If variable applies on nodes vector will have a size of number of nodes. //! If results vector is scalar then its size will be 1. //! This function returns valid results only for ISO and CUT entity group types. - std::vector getInterpolatedElementResultsValues( RVariableType variableType, - REntityGroupType entityGroupType, - uint entityID, - uint elementID ) const; + std::vector getInterpolatedElementResultsValues(RVariableType variableType, + REntityGroupType entityGroupType, + uint entityID, + uint elementID) const; //! Return results vector for given interpolated node ID. //! If results vector is scalar then its size will be 1. //! This function returns valid results only for ISO and CUT entity group types. - RRVector getInterpolatedNodeResultsValues( RVariableType variableType, - REntityGroupType entityGroupType, - uint entityID, - uint elementID, - uint nodeID ) const; + RRVector getInterpolatedNodeResultsValues(RVariableType variableType, + REntityGroupType entityGroupType, + uint entityID, + uint elementID, + uint nodeID) const; //! Return results vector for given node. //! If results vector is scalar then its size will be 1. //! If node is outside of the model empty vector is returned. - RRVector getInterpolatedResultsValues( RVariableType variableType, - const RNode &rNode, - REntityGroupTypeMask entityGroup = R_ENTITY_GROUP_ELEMENT ) const; + RRVector getInterpolatedResultsValues(RVariableType variableType, + const RNode &rNode, + REntityGroupTypeMask entityGroup = R_ENTITY_GROUP_ELEMENT) const; /************************************************************* @@ -809,7 +761,7 @@ class RModel : public RProblem, public RResults *************************************************************/ //! Return true if model is empty. - inline bool isEmpty( void ) const + inline bool isEmpty() const { return (this->getNNodes() == 0); } @@ -818,7 +770,7 @@ class RModel : public RProblem, public RResults RModelProblemTypeMask checkMesh(bool printOutput = true) const; //! Return book vector of edge nodes. - QVector findEdgeNodes( void ) const; + QVector findEdgeNodes() const; //! Sort given list of line elements into continuous chain. //! Elements which are not in the chain are not listed in returned index list. @@ -831,25 +783,24 @@ class RModel : public RProblem, public RResults double findMinimumNodeDistance() const; //! Create interpolated entity from plane and list of element IDs. - void createCut( RCut &rCut ) const; + void createCut(RCut &rCut) const; //! Create interpolated entity from variable type, variable value and list of element IDs. - void createIso( RIso &rIso ) const; + void createIso(RIso &rIso) const; //! Create interpolated entity from variable type, variable value. - void createStreamLine( RStreamLine &rStreamLine ) const; + void createStreamLine(RStreamLine &rStreamLine) const; //! Recreate dependent entities such as cuts or isos. - void createDependentEntities( void ); + void createDependentEntities(); //! Return neighbor ID at given position. //! If no neighbor is found RConstants::eod is returned. - uint getNeighbor( uint elementID, - uint neighborPosition ) const; + uint getNeighbor(uint elementID, uint neighborPosition) const; //! Return pointer to vector of neighbor IDs. //! If element has no neighbors assigned NULL pointer is returned. - const std::vector * getNeighborIDs( uint elementID ) const; + const std::vector *getNeighborIDs(uint elementID) const; //! Set surface neighbors book. void setSurfaceNeighbors(const std::vector &surfaceNeigs); @@ -922,7 +873,7 @@ class RModel : public RProblem, public RResults void findPatchNormal(const RPatch &rPatch, double &nx, double &ny, double &nz) const; //! Find patch area. - void findPatchArea(const RPatch &rPatch, double area) const; + void findPatchArea(const RPatch &rPatch, double &area) const; //! Find most recent view factor file. QString findRecentViewFactorMatrixFile() const; @@ -970,27 +921,26 @@ class RModel : public RProblem, public RResults *************************************************************/ //! Return default file extension. - static QString getDefaultFileExtension ( bool binary = true ); + static QString getDefaultFileExtension(bool binary = true); //! Write link file. - static void writeLink ( const QString &linkFileName, - const QString &targetFileName ); + static void writeLink(const QString &linkFileName, const QString &targetFileName); protected: //! Read from the ASCII file. //! If file is a link target filename is returned. - QString readAscii ( const QString &fileName ); + QString readAscii(const QString &fileName); //! Read from the binary file. //! If file is a link target filename is returned. - QString readBinary ( const QString &fileName ); + QString readBinary(const QString &fileName); //! Write to the ASCII file. - void writeAscii ( const QString &fileName ) const; + void writeAscii(const QString &fileName) const; //! Write to the binary file. - void writeBinary ( const QString &fileName ) const; + void writeBinary(const QString &fileName) const; protected: @@ -1023,10 +973,10 @@ class RModel : public RProblem, public RResults //! Stop criteria are: //! 1. maximum distance from starting element in number of steps //! 2. separation angle between two elements in radians. - void generateElementDistanceVector( uint startElementID, - uint maximumDistance, - double separationAngle, - RDistanceVector &distanceVector ) const; + void generateElementDistanceVector(uint startElementID, + uint maximumDistance, + double separationAngle, + RDistanceVector &distanceVector) const; //! Find near node to the given node. //! If no node was found a RConstants::eod is returned. diff --git a/range/RangeModel/include/rml_problem.h b/range/RangeModel/include/rml_problem.h index 0fac96c7..3a9dc87b 100644 --- a/range/RangeModel/include/rml_problem.h +++ b/range/RangeModel/include/rml_problem.h @@ -2,7 +2,7 @@ * AUTHOR: Tomas Soltys * * FILE: rml_problem.h * * GROUP: RML * - * TYPE: header file (*.h) * + * TYPE: header file(*.h) * * DATE: 23-rd December 2011 * * * * DESCRIPTION: Problem class declaration * @@ -28,7 +28,7 @@ class RProblem private: //! Internal initialization function. - void _init ( const RProblem *pProblem = nullptr ); + void _init(const RProblem *pProblem = nullptr); protected: @@ -46,31 +46,31 @@ class RProblem public: //! Constructor. - RProblem (); + RProblem(); //! Copy constructor. - RProblem ( const RProblem & problem ); + RProblem(const RProblem &problem); //! Destructor. - ~RProblem (); + ~RProblem(); //! Return const reference to problem task tree. - const RProblemTaskItem &getProblemTaskTree ( void ) const; + const RProblemTaskItem &getProblemTaskTree() const; //! Return reference to problem task tree. - RProblemTaskItem &getProblemTaskTree ( void ); + RProblemTaskItem &getProblemTaskTree(); //! Set problem task tree. - void setProblemTaskTree ( const RProblemTaskItem &taskTree ); + void setProblemTaskTree(const RProblemTaskItem &taskTree); //! Return const reference to time-solver. - const RTimeSolver & getTimeSolver ( void ) const; + const RTimeSolver &getTimeSolver() const; //! Return reference to time-solver. - RTimeSolver & getTimeSolver ( void ); + RTimeSolver &getTimeSolver(); //! Set new time-solver. - void setTimeSolver ( const RTimeSolver &timeSolver ); + void setTimeSolver(const RTimeSolver &timeSolver); //! Return const reference to matrix solver. RMatrixSolverConf getMatrixSolverConf(RMatrixSolverType matrixSolverType) const; @@ -79,52 +79,52 @@ class RProblem RMatrixSolverConf &getMatrixSolverConf(RMatrixSolverType matrixSolverType); //! Return const reference to monitoring point manager. - const RMonitoringPointManager & getMonitoringPointManager(void) const; + const RMonitoringPointManager &getMonitoringPointManager() const; //! Return reference to monitoring point manager. - RMonitoringPointManager & getMonitoringPointManager(void); + RMonitoringPointManager &getMonitoringPointManager(); //! Set monitoring point manager. void setMonitoringPointManager(const RMonitoringPointManager &monitoringPointManager); //! Return const reference to problem setup. - const RProblemSetup &getProblemSetup(void) const; + const RProblemSetup &getProblemSetup() const; //! Return reference to problem setup. - RProblemSetup &getProblemSetup(void); + RProblemSetup &getProblemSetup(); //! Set problem setup. void setProblemSetup(const RProblemSetup &problemSetup); //! Assignment operator. - RProblem & operator = ( const RProblem & problem ); + RProblem &operator =(const RProblem &problem); //! Return problem type for given problem ID. static RProblemType getTypeFromId(const QString &problemId); //! Return problem ID for specified problem type. - static QString getId ( RProblemType type ); + static QString getId(RProblemType type); //! Return problem name for specified problem type. - static QString getName ( RProblemType type ); + static QString getName(RProblemType type); //! Return problem description for specified problem type. - static QString getDesc ( RProblemType type ); + static QString getDesc(RProblemType type); //! Return time-solver is enabled for specified problem type. - static bool getTimeSolverEnabled ( RProblemTypeMask typeMask ); + static bool getTimeSolverEnabled(RProblemTypeMask typeMask); //! Return required problem type mask. - static RProblemTypeMask getRequiredProblemTypeMask ( RProblemTypeMask typeMask ); + static RProblemTypeMask getRequiredProblemTypeMask(RProblemTypeMask typeMask); //! Return excluded problem type mask. - static RProblemTypeMask getExcludedProblemTypeMask ( RProblemTypeMask typeMask ); + static RProblemTypeMask getExcludedProblemTypeMask(RProblemTypeMask typeMask); //! Return list of problem names for specified problem type mask. - static std::vector getTypes ( RProblemTypeMask typeMask ); + static std::vector getTypes(RProblemTypeMask typeMask); //! Return list of possible result variable types for specific problem type mask. - static std::vector getVariableTypes ( RProblemTypeMask typeMask ); + static std::vector getVariableTypes(RProblemTypeMask typeMask); //! Sort list of problem types by dependency. static void sortTypesByDependency(std::vector &problemTypes); diff --git a/range/RangeModel/include/rml_results.h b/range/RangeModel/include/rml_results.h index 9d3d1d3b..51a6ff9a 100644 --- a/range/RangeModel/include/rml_results.h +++ b/range/RangeModel/include/rml_results.h @@ -2,7 +2,7 @@ * AUTHOR: Tomas Soltys * * FILE: rml_results.h * * GROUP: RML * - * TYPE: header file (*.h) * + * TYPE: header file(*.h) * * DATE: 14-th December 2011 * * * * DESCRIPTION: Results class declaration * @@ -23,7 +23,7 @@ class RResults private: //! Internal initialization function. - void _init ( const RResults *results = nullptr ); + void _init(const RResults *results = nullptr); protected: @@ -31,94 +31,92 @@ class RResults unsigned int nnodes; //! Number of elements. unsigned int nelements; -// //! Current computational time / frequency (modal analysis). -// double compTime; //! Variables. std::vector variables; public: //! Constructor. - RResults (); + RResults(); //! Copy constructor. - RResults ( const RResults &results ); + RResults(const RResults &results); //! Destructor. - ~RResults (); + ~RResults(); //! Assignment operator. - RResults & operator = ( const RResults &results ); + RResults &operator =(const RResults &results); //! Clear results. - void clearResults(void); + void clearResults(); //! Return current computational time / frequency. - double getCompTime(void) const; + double getCompTime() const; //! Set current computational time / frequency. void setCompTime(double compTime); //! Return number of variables. - unsigned int getNVariables ( void ) const; + unsigned int getNVariables() const; //! Set number of node variables. - void setNVariables ( unsigned int nvariables ); + void setNVariables(unsigned int nvariables); //! Return const reference to variable. - const RVariable & getVariable ( unsigned int position ) const; + const RVariable &getVariable(unsigned int position) const; //! Return reference to variable. - RVariable & getVariable ( unsigned int position ); + RVariable &getVariable(unsigned int position); //! Find variable. //! If such variable type can not be found RConstants::eod is returned. - unsigned int findVariable ( RVariableType variableType ) const; + unsigned int findVariable(RVariableType variableType) const; //! Find variable. //! If such variable type can not be found and create is set to false //! RConstants::eod is returned. //! If create is true and variable can not be found it will be created //! and its possition will be returned. -// unsigned int findVariable ( RVariableType variableType, bool create = false ); +// unsigned int findVariable(RVariableType variableType, bool create = false); //! Add variable. //! If such variable already exist it will be replaced. - unsigned int addVariable ( const RVariable &variable ); + unsigned int addVariable(const RVariable &variable); //! Set variable. - void setVariable ( unsigned int position, - const RVariable &variable ); + void setVariable(unsigned int position, + const RVariable &variable); //! Remove variable. - virtual void removeVariable(uint position); + void removeVariable(uint position); //! Remove all variables. - virtual void removeAllVariables(void); + void removeAllVariables(); //! Return number of nodes. - unsigned int getNNodes ( void ) const; + unsigned int getNNodes() const; //! Set number of nodes. - virtual void setNNodes ( unsigned int nnodes ); + void setNNodes(unsigned int nnodes); //! Increase number of nodes by one. - virtual void addNode ( double value = 0.0 ); + void addNode(double value = 0.0); //! Remove node from results at give position. - virtual void removeNode ( unsigned int position ); + void removeNode(unsigned int position); //! Return number of elements. - unsigned int getNElements ( void ) const; + unsigned int getNElements() const; //! Set number of elements. - virtual void setNElements ( unsigned int nelements ); + void setNElements(unsigned int nelements); //! Increase number of elements by one. - virtual void addElement ( double value = 0.0 ); + void addElement(double value = 0.0); //! Remove element from results at give position. - virtual void removeElement ( unsigned int position ); + void removeElement(unsigned int position); //! Remove elements from results at give positions. //! If elementBook[i] == RConstants::eod then element will be removed. diff --git a/range/RangeModel/src/rml_model.cpp b/range/RangeModel/src/rml_model.cpp index 4e3bd168..62099513 100644 --- a/range/RangeModel/src/rml_model.cpp +++ b/range/RangeModel/src/rml_model.cpp @@ -27,7 +27,6 @@ #include "rml_file_manager.h" #include "rml_view_factor_matrix.h" #include "rml_polygon.h" -#include "rml_segment.h" static const RVersion _version = RVersion(FILE_MAJOR_VERSION,FILE_MINOR_VERSION,FILE_RELEASE_VERSION); @@ -57,20 +56,21 @@ void RModel::_init (const RModel *pModel) } /* RModel::_init */ -RModel::RModel () +RModel::RModel() { - this->_init (); + this->_init(); } /* RModel::RModel */ -RModel::RModel (const RModel &model) : RProblem (model) - , RResults (model) +RModel::RModel(const RModel &model) + : RProblem (model) + , RResults (model) { - this->_init (&model); + this->_init(&model); } /* RModel::RModel copy */ -RModel::RModel (const RModelMsh &modelMsh) +RModel::RModel(const RModelMsh &modelMsh) { RNode node; RElement element; @@ -79,7 +79,7 @@ RModel::RModel (const RModelMsh &modelMsh) RUVector faceBook(modelMsh.facesAll.getNRows()); RUVector bodyBook(modelMsh.bodiesAll.getNRows()); - this->_init (); + this->_init(); // Set name and description @@ -88,7 +88,7 @@ RModel::RModel (const RModelMsh &modelMsh) // Convert nodes - this->setNNodes(modelMsh.nodes.getNRows()); + this->RModel::setNNodes(modelMsh.nodes.getNRows()); for (uint i=0;isetNElements( modelMsh.pointsAll.getNRows() - + modelMsh.linesAll.getNRows() - + modelMsh.facesAll.getNRows() - + modelMsh.bodiesAll.getNRows()); + this->RModel::setNElements( modelMsh.pointsAll.getNRows() + + modelMsh.linesAll.getNRows() + + modelMsh.facesAll.getNRows() + + modelMsh.bodiesAll.getNRows()); uint elNum = 0; element.setType(R_ELEMENT_POINT); @@ -200,9 +200,9 @@ RModel::RModel (const RModelMsh &modelMsh) } /* RModel::RModel copy - MSH */ -RModel::RModel (const RModelStl &modelStl) +RModel::RModel(const RModelStl &modelStl) { - this->_init (); + this->_init(); this->setName(modelStl.getName()); this->setDescription(modelStl.getDescription()); this->setNNodes(modelStl.getNNodes()); @@ -225,11 +225,9 @@ RModel::RModel (const RModelStl &modelStl) } /* RModel::RModel copy - STL */ -RModel::RModel (const RModelRaw &modelRaw, - const QString &name, - const QString &description) +RModel::RModel(const RModelRaw &modelRaw, const QString &name, const QString &description) { - this->_init (); + this->_init(); this->setName(name); this->setDescription(description); this->setNNodes(modelRaw.getNNodes()); @@ -252,12 +250,12 @@ RModel::RModel (const RModelRaw &modelRaw, } /* RModel::RModel copy - RAW */ -RModel::~RModel () +RModel::~RModel() { } /* RModel::~RModel */ -RModel & RModel::operator = (const RModel &model) +RModel &RModel::operator = (const RModel &model) { this->RProblem::operator = (model); this->RResults::operator = (model); @@ -445,7 +443,7 @@ void RModel::read(const QString &fileName) { throw RError(R_ERROR_APPLICATION,R_ERROR_REF, "Memory allocation failed."); } - catch (const std::exception& x) + catch (const std::exception&x) { throw RError(R_ERROR_APPLICATION,R_ERROR_REF, "%s.", typeid(x).name()); } @@ -490,7 +488,7 @@ QString RModel::write(const QString &fileName, bool writeLinkFile) const } else { - if (this->getProblemTaskTree().getProblemTypeMask() & R_PROBLEM_STRESS_MODAL) + if (this->getProblemTaskTree().getProblemTypeMask() &R_PROBLEM_STRESS_MODAL) { recordNumber = this->getProblemSetup().getModalSetup().getMode() + 1; } @@ -526,7 +524,7 @@ QString RModel::write(const QString &fileName, bool writeLinkFile) const { throw RError(R_ERROR_APPLICATION,R_ERROR_REF, "Memory allocation failed."); } - catch (const std::exception& x) + catch (const std::exception&x) { throw RError(R_ERROR_APPLICATION,R_ERROR_REF, "%s.", typeid(x).name()); } @@ -943,6 +941,7 @@ void RModel::setProblemTaskTree (const RProblemTaskItem &taskTree) else { pElementGroup = nullptr; + continue; } // Check all boundary conditions @@ -950,7 +949,7 @@ void RModel::setProblemTaskTree (const RProblemTaskItem &taskTree) while (pos < pElementGroup->getNBoundaryConditions()) { conditionTypeMask = RBoundaryCondition::getProblemTypeMask(pElementGroup->getBoundaryCondition(pos).getType()); - if (!(conditionTypeMask & typeMask)) + if (!(conditionTypeMask &typeMask)) { pElementGroup->removeBoundaryCondition (pos); } @@ -965,7 +964,7 @@ void RModel::setProblemTaskTree (const RProblemTaskItem &taskTree) while (pos < pElementGroup->getNEnvironmentConditions()) { conditionTypeMask = REnvironmentCondition::getProblemTypeMask(pElementGroup->getEnvironmentCondition(pos).getType()); - if (!(conditionTypeMask & typeMask)) + if (!(conditionTypeMask &typeMask)) { pElementGroup->removeEnvironmentCondition (pos); } @@ -980,7 +979,7 @@ void RModel::setProblemTaskTree (const RProblemTaskItem &taskTree) while (pos < pElementGroup->getNInitialConditions()) { conditionTypeMask = RInitialCondition::getProblemTypeMask(pElementGroup->getInitialCondition(pos).getType()); - if (!(conditionTypeMask & typeMask)) + if (!(conditionTypeMask &typeMask)) { pElementGroup->removeInitialCondition (pos); } @@ -1019,7 +1018,7 @@ void RModel::removeAllVariables() *********************************************************************/ -uint RModel::getNNodes () const +uint RModel::getNNodes() const { return uint(this->nodes.size()); } /* RModel::getNNodes */ @@ -1046,14 +1045,14 @@ RNode * RModel::getNodePtr (uint position) } /* RModel::get_node_ptr */ -const RNode & RModel::getNode (uint position) const +const RNode &RModel::getNode (uint position) const { R_ERROR_ASSERT (position < this->nodes.size()); return this->nodes[position]; } /* RModel::getNode */ -RNode & RModel::getNode (uint position) +RNode &RModel::getNode (uint position) { R_ERROR_ASSERT (position < this->nodes.size()); return this->nodes[position]; @@ -1066,25 +1065,10 @@ const std::vector &RModel::getNodes() const } /* RModel::getNodes */ -void RModel::addNode (const RNode &node, - double value) +void RModel::addNode(const RNode &node) { this->nodes.push_back (node); - this->RResults::addNode (value); -} /* RModel::addNode */ - - -void RModel::addNode (double x, - double y, - double z, - double value) -{ - RNode node; - - node.set (x, y, z); - - this->addNode (node); - this->RResults::addNode (value); + this->RResults::addNode(0.0); } /* RModel::addNode */ @@ -1096,30 +1080,16 @@ void RModel::setNode (uint position, } /* RModel::set_node */ -void RModel::removeNode (uint position, - std::vector * removedElements, - std::vector * removedPoints, - std::vector * removedLines, - std::vector * removedSurfaces, - std::vector * removedVolumes) +void RModel::removeNode(uint position) { R_ERROR_ASSERT (position < this->nodes.size()); // Loop over all elements and remove each containing the node std::vector eps = this->findElementPositionsByNodeId(position); - if (removedElements) - { - (*removedElements) = eps; - } for (std::vector::reverse_iterator rIterEps = eps.rbegin(); rIterEps != eps.rend(); ++rIterEps) { - this->removeElement (*rIterEps, - true, - removedPoints, - removedLines, - removedSurfaces, - removedVolumes); + this->removeElement(*rIterEps, true); } // Remove node from nodes vector @@ -1365,15 +1335,15 @@ double RModel::findNodeScale() const double dy = ymax - ymin; double dz = zmax - zmin; - if (dx >= dy && dx >= dz && dx != 0.0) + if (dx >= dy &&dx >= dz &&dx != 0.0) { return 1.0/dx; } - if (dy >= dx && dy >= dz && dy != 0.0) + if (dy >= dx &&dy >= dz &&dy != 0.0) { return 1.0/dy; } - if (dz >= dx && dz >= dy && dz != 0.0) + if (dz >= dx &&dz >= dy &&dz != 0.0) { return 1.0/dz; } @@ -1582,14 +1552,14 @@ RElement * RModel::getElementPtr (uint position) } /* RModel::getElementPtr */ -const RElement & RModel::getElement (uint position) const +const RElement &RModel::getElement (uint position) const { R_ERROR_ASSERT (position < this->elements.size()); return this->elements[position]; } /* RModel::getElement */ -RElement & RModel::getElement (uint position) +RElement &RModel::getElement (uint position) { R_ERROR_ASSERT (position < this->elements.size()); return this->elements[position]; @@ -1741,12 +1711,7 @@ void RModel::setElement (uint position, } /* RModel::setElement */ -void RModel::removeElement (uint position, - bool removeGroups, - std::vector * removedPoints, - std::vector * removedLines, - std::vector * removedSurfaces, - std::vector * removedVolumes) +void RModel::removeElement(uint position, bool removeGroups) { R_ERROR_ASSERT (position < this->elements.size()); @@ -1768,12 +1733,7 @@ void RModel::removeElement (uint position, if (rIter->empty()) { // Remove empty element group - if (removedPoints) - { - uint gPosition = uint(std::distance(this->points.begin(),(rIter+1).base())); - removedPoints->push_back(gPosition); - } - this->points.erase ((rIter+1).base()); + this->points.erase((rIter+1).base()); } else { @@ -1802,11 +1762,6 @@ void RModel::removeElement (uint position, if (rIter->empty()) { // Remove empty element group - if (removedLines) - { - uint gPosition = uint(std::distance(this->lines.begin(),(rIter+1).base())); - removedLines->push_back(gPosition); - } this->lines.erase((rIter+1).base()); } else @@ -1836,11 +1791,6 @@ void RModel::removeElement (uint position, if (rIter->empty()) { // Remove empty element group - if (removedSurfaces) - { - uint gPosition = uint(std::distance(this->surfaces.begin(),(rIter+1).base())); - removedSurfaces->push_back(gPosition); - } this->surfaces.erase((rIter+1).base()); } else @@ -1870,11 +1820,6 @@ void RModel::removeElement (uint position, if (rIter->empty()) { // Remove empty element group - if (removedVolumes) - { - uint gPosition = uint(std::distance(this->volumes.begin(),(rIter+1).base())); - removedVolumes->push_back(gPosition); - } this->volumes.erase((rIter+1).base()); } else @@ -1899,7 +1844,7 @@ void RModel::removeElement (uint position, { uint nodeID = this->getElement(position).getNodeId(i); bool nodeIsUsed = false; - for (uint j=0;jgetNElements() && !nodeIsUsed;j++) + for (uint j=0;jgetNElements() &&!nodeIsUsed;j++) { if (j == position) { @@ -2223,28 +2168,28 @@ uint RModel::getNEntityElements(REntityGroupType entityType) const { uint nElements = 0; - if (R_ENTITY_GROUP_POINT & entityType) + if (R_ENTITY_GROUP_POINT &entityType) { for (uint i=0;igetNPoints();i++) { nElements += this->getPoint(i).size(); } } - if (R_ENTITY_GROUP_LINE & entityType) + if (R_ENTITY_GROUP_LINE &entityType) { for (uint i=0;igetNLines();i++) { nElements += this->getLine(i).size(); } } - if (R_ENTITY_GROUP_SURFACE & entityType) + if (R_ENTITY_GROUP_SURFACE &entityType) { for (uint i=0;igetNSurfaces();i++) { nElements += this->getSurface(i).size(); } } - if (R_ENTITY_GROUP_VOLUME & entityType) + if (R_ENTITY_GROUP_VOLUME &entityType) { for (uint i=0;igetNVolumes();i++) { @@ -3150,7 +3095,7 @@ void RModel::removeEntities(REntityGroupType entityType, const QList &enti *********************************************************************/ -uint RModel::getNPoints () const +uint RModel::getNPoints() const { return uint(this->points.size()); } /* RModel::getNPoints */ @@ -3185,14 +3130,14 @@ RPoint * RModel::getPointPtr (uint position) } /* RModel::getPointPtr */ -const RPoint & RModel::getPoint (uint position) const +const RPoint &RModel::getPoint (uint position) const { R_ERROR_ASSERT (position < this->points.size()); return this->points[position]; } /* RModel::getPoint */ -RPoint & RModel::getPoint (uint position) +RPoint &RModel::getPoint (uint position) { R_ERROR_ASSERT (position < this->points.size()); return this->points[position]; @@ -3234,7 +3179,7 @@ void RModel::removePoint (uint position) *********************************************************************/ -uint RModel::getNLines () const +uint RModel::getNLines() const { return uint(this->lines.size()); } /* RModel::getNLines */ @@ -3269,14 +3214,14 @@ RLine * RModel::getLinePtr (uint position) } /* RModel::getLinePtr */ -const RLine & RModel::getLine (uint position) const +const RLine &RModel::getLine (uint position) const { R_ERROR_ASSERT (position < this->lines.size()); return this->lines[position]; } /* RModel::getLine */ -RLine & RModel::getLine (uint position) +RLine &RModel::getLine (uint position) { R_ERROR_ASSERT (position < this->lines.size()); return this->lines[position]; @@ -3318,7 +3263,7 @@ void RModel::removeLine (uint position) *********************************************************************/ -uint RModel::getNSurfaces () const +uint RModel::getNSurfaces() const { return uint(this->surfaces.size()); } /* RModel::getNSurfaces */ @@ -3353,14 +3298,14 @@ RSurface * RModel::getSurfacePtr (uint position) } /* RModel::getSurfacePtr */ -const RSurface & RModel::getSurface (uint position) const +const RSurface &RModel::getSurface (uint position) const { R_ERROR_ASSERT (position < this->surfaces.size()); return this->surfaces[position]; } /* RModel::getSurface */ -RSurface & RModel::getSurface (uint position) +RSurface &RModel::getSurface (uint position) { R_ERROR_ASSERT (position < this->surfaces.size()); return this->surfaces[position]; @@ -3483,7 +3428,7 @@ void RModel::syncSurfaceNormals() for (uint k=0;ksurfaceNeigs[elementID].size();k++) { uint neighbourID = surfaceNeigs[elementID][k]; - if (elementSurface[neighbourID] && !elementChecked[neighbourID]) + if (elementSurface[neighbourID] &&!elementChecked[neighbourID]) { // Check neighbor orientation. if (!this->getElement(elementID).isNeighborNormalSync(this->getElement(neighbourID))) @@ -3514,7 +3459,7 @@ void RModel::syncSurfaceNormals() *********************************************************************/ -uint RModel::getNVolumes () const +uint RModel::getNVolumes() const { return uint(this->volumes.size()); } /* RModel::getNVolumes */ @@ -3549,14 +3494,14 @@ RVolume * RModel::getVolumePtr (uint position) } /* RModel::getVolumePtr */ -const RVolume & RModel::getVolume (uint position) const +const RVolume &RModel::getVolume (uint position) const { R_ERROR_ASSERT (position < this->volumes.size()); return this->volumes[position]; } /* RModel::getVolume */ -RVolume & RModel::getVolume (uint position) +RVolume &RModel::getVolume (uint position) { R_ERROR_ASSERT (position < this->volumes.size()); return this->volumes[position]; @@ -4228,7 +4173,7 @@ RRVector RModel::getInterpolatedResultsValues(RVariableType variableType, const for (uint i=0;igetNElements();i++) { const RElement &rElement = this->getElement(i); - if (RElementGroup::getGroupType(rElement.getType()) & entityGroup) + if (RElementGroup::getGroupType(rElement.getType()) &entityGroup) { if (rElement.isInside(this->getNodes(),rNode,volumes)) { @@ -4676,7 +4621,7 @@ QList RModel::sortLineElements(const QList &edges, uint firstID) { item.n2 = uint(j); } - if (item.n1 != RConstants::eod && item.n2 != RConstants::eod) + if (item.n1 != RConstants::eod &&item.n2 != RConstants::eod) { break; } @@ -4715,7 +4660,7 @@ QList RModel::sortLineElements(const QList &edges, uint firstID) } if (elementIDs.last() == elementIDs.first()) { - elementIDs.erase(elementIDs.end()-1); + elementIDs.erase(elementIDs.constEnd()-1); } return elementIDs; @@ -4897,7 +4842,7 @@ void RModel::createStreamLine(RStreamLine &rStreamLine) const { const RElement &rElement = this->getElement(uint(i)); - if (R_ELEMENT_TYPE_IS_POINT(rElement.getType()) && pointElementID == RConstants::eod) + if (R_ELEMENT_TYPE_IS_POINT(rElement.getType()) &&pointElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { @@ -4907,7 +4852,7 @@ void RModel::createStreamLine(RStreamLine &rStreamLine) const } } } - if (R_ELEMENT_TYPE_IS_LINE(rElement.getType()) && lineElementID == RConstants::eod) + if (R_ELEMENT_TYPE_IS_LINE(rElement.getType()) &&lineElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { @@ -4917,7 +4862,7 @@ void RModel::createStreamLine(RStreamLine &rStreamLine) const } } } - if (R_ELEMENT_TYPE_IS_SURFACE(rElement.getType()) && surfaceElementID == RConstants::eod) + if (R_ELEMENT_TYPE_IS_SURFACE(rElement.getType()) &&surfaceElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { @@ -4927,7 +4872,7 @@ void RModel::createStreamLine(RStreamLine &rStreamLine) const } } } - if (R_ELEMENT_TYPE_IS_VOLUME(rElement.getType()) && volumeElementID == RConstants::eod) + if (R_ELEMENT_TYPE_IS_VOLUME(rElement.getType()) &&volumeElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { @@ -4985,7 +4930,7 @@ void RModel::createStreamLine(RStreamLine &rStreamLine) const std::vector nodeValues; nodeValues.resize(rElement.size(),0); - for (uint i=0;i RModel::findIntersectedElements() const RLimitBox limitBox2; bool bothIntersected = false; #pragma omp critical - bothIntersected = (intElements[int(i)] && intElements[int(j)]); + bothIntersected = (intElements[int(i)] &&intElements[int(j)]); if (bothIntersected) { continue; @@ -5658,7 +5603,7 @@ uint RModel::breakIntersectedElements(uint nIterations, const std::vector std::set::const_iterator iter; for (iter=intersectionPoints[i].begin();iter!=intersectionPoints[i].end();++iter) { - this->addNode((*iter)[0],(*iter)[1],(*iter)[2]); + this->addNode(RNode((*iter)[0],(*iter)[1],(*iter)[2])); breakNodeIDs.push_back(this->getNNodes() - 1); } @@ -6329,7 +6274,7 @@ QString RModel::generateMeshTetGenInputParams(const RMeshInput &meshInput) const { parameters += "e"; } - if (meshInput.getReconstruct() && this->getNVolumes() > 0) + if (meshInput.getReconstruct() &&this->getNVolumes() > 0) { parameters += "r"; } @@ -6369,7 +6314,7 @@ void RModel::generatePatchSurface(const std::vector &patchInput, RP { continue; } - if (!patchInput[surfaceID].getEmitter() && !patchInput[surfaceID].getReceiver()) + if (!patchInput[surfaceID].getEmitter() &&!patchInput[surfaceID].getReceiver()) { continue; } @@ -6545,7 +6490,7 @@ void RModel::findPatchNormal(const RPatch &rPatch, double &nx, double &ny, doubl } /* RModel::findPatchNormal */ -void RModel::findPatchArea(const RPatch &rPatch, double area) const +void RModel::findPatchArea(const RPatch &rPatch, double &area) const { const RUVector &rElementIDs = rPatch.getElementIDs(); @@ -6603,7 +6548,7 @@ RBoundaryCondition RModel::generateDefaultBoundayCondition(RBoundaryConditionTyp { RBoundaryCondition bc(type); - if (type == R_BOUNDARY_CONDITION_RADIATION && entityGroupType == R_ENTITY_GROUP_SURFACE) + if (type == R_BOUNDARY_CONDITION_RADIATION &&entityGroupType == R_ENTITY_GROUP_SURFACE) { uint cPos; @@ -8346,7 +8291,7 @@ void RModel::generateElementDistanceVector(uint startElementID, uint maximumDist } } } - if (popPrevious && elementStack.size() > 0) + if (popPrevious &&elementStack.size() > 0) { elementID = elementStack.top(); distance = distanceVector[elementID]; diff --git a/range/RangeModel/src/rml_problem.cpp b/range/RangeModel/src/rml_problem.cpp index 0cbef36e..9ee954e6 100644 --- a/range/RangeModel/src/rml_problem.cpp +++ b/range/RangeModel/src/rml_problem.cpp @@ -159,7 +159,7 @@ RProblem::RProblem() } /* RProblem::RProblem */ -RProblem::RProblem(const RProblem & problem) +RProblem::RProblem(const RProblem &problem) { this->_init(&problem); } /* RProblem::RProblem (copy) */ @@ -185,13 +185,13 @@ void RProblem::_init(const RProblem *pProblem) } /* RProblem::_init */ -const RProblemTaskItem &RProblem::getProblemTaskTree(void) const +const RProblemTaskItem &RProblem::getProblemTaskTree() const { return this->taskTree; } /* RProblem::getProblemTaskTree */ -RProblemTaskItem &RProblem::getProblemTaskTree(void) +RProblemTaskItem &RProblem::getProblemTaskTree() { return this->taskTree; } /* RProblem::getProblemTaskTree */ @@ -203,13 +203,13 @@ void RProblem::setProblemTaskTree(const RProblemTaskItem &taskTree) } /* RProblem::setProblemTaskTree */ -const RTimeSolver &RProblem::getTimeSolver(void) const +const RTimeSolver &RProblem::getTimeSolver() const { return this->timeSolver; } /* RProblem::getTimeSolver */ -RTimeSolver &RProblem::getTimeSolver(void) +RTimeSolver &RProblem::getTimeSolver() { return this->timeSolver; } /* RProblem::getTimeSolver */ @@ -242,13 +242,13 @@ RMatrixSolverConf &RProblem::getMatrixSolverConf(RMatrixSolverType matrixSolverT } /* RProblem::getMatrixSolver */ -const RMonitoringPointManager &RProblem::getMonitoringPointManager(void) const +const RMonitoringPointManager &RProblem::getMonitoringPointManager() const { return this->monitoringPointManager; } /* RProblem::getMonitoringPointManager */ -RMonitoringPointManager &RProblem::getMonitoringPointManager(void) +RMonitoringPointManager &RProblem::getMonitoringPointManager() { return this->monitoringPointManager; } /* RProblem::getMonitoringPointManager */ @@ -260,13 +260,13 @@ void RProblem::setMonitoringPointManager(const RMonitoringPointManager &monitori } /* RProblem::setMonitoringPointManager */ -const RProblemSetup &RProblem::getProblemSetup(void) const +const RProblemSetup &RProblem::getProblemSetup() const { return this->problemSetup; } /* RProblem::getProblemSetup */ -RProblemSetup &RProblem::getProblemSetup(void) +RProblemSetup &RProblem::getProblemSetup() { return this->problemSetup; } /* RProblem::getProblemSetup */ @@ -278,7 +278,7 @@ void RProblem::setProblemSetup(const RProblemSetup &problemSetup) } /* RProblem::setProblemSetup */ -RProblem & RProblem::operator = (const RProblem & problem) +RProblem &RProblem::operator = (const RProblem &problem) { this->_init(&problem); return (*this); @@ -371,7 +371,7 @@ bool RProblem::getTimeSolverEnabled(RProblemTypeMask typeMask) while (problemDesc[i].type != R_PROBLEM_NONE) { - if (problemDesc[i].type & typeMask && problemDesc[i].type != R_PROBLEM_MESH) + if (problemDesc[i].type &typeMask &&problemDesc[i].type != R_PROBLEM_MESH) { if (!problemDesc[i].timeSolverEnabled) { @@ -390,7 +390,7 @@ RProblemTypeMask RProblem::getRequiredProblemTypeMask(RProblemTypeMask typeMask) unsigned int i = 0; while (problemDesc[i].type != R_PROBLEM_NONE) { - if (problemDesc[i].type & typeMask) + if (problemDesc[i].type &typeMask) { reqTypeMask |= problemDesc[i].requiredProblemTypeMask; } @@ -406,7 +406,7 @@ RProblemTypeMask RProblem::getExcludedProblemTypeMask(RProblemTypeMask typeMask) unsigned int i = 0; while (problemDesc[i].type != R_PROBLEM_NONE) { - if (problemDesc[i].type & typeMask) + if (problemDesc[i].type &typeMask) { excTypeMask |= problemDesc[i].excludedProblemTypeMask; } @@ -424,7 +424,7 @@ std::vector RProblem::getTypes(RProblemTypeMask typeMask) unsigned int i = 0; while (problemDesc[i].type != R_PROBLEM_NONE) { - if (problemDesc[i].type & typeMask) + if (problemDesc[i].type &typeMask) { types.push_back (problemDesc[i].type); } @@ -445,7 +445,7 @@ std::vector RProblem::getVariableTypes(RProblemTypeMask typeMask) RProblemTypeMask variableProblemTypeMask = RVariable::getResultsProblemTypeMask(RVariableType(i)); for (unsigned int j=0;j &problemTypes) RProblemTypeMask requiredProblemTypes = RProblem::getRequiredProblemTypeMask(problemTypes[i]); for (uint j=i+1;j_init (); + this->_init(); } /* RResults::RResults */ RResults::RResults (const RResults &results) @@ -44,19 +44,19 @@ RResults::RResults (const RResults &results) } /* RResults::RResults (copy) */ -RResults::~RResults () +RResults::~RResults() { } /* RResults::~RResults */ -RResults & RResults::operator = (const RResults &results) +RResults &RResults::operator = (const RResults &results) { this->_init (&results); return (*this); } /* RResults::operator = */ -void RResults::clearResults(void) +void RResults::clearResults() { for (unsigned int i=0;ivariables.size();i++) { @@ -66,7 +66,7 @@ void RResults::clearResults(void) } /* RResults::clearResults */ -//double RResults::getCompTime(void) const +//double RResults::getCompTime() const //{ // return this->compTime; //} /* RResults::getCompTime */ @@ -78,7 +78,7 @@ void RResults::clearResults(void) //} /* RResults::setCompTime */ -unsigned int RResults::getNVariables (void) const +unsigned int RResults::getNVariables() const { return uint(this->variables.size()); } /* RResults::getNVariables */ @@ -90,14 +90,14 @@ void RResults::setNVariables (unsigned int nvariables) } /* RResults::set_n_variables */ -const RVariable & RResults::getVariable (unsigned int position) const +const RVariable &RResults::getVariable (unsigned int position) const { R_ERROR_ASSERT (position < this->getNVariables()); return this->variables[position]; } /* RResults::getVariable */ -RVariable & RResults::getVariable (unsigned int position) +RVariable &RResults::getVariable (unsigned int position) { R_ERROR_ASSERT (position < this->getNVariables()); return this->variables[position]; @@ -166,13 +166,13 @@ void RResults::removeVariable(uint position) } /* RResults::removeVariable */ -void RResults::removeAllVariables(void) +void RResults::removeAllVariables() { this->variables.clear(); } /* RResults::removeAllVariables */ -unsigned int RResults::getNNodes (void) const +unsigned int RResults::getNNodes() const { return this->nnodes; } /* RResults::getNNodes */ @@ -234,7 +234,7 @@ void RResults::removeNode (unsigned int position) } /* RResults::removeNode */ -unsigned int RResults::getNElements (void) const +unsigned int RResults::getNElements() const { return this->nelements; } /* RResults::getNElements */ diff --git a/range/range.pri b/range/range.pri index 9c1c6aa6..7521b42e 100644 --- a/range/range.pri +++ b/range/range.pri @@ -30,3 +30,6 @@ CONFIG(debug, debug|release) { DEFINES += DEBUG DEBUG_EXT = "_debug" } + +#QMAKE_MACOSX_DEPLOYMENT_TARGET = 12.0 +#QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 diff --git a/scripts/create_mac_app.sh b/scripts/create_mac_app.sh index d175bac4..c2add023 100755 --- a/scripts/create_mac_app.sh +++ b/scripts/create_mac_app.sh @@ -1,7 +1,7 @@ #!/bin/bash #-------------------------------------------------------------------------- -# Script to generate RPM spec file +# Script to generate MacOS app #-------------------------------------------------------------------------- # Configuration section - Begin ------------------------------------------- @@ -45,7 +45,7 @@ license='Commercial' group='Application/Engineering' desc='Range Software Package.\nSoftware for engineering simulations.\nFinite Element Analysis.' -installToDir=$HOME/bin +appleDevId= debug=false # Configuration section - End --------------------------------------------- @@ -62,9 +62,7 @@ cat < Date: Wed, 12 Oct 2022 20:22:13 +0200 Subject: [PATCH 02/11] Fixed glitches when zooming using mouse wheel --- range/Range/doc/RELEASE_NOTES.txt | 2 ++ range/Range/src/gl_widget.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index 196d97fe..758f153b 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -5,6 +5,8 @@ Version 3.2.8 Bug fixes: +* Fixed glitches when zooming using mouse wheel + ------------------------------------------------------------------ Version 3.2.7 diff --git a/range/Range/src/gl_widget.cpp b/range/Range/src/gl_widget.cpp index bb169d66..335f5bbb 100644 --- a/range/Range/src/gl_widget.cpp +++ b/range/Range/src/gl_widget.cpp @@ -874,7 +874,7 @@ void GLWidget::applyTransformations(void) glRotatef(this->dry, 0.0f, 1.0f, 0.0f); } - if (this->dscale != 0.0f && this->dscale != 1.0f) + if (this->dscale != 0.0f && this->dscale != -1.0f) { this->scale *= 1.0f+this->dscale; if (this->scale < 1e4f) @@ -1092,9 +1092,11 @@ void GLWidget::wheelEvent(QWheelEvent *mouseEvent) this->dtx = 2.0f*x/w - 1.0f; this->dty = 2.0f*y/h - 1.0f; this->dty = (0.5f - y/h)*2.0f*h/w; - this->dtx *= numSteps.y()/(10.0f*scaleFactor); - this->dty *= numSteps.y()/(10.0f*scaleFactor); - this->dscale = -float(numSteps.y())/(10.0f*scaleFactor); +// float zoomScale = float(numSteps.y())/(10.0f*scaleFactor); + float zoomScale = float(numSteps.y())/float(this->height()); + this->dtx *= zoomScale; + this->dty *= zoomScale; + this->dscale = -zoomScale; } this->actionEvent.setScrollPhase(Qt::NoScrollPhase); From 6b7f3844f3bc63ce1878bccc1b9e6d8ca831abea Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Fri, 28 Oct 2022 10:00:30 +0200 Subject: [PATCH 03/11] Faster intersection detection --- range/Range/doc/RELEASE_NOTES.txt | 1 + range/Range/src/model.cpp | 16 +- range/Range/src/progress.cpp | 5 +- range/RangeBase/include/rbl_limit_box.h | 2 - range/RangeModel/include/rml_element.h | 14 +- range/RangeModel/include/rml_segment.h | 4 +- range/RangeModel/include/rml_triangle.h | 16 +- range/RangeModel/src/rml_element.cpp | 204 +++++++++++++++--------- range/RangeModel/src/rml_model.cpp | 115 ++++++------- range/RangeModel/src/rml_segment.cpp | 26 +-- range/RangeModel/src/rml_triangle.cpp | 67 ++++---- range/RangeSolverLib/src/rhemicube.cpp | 2 +- range/range.pri | 2 +- scripts/build.sh | 4 +- 14 files changed, 272 insertions(+), 206 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index 758f153b..4f896c66 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -2,6 +2,7 @@ Version 3.2.8 * ALL: Resolved build warnings +* ALL: Optimised detection of self-intersecting elements Bug fixes: diff --git a/range/Range/src/model.cpp b/range/Range/src/model.cpp index a09f2598..4fd24975 100644 --- a/range/Range/src/model.cpp +++ b/range/Range/src/model.cpp @@ -2533,9 +2533,9 @@ bool Model::findPickedElement(const RR3Vector &position, const RR3Vector &direct double distance; if (rElement.findPickDistance(dispNodes,position,direction,tolerance,distance)) { -#pragma omp critical + if (!found || minDistance > distance) { - if (!found || minDistance > distance) +#pragma omp critical { minDistance = distance; pickItem = PickItem(SessionEntityID(0,entityType,entityID),elementID,uint(j)); @@ -2569,9 +2569,9 @@ bool Model::findPickedElement(const RR3Vector &position, const RR3Vector &direct double distance; if (iElement.findPickDistance(position,direction,tolerance,distance)) { -#pragma omp critical + if (!found || minDistance > distance) { - if (!found || minDistance > distance) +#pragma omp critical { minDistance = distance; pickItem = PickItem(SessionEntityID(0,entityType,entityID),uint(j),uint(j)); @@ -2652,9 +2652,9 @@ bool Model::findPickedNode(const RR3Vector &position, const RR3Vector &direction if (u <= tolerance) { double distance = node.getDistance(RNode(position)); -#pragma omp critical + if (!found || minDistance > distance) { - if (!found || minDistance > distance) +#pragma omp critical { minDistance = distance; pickItem = PickItem(SessionEntityID(0,entityType,entityID),elementID,uint(j),nodeID,k); @@ -2692,9 +2692,9 @@ bool Model::findPickedNode(const RR3Vector &position, const RR3Vector &direction if (u <= tolerance) { double distance = iElement[k].getDistance(RNode(position)); -#pragma omp critical + if (!found || minDistance > distance) { - if (!found || minDistance > distance) +#pragma omp critical { minDistance = distance; pickItem = PickItem(SessionEntityID(0,entityType,entityID),uint(j),uint(j),k,k); diff --git a/range/Range/src/progress.cpp b/range/Range/src/progress.cpp index cd133926..db181ae6 100644 --- a/range/Range/src/progress.cpp +++ b/range/Range/src/progress.cpp @@ -54,9 +54,10 @@ void Progress::emitProgressFinalize(const QString &message) static void progressPrintHandler (double fraction) { static double lastValue = 0.0; - if (qAbs(qFloor(fraction*100) - lastValue) >= 1) + double newValue = qFloor(fraction*100); + if (qAbs(newValue - lastValue) >= 1) { - lastValue = qFloor(fraction*100); + lastValue = newValue; Progress::getInstance().print(fraction); } } diff --git a/range/RangeBase/include/rbl_limit_box.h b/range/RangeBase/include/rbl_limit_box.h index 7d1c29ed..5f63d7c8 100644 --- a/range/RangeBase/include/rbl_limit_box.h +++ b/range/RangeBase/include/rbl_limit_box.h @@ -11,8 +11,6 @@ #ifndef RBL_BOX_H #define RBL_BOX_H -#include "rbl_r3vector.h" - class RLimitBox { diff --git a/range/RangeModel/include/rml_element.h b/range/RangeModel/include/rml_element.h index 03a4a956..24490aa2 100644 --- a/range/RangeModel/include/rml_element.h +++ b/range/RangeModel/include/rml_element.h @@ -243,11 +243,19 @@ class RElement //! Find line segments. //! For line element this function will return list of segments which represent line of element. - std::vector segmentize ( const std::vector &nodes ) const; + void segmentize(const std::vector &nodes, QList segments) const; + + //! Find line segments. + //! For line element this function will return list of segments which represent line of element. + QList segmentize(const std::vector &nodes) const; + + //! Find surface and volume triangles. + //! For surface element this function will return list of triangles which represent surface of element. + void triangulate(const std::vector &nodes, QList &triangles) const; //! Find surface and volume triangles. //! For surface element this function will return list of triangles which represent surface of element. - std::vector triangulate ( const std::vector &nodes ) const; + QList triangulate(const std::vector &nodes) const; //! Return number of edge elements. uint getNEdgeElements(void) const; @@ -346,7 +354,7 @@ class RElement static bool hasConstantDerivative ( RElementType type ); //! Find intersection points between two elements. - static bool findIntersectionPoints(const RElement &e1, const RElement &e2, const std::vector &nodes, std::set &x); + static bool findIntersectionPoints(const RElement &e1, const RElement &e2, const std::vector &nodes, QList &x, bool testOnly = false); private: diff --git a/range/RangeModel/include/rml_segment.h b/range/RangeModel/include/rml_segment.h index 995f5b47..6d065fe6 100644 --- a/range/RangeModel/include/rml_segment.h +++ b/range/RangeModel/include/rml_segment.h @@ -78,11 +78,11 @@ class RSegment //! Find segment node intersection points. //! Return true if intersection was found. - bool findPointIntersection ( const RNode &node, std::set &x) const; + bool findPointIntersection ( const RNode &node, QList &x) const; //! Find segment segment intersection points. //! Return true if intersection was found. - bool findSegmentIntersection ( const RSegment &segment, std::set &x) const; + bool findSegmentIntersection (const RSegment &segment, QList &x, bool testOnly=false) const; //! Find segment segment intersection point. //! Return true if intersection was found. diff --git a/range/RangeModel/include/rml_triangle.h b/range/RangeModel/include/rml_triangle.h index 65fdf81a..10b80275 100644 --- a/range/RangeModel/include/rml_triangle.h +++ b/range/RangeModel/include/rml_triangle.h @@ -78,19 +78,19 @@ class RTriangle //! Find triangle node intersection points. //! Return true if intersection was found. - bool findPointIntersection ( const RNode &node, RR3Vector &x ) const; + bool findPointIntersection(const RNode &node, RR3Vector &x) const; //! Find triangle node intersection points. //! Return true if intersection was found. - bool findPointIntersection ( const RNode &node, std::set &x ) const; + bool findPointIntersection(const RNode &node, QList &x) const; //! Find triangle segment intersection points. //! Return true if intersection was found. - bool findSegmentIntersection ( const RSegment &segment, std::set &x ) const; + bool findSegmentIntersection(const RSegment &segment, QList &x, bool testOnly=false) const; //! Find triangle triangle intersection points. //! Return true if intersection was found. - bool findTriangleIntersection ( const RTriangle &triangle, std::set &x ) const; + bool findTriangleIntersection(const RTriangle &triangle, QList &x, bool testOnly = false) const; //! Return true if point is inside the triangle. bool isPointInside ( const RR3Vector &point, bool includeNodes = true ) const; @@ -188,16 +188,16 @@ class RTriangle void computeNormal (void); //! Find parallel segment triangle intersection points. - bool findParallelSegmentIntersection ( const RSegment &segment, std::set &x ) const; + bool findParallelSegmentIntersection (const RSegment &segment, QList &x ) const; //! Find skewed segment triangle intersection points. - bool findSkewedSegmentIntersection ( const RSegment &segment, std::set &x ) const; + bool findSkewedSegmentIntersection ( const RSegment &segment, QList &x ) const; //! Find parallel triangle triangle intersection points. - bool findParallelTriangleIntersection ( const RTriangle &triangle, std::set &x ) const; + bool findParallelTriangleIntersection ( const RTriangle &triangle, QList &x ) const; //! Find skewed triangle triangle intersection points. - bool findSkewedTriangleIntersection ( const RTriangle &triangle, std::set &x ) const; + bool findSkewedTriangleIntersection ( const RTriangle &triangle, QList &x ) const; }; diff --git a/range/RangeModel/src/rml_element.cpp b/range/RangeModel/src/rml_element.cpp index ad9a97f1..4dfe8d58 100644 --- a/range/RangeModel/src/rml_element.cpp +++ b/range/RangeModel/src/rml_element.cpp @@ -648,7 +648,7 @@ bool RElement::findPickDistance(const std::vector &nodes, } else if (R_ELEMENT_TYPE_IS_LINE(this->type)) { - std::vector segments = this->segmentize(nodes); + QList segments = this->segmentize(nodes); double d; bool found = false; for (uint i=0;i &nodes, } else if (R_ELEMENT_TYPE_IS_SURFACE(this->type)) { - std::vector triangles = this->triangulate(nodes); + QList triangles = this->triangulate(nodes); for (uint i=0;i &nodes, return RConstants::eod; } /* RElement::findIntersectedSide */ -std::vector RElement::segmentize(const std::vector &nodes) const -{ - std::vector segments; +void RElement::segmentize(const std::vector &nodes, QList segments) const +{ switch (this->type) { case R_ELEMENT_BEAM1: case R_ELEMENT_TRUSS1: + segments.reserve(1); segments.push_back(RSegment(nodes[this->nodeIDs[0]],nodes[this->nodeIDs[1]])); break; case R_ELEMENT_BEAM2: @@ -1423,14 +1423,19 @@ std::vector RElement::segmentize(const std::vector &nodes) cons default: break; } +} /* RElement::segmentize */ + +QList RElement::segmentize(const std::vector &nodes) const +{ + QList segments; + this->segmentize(nodes,segments); return segments; } /* RElement::segmentize */ -std::vector RElement::triangulate(const std::vector &nodes) const -{ - std::vector triangles; +void RElement::triangulate(const std::vector &nodes, QList &triangles) const +{ switch (this->type) { case R_ELEMENT_TRI1: @@ -1438,6 +1443,7 @@ std::vector RElement::triangulate(const std::vector &nodes) co { RTriangle t1(RTriangle(nodes[this->nodeIDs[0]],nodes[this->nodeIDs[1]],nodes[this->nodeIDs[2]])); t1.setNodeIDs(this->nodeIDs[0],this->nodeIDs[1],this->nodeIDs[2]); + triangles.reserve(1); triangles.push_back(t1); break; } @@ -1458,7 +1464,13 @@ std::vector RElement::triangulate(const std::vector &nodes) co break; } } +} /* RElement::triangulate */ + +QList RElement::triangulate(const std::vector &nodes) const +{ + QList triangles; + this->triangulate(nodes,triangles); return triangles; } /* RElement::triangulate */ @@ -2502,14 +2514,14 @@ bool RElement::hasConstantDerivative(RElementType type) } /* RElement::getMassVector */ -bool RElement::findIntersectionPoints(const RElement &e1, const RElement &e2, const std::vector &nodes, std::set &x) +bool RElement::findIntersectionPoints(const RElement &e1, const RElement &e2, const std::vector &nodes, QList &x, bool testOnly) { std::vector p1; std::vector p2; - std::vector s1; - std::vector s2; - std::vector t1; - std::vector t2; + QList s1; + QList s2; + QList t1; + QList t2; double nodeScale = 1.0; @@ -2548,8 +2560,8 @@ bool RElement::findIntersectionPoints(const RElement &e1, const RElement &e2, co zmax = std::max(nodes[e2.getNodeId(i)].getZ(),zmax); } - - nodeScale = std::sqrt(std::pow(xmax - xmin,2) + std::pow(ymax - ymin,2) + std::pow(zmax - zmin,2)); + nodeScale = std::min(std::min(std::abs(xmax - xmin),std::abs(ymax - ymin)),std::abs(zmax - zmin)); +// nodeScale = std::sqrt(std::pow(xmax - xmin,2) + std::pow(ymax - ymin,2) + std::pow(zmax - zmin,2)); if (nodeScale <= RConstants::eps) { nodeScale = 1.0; @@ -2564,148 +2576,192 @@ bool RElement::findIntersectionPoints(const RElement &e1, const RElement &e2, co p1.push_back(nodes[e1.getNodeId(0)]); p1.at(0).scale(nodeScale); } - if (R_ELEMENT_TYPE_IS_POINT(e2.getType())) - { - p2.push_back(nodes[e2.getNodeId(0)]); - p2.at(0).scale(nodeScale); - } - if (R_ELEMENT_TYPE_IS_LINE(e1.getType())) + else if (R_ELEMENT_TYPE_IS_LINE(e1.getType())) { s1 = e1.segmentize(nodes); for (uint i=0;i xTmp; + QList xTmp; // Segment-point intersection - for (uint i=0;i 0 && p2.size() > 0) { - for (uint j=0;j 0 && p1.size() > 0) { - for (uint j=0;j 0 && s2.size() > 0) { - for (uint j=0;j 0 && p2.size() > 0) { - for (uint j=0;j 0 && p1.size() > 0) { - for (uint j=0;j 0 && s2.size() > 0) { - for (uint j=0;j 0 && s1.size() > 0) { - for (uint j=0;j 0 && t2.size() > 0) { - for (uint j=0;jgetNodes(),startNode)) { -#pragma omp critical - { - pointElementID = uint(i); - } + pointElementID = uint(i); } } if (R_ELEMENT_TYPE_IS_LINE(rElement.getType()) &&lineElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { -#pragma omp critical - { - lineElementID = uint(i); - } + lineElementID = uint(i); } } if (R_ELEMENT_TYPE_IS_SURFACE(rElement.getType()) &&surfaceElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { -#pragma omp critical - { - surfaceElementID = uint(i); - } + surfaceElementID = uint(i); } } if (R_ELEMENT_TYPE_IS_VOLUME(rElement.getType()) &&volumeElementID == RConstants::eod) { if (rElement.isInside(this->getNodes(),startNode)) { -#pragma omp critical - { - volumeElementID = uint(i); - } + volumeElementID = uint(i); } } } @@ -5353,37 +5341,37 @@ QList RModel::findIntersectedElements() const intElements.resize(int(this->getNElements())); intElements.fill(false); - RLimitBox limitBox1; - - RProgressInitialize("Finding intersected elements"); + QVector limitBoxes(this->getNElements()); for (uint i=0;igetNElements();i++) { - RProgressPrint(i,this->getNElements()); - this->getElement(i).findLimitBox(this->getNodes(),limitBox1); + this->getElement(i).findLimitBox(this->getNodes(),limitBoxes[i]); + } + RProgressInitialize("Finding intersected elements"); + uint n_total = std::pow(this->getNElements(),2)/2; + uint n_count = 0; #pragma omp parallel for default(shared) - for (int64_t j=int64_t(i)+1;jgetNElements());j++) - { - RLimitBox limitBox2; - bool bothIntersected = false; + for (int64_t i=0;igetNElements());i++) + { #pragma omp critical - bothIntersected = (intElements[int(i)] &&intElements[int(j)]); - if (bothIntersected) - { - continue; - } - this->getElement(uint(j)).findLimitBox(this->getNodes(),limitBox2); - if (!RLimitBox::areIntersecting(limitBox1,limitBox2)) + { + RProgressPrint(n_count,n_total); + } + + for (int64_t j=i+1;jgetNElements());j++) + { +#pragma omp atomic + n_count++; + if ((intElements[int(i)] && intElements[int(j)]) || !RLimitBox::areIntersecting(limitBoxes[i],limitBoxes[j])) { continue; } - std::set x; - if (RElement::findIntersectionPoints(this->getElement(i),this->getElement(uint(j)),this->getNodes(),x)) + QList x; + if (RElement::findIntersectionPoints(this->getElement(i),this->getElement(uint(j)),this->getNodes(),x,true)) { #pragma omp critical { -// RLogger::warning("Elements %u and %u are intersecting.\n",i,j); intElements[int(i)] = intElements[int(j)] = true; } } @@ -5448,9 +5436,15 @@ uint RModel::breakIntersectedElements(uint nIterations, const std::vector RLogger::info("Iteration %u of %u\n",iteration,nIterations); RLogger::indent(); - std::vector< std::set > intersectionPoints; + std::vector< QList > intersectionPoints; intersectionPoints.resize(bElementIDs.size()); + QVector limitBoxes(bElementIDs.size()); + for (uint i=0;igetElement(bElementIDs[i]).findLimitBox(this->getNodes(),limitBoxes[i]); + } + // Find intersection points. RLogger::info("Finding intersection points\n"); RLogger::indent(); @@ -5467,9 +5461,6 @@ uint RModel::breakIntersectedElements(uint nIterations, const std::vector continue; } - RLimitBox limitBox1; - this->getElement(bElementIDs[i]).findLimitBox(this->getNodes(),limitBox1); - #pragma omp parallel for default(shared) for (int64_t j=int64_t(i)+1;j continue; } - RLimitBox limitBox2; - this->getElement(bElementIDs[uint(j)]).findLimitBox(this->getNodes(),limitBox2); - if (!RLimitBox::areIntersecting(limitBox1,limitBox2)) + if (!RLimitBox::areIntersecting(limitBoxes[i],limitBoxes[j])) { continue; } - std::set x; + QList x; if (RElement::findIntersectionPoints(this->getElement(bElementIDs[i]),this->getElement(bElementIDs[uint(j)]),this->getNodes(),x)) { #pragma omp critical { - std::set::reverse_iterator it; + QList::reverse_iterator it; for (it=x.rbegin();it!=x.rend();++it) { // Insert only nodes which are not in the verticies. bool nodeFound = false; - std::set::const_iterator cit; - for (cit=intersectionPoints[i].begin();cit!=intersectionPoints[i].end();++cit) + QList::const_iterator cit; + for (cit=intersectionPoints[i].constBegin();cit!=intersectionPoints[i].constEnd();++cit) { if (RR3Vector::findDistance(*it,*cit) < tolerance) { @@ -5506,11 +5495,11 @@ uint RModel::breakIntersectedElements(uint nIterations, const std::vector } if (!nodeFound) { - intersectionPoints[i].insert(*it); + intersectionPoints[i].append(*it); intersectionFound = true; } nodeFound = false; - for (cit=intersectionPoints[uint(j)].begin();cit!=intersectionPoints[uint(j)].end();++cit) + for (cit=intersectionPoints[uint(j)].constBegin();cit!=intersectionPoints[uint(j)].constEnd();++cit) { if (RR3Vector::findDistance(*it,*cit) < tolerance) { @@ -5520,7 +5509,7 @@ uint RModel::breakIntersectedElements(uint nIterations, const std::vector } if (!nodeFound) { - intersectionPoints[uint(j)].insert(*it); + intersectionPoints[uint(j)].append(*it); intersectionFound = true; } } @@ -5600,8 +5589,8 @@ uint RModel::breakIntersectedElements(uint nIterations, const std::vector { std::vector breakNodeIDs; - std::set::const_iterator iter; - for (iter=intersectionPoints[i].begin();iter!=intersectionPoints[i].end();++iter) + QList::const_iterator iter; + for (iter=intersectionPoints[i].constBegin();iter!=intersectionPoints[i].constEnd();++iter) { this->addNode(RNode((*iter)[0],(*iter)[1],(*iter)[2])); breakNodeIDs.push_back(this->getNNodes() - 1); @@ -5838,7 +5827,7 @@ bool RModel::boolIntersection(uint nIterations, QList surfaceEntityIDs) } // Remove elements - std::set elementIDsSet; + QList elementIDsSet; for (int i=0;i surfaceEntityIDs) { if (!insideBook[k]) { - elementIDsSet.insert(rSurface.get(k)); + elementIDsSet.append(rSurface.get(k)); } } } @@ -5881,8 +5870,8 @@ bool RModel::boolIntersection(uint nIterations, QList surfaceEntityIDs) QList elementsToRemove; elementsToRemove.reserve(int(elementIDsSet.size())); - std::set::const_iterator iter; - for (iter=elementIDsSet.begin();iter!=elementIDsSet.end();++iter) + QList::const_iterator iter; + for (iter=elementIDsSet.constBegin();iter!=elementIDsSet.constEnd();++iter) { elementsToRemove.push_back(*iter); } @@ -5919,7 +5908,7 @@ bool RModel::boolUnion(uint nIterations, QList surfaceEntityIDs) } // Remove elements - std::set elementIDsSet; + QList elementIDsSet; for (int i=0;i surfaceEntityIDs) { if (insideBook[k]) { - elementIDsSet.insert(rSurface.get(k)); + elementIDsSet.append(rSurface.get(k)); } } } @@ -5962,8 +5951,8 @@ bool RModel::boolUnion(uint nIterations, QList surfaceEntityIDs) QList elementsToRemove; elementsToRemove.reserve(int(elementIDsSet.size())); - std::set::const_iterator iter; - for (iter=elementIDsSet.begin();iter!=elementIDsSet.end();++iter) + QList::const_iterator iter; + for (iter=elementIDsSet.constBegin();iter!=elementIDsSet.constEnd();++iter) { elementsToRemove.push_back(*iter); } @@ -8060,10 +8049,10 @@ std::vector RModel::findVolumeNeighbors() const { neigs[elementID1].push_back(elementID2); neigs[elementID2].push_back(elementID1); - if (neigs[elementID1].size() == volumeNeighborCount[elementID1]) - { - skip = true; - } + } + if (neigs[elementID1].size() == volumeNeighborCount[elementID1]) + { + skip = true; } } if (skip) diff --git a/range/RangeModel/src/rml_segment.cpp b/range/RangeModel/src/rml_segment.cpp index e326567b..26fd9e6d 100644 --- a/range/RangeModel/src/rml_segment.cpp +++ b/range/RangeModel/src/rml_segment.cpp @@ -207,7 +207,7 @@ bool RSegment::findLineIntersection(const RR3Vector &position, const RR3Vector & return R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u); } -bool RSegment::findPointIntersection(const RNode &node, std::set &x) const +bool RSegment::findPointIntersection(const RNode &node, QList &x) const { bool intersectionFound = false; RR3Vector point(node.toVector()); @@ -220,13 +220,13 @@ bool RSegment::findPointIntersection(const RNode &node, std::set &x) if (intersectionFound) { - x.insert(point); + x.append(point); } return intersectionFound; } -bool RSegment::findSegmentIntersection(const RSegment &segment, std::set &x) const +bool RSegment::findSegmentIntersection(const RSegment &segment, QList &x, bool testOnly) const { double tollerance = 1.0e-5; @@ -240,25 +240,26 @@ bool RSegment::findSegmentIntersection(const RSegment &segment, std::set xTemp; + QList xTemp; + xTemp.reserve(2); if (RR3Vector::areParallel(this->findDirection(),segment.findDirection())) { if (this->isPointInside(segment.getNode1().toVector())) { - xTemp.insert(segment.getNode1().toVector()); + xTemp.append(segment.getNode1().toVector()); } if (this->isPointInside(segment.getNode2().toVector())) { - xTemp.insert(segment.getNode2().toVector()); + xTemp.append(segment.getNode2().toVector()); } if (segment.isPointInside(this->getNode1().toVector())) { - xTemp.insert(this->getNode1().toVector()); + xTemp.append(this->getNode1().toVector()); } if (segment.isPointInside(this->getNode2().toVector())) { - xTemp.insert(this->getNode2().toVector()); + xTemp.append(this->getNode2().toVector()); } } else @@ -275,7 +276,7 @@ bool RSegment::findSegmentIntersection(const RSegment &segment, std::set::reverse_iterator it; + QList::reverse_iterator it; for (it=xTemp.rbegin();it!=xTemp.rend();++it) { bool isNode1 = (RR3Vector::findDistance(this->getNode1().toVector(),*it) < RConstants::eps || @@ -296,7 +297,10 @@ bool RSegment::findSegmentIntersection(const RSegment &segment, std::set &x) const +bool RTriangle::findPointIntersection(const RNode &node, QList &x) const { bool intersectionFound = false; RR3Vector point(node.toVector()); @@ -187,19 +187,19 @@ bool RTriangle::findPointIntersection(const RNode &node, std::set &x) if (intersectionFound) { - x.insert(point); + x.append(point); } return intersectionFound; } -bool RTriangle::findSegmentIntersection(const RSegment &segment, std::set &x) const +bool RTriangle::findSegmentIntersection(const RSegment &segment, QList &x, bool testOnly) const { RPlane plane(this->getNode1().toVector(),this->getNode2().toVector(),this->getNode3().toVector()); double d1 = plane.findPointDistance(segment.getNode1().toVector()); double d2 = plane.findPointDistance(segment.getNode2().toVector()); - std::set xTemp; + QList xTemp; bool intersectionFound = false; if (std::fabs(d1-d2) < RConstants::eps) @@ -218,8 +218,7 @@ bool RTriangle::findSegmentIntersection(const RSegment &segment, std::set::reverse_iterator it; + QList::reverse_iterator it; for (it=xTemp.rbegin();it!=xTemp.rend();++it) { bool isNode1 = (RR3Vector::findDistance(this->getNode1().toVector(),*it) < RConstants::eps || @@ -232,7 +231,10 @@ bool RTriangle::findSegmentIntersection(const RSegment &segment, std::set &x) const +bool RTriangle::findTriangleIntersection(const RTriangle &triangle, QList &x, bool testOnly) const { double tolerance = 1.0e-5; bool intersectionFound = false; - std::set xTemp; + QList xTemp; + xTemp.reserve(6); + RR3Vector nv; RR3Vector::cross(this->getNormal(),triangle.getNormal(),nv); if (RR3Vector::norm(nv) < tolerance) @@ -267,7 +271,7 @@ bool RTriangle::findTriangleIntersection(const RTriangle &triangle, std::set::reverse_iterator it; + QList::reverse_iterator it; for (it=xTemp.rbegin();it!=xTemp.rend();++it) { bool isNode1 = (RR3Vector::findDistance(this->getNode1().toVector(),*it) < tolerance || @@ -283,7 +287,10 @@ bool RTriangle::findTriangleIntersection(const RTriangle &triangle, std::setisPointInside(*it,false) || triangle.isPointInside(*it,false)) { // Intersection is not in node. - x.insert(*it); + if (!testOnly) + { + x.append(*it); + } intersectionFound = true; } } @@ -420,7 +427,7 @@ void RTriangle::computeNormal(void) this->normal = RTriangle::computeNormal(this->node1,this->node2,this->node3); } -bool RTriangle::findParallelSegmentIntersection(const RSegment &segment, std::set &x) const +bool RTriangle::findParallelSegmentIntersection(const RSegment &segment, QList &x) const { bool intersectionFound = false; uint nNFound = 0; @@ -428,13 +435,13 @@ bool RTriangle::findParallelSegmentIntersection(const RSegment &segment, std::se // Check if segment's points are inside this triangle. if (this->isPointInside(segment.getNode1().toVector())) { - x.insert(segment.getNode1().toVector()); + x.append(segment.getNode1().toVector()); intersectionFound = true; nNFound++; } if (this->isPointInside(segment.getNode2().toVector())) { - x.insert(segment.getNode2().toVector()); + x.append(segment.getNode2().toVector()); intersectionFound = true; nNFound++; } @@ -464,7 +471,7 @@ bool RTriangle::findParallelSegmentIntersection(const RSegment &segment, std::se return intersectionFound; } -bool RTriangle::findSkewedSegmentIntersection(const RSegment &segment, std::set &x) const +bool RTriangle::findSkewedSegmentIntersection(const RSegment &segment, QList &x) const { RR3Vector xVec; double u = 0.0; @@ -472,14 +479,14 @@ bool RTriangle::findSkewedSegmentIntersection(const RSegment &segment, std::set< { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(xVec); + x.append(xVec); return true; } } return false; } -bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std::set &x) const +bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, QList &x) const { bool intersectionFound = false; uint nNFound = 0; @@ -493,7 +500,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: { if (!hasNode11) { - x.insert(triangle.getNode1().toVector()); + x.append(triangle.getNode1().toVector()); intersectionFound = true; } nNFound++; @@ -502,7 +509,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: { if (!hasNode12) { - x.insert(triangle.getNode2().toVector()); + x.append(triangle.getNode2().toVector()); intersectionFound = true; } nNFound++; @@ -511,7 +518,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: { if (!hasNode13) { - x.insert(triangle.getNode3().toVector()); + x.append(triangle.getNode3().toVector()); intersectionFound = true; } nNFound++; @@ -531,7 +538,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: { if (!hasNode21) { - x.insert(this->getNode1().toVector()); + x.append(this->getNode1().toVector()); intersectionFound = true; } nNFound++; @@ -540,7 +547,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: { if (!hasNode22) { - x.insert(this->getNode2().toVector()); + x.append(this->getNode2().toVector()); intersectionFound = true; } nNFound++; @@ -549,7 +556,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: { if (!hasNode23) { - x.insert(this->getNode3().toVector()); + x.append(this->getNode3().toVector()); intersectionFound = true; nNFound++; } @@ -611,7 +618,7 @@ bool RTriangle::findParallelTriangleIntersection(const RTriangle &triangle, std: } -bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::set &x) const +bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, QList &x) const { bool intersectionFound = false; @@ -630,7 +637,7 @@ bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::s { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(vx); + x.append(vx); intersectionFound = true; } } @@ -638,7 +645,7 @@ bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::s { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(vx); + x.append(vx); intersectionFound = true; } } @@ -646,7 +653,7 @@ bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::s { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(vx); + x.append(vx); intersectionFound = true; } } @@ -663,7 +670,7 @@ bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::s { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(vx); + x.append(vx); intersectionFound = true; } } @@ -671,7 +678,7 @@ bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::s { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(vx); + x.append(vx); intersectionFound = true; } } @@ -679,7 +686,7 @@ bool RTriangle::findSkewedTriangleIntersection(const RTriangle &triangle, std::s { if (R_IS_IN_CLOSED_INTERVAL(0.0,1.0,u)) { - x.insert(vx); + x.append(vx); intersectionFound = true; } } diff --git a/range/RangeSolverLib/src/rhemicube.cpp b/range/RangeSolverLib/src/rhemicube.cpp index 542e2280..87be1879 100644 --- a/range/RangeSolverLib/src/rhemicube.cpp +++ b/range/RangeSolverLib/src/rhemicube.cpp @@ -205,7 +205,7 @@ void RHemiCube::calculateViewFactors(const RModel &model, RViewFactorMatrix &rVi for (uint j=0;j triangles = rElement.triangulate(model.getNodes()); + QList triangles = rElement.triangulate(model.getNodes()); for (uint k=0;k Date: Mon, 31 Oct 2022 14:42:19 +0100 Subject: [PATCH 04/11] Correct entity update order --- range/Range/doc/RELEASE_NOTES.txt | 4 +-- range/RangeModel/src/rml_model.cpp | 48 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index 4f896c66..f5aab410 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -6,8 +6,8 @@ Version 3.2.8 Bug fixes: -* Fixed glitches when zooming using mouse wheel - +* GUI: Fixed glitches when zooming using mouse wheel +* GUI: Vector and scalar field entity list can get lost when results are reloaded ------------------------------------------------------------------ Version 3.2.7 diff --git a/range/RangeModel/src/rml_model.cpp b/range/RangeModel/src/rml_model.cpp index d9b1b636..8f0fbf73 100644 --- a/range/RangeModel/src/rml_model.cpp +++ b/range/RangeModel/src/rml_model.cpp @@ -297,6 +297,18 @@ void RModel::update(const RModel &rModel) updateVolumeGroupData.push_back(this->getVolume(i).getData()); } + std::vector cuts; + for (uint i=0;igetNCuts();i++) + { + cuts.push_back(this->getCut(i)); + } + + std::vector isos; + for (uint i=0;igetNIsos();i++) + { + isos.push_back(this->getIso(i)); + } + std::vector scalarFields; for (uint i=0;igetNScalarFields();i++) { @@ -315,18 +327,6 @@ void RModel::update(const RModel &rModel) streamLines.push_back(this->getStreamLine(i)); } - std::vector cuts; - for (uint i=0;igetNCuts();i++) - { - cuts.push_back(this->getCut(i)); - } - - std::vector isos; - for (uint i=0;igetNIsos();i++) - { - isos.push_back(this->getIso(i)); - } - uint nUpdateVariables = std::min(this->getNVariables(),rModel.getNVariables()); std::vector updateVariableData; std::vector updateVariableType; @@ -360,6 +360,18 @@ void RModel::update(const RModel &rModel) this->getVolume(i).setData(updateVolumeGroupData[i]); } + this->setNCuts(uint(cuts.size())); + for (uint i=0;igetNCuts();i++) + { + this->setCut(i,cuts[i]); + } + + this->setNIsos(uint(isos.size())); + for (uint i=0;igetNIsos();i++) + { + this->setIso(i,isos[i]); + } + this->setNScalarFields(uint(scalarFields.size())); for (uint i=0;igetNScalarFields();i++) { @@ -378,18 +390,6 @@ void RModel::update(const RModel &rModel) this->setStreamLine(i,streamLines[i]); } - this->setNCuts(uint(cuts.size())); - for (uint i=0;igetNCuts();i++) - { - this->setCut(i,cuts[i]); - } - - this->setNIsos(uint(isos.size())); - for (uint i=0;igetNIsos();i++) - { - this->setIso(i,isos[i]); - } - for (uint i=0;igetVariable(i).getType() == updateVariableType[i]) From e9c14e4b45c47f1222ea4e21f342bdbf1649f8bf Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Mon, 31 Oct 2022 15:28:20 +0100 Subject: [PATCH 05/11] Change order of entities in the model tree --- range/Range/doc/RELEASE_NOTES.txt | 1 + range/Range/src/model_tree.cpp | 184 ++++++++++++++--------------- range/RangeModel/src/rml_model.cpp | 24 ++-- 3 files changed, 105 insertions(+), 104 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index f5aab410..17f38a4e 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -3,6 +3,7 @@ Version 3.2.8 * ALL: Resolved build warnings * ALL: Optimised detection of self-intersecting elements +* GUI: Change order of entities in the model tree to "Points,Lines,Surfaces,Volumes,Cuts,ISO surfaces,Stream Lines, Scalar fields,Vector fields" Bug fixes: diff --git a/range/Range/src/model_tree.cpp b/range/Range/src/model_tree.cpp index 9e1ee2a7..3476a589 100644 --- a/range/Range/src/model_tree.cpp +++ b/range/Range/src/model_tree.cpp @@ -22,20 +22,20 @@ typedef enum _ModelTreeEntity MODEL_TREE_GROUP_LINE, MODEL_TREE_GROUP_SURFACE, MODEL_TREE_GROUP_VOLUME, - MODEL_TREE_GROUP_VECTOR_FIELD, - MODEL_TREE_GROUP_SCALAR_FIELD, - MODEL_TREE_GROUP_STREAM_LINE, MODEL_TREE_GROUP_CUT, MODEL_TREE_GROUP_ISO, + MODEL_TREE_GROUP_STREAM_LINE, + MODEL_TREE_GROUP_SCALAR_FIELD, + MODEL_TREE_GROUP_VECTOR_FIELD, MODEL_TREE_POINT, MODEL_TREE_LINE, MODEL_TREE_SURFACE, MODEL_TREE_VOLUME, - MODEL_TREE_VECTOR_FIELD, - MODEL_TREE_SCALAR_FIELD, - MODEL_TREE_STREAM_LINE, MODEL_TREE_CUT, MODEL_TREE_ISO, + MODEL_TREE_STREAM_LINE, + MODEL_TREE_SCALAR_FIELD, + MODEL_TREE_VECTOR_FIELD, MODEL_TREE_N_TYPES } ModelTreeEntity; @@ -61,16 +61,16 @@ static REntityGroupType EntityTypeToGroupType(ModelTreeEntity entityType) return R_ENTITY_GROUP_SURFACE; case MODEL_TREE_VOLUME: return R_ENTITY_GROUP_VOLUME; - case MODEL_TREE_VECTOR_FIELD: - return R_ENTITY_GROUP_VECTOR_FIELD; - case MODEL_TREE_SCALAR_FIELD: - return R_ENTITY_GROUP_SCALAR_FIELD; - case MODEL_TREE_STREAM_LINE: - return R_ENTITY_GROUP_STREAM_LINE; case MODEL_TREE_CUT: return R_ENTITY_GROUP_CUT; case MODEL_TREE_ISO: return R_ENTITY_GROUP_ISO; + case MODEL_TREE_STREAM_LINE: + return R_ENTITY_GROUP_STREAM_LINE; + case MODEL_TREE_SCALAR_FIELD: + return R_ENTITY_GROUP_SCALAR_FIELD; + case MODEL_TREE_VECTOR_FIELD: + return R_ENTITY_GROUP_VECTOR_FIELD; default: return R_ENTITY_GROUP_NONE; } @@ -245,15 +245,15 @@ void ModelTree::insertModel(uint modelID) || (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_VOLUME && rModel.getNVolumes() == 0) || + (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_CUT && rModel.getNCuts() == 0) + || + (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_ISO && rModel.getNIsos() == 0) + || (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_STREAM_LINE && rModel.getNStreamLines() == 0) || (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_VECTOR_FIELD && rModel.getNVectorFields() == 0) || (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_SCALAR_FIELD && rModel.getNScalarFields() == 0) - || - (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_CUT && rModel.getNCuts() == 0) - || - (itemModel->child(i)->data(MODEL_TREE_COLUMN_TYPE,Qt::DisplayRole).toInt() == MODEL_TREE_GROUP_ISO && rModel.getNIsos() == 0) ) { itemModel->takeChild(i); @@ -873,25 +873,25 @@ void ModelTree::onSelectionChanged(void) } } } - else if (type == MODEL_TREE_GROUP_VECTOR_FIELD) + else if (type == MODEL_TREE_GROUP_CUT) { // Select all entities in the group for (int j=0;jsetIgnoreSignals(false); @@ -1221,14 +1221,14 @@ void ModelTree::selectSelected(void) bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_VOLUME,true); allItems[i]->setSelected(groupSelected); } - else if (entityType == MODEL_TREE_GROUP_VECTOR_FIELD) + else if (entityType == MODEL_TREE_GROUP_CUT) { - bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_VECTOR_FIELD,true); + bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_CUT,true); allItems[i]->setSelected(groupSelected); } - else if (entityType == MODEL_TREE_GROUP_SCALAR_FIELD) + else if (entityType == MODEL_TREE_GROUP_ISO) { - bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_SCALAR_FIELD,true); + bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_ISO,true); allItems[i]->setSelected(groupSelected); } else if (entityType == MODEL_TREE_GROUP_STREAM_LINE) @@ -1236,25 +1236,25 @@ void ModelTree::selectSelected(void) bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_STREAM_LINE,true); allItems[i]->setSelected(groupSelected); } - else if (entityType == MODEL_TREE_GROUP_CUT) + else if (entityType == MODEL_TREE_GROUP_SCALAR_FIELD) { - bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_CUT,true); + bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_SCALAR_FIELD,true); allItems[i]->setSelected(groupSelected); } - else if (entityType == MODEL_TREE_GROUP_ISO) + else if (entityType == MODEL_TREE_GROUP_VECTOR_FIELD) { - bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_ISO,true); + bool groupSelected = Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_VECTOR_FIELD,true); allItems[i]->setSelected(groupSelected); } else if (entityType == MODEL_TREE_POINT || entityType == MODEL_TREE_LINE || entityType == MODEL_TREE_SURFACE || entityType == MODEL_TREE_VOLUME || - entityType == MODEL_TREE_VECTOR_FIELD || - entityType == MODEL_TREE_SCALAR_FIELD || - entityType == MODEL_TREE_STREAM_LINE || entityType == MODEL_TREE_CUT || - entityType == MODEL_TREE_ISO) + entityType == MODEL_TREE_ISO || + entityType == MODEL_TREE_STREAM_LINE || + entityType == MODEL_TREE_SCALAR_FIELD || + entityType == MODEL_TREE_VECTOR_FIELD) { bool entitySelected = Session::getInstance().getModel(mid).getSelected(elementGrpType,eid); allItems[i]->setSelected(entitySelected); @@ -1295,20 +1295,20 @@ void ModelTree::expandSelected(void) case MODEL_TREE_GROUP_VOLUME: expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_VOLUME,false)); break; - case MODEL_TREE_GROUP_VECTOR_FIELD: - expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_VECTOR_FIELD,false)); + case MODEL_TREE_GROUP_CUT: + expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_CUT,false)); break; - case MODEL_TREE_GROUP_SCALAR_FIELD: - expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_SCALAR_FIELD,false)); + case MODEL_TREE_GROUP_ISO: + expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_ISO,false)); break; case MODEL_TREE_GROUP_STREAM_LINE: expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_STREAM_LINE,false)); break; - case MODEL_TREE_GROUP_CUT: - expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_CUT,false)); + case MODEL_TREE_GROUP_SCALAR_FIELD: + expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_SCALAR_FIELD,false)); break; - case MODEL_TREE_GROUP_ISO: - expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_ISO,false)); + case MODEL_TREE_GROUP_VECTOR_FIELD: + expand = (!Session::getInstance().getModel(mid).isSelected(R_ENTITY_GROUP_VECTOR_FIELD,false)); break; default: break; @@ -1406,10 +1406,10 @@ void ModelTree::checkVisible(void) } allItems[i]->setCheckState(MODEL_TREE_COLUMN_NAME,checkState); } - else if (entityType == MODEL_TREE_GROUP_VECTOR_FIELD) + else if (entityType == MODEL_TREE_GROUP_CUT) { - visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_VECTOR_FIELD,true); - hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_VECTOR_FIELD,false); + visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_CUT,true); + hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_CUT,false); if (visible) { checkState = Qt::Checked; @@ -1420,10 +1420,10 @@ void ModelTree::checkVisible(void) } allItems[i]->setCheckState(MODEL_TREE_COLUMN_NAME,checkState); } - else if (entityType == MODEL_TREE_GROUP_SCALAR_FIELD) + else if (entityType == MODEL_TREE_GROUP_ISO) { - visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_SCALAR_FIELD,true); - hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_SCALAR_FIELD,false); + visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_ISO,true); + hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_ISO,false); if (visible) { checkState = Qt::Checked; @@ -1448,10 +1448,10 @@ void ModelTree::checkVisible(void) } allItems[i]->setCheckState(MODEL_TREE_COLUMN_NAME,checkState); } - else if (entityType == MODEL_TREE_GROUP_CUT) + else if (entityType == MODEL_TREE_GROUP_SCALAR_FIELD) { - visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_CUT,true); - hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_CUT,false); + visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_SCALAR_FIELD,true); + hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_SCALAR_FIELD,false); if (visible) { checkState = Qt::Checked; @@ -1462,10 +1462,10 @@ void ModelTree::checkVisible(void) } allItems[i]->setCheckState(MODEL_TREE_COLUMN_NAME,checkState); } - else if (entityType == MODEL_TREE_GROUP_ISO) + else if (entityType == MODEL_TREE_GROUP_VECTOR_FIELD) { - visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_ISO,true); - hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_ISO,false); + visible = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_VECTOR_FIELD,true); + hidden = Session::getInstance().getModel(mid).isVisible(R_ENTITY_GROUP_VECTOR_FIELD,false); if (visible) { checkState = Qt::Checked; @@ -1480,11 +1480,11 @@ void ModelTree::checkVisible(void) entityType == MODEL_TREE_LINE || entityType == MODEL_TREE_SURFACE || entityType == MODEL_TREE_VOLUME || - entityType == MODEL_TREE_VECTOR_FIELD || - entityType == MODEL_TREE_SCALAR_FIELD || - entityType == MODEL_TREE_STREAM_LINE || entityType == MODEL_TREE_CUT || - entityType == MODEL_TREE_ISO) + entityType == MODEL_TREE_ISO || + entityType == MODEL_TREE_STREAM_LINE || + entityType == MODEL_TREE_SCALAR_FIELD || + entityType == MODEL_TREE_VECTOR_FIELD) { if (Session::getInstance().getModel(mid).getVisible(elementGrpType,eid)) { @@ -1528,11 +1528,11 @@ void ModelTree::onItemDoubleClicked(QTreeWidgetItem *item, int column) entityType == MODEL_TREE_LINE || entityType == MODEL_TREE_SURFACE || entityType == MODEL_TREE_VOLUME || - entityType == MODEL_TREE_VECTOR_FIELD || - entityType == MODEL_TREE_SCALAR_FIELD || - entityType == MODEL_TREE_STREAM_LINE || entityType == MODEL_TREE_CUT || - entityType == MODEL_TREE_ISO) + entityType == MODEL_TREE_ISO || + entityType == MODEL_TREE_STREAM_LINE || + entityType == MODEL_TREE_SCALAR_FIELD || + entityType == MODEL_TREE_VECTOR_FIELD) { isEditable = true; } diff --git a/range/RangeModel/src/rml_model.cpp b/range/RangeModel/src/rml_model.cpp index 8f0fbf73..8751353f 100644 --- a/range/RangeModel/src/rml_model.cpp +++ b/range/RangeModel/src/rml_model.cpp @@ -309,6 +309,12 @@ void RModel::update(const RModel &rModel) isos.push_back(this->getIso(i)); } + std::vector streamLines; + for (uint i=0;igetNStreamLines();i++) + { + streamLines.push_back(this->getStreamLine(i)); + } + std::vector scalarFields; for (uint i=0;igetNScalarFields();i++) { @@ -321,12 +327,6 @@ void RModel::update(const RModel &rModel) vectorFields.push_back(this->getVectorField(i)); } - std::vector streamLines; - for (uint i=0;igetNStreamLines();i++) - { - streamLines.push_back(this->getStreamLine(i)); - } - uint nUpdateVariables = std::min(this->getNVariables(),rModel.getNVariables()); std::vector updateVariableData; std::vector updateVariableType; @@ -372,6 +372,12 @@ void RModel::update(const RModel &rModel) this->setIso(i,isos[i]); } + this->setNStreamLines(uint(streamLines.size())); + for (uint i=0;igetNStreamLines();i++) + { + this->setStreamLine(i,streamLines[i]); + } + this->setNScalarFields(uint(scalarFields.size())); for (uint i=0;igetNScalarFields();i++) { @@ -384,12 +390,6 @@ void RModel::update(const RModel &rModel) this->setVectorField(i,vectorFields[i]); } - this->setNStreamLines(uint(streamLines.size())); - for (uint i=0;igetNStreamLines();i++) - { - this->setStreamLine(i,streamLines[i]); - } - for (uint i=0;igetVariable(i).getType() == updateVariableType[i]) From 604d23dd87778beb39bf5cb4dca125ebc5145818 Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Mon, 31 Oct 2022 15:41:51 +0100 Subject: [PATCH 06/11] Append counter to newly created cut name --- range/Range/doc/RELEASE_NOTES.txt | 1 + range/Range/src/cut_dialog.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index 17f38a4e..30d220af 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -4,6 +4,7 @@ Version 3.2.8 * ALL: Resolved build warnings * ALL: Optimised detection of self-intersecting elements * GUI: Change order of entities in the model tree to "Points,Lines,Surfaces,Volumes,Cuts,ISO surfaces,Stream Lines, Scalar fields,Vector fields" +* GUI: Append counter to newly created cut name Bug fixes: diff --git a/range/Range/src/cut_dialog.cpp b/range/Range/src/cut_dialog.cpp index 2d5bd688..7d74b8ac 100644 --- a/range/Range/src/cut_dialog.cpp +++ b/range/Range/src/cut_dialog.cpp @@ -167,13 +167,13 @@ void CutDialog::onAccept(void) rCut.addElementGroupID(elementGroupId); } - RLogger::info("Modified vector field \'%s\'\n",rCut.getName().toUtf8().constData()); + RLogger::info("Modified cut \'%s\'\n",rCut.getName().toUtf8().constData()); } else { RCut cut; - cut.setName("Cut"); + cut.setName("Cut " + QString::number(Session::getInstance().getModel(this->modelID).getNCuts() + 1)); cut.setPlane(this->cutPlane); for (int i=0;imodelID).addCut(cut); - RLogger::info("Created new vector field \'%s\'\n",cut.getName().toUtf8().constData()); + RLogger::info("Created new cut \'%s\'\n",cut.getName().toUtf8().constData()); } Session::getInstance().setModelChanged(this->modelID); From 5f407aded897ebfe3957a086ac27699176209f2b Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Mon, 31 Oct 2022 19:04:03 +0100 Subject: [PATCH 07/11] Use dafault LLVM on MacOS --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 15f4c062..1a6f6ea6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -159,7 +159,7 @@ pushd $buildDir if [[ $(uname -s) == "Darwin" ]]; then qmakeArgs+=" -spec macx-clang" - override_clang="true" + override_clang="false" if [ "$override_clang" == "true" ] then qmake_cc="$(which clang)" From bdd7ed7a1dd9a45b4c962c043abec4578695b73b Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Mon, 7 Nov 2022 08:44:39 +0100 Subject: [PATCH 08/11] Improved stability of CFD solver --- range/Range/doc/RELEASE_NOTES.txt | 1 + range/RangeSolverLib/include/rsolverfluid.h | 3 +- range/RangeSolverLib/src/rsolverfluid.cpp | 148 ++++++++++---------- range/RangeSolverLib/src/rsolvergeneric.cpp | 7 +- 4 files changed, 82 insertions(+), 77 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index 30d220af..f1ba44b9 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -5,6 +5,7 @@ Version 3.2.8 * ALL: Optimised detection of self-intersecting elements * GUI: Change order of entities in the model tree to "Points,Lines,Surfaces,Volumes,Cuts,ISO surfaces,Stream Lines, Scalar fields,Vector fields" * GUI: Append counter to newly created cut name +* SOLVER: Improved stability of CFD solver Bug fixes: diff --git a/range/RangeSolverLib/include/rsolverfluid.h b/range/RangeSolverLib/include/rsolverfluid.h index 1993d468..78cd3fe9 100644 --- a/range/RangeSolverLib/include/rsolverfluid.h +++ b/range/RangeSolverLib/include/rsolverfluid.h @@ -172,8 +172,7 @@ class RSolverFluid : public RSolverGeneric //! Find stream velocity. static double computeStreamVelocity(const RModel &rModel, const RSolverCartesianVector &nodeVelocity, - bool averageBased, - double streamVelocity = 0.0); + bool averageBased); }; diff --git a/range/RangeSolverLib/src/rsolverfluid.cpp b/range/RangeSolverLib/src/rsolverfluid.cpp index e2d6f44d..909d1939 100644 --- a/range/RangeSolverLib/src/rsolverfluid.cpp +++ b/range/RangeSolverLib/src/rsolverfluid.cpp @@ -738,7 +738,10 @@ void RSolverFluid::statistics(void) this->printStats(R_VARIABLE_PRESSURE); this->processMonitoringPoints(); - RLogger::info("Convergence: %-13g\n",residual); + RLogger::info("Residual: % -13g\n",residual); + RLogger::info("Convergence-R: % -13g\n",convergence); + RLogger::info("Convergence-V: % -13g\n",this->cvgV); + RLogger::info("Convergence-P: % -13g\n",this->cvgP); RLogger::info("Build time: %9u [ms]\n",this->buildStopWatch.getMiliSeconds()); RLogger::info("Solver time: %9u [ms]\n",this->solverStopWatch.getMiliSeconds()); @@ -2329,7 +2332,7 @@ double RSolverFluid::findWeightScale(void) const double ws = (this->avgU == 0.0) ? 1.0 : 1.0 * v / (this->avgU * l * l); if (this->pModel->getTimeSolver().getEnabled()) { - ws *= 1.0e-2 / this->pModel->getTimeSolver().getCurrentTimeStepSize(); + ws /= this->pModel->getTimeSolver().getCurrentTimeStepSize(); } return ws; @@ -2421,8 +2424,9 @@ void RSolverFluid::assemblyMatrix(uint elementID, const RRMatrix &Ae, const RRVe if (this->nodeBook.getValue(dims*rElement.getNodeId(m)+i,mp)) { + uint row = dims*m+i; #pragma omp atomic - this->b[mp] += fe[dims*m+i]; + this->b[mp] += fe[row]; #pragma omp critical { for (uint n=0;nnodeBook.getValue(dims*rElement.getNodeId(n)+j,np)) { - this->A.addValue(mp,np,Ae[dims*m+i][dims*n+j]); + this->A.addValue(mp,np,Ae[row][dims*n+j]); } } } @@ -2505,74 +2509,12 @@ void RSolverFluid::applyLocalRotations(unsigned int elementID, RRMatrix &Ae) } } -double RSolverFluid::computeStreamVelocity(const RModel &rModel, const RSolverCartesianVector &nodeVelocity, bool averageBased, double streamVelocity) +double RSolverFluid::computeStreamVelocity(const RModel &rModel, const RSolverCartesianVector &nodeVelocity, bool averageBased) { - double velocity = 1.0; - - double totalArea = 0.0; - double totalVolurate = 0.0; - - for (uint i=0;iapplyDisplacement(); } - this->updateScales(); + static bool updateScalesDone = false; + if (!updateScalesDone || this->problemType == R_PROBLEM_MESH) + { + this->updateScales(); + } + updateScalesDone = true; if (this->problemType != R_PROBLEM_MESH) { this->scales.downscale(*this->pModel); From ffdb5ab560894d4eeaf4a015f1597396806c4ad6 Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Tue, 8 Nov 2022 10:36:07 +0100 Subject: [PATCH 09/11] Improved problem time setup dock --- range/Range/doc/RELEASE_NOTES.txt | 1 + range/Range/src/time_solver_setup_widget.cpp | 79 +++++++++++++------ range/Range/src/time_solver_setup_widget.h | 7 +- range/RangeModel/include/rml_time_solver.h | 82 ++++++++++---------- range/RangeModel/src/rml_time_solver.cpp | 52 ++++++------- 5 files changed, 125 insertions(+), 96 deletions(-) diff --git a/range/Range/doc/RELEASE_NOTES.txt b/range/Range/doc/RELEASE_NOTES.txt index f1ba44b9..bccd2507 100644 --- a/range/Range/doc/RELEASE_NOTES.txt +++ b/range/Range/doc/RELEASE_NOTES.txt @@ -5,6 +5,7 @@ Version 3.2.8 * ALL: Optimised detection of self-intersecting elements * GUI: Change order of entities in the model tree to "Points,Lines,Surfaces,Volumes,Cuts,ISO surfaces,Stream Lines, Scalar fields,Vector fields" * GUI: Append counter to newly created cut name +* GUI: Improved problem time setup dock. * SOLVER: Improved stability of CFD solver Bug fixes: diff --git a/range/Range/src/time_solver_setup_widget.cpp b/range/Range/src/time_solver_setup_widget.cpp index 3666321a..a9db4938 100644 --- a/range/Range/src/time_solver_setup_widget.cpp +++ b/range/Range/src/time_solver_setup_widget.cpp @@ -14,7 +14,6 @@ #include #include -#include "session.h" #include "time_solver_setup_widget.h" #include "value_line_edit.h" @@ -39,7 +38,10 @@ TimeSolverSetupWidget::TimeSolverSetupWidget(const RTimeSolver &timeSolver, QWid int groupLayoutRow = 0; // Time-march approximation - QLabel *labelTimeApprox = new QLabel(tr("Time-march approximation")); + QString toolTipTimeApprox(tr("Time-march approximation method.")); + + QLabel *labelTimeApprox = new QLabel(tr("Approximation")); + labelTimeApprox->setToolTip(toolTipTimeApprox); groupLayout->addWidget(labelTimeApprox,groupLayoutRow,0); QComboBox *comboTimeApprox = new QComboBox(); @@ -47,73 +49,100 @@ TimeSolverSetupWidget::TimeSolverSetupWidget(const RTimeSolver &timeSolver, QWid comboTimeApprox->addItem(RTimeSolver::getTimeMarchApproximationName(R_TIME_MARCH_BACKWARD)); comboTimeApprox->addItem(RTimeSolver::getTimeMarchApproximationName(R_TIME_MARCH_FORWARD)); comboTimeApprox->setCurrentIndex(this->timeSolver.getTimeMarchApproximation()); - comboTimeApprox->setToolTip(tr("Time-march approximation.")); - groupLayout->addWidget(comboTimeApprox,groupLayoutRow++,1); + comboTimeApprox->setToolTip(toolTipTimeApprox); + groupLayout->addWidget(comboTimeApprox,groupLayoutRow++,1,1,2); this->connect(comboTimeApprox,SIGNAL(currentIndexChanged(int)),SLOT(onTimeApproximationChanged(int))); // Start time + QString toolTipStartTime(tr("Start time in seconds.") + + "\n" + + tr("In case of solver restart, entered value will be ignored and current computed time will be used.") + + "\n" + + tr("Current computed time") + " = " + QString::number(this->timeSolver.getComputedTime()) + RVariable::getUnits(R_VARIABLE_TIME)); + QLabel *labelStartTime = new QLabel(tr("Start time")); + labelStartTime->setToolTip(toolTipStartTime); groupLayout->addWidget(labelStartTime,groupLayoutRow,0); ValueLineEdit *lineStartTime = new ValueLineEdit; lineStartTime->setDoubleValidator(); lineStartTime->setText(QString::number(this->timeSolver.getInputStartTime())); - lineStartTime->setToolTip(tr("Start time in seconds.")); - groupLayout->addWidget(lineStartTime,groupLayoutRow++,1); + lineStartTime->setToolTip(toolTipStartTime); + groupLayout->addWidget(lineStartTime,groupLayoutRow,1); QObject::connect(lineStartTime,&ValueLineEdit::valueChanged,this,&TimeSolverSetupWidget::onStartTimeChanged); + QLabel *unitsStartTime = new QLabel(RVariable::getUnits(R_VARIABLE_TIME)); + groupLayout->addWidget(unitsStartTime,groupLayoutRow++,2); + // End time - QLabel *labelEndTime = new QLabel(tr("End time") + " (" + tr("read only") + ")"); + QString toolTipEndTime(tr("End time in seconds.") + + "\n" + + tr("End time = Start time + Time-step size * Number of time-steps")); + + QLabel *labelEndTime = new QLabel(tr("End time")); + labelEndTime->setToolTip(toolTipEndTime); groupLayout->addWidget(labelEndTime,groupLayoutRow,0); - this->lineEndTime = new ValueLineEdit; - this->lineEndTime->setDoubleValidator(); - this->lineEndTime->setValue(this->findEndTime()); - this->lineEndTime->setToolTip(tr("End time in seconds.")); - this->lineEndTime->setReadOnly(true); - groupLayout->addWidget(this->lineEndTime,groupLayoutRow++,1); + this->valueEndTime = new QLabel(QString::number(this->findEndTime())); + this->valueEndTime->setToolTip(toolTipEndTime); + groupLayout->addWidget(this->valueEndTime,groupLayoutRow,1,Qt::AlignRight); + + QLabel *unitsEndTime = new QLabel(RVariable::getUnits(R_VARIABLE_TIME)); + groupLayout->addWidget(unitsEndTime,groupLayoutRow++,2); + + // Time-step size + QString toolTipTimeStepSize(tr("Time-step size in seconds.")); - // Default time-step size QLabel *labelTimeStepSize = new QLabel(tr("Time-step size")); + labelTimeStepSize->setToolTip(toolTipTimeStepSize); groupLayout->addWidget(labelTimeStepSize,groupLayoutRow,0); ValueLineEdit *lineTimeStepSize = new ValueLineEdit(1.0e-99,1.0e99); lineTimeStepSize->setText(QString::number(this->timeSolver.getInputTimeStepSize())); - lineTimeStepSize->setToolTip(tr("Time-step size in seconds. This also determines end time.")); - groupLayout->addWidget(lineTimeStepSize,groupLayoutRow++,1); + lineTimeStepSize->setToolTip(toolTipTimeStepSize); + groupLayout->addWidget(lineTimeStepSize,groupLayoutRow,1); QObject::connect(lineTimeStepSize,&ValueLineEdit::valueChanged,this,&TimeSolverSetupWidget::onTimeStepSizeChanged); + QLabel *unitsTimeStepSize = new QLabel(RVariable::getUnits(R_VARIABLE_TIME)); + groupLayout->addWidget(unitsTimeStepSize,groupLayoutRow++,2); + // Number of time-steps + QString toolTipNTimeSteps(tr("Number of time-steps to solve.")); + QLabel *labelNTimeSteps = new QLabel(tr("Number of time-steps")); + labelNTimeSteps->setToolTip(toolTipNTimeSteps); groupLayout->addWidget(labelNTimeSteps,groupLayoutRow,0); QSpinBox *spinNTimeSteps = new QSpinBox; spinNTimeSteps->setMinimum(R_TIME_STEP_MIN_NUMBER); spinNTimeSteps->setMaximum(R_TIME_STEP_MAX_NUMBER); spinNTimeSteps->setValue(this->timeSolver.getInputNTimeSteps()); - spinNTimeSteps->setToolTip(tr("Number of time-steps to solve.")); - groupLayout->addWidget(spinNTimeSteps,groupLayoutRow++,1); + spinNTimeSteps->setToolTip(toolTipNTimeSteps); + groupLayout->addWidget(spinNTimeSteps,groupLayoutRow++,1,1,2); this->connect(spinNTimeSteps,SIGNAL(valueChanged(int)),SLOT(onNTimeStepsChanged(int))); // Write output frequency + QString toolTipOutputFrequency(tr("Number of time-steps after to be computed for results to be written into a file.")); + QLabel *labelOutputFrequency = new QLabel(tr("Output frequency")); + labelOutputFrequency->setToolTip(toolTipOutputFrequency); groupLayout->addWidget(labelOutputFrequency,groupLayoutRow,0); QSpinBox *spinOutputFrequency = new QSpinBox; spinOutputFrequency->setMinimum(R_TIME_MIN_OUTPUT_FREQUENCY); spinOutputFrequency->setMaximum(R_TIME_MAX_OUTPUT_FREQUENCY); spinOutputFrequency->setValue(this->timeSolver.getOutputFrequency()); - spinOutputFrequency->setToolTip(tr("Number of time-steps after which results will be written to a file.")); - groupLayout->addWidget(spinOutputFrequency,groupLayoutRow++,1); + spinOutputFrequency->setToolTip(toolTipOutputFrequency); + groupLayout->addWidget(spinOutputFrequency,groupLayoutRow++,1,1,2); this->connect(spinOutputFrequency,SIGNAL(valueChanged(int)),SLOT(onOutputFrequencyChanged(int))); } -double TimeSolverSetupWidget::findEndTime(void) const +double TimeSolverSetupWidget::findEndTime() const { return this->timeSolver.getInputStartTime() + this->timeSolver.getInputTimeStepSize() * this->timeSolver.getInputNTimeSteps(); } @@ -137,27 +166,27 @@ void TimeSolverSetupWidget::onTimeApproximationChanged(int index) void TimeSolverSetupWidget::onStartTimeChanged(double startTime) { this->timeSolver.setInputStartTime(startTime); - this->lineEndTime->setValue(this->findEndTime()); + this->valueEndTime->setText(QString::number(this->findEndTime())); emit this->changed(this->timeSolver); } void TimeSolverSetupWidget::onTimeStepSizeChanged(double timeStepSize) { this->timeSolver.setInputTimeStepSize(timeStepSize); - this->lineEndTime->setValue(this->findEndTime()); + this->valueEndTime->setText(QString::number(this->findEndTime())); emit this->changed(this->timeSolver); } void TimeSolverSetupWidget::onNTimeStepsChanged(int nTimeSteps) { this->timeSolver.setInputNTimeSteps(nTimeSteps); - this->lineEndTime->setValue(this->findEndTime()); + this->valueEndTime->setText(QString::number(this->findEndTime())); emit this->changed(this->timeSolver); } void TimeSolverSetupWidget::onOutputFrequencyChanged(int outputFrequency) { this->timeSolver.setOutputFrequency(outputFrequency); - this->lineEndTime->setValue(this->findEndTime()); + this->valueEndTime->setText(QString::number(this->findEndTime())); emit this->changed(this->timeSolver); } diff --git a/range/Range/src/time_solver_setup_widget.h b/range/Range/src/time_solver_setup_widget.h index ae05da06..30ae2e5a 100644 --- a/range/Range/src/time_solver_setup_widget.h +++ b/range/Range/src/time_solver_setup_widget.h @@ -12,11 +12,10 @@ #define TIME_SOLVER_SETUP_WIDGET_H #include +#include #include -#include "value_line_edit.h" - class TimeSolverSetupWidget : public QWidget { @@ -27,7 +26,7 @@ class TimeSolverSetupWidget : public QWidget //! Time solver. RTimeSolver timeSolver; //! End time - readonly. - ValueLineEdit *lineEndTime; + QLabel *valueEndTime; public: @@ -37,7 +36,7 @@ class TimeSolverSetupWidget : public QWidget protected: //! Find end time. - double findEndTime(void) const; + double findEndTime() const; signals: diff --git a/range/RangeModel/include/rml_time_solver.h b/range/RangeModel/include/rml_time_solver.h index 605d5249..b144464b 100644 --- a/range/RangeModel/include/rml_time_solver.h +++ b/range/RangeModel/include/rml_time_solver.h @@ -54,25 +54,25 @@ class RTimeSolver //! Vector of time values (seconds). std::vector times; //! Input number of time steps. - unsigned int inputNTimeSteps; + uint inputNTimeSteps; //! Input start time. double inputStartTime; //! Input time-step size. double inputTimeStepSize; //! Current time-step. - unsigned int currentTimeStep; + uint currentTimeStep; //! Current computed time. double computedTime; //! Write output frequency. - unsigned int outputFrequency; + uint outputFrequency; private: //! Internal initialization function. - void _init ( const RTimeSolver *pTimeSolver = nullptr ); + void _init(const RTimeSolver *pTimeSolver = nullptr); //! Sort array of times. - void sort ( void ); + void sort(); public: @@ -80,13 +80,13 @@ class RTimeSolver RTimeSolver (); //! Copy constructor. - RTimeSolver ( const RTimeSolver &timeSolver ); + RTimeSolver(const RTimeSolver &timeSolver); //! Destructor. ~RTimeSolver (); //! Assignment operator. - RTimeSolver & operator = ( const RTimeSolver &timeSolver ); + RTimeSolver & operator =(const RTimeSolver &timeSolver); //! Return enabled. bool getEnabled(void) const; @@ -95,103 +95,103 @@ class RTimeSolver void setEnabled(bool enabled); //! Return time march approximation. - RTimeMarchApproximation getTimeMarchApproximation ( void ) const; + RTimeMarchApproximation getTimeMarchApproximation() const; //! Return alpha coefficient for time approximation. - double getTimeMarchApproximationCoefficient ( void ) const; + double getTimeMarchApproximationCoefficient() const; //! Set time march approximation. - void setTimeMarchApproximation ( RTimeMarchApproximation timeMarchApproximation ); + void setTimeMarchApproximation(RTimeMarchApproximation timeMarchApproximation); //! Return const reference to vector containing all time step times. - const std::vector & getTimes ( void ) const; + const std::vector & getTimes() const; //! Return reference to vector containing all time step times. //! This function will also set the current time step to zero (first time step). - std::vector & getTimes ( void ); + std::vector & getTimes(); //! Set new vector containing all time step times. - void setTimes ( const std::vector × ); + void setTimes(const std::vector ×); //! Add new time step times. - void addTimes( unsigned int startTimeStep, - unsigned int nTimeSteps, - double timeStepSize ); + void addTimes( uint startTimeStep, + uint nTimeSteps, + double timeStepSize); //! Return input number of time-steps. - unsigned int getInputNTimeSteps(void) const; + uint getInputNTimeSteps(void) const; //! Set input number of time-steps. - void setInputNTimeSteps(unsigned int inputNTimeSteps); + void setInputNTimeSteps(uint inputNTimeSteps); //! Return input start time. - double getInputStartTime ( void ) const; + double getInputStartTime() const; //! Return input start time. - void setInputStartTime ( double inputStartTime ); + void setInputStartTime(double inputStartTime); //! Return input time-step size. - double getInputTimeStepSize ( void ) const; + double getInputTimeStepSize() const; //! Set input time step size. - void setInputTimeStepSize ( double inputTimeStepSize ); + void setInputTimeStepSize(double inputTimeStepSize); //! Return current time step. - unsigned int getCurrentTimeStep ( void ) const; + uint getCurrentTimeStep() const; //! Set current time step. - void setCurrentTimeStep ( unsigned int currentTimeStep ); + void setCurrentTimeStep(uint currentTimeStep); //! Return write output frequency. - unsigned int getOutputFrequency ( void ) const; + uint getOutputFrequency() const; //! Set write output frequency. - void setOutputFrequency ( unsigned int outputFrequency ); + void setOutputFrequency(uint outputFrequency); //! Set next time step and return modified current time step. //! If no next time step can be set RConstants::eod is returned. - unsigned int setNextTimeStep ( void ); + uint setNextTimeStep(); //! Return current time step size. - double getCurrentTimeStepSize ( void ) const; + double getCurrentTimeStepSize() const; //! Return computed time. - double getComputedTime ( void ) const; + double getComputedTime() const; //! Set computed time. - void setComputedTime ( double computedTime ); + void setComputedTime(double computedTime); //! Return current time. - double getCurrentTime ( void ) const; + double getCurrentTime() const; //! Return previous time. - double getPreviousTime ( void ) const; + double getPreviousTime() const; //! Return time at given time step. - double getTime ( unsigned int timeStep ) const; + double getTime(uint timeStep) const; //! Return first time in the list. - double getFirstTime ( void ) const; + double getFirstTime() const; //! Return last time in the list. - double getLastTime ( void ) const; + double getLastTime() const; //! Return number of time steps. - unsigned int getNTimeSteps ( void ) const; + uint getNTimeSteps() const; //! Return true if given time is in the time interval. - bool hasTime ( double timeValue ) const; + bool hasTime(double timeValue) const; //! Harmonize times with input. void harmonizeTimesWithInput(bool restart); //! Return time-marching approximation name. - static const QString & getTimeMarchApproximationName ( RTimeMarchApproximation timeApproximation ); + static const QString & getTimeMarchApproximationName(RTimeMarchApproximation timeApproximation); //! Compute times vector. - static std::vector findTimesVector ( unsigned int nTimeSteps, - double startTime, - double timeStepSize); + static std::vector findTimesVector(uint nTimeSteps, + double startTime, + double timeStepSize); //! Allow RFileIO to access private members. friend class RFileIO; diff --git a/range/RangeModel/src/rml_time_solver.cpp b/range/RangeModel/src/rml_time_solver.cpp index c137852a..82f6cfc9 100644 --- a/range/RangeModel/src/rml_time_solver.cpp +++ b/range/RangeModel/src/rml_time_solver.cpp @@ -37,7 +37,7 @@ void RTimeSolver::_init(const RTimeSolver *pTimeSolver) } } /* RTimeSolver::_init */ -void RTimeSolver::sort(void) +void RTimeSolver::sort() { std::sort(this->times.begin(),this->times.end()); } /* RTimeSolver::sort */ @@ -71,7 +71,7 @@ RTimeSolver &RTimeSolver::operator =(const RTimeSolver &timeSolver) return (*this); } /* RTimeSolver::operator = */ -bool RTimeSolver::getEnabled(void) const +bool RTimeSolver::getEnabled() const { return this->enabled; } /* RTimeSolver::getEnabled */ @@ -81,12 +81,12 @@ void RTimeSolver::setEnabled(bool enabled) this->enabled = enabled; } /* RTimeSolver::setEnabled */ -RTimeMarchApproximation RTimeSolver::getTimeMarchApproximation(void) const +RTimeMarchApproximation RTimeSolver::getTimeMarchApproximation() const { return this->timeMarchApproximation; } /* RTimeSolver::getTimeMarchApproximation */ -double RTimeSolver::getTimeMarchApproximationCoefficient(void) const +double RTimeSolver::getTimeMarchApproximationCoefficient() const { switch (this->timeMarchApproximation) { @@ -107,12 +107,12 @@ void RTimeSolver::setTimeMarchApproximation(RTimeMarchApproximation timeMarchApp this->timeMarchApproximation = timeMarchApproximation; } /* RTimeSolver::setTimeMarchApproximation */ -const std::vector &RTimeSolver::getTimes(void) const +const std::vector &RTimeSolver::getTimes() const { return this->times; } /* RTimeSolver::getTimes */ -std::vector &RTimeSolver::getTimes(void) +std::vector &RTimeSolver::getTimes() { return this->times; } /* RTimeSolver::getTimes */ @@ -124,7 +124,7 @@ void RTimeSolver::setTimes(const std::vector ×) this->sort(); } /* RTimeSolver::setTimes */ -void RTimeSolver::addTimes(unsigned int startTimeStep, unsigned int nTimeSteps, double timeStepSize) +void RTimeSolver::addTimes(uint startTimeStep, uint nTimeSteps, double timeStepSize) { if (startTimeStep < this->getNTimeSteps()) { @@ -134,17 +134,17 @@ void RTimeSolver::addTimes(unsigned int startTimeStep, unsigned int nTimeSteps, this->times.insert(this->times.end(),newTimes.begin(),newTimes.end()); } /* RTimeSolver::addTimes */ -unsigned int RTimeSolver::getInputNTimeSteps(void) const +uint RTimeSolver::getInputNTimeSteps() const { return this->inputNTimeSteps; } /* RTimeSolver::getInputNTimeSteps */ -void RTimeSolver::setInputNTimeSteps(unsigned int inputNTimeSteps) +void RTimeSolver::setInputNTimeSteps(uint inputNTimeSteps) { this->inputNTimeSteps = inputNTimeSteps; } /* RTimeSolver::setInputNTimeSteps */ -double RTimeSolver::getInputStartTime(void) const +double RTimeSolver::getInputStartTime() const { return this->inputStartTime; } /* RTimeSolver::getInputStartTime */ @@ -154,7 +154,7 @@ void RTimeSolver::setInputStartTime(double inputStartTime) this->inputStartTime = inputStartTime; } /* RTimeSolver::setInputStartTime */ -double RTimeSolver::getInputTimeStepSize(void) const +double RTimeSolver::getInputTimeStepSize() const { return this->inputTimeStepSize; } /* RTimeSolver::getInputTimeStepSize */ @@ -164,28 +164,28 @@ void RTimeSolver::setInputTimeStepSize(double inputTimeStepSize) this->inputTimeStepSize = inputTimeStepSize; } /* RTimeSolver::setInputTimeStepSize */ -unsigned int RTimeSolver::getCurrentTimeStep(void) const +uint RTimeSolver::getCurrentTimeStep() const { return this->currentTimeStep; } /* RTimeSolver::getCurrentTimeStep */ -void RTimeSolver::setCurrentTimeStep(unsigned int timeStep) +void RTimeSolver::setCurrentTimeStep(uint timeStep) { R_ERROR_ASSERT(timeStep < this->getNTimeSteps()); this->currentTimeStep = timeStep; } /* RTimeSolver::setCurrentTimeStep */ -unsigned int RTimeSolver::getOutputFrequency(void) const +uint RTimeSolver::getOutputFrequency() const { return this->outputFrequency; } /* RTimeSolver::getOutputFrequency */ -void RTimeSolver::setOutputFrequency(unsigned int outputFrequency) +void RTimeSolver::setOutputFrequency(uint outputFrequency) { this->outputFrequency = outputFrequency; } /* RTimeSolver::setOutputFrequency */ -unsigned int RTimeSolver::setNextTimeStep(void) +uint RTimeSolver::setNextTimeStep() { if (this->currentTimeStep + 1 >= this->getNTimeSteps()) { @@ -194,7 +194,7 @@ unsigned int RTimeSolver::setNextTimeStep(void) return ++this->currentTimeStep; } /* RTimeSolver::setNextTimeStep */ -double RTimeSolver::getCurrentTimeStepSize(void) const +double RTimeSolver::getCurrentTimeStepSize() const { if (this->enabled) { @@ -206,7 +206,7 @@ double RTimeSolver::getCurrentTimeStepSize(void) const } } /* RTimeSolver::getCurrentTimeStepSize */ -double RTimeSolver::getComputedTime(void) const +double RTimeSolver::getComputedTime() const { return this->computedTime; } /* RTimeSolver::getComputedTime */ @@ -216,13 +216,13 @@ void RTimeSolver::setComputedTime(double computedTime) this->computedTime = computedTime; } /* RTimeSolver::setComputedTime */ -double RTimeSolver::getCurrentTime(void) const +double RTimeSolver::getCurrentTime() const { R_ERROR_ASSERT(this->getCurrentTimeStep() < this->getNTimeSteps()); return this->times[this->getCurrentTimeStep()]; } /* RTimeSolver::getCurrentTime */ -double RTimeSolver::getPreviousTime(void) const +double RTimeSolver::getPreviousTime() const { R_ERROR_ASSERT(this->getCurrentTimeStep() < this->getNTimeSteps()); if (this->getCurrentTimeStep() > 0) @@ -235,25 +235,25 @@ double RTimeSolver::getPreviousTime(void) const } } /* RTimeSolver::getPreviousTime */ -double RTimeSolver::getTime(unsigned int timeStep) const +double RTimeSolver::getTime(uint timeStep) const { R_ERROR_ASSERT(timeStep < this->getNTimeSteps()); return this->times[timeStep]; } /* RTimeSolver::getTime */ -double RTimeSolver::getFirstTime(void) const +double RTimeSolver::getFirstTime() const { return this->getTime(0); } /* RTimeSolver::getFirstTime */ -double RTimeSolver::getLastTime(void) const +double RTimeSolver::getLastTime() const { return this->getTime(this->getNTimeSteps()-1); } /* RTimeSolver::getLastTime */ -unsigned int RTimeSolver::getNTimeSteps(void) const +uint RTimeSolver::getNTimeSteps() const { - return (unsigned int)this->times.size(); + return (uint)this->times.size(); } /* RTimeSolver::getNTimeSteps */ bool RTimeSolver::hasTime(double timeValue) const @@ -296,7 +296,7 @@ const QString &RTimeSolver::getTimeMarchApproximationName(RTimeMarchApproximatio return timeApproximationNames[timeApproximation]; } /* RTimeSolver::getTimeMarchApproximationName */ -std::vector RTimeSolver::findTimesVector(unsigned int nTimeSteps, double startTime, double timeStepSize) +std::vector RTimeSolver::findTimesVector(uint nTimeSteps, double startTime, double timeStepSize) { std::vector timesVector; From edb5d9d4bcd4571c71834f5eb646817a54b61d26 Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Tue, 8 Nov 2022 12:44:40 +0100 Subject: [PATCH 10/11] Set release version to 3.2.8 and grammar corrections --- range/Range/help/action_Export RAW model.html | 2 +- range/Range/help/action_New Session.html | 2 +- range/Range/help/action_Save Model As.html | 2 +- range/Range/help/action_Save Session As.html | 2 +- range/Range/help/general_Boundary condition.html | 6 +++--- range/Range/help/general_Environment condition.html | 4 ++-- range/Range/help/general_Problem type.html | 6 +++--- range/Range/help/general_Results.html | 6 +++--- range/Range/help/tutorial_Draw cube.html | 2 +- range/range.pri | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/range/Range/help/action_Export RAW model.html b/range/Range/help/action_Export RAW model.html index 01904248..77467f85 100644 --- a/range/Range/help/action_Export RAW model.html +++ b/range/Range/help/action_Export RAW model.html @@ -1,6 +1,6 @@

Export RAW model

Export selected model to RAW type file.

-

Each line in RAW file contains coordeinates of all nodes of exactly one element (simplex). Empty lines and comments that begins with # are accepted.

+

Each line in RAW file contains coordinates of all nodes of exactly one element (simplex). Empty lines and comments that begin with # are accepted.

Following simplexes are accepted:

diff --git a/range/Range/help/action_New Session.html b/range/Range/help/action_New Session.html index 8e6b479d..34594853 100644 --- a/range/Range/help/action_New Session.html +++ b/range/Range/help/action_New Session.html @@ -1,3 +1,3 @@

New Session

Create a new Session.

-

Session serves as a 'container' for multiple models. These models are not directly linked so no data can be exchanged nor shared between them. Purpose of session is to give possibility to work on multiple models simultaneously.

+

Session serves as a 'container' for multiple models. These models are not directly linked so no data can be exchanged nor shared between them. The purpose of the session is to give the possibility to work on multiple models simultaneously.

diff --git a/range/Range/help/action_Save Model As.html b/range/Range/help/action_Save Model As.html index 3e034539..1ffe4572 100644 --- a/range/Range/help/action_Save Model As.html +++ b/range/Range/help/action_Save Model As.html @@ -1,2 +1,2 @@

Save Model As

-Save selected model under a different file-name. +Save selected model under different filename. diff --git a/range/Range/help/action_Save Session As.html b/range/Range/help/action_Save Session As.html index 0db0062b..a69966e5 100644 --- a/range/Range/help/action_Save Session As.html +++ b/range/Range/help/action_Save Session As.html @@ -1,2 +1,2 @@

Save Session As

-Save current Session under different file name. +Save current Session under different filename. diff --git a/range/Range/help/general_Boundary condition.html b/range/Range/help/general_Boundary condition.html index 3bbfffe4..7919d2e1 100644 --- a/range/Range/help/general_Boundary condition.html +++ b/range/Range/help/general_Boundary condition.html @@ -3,8 +3,8 @@

Boundary condition

Boundary conditions are:

  • Problem specific - Each Problem type defines its own set of boundary conditions.
  • -
  • Explicit - Exact solution is prescribed at the boundary (eg. Temperature for Heat transfer). Bold text in Boundary conditions list.
  • -
  • Implicit - Implies a solution at the boundary (eg. Heat flux for Heat transfer).
  • +
  • Explicit - Exact solution is prescribed at the boundary (e.g., Temperature for Heat transfer). Bold text in Boundary conditions list.
  • +
  • Implicit - Implies a solution at the boundary (e.g., Heat flux for Heat transfer).

-

If problem is transient (time-dependent) then time dependent values can be assigned to boundary condition.

\ No newline at end of file +

If problem is transient (time-dependent) then time dependent values can be assigned to boundary condition.

diff --git a/range/Range/help/general_Environment condition.html b/range/Range/help/general_Environment condition.html index 5fb331b8..e732bf13 100644 --- a/range/Range/help/general_Environment condition.html +++ b/range/Range/help/general_Environment condition.html @@ -1,3 +1,3 @@

Environment condition

-

Environment condition is a condition which can be specified at any model entity such as Point, Line, Surface or Volume. Environment condition specifies problem specific values for given environment (eg. Environment temperature or Gravitational force.

-

If no Initial condition for given model entity is specified then environment condition is used.

\ No newline at end of file +

Environment condition is a condition which can be specified at any model entity such as Point, Line, Surface or Volume. Environment condition specifies problem specific values for given environment (e.g., Environment temperature or Gravitational force.

+

If no Initial condition for given model entity is specified then environment condition is used.

diff --git a/range/Range/help/general_Problem type.html b/range/Range/help/general_Problem type.html index bebfd0c5..54c39de7 100644 --- a/range/Range/help/general_Problem type.html +++ b/range/Range/help/general_Problem type.html @@ -1,6 +1,6 @@

Problem type

-

Problem type is an unique identifier of the physical phenomena to be solved.

-

It is possible to combine multiple different problem types (eg. Heat transfer and Stress analysis or In-compressible viscous flow and Contaminant dispersion).

+

Problem type is a unique identifier of the physical phenomena to be solved.

+

It is possible to combine multiple different problem types (e.g., Heat transfer and Stress analysis or In-compressible viscous flow and Contaminant dispersion).

List of supported problem types:

    @@ -14,4 +14,4 @@

    Problem type

  • Stress analysis
  • Modal analysis
-

\ No newline at end of file +

diff --git a/range/Range/help/general_Results.html b/range/Range/help/general_Results.html index d416f946..90ccd82d 100644 --- a/range/Range/help/general_Results.html +++ b/range/Range/help/general_Results.html @@ -1,6 +1,6 @@

Results

Results are produced by the Solver and consist of Result variables.

Results variable

-

Results variable is set of values computed by the Solver. Results variable is defined type (e.g. Temperature or Displacement and a vector of values. Based on type Results variable can contain vector of scalar values or vector values.

-

For example Temperature results variable will contain vector of temperatures for each node whereas Displacement will contain vector of displacement vectors for each node.

-

Results variable can be computed either on node or on element level. For example Displacement is computed on node level, whereas Stress is computed on element level. Each element level variable once computed can be converted to node level. Converting element level variable to node level is one time operation and can not be reverted. To do so results have to be recalculated by the Solver.

\ No newline at end of file +

Results variable is set of values computed by the Solver. Results variable is defined type (e.g., Temperature or Displacement and a vector of values. Based on type Results variable can contain vector of scalar values or vector values.

+

For example, Temperature results variable will contain vector of temperatures for each node whereas Displacement will contain vector of displacement vectors for each node.

+

Results variable can be computed either on node or on element level. For example, Displacement is computed on node level, whereas Stress is computed on element level. Each element level variable once computed can be converted to node level. Converting element level variable to node level is one time operation and can not be reverted. To do so results have to be recalculated by the Solver.

diff --git a/range/Range/help/tutorial_Draw cube.html b/range/Range/help/tutorial_Draw cube.html index c492fbdd..0206a2f2 100644 --- a/range/Range/help/tutorial_Draw cube.html +++ b/range/Range/help/tutorial_Draw cube.html @@ -17,4 +17,4 @@

2. Draw a cube

Save model

To save model just execute following action.

Menu: File -> Save Model

-

If model has not been saved before, program will show Save model dialog offering a file-name and path were to store. Click Save to accept.

+

If model has not been saved before, program will show Save model dialog offering a filename and path were to store. Click Save to accept.

diff --git a/range/range.pri b/range/range.pri index 80110061..26fdf330 100644 --- a/range/range.pri +++ b/range/range.pri @@ -1,6 +1,6 @@ -VERSION=3.2.7 +VERSION=3.2.8 YEAR=2022 -RELEASEDATE=2022-03-07 +RELEASEDATE=2022-11-08 NAME='Range Software' SHORTNAME='Range' TITLE='Finite Element Analysis' From 031a9966c5bed6128f114201916b657bc8525c1f Mon Sep 17 00:00:00 2001 From: Tomas Soltys Date: Tue, 8 Nov 2022 13:41:04 +0100 Subject: [PATCH 11/11] Updated README doc --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 47315506..06b4fa6e 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,14 @@ $ ./scripts/build.sh --clean && ./scripts/create_package.sh ``` $ ./scripts/build.sh --clean && ./scripts/create_mac_app.sh ``` -Above command will produce `./build-Release/packages/range-3.2.7.dmg` which can be installed with following command: +Above command will produce `./build-Release/packages/range-3.2.8.dmg` which can be installed with following command: ``` -$ open './build-Release/packages/range-3.2.7.dmg' +$ open './build-Release/packages/range-3.2.8.dmg' ``` + ## Running the software ``` -$ $HOME/bin/range-3.2.7/bin/Range +$ $HOME/bin/range-3.2.8/bin/Range ``` ## Download