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