From 9f124170431ba24b7302d8ed9e2f7045b138214b Mon Sep 17 00:00:00 2001 From: mzh Date: Tue, 12 Nov 2024 12:05:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81ui=E7=95=8C=E9=9D=A2=E4=B8=8A?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E6=96=B9=E6=B3=95-=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=A6=BB=E6=95=A3=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=AE=9A=E5=B8=B8?= =?UTF-8?q?=E9=9D=9E=E5=AE=9A=E5=B8=B8=E5=B1=95=E7=A4=BA=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E3=80=81=E8=BF=AD=E4=BB=A3=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...StructDataSolverNumericalMethodManager.cpp | 469 +++++++++++------- ...FDStructDataSolverNumericalMethodManager.h | 5 + 2 files changed, 308 insertions(+), 166 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.cpp index 504c04e..154deaa 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.cpp @@ -11,6 +11,9 @@ CFDStructDataSolverNumericalMethodManager::~CFDStructDataSolverNumericalMethodMa } CUIConfig *CFDStructDataSolverNumericalMethodManager::getParamUIConfig() { + + initTimeDespersionGroupConfig(); + if (m_fluxFormat == 0) return this->genJamesonModeUIConfig(); if (m_fluxFormat == 1) @@ -238,49 +241,50 @@ CUIConfig *CFDStructDataSolverNumericalMethodManager::genJamesonModeUIConfig() { }), }), }), - new CUIConfig({ - {"type", "GroupBox"}, // 时间离散 - {"name", tr("Time dispersion")}, - }, - { - new CUIConfig({ - {"type", "ComboBox"}, // 时间格式 - {"name", tr("Time format")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + // new CUIConfig({ + // {"type", "GroupBox"}, // 时间离散 + // {"name", tr("Time dispersion")}, + // }, + // { + // new CUIConfig({ + // {"type", "ComboBox"}, // 时间格式 + // {"name", tr("Time format")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_timeFormat)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // 隐式 - {"name", tr("Implicit")}, - }), - new CUIConfig({ - {"type", "Item"}, // 隐式二阶差分 - {"name", tr("Implicit second-order difference")}, - }), - }), - new CUIConfig({ - {"type", "ComboBox"}, // 迭代方法 - {"name", tr("Iterative method")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // 隐式 + // {"name", tr("Implicit")}, + // }), + // new CUIConfig({ + // {"type", "Item"}, // 隐式二阶差分 + // {"name", tr("Implicit second-order difference")}, + // }), + // }), + // new CUIConfig({ + // {"type", "ComboBox"}, // 迭代方法 + // {"name", tr("Iterative method")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // LUSGS - {"name", tr("LUSGS")}, - }), - }), - new CUIConfig({ - {"type", "LineEdit"}, // 松弛因子 - {"name", tr("Relaxation factor")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, - }, - {}), - }), + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // LUSGS + // {"name", tr("LUSGS")}, + // }), + // }), + // new CUIConfig({ + // {"type", "LineEdit"}, // 松弛因子 + // {"name", tr("Relaxation factor")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + // {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, + // }, + // {}), + // }), + m_TimeDispersionGroupConfig, new CUIConfig({ {"type", "GroupBox"}, // 加速收敛 {"name", tr("Accelerate convergence")}, @@ -458,49 +462,50 @@ CUIConfig *CFDStructDataSolverNumericalMethodManager::genRoeModeUIConfig() { }), }), }), - new CUIConfig({ - {"type", "GroupBox"}, // 时间离散 - {"name", tr("Time dispersion")}, - }, - { - new CUIConfig({ - {"type", "ComboBox"}, // 时间格式 - {"name", tr("Time format")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + // new CUIConfig({ + // {"type", "GroupBox"}, // 时间离散 + // {"name", tr("Time dispersion")}, + // }, + // { + // new CUIConfig({ + // {"type", "ComboBox"}, // 时间格式 + // {"name", tr("Time format")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_timeFormat)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // 隐式 - {"name", tr("Implicit")}, - }), - new CUIConfig({ - {"type", "Item"}, // 隐式二阶差分 - {"name", tr("Implicit second-order difference")}, - }), - }), - new CUIConfig({ - {"type", "ComboBox"}, // 迭代方法 - {"name", tr("Iterative method")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // 隐式 + // {"name", tr("Implicit")}, + // }), + // new CUIConfig({ + // {"type", "Item"}, // 隐式二阶差分 + // {"name", tr("Implicit second-order difference")}, + // }), + // }), + // new CUIConfig({ + // {"type", "ComboBox"}, // 迭代方法 + // {"name", tr("Iterative method")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // LUSGS - {"name", tr("LUSGS")}, - }), - }), - new CUIConfig({ - {"type", "LineEdit"}, // 松弛因子 - {"name", tr("Relaxation factor")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, - }, - {}), - }), + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // LUSGS + // {"name", tr("LUSGS")}, + // }), + // }), + // new CUIConfig({ + // {"type", "LineEdit"}, // 松弛因子 + // {"name", tr("Relaxation factor")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + // {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, + // }, + // {}), + // }), + m_TimeDispersionGroupConfig, new CUIConfig({ {"type", "GroupBox"}, // 加速收敛 {"name", tr("Accelerate convergence")}, @@ -658,49 +663,50 @@ CUIConfig *CFDStructDataSolverNumericalMethodManager::genAUSMDYModeUIConfig() { }), }), }), - new CUIConfig({ - {"type", "GroupBox"}, // 时间离散 - {"name", tr("Time dispersion")}, - }, - { - new CUIConfig({ - {"type", "ComboBox"}, // 时间格式 - {"name", tr("Time format")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + // new CUIConfig({ + // {"type", "GroupBox"}, // 时间离散 + // {"name", tr("Time dispersion")}, + // }, + // { + // new CUIConfig({ + // {"type", "ComboBox"}, // 时间格式 + // {"name", tr("Time format")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_timeFormat)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // 隐式 - {"name", tr("Implicit")}, - }), - new CUIConfig({ - {"type", "Item"}, // 隐式二阶差分 - {"name", tr("Implicit second-order difference")}, - }), - }), - new CUIConfig({ - {"type", "ComboBox"}, // 迭代方法 - {"name", tr("Iterative method")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // 隐式 + // {"name", tr("Implicit")}, + // }), + // new CUIConfig({ + // {"type", "Item"}, // 隐式二阶差分 + // {"name", tr("Implicit second-order difference")}, + // }), + // }), + // new CUIConfig({ + // {"type", "ComboBox"}, // 迭代方法 + // {"name", tr("Iterative method")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // LUSGS - {"name", tr("LUSGS")}, - }), - }), - new CUIConfig({ - {"type", "LineEdit"}, // 松弛因子 - {"name", tr("Relaxation factor")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, - }, - {}), - }), + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // LUSGS + // {"name", tr("LUSGS")}, + // }), + // }), + // new CUIConfig({ + // {"type", "LineEdit"}, // 松弛因子 + // {"name", tr("Relaxation factor")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + // {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, + // }, + // {}), + // }), + m_TimeDispersionGroupConfig, new CUIConfig({ {"type", "GroupBox"}, // 加速收敛 {"name", tr("Accelerate convergence")}, @@ -790,8 +796,6 @@ CUIConfig *CFDStructDataSolverNumericalMethodManager::genAUSMPWPModeUIConfig() { {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, {"value_origin", QVA_GLOBAL(&m_fluxFormat)}, {"semaphore", (int)SolutionAnalysisModuleProperty::NUumerical_Methods}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_fluxFormat)}, }, { @@ -860,49 +864,50 @@ CUIConfig *CFDStructDataSolverNumericalMethodManager::genAUSMPWPModeUIConfig() { }), }), }), - new CUIConfig({ - {"type", "GroupBox"}, // 时间离散 - {"name", tr("Time dispersion")}, - }, - { - new CUIConfig({ - {"type", "ComboBox"}, // 时间格式 - {"name", tr("Time format")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + // new CUIConfig({ + // {"type", "GroupBox"}, // 时间离散 + // {"name", tr("Time dispersion")}, + // }, + // { + // new CUIConfig({ + // {"type", "ComboBox"}, // 时间格式 + // {"name", tr("Time format")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_timeFormat)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // 隐式 - {"name", tr("Implicit")}, - }), - new CUIConfig({ - {"type", "Item"}, // 隐式二阶差分 - {"name", tr("Implicit second-order difference")}, - }), - }), - new CUIConfig({ - {"type", "ComboBox"}, // 迭代方法 - {"name", tr("Iterative method")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // 隐式 + // {"name", tr("Implicit")}, + // }), + // new CUIConfig({ + // {"type", "Item"}, // 隐式二阶差分 + // {"name", tr("Implicit second-order difference")}, + // }), + // }), + // new CUIConfig({ + // {"type", "ComboBox"}, // 迭代方法 + // {"name", tr("Iterative method")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + // {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, - }, - { - new CUIConfig({ - {"type", "Item"}, // LUSGS - {"name", tr("LUSGS")}, - }), - }), - new CUIConfig({ - {"type", "LineEdit"}, // 松弛因子 - {"name", tr("Relaxation factor")}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, - }, - {}), - }), + // }, + // { + // new CUIConfig({ + // {"type", "Item"}, // LUSGS + // {"name", tr("LUSGS")}, + // }), + // }), + // new CUIConfig({ + // {"type", "LineEdit"}, // 松弛因子 + // {"name", tr("Relaxation factor")}, + // {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + // {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, + // }, + // {}), + // }), + m_TimeDispersionGroupConfig, new CUIConfig({ {"type", "GroupBox"}, // 加速收敛 {"name", tr("Accelerate convergence")}, @@ -975,3 +980,135 @@ CUIConfig *CFDStructDataSolverNumericalMethodManager::genAUSMPWPModeUIConfig() { }); return nullptr; } + +#include "CFDStructDataManager.h" +void CFDStructDataSolverNumericalMethodManager::initTimeDespersionGroupConfig() { + int m_runTime = CFDStructDataManager::getInstance()->getTimeModeRunTime(); + + m_TimeDispersionGroupConfig = new CUIConfig({}, {}); + + if (m_runTime == 0) { + if (m_timeFormat == 0) { + m_TimeDispersionGroupConfig = new CUIConfig({ + {"type", "GroupBox"}, // 时间离散 + {"name", tr("Time dispersion")}, + }, + { + new CUIConfig({ + {"type", "ComboBox"}, // 时间格式 + {"name", tr("Time format")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::NUumerical_Methods}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 隐式 + {"name", tr("Implicit")}, + }), + new CUIConfig({ + {"type", "Item"}, // 显式 + {"name", tr("Explicit")}, + }), + }), + new CUIConfig({ + {"type", "ComboBox"}, // 迭代方法 + {"name", tr("Iterative method")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + + }, + { + new CUIConfig({ + {"type", "Item"}, // LUSGS + {"name", tr("LUSGS")}, + }), + }), + new CUIConfig({ + {"type", "LineEdit"}, // 松弛因子 + {"name", tr("Relaxation factor")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, + }, + {}), + }); + } else if (m_timeFormat == 1) { + m_TimeDispersionGroupConfig = new CUIConfig({ + {"type", "GroupBox"}, // 时间离散 + {"name", tr("Time dispersion")}, + }, + { + new CUIConfig({ + {"type", "ComboBox"}, // 时间格式 + {"name", tr("Time format")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::NUumerical_Methods}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 隐式 + {"name", tr("Implicit")}, + }), + new CUIConfig({ + {"type", "Item"}, // 显式 + {"name", tr("Explicit")}, + }), + }), + new CUIConfig({ + {"type", "ComboBox"}, // 迭代方法 + {"name", tr("Iterative method")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + + }, + { + new CUIConfig({ + {"type", "Item"}, // 5级龙格库塔 + {"name", tr("5th-order Runge-Kutta")}, + }), + }), + }); + } + } else if (m_runTime == 1) { + m_TimeDispersionGroupConfig = new CUIConfig({ + {"type", "GroupBox"}, // 时间离散 + {"name", tr("Time dispersion")}, + }, + { + new CUIConfig({ + {"type", "ComboBox"}, // 时间格式 + {"name", tr("Time format")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_timeFormat)}, + + }, + { + new CUIConfig({ + {"type", "Item"}, // 隐式 + {"name", tr("Implicit second-order difference")}, + }), + }), + new CUIConfig({ + {"type", "ComboBox"}, // 迭代方法 + {"name", tr("Iterative method")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_iterationMethod)}, + + }, + { + new CUIConfig({ + {"type", "Item"}, // LUSGS + {"name", tr("LUSGS")}, + }), + }), + new CUIConfig({ + {"type", "LineEdit"}, // 松弛因子 + {"name", tr("Relaxation factor")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_relaxationFactor)}, + }, + {}), + }); + } +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.h index 547b92c..3731745 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverNumericalMethodManager.h @@ -31,6 +31,11 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverNumericalMethodManager : pu signals: private: + // 时间离散部分的配置 + CUIConfig *m_TimeDispersionGroupConfig; + // 初始化时间离散部分的配置 + void initTimeDespersionGroupConfig(); + // 通量格式 /** * @brief m_fluxFormat