From c9c0d806317bdefacc2bf333b238369be0a12aad Mon Sep 17 00:00:00 2001 From: mzh Date: Thu, 31 Oct 2024 16:13:26 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E6=88=90=E8=BF=90=E5=8A=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E3=80=81=E8=BE=B9=E7=95=8C=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=80=81=E5=88=9D=E5=A7=8B=E5=8C=96=E3=80=81=E5=8F=82=E8=80=83?= =?UTF-8?q?=E9=87=8F=E3=80=81=E8=AE=A1=E7=AE=97=E6=8E=A7=E5=88=B6=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E5=88=86ui=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CFDStructDataManager.pri | 10 + ...ructDataSolverBoundaryConditionManager.cpp | 577 ++++++++++++++++++ ...StructDataSolverBoundaryConditionManager.h | 51 ++ ...tructDataSolverComputingControlManager.cpp | 71 +++ ...DStructDataSolverComputingControlManager.h | 37 ++ ...DStructDataSolverInitializationManager.cpp | 77 +++ ...CFDStructDataSolverInitializationManager.h | 37 ++ ...ructDataSolverReferenceQuantityManager.cpp | 79 +++ ...StructDataSolverReferenceQuantityManager.h | 37 ++ ...tructDataSolverSportsAttributesManager.cpp | 138 +++++ ...DStructDataSolverSportsAttributesManager.h | 39 ++ .../CFDStructMain/CFDStructMainWindow.cpp | 4 +- Resources/Resources.qrc | 1 + Resources/icons/createbox2.png | Bin 0 -> 674 bytes Resources/img/createbox.png | Bin 0 -> 674 bytes 15 files changed, 1156 insertions(+), 2 deletions(-) create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp create mode 100644 CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h create mode 100644 Resources/icons/createbox2.png create mode 100644 Resources/img/createbox.png diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri b/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri index 832cc3e..52e6b39 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri +++ b/CFDStruct/CFDStructDataManager/CFDStructDataManager.pri @@ -1,5 +1,10 @@ SOURCES += \ $$PWD/CFDStructDataManagerBase.cpp \ + $$PWD/CFDStructDataSolverBoundaryConditionManager.cpp \ + $$PWD/CFDStructDataSolverComputingControlManager.cpp \ + $$PWD/CFDStructDataSolverInitializationManager.cpp \ + $$PWD/CFDStructDataSolverReferenceQuantityManager.cpp \ + $$PWD/CFDStructDataSolverSportsAttributesManager.cpp \ $$PWD/CFDStructDataSolverTimeModeManager.cpp \ $$PWD/CFDStructDataSolverBasicModelManager.cpp \ $$PWD/CFDStructDataSolverKvislManager.cpp \ @@ -9,6 +14,11 @@ SOURCES += \ HEADERS += \ $$PWD/CFDStructDataManagerBase.h \ + $$PWD/CFDStructDataSolverBoundaryConditionManager.h \ + $$PWD/CFDStructDataSolverComputingControlManager.h \ + $$PWD/CFDStructDataSolverInitializationManager.h \ + $$PWD/CFDStructDataSolverReferenceQuantityManager.h \ + $$PWD/CFDStructDataSolverSportsAttributesManager.h \ $$PWD/CFDStructDataSolverTimeModeManager.h \ $$PWD/CFDStructDataSolverBasicModelManager.h \ $$PWD/CFDStructDataSolverKvislManager.h \ diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp new file mode 100644 index 0000000..0ac1469 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.cpp @@ -0,0 +1,577 @@ +#include "CFDStructDataSolverTimeModeManager.h" +#include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" +#include "CUIProperty/CUISigsCenter.h" +#include +#include "CFDStructDataSolverBoundaryConditionManager.h" + +CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +{ + m_uiConfig = nullptr; + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) + { + qDebug() << semaphore << " ========================"; + emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); +} + +CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +{ + // CFDStructDataManagerBase::~CFDStructDataManagerBase(); +} + +CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +{ + if (m_uiConfig != nullptr) + { + delete m_uiConfig; + m_uiConfig = nullptr; + } + // // 如果是定常 + // if (m_runtype == 0) { + // m_uiConfig = this->genSteadyModeUIConfig(); + // qDebug() << " steady ============"; + // } else { + // // 如果是非定常 + // m_uiConfig = this->genUnsteadyModeUIConfig(); + // qDebug() << " unsteady ============"; + // } + // m_uiConfig->printConfig(); + return m_uiConfig; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genFarFieldModeUIConfig() +{ + + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "LineEdit"}, // 马赫数 + {"name", tr("mach number")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 密度 + {"name", tr("density")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 温度 + {"name", tr("temperature")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 来流方向 + {"name", tr("Flow direction")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流粘性比 + {"name", tr("Turbulent viscosity ratio")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流强度 + {"name", tr("Turbulence intensity")}, + }, + {}), + }); + + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureInletModeUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "LineEdit"}, // 总压 + {"name", tr("Total pressure")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 总温 + {"name", tr("Total temperature")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 静压 + {"name", tr("static pressure")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 来流方向 + {"name", tr("Flow direction")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流粘性比 + {"name", tr("Turbulent viscosity ratio")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 湍流强度 + {"name", tr("Turbulence intensity")}, + }, + {}), + // TODO 用户自定义 + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genPressureOutletUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "LineEdit"}, // 静压 + {"name", tr("static pressure")}, + }, + {}), + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genSymmetricUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genCycleUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "LineEdit"}, // 配对名称 + {"name", tr("Pairing Name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 对应面 + {"name", tr("Corresponding surface")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 周期类型 + {"name", tr("Cycle type")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 旋转中心 + {"name", tr("Rotation center")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 转轴方向 + {"name", tr("Axis direction")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 旋转角 + {"name", tr("Rotation angle")}, + }, + {}), + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallAdiabaticWallUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "GroupBox"}, // 壁面类型 + {"name", tr(("Wall type"))}, + }, + { + new CUIConfig({ + {"type", "RadioButton"}, // 绝热壁 + {"name", tr("Adiabatic wall")}, + }), + new CUIConfig({ + {"type", "RadioButton"}, // 等温壁 + {"name", tr("Isothermal wall")}, + }), + new CUIConfig({ + {"type", "RadioButton"}, // 热流壁 + {"name", tr("Hot flow wall")}, + }), + }), + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallIsothermalWallUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "GroupBox"}, // 壁面类型 + {"name", tr(("Wall type"))}, + }, + { + new CUIConfig({ + {"type", "RadioButton"}, // 绝热壁 + {"name", tr("Adiabatic wall")}, + }), + new CUIConfig({ + {"type", "RadioButton"}, // 等温壁 + {"name", tr("Isothermal wall")}, + }), + new CUIConfig({ + {"type", "RadioButton"}, // 热流壁 + {"name", tr("Hot flow wall")}, + }), + new CUIConfig({ + {"type","LineEidt"},//壁面温度 + {"name",tr("Wall temperature")}, + }), + }), + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverBoundaryConditionManager::genWallHotFlowWallUIConfig() +{ + return new CUIConfig({{"type", "Widget"}}, { + new CUIConfig({ + {"type", "LineEdit"}, // 边界名称 + {"name", tr("Boundary name")}, + }, + {}), + new CUIConfig({ + {"type", "LineEdit"}, // 所属计算域 + {"name", tr("Belonging to the computing domain")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 边界类型 + {"name", tr("Boundary type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 远场 + {"name", tr("far field")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强入口 + {"name", tr("Pressure inlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 压强出口 + {"name", tr("Pressure outlet")}, + }), + new CUIConfig({ + {"type", "Item"}, // 对称 + {"name", tr("symmetric")}, + }), + new CUIConfig({ + {"type", "Item"}, // 周期 + {"name", tr("cycle")}, + }), + new CUIConfig({ + {"type", "Item"}, // 壁面 + {"name", tr("Wall surface")}, + }), + }), + new CUIConfig({ + {"type", "GroupBox"}, // 壁面类型 + {"name", tr(("Wall type"))}, + }, + { + new CUIConfig({ + {"type", "RadioButton"}, // 绝热壁 + {"name", tr("Adiabatic wall")}, + }), + new CUIConfig({ + {"type", "RadioButton"}, // 等温壁 + {"name", tr("Isothermal wall")}, + }), + new CUIConfig({ + {"type", "RadioButton"}, // 热流壁 + {"name", tr("Hot flow wall")}, + }), + new CUIConfig({ + {"type","LineEidt"},//壁面热流 + {"name",tr("Wall heat flux")}, + }), + }), + }); + return nullptr; +} \ No newline at end of file diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h new file mode 100644 index 0000000..9d51dc2 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverBoundaryConditionManager.h @@ -0,0 +1,51 @@ +#ifndef CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H +#define CFDSTRUCTDATASOLVERBOUNDARYCONDITIONEMANAGER_H + +#include +#include "CFDStructDataManager_global.h" +class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverBoundaryConditionManager : public CFDStructDataManagerBase +{ + Q_OBJECT +public: + explicit CFDStructDataSolverBoundaryConditionManager(QObject *parent = nullptr); + ~CFDStructDataSolverBoundaryConditionManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成界面配置 远场 + CUIConfig* genFarFieldModeUIConfig(); + // 生成界面配置 压强入口 + CUIConfig* genPressureInletModeUIConfig(); + // 生成界面配置 压强出口 + CUIConfig* genPressureOutletUIConfig(); + // 生成界面配置 对称 + CUIConfig* genSymmetricUIConfig(); + // 生成界面配置 周期 + CUIConfig* genCycleUIConfig(); + // 生成界面配置 壁面 绝热壁 + CUIConfig* genWallAdiabaticWallUIConfig(); + // 生成界面配置 壁面 绝热壁 + CUIConfig* genWallIsothermalWallUIConfig(); + // 生成界面配置 壁面 绝热壁 + CUIConfig* genWallHotFlowWallUIConfig(); +signals: + +private: + // 时间模式:定常0,非定常1 + int m_runtype = 0; + // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 + int m_mcyc = 1000; + // 步长模式 >=1 + double m_alf0 = 1.0; + // 时间步长 >0 + double m_realdt = 1.0; + // 时间步数 >=1 + int m_nstep = 10; + // 时均统计量数据采样:0 | 1 + int m_timeaverage = 0; +}; + +#endif // CFDSTRUCTDATASOLVERBOUNDARYCONDITIONMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp new file mode 100644 index 0000000..e5be05c --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp @@ -0,0 +1,71 @@ +#include "CFDStructDataSolverTimeModeManager.h" +#include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" +#include "CUIProperty/CUISigsCenter.h" +#include +#include "CFDStructDataSolverComputingControlManager.h" + +CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +{ + m_uiConfig = nullptr; + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) + { + qDebug() << semaphore << " ========================"; + emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); +} + +CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +{ + // CFDStructDataManagerBase::~CFDStructDataManagerBase(); +} + +CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +{ + if (m_uiConfig != nullptr) + { + delete m_uiConfig; + m_uiConfig = nullptr; + } + // m_uiConfig->printConfig(); + return m_uiConfig; +} + +CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() +{ + return new CUIConfig( + { + {"type", "Widget"}, + }, + { + new CUIConfig({ + {"type", "GroupBox"}, // 自动保存 + {"name", tr("Auto Save")}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, // 数据保存频率 + {"name", tr("Data retention frequency")}, + }), + + // TODO数据文件保存 + }), + new CUIConfig({ + {"type", "GroupBox"}, // 并行控制 + {"name", tr("Parallel control")}, + }, + { + new CUIConfig({ + {"type", "CheckButton"}, // 并行 + {"name", tr("parallel")}, + }), + new CUIConfig({ + {"type", "CheckButton"}, // MPI库 + {"name", tr("MPI library")}, + }), + //TODO 数值计算核数 + //TODO 网格组装核数 + }), + }); + return nullptr; +} \ No newline at end of file diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h new file mode 100644 index 0000000..2147453 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h @@ -0,0 +1,37 @@ +#ifndef CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H +#define CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H + +#include +#include "CFDStructDataManager_global.h" +class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverComputingControlManager : public CFDStructDataManagerBase +{ + Q_OBJECT +public: + explicit CFDStructDataSolverComputingControlManager(QObject *parent = nullptr); + ~CFDStructDataSolverComputingControlManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成界面配置 + CUIConfig* genUIConfig(); +signals: + +private: + // 时间模式:定常0,非定常1 + int m_runtype = 0; + // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 + int m_mcyc = 1000; + // 步长模式 >=1 + double m_alf0 = 1.0; + // 时间步长 >0 + double m_realdt = 1.0; + // 时间步数 >=1 + int m_nstep = 10; + // 时均统计量数据采样:0 | 1 + int m_timeaverage = 0; +}; + +#endif // CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp new file mode 100644 index 0000000..69db404 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.cpp @@ -0,0 +1,77 @@ +#include "CFDStructDataSolverTimeModeManager.h" +#include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" +#include "CUIProperty/CUISigsCenter.h" +#include +#include "CFDStructDataSolverInitializationManager.h" + +CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +{ + m_uiConfig = nullptr; + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { + qDebug() << semaphore << " ========================"; + emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); + }); +} + +CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +{ +// CFDStructDataManagerBase::~CFDStructDataManagerBase(); +} + +CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +{ + if (m_uiConfig != nullptr) { + delete m_uiConfig; + m_uiConfig = nullptr; + } +// m_uiConfig->printConfig(); + return m_uiConfig; +} + +CUIConfig *CFDStructDataSolverInitializationManager::genUIConfig() +{ + new CUIConfig({ + {"type","Widget"}, + },{ + new CUIConfig({ + {"type","ComboBox"},//参考值取自 + {"name",tr("The reference value is taken from")}, + },{}), + new CUIConfig({ + {"type","GroupBox"},//初始值定义 + {"name",tr("Initial value definition")}, + },{ + new CUIConfig({ + {"type","LineEdit"},//密度 + {"name",tr("density")}, + }), + new CUIConfig({ + {"type","LineEdit"},//μ速度 + {"name",tr("μ speed")}, + }), + new CUIConfig({ + {"type","LineEdit"},//ν速度 + {"name",tr("v Speed")}, + }), + new CUIConfig({ + {"type","LineEdit"},//ω速度 + {"name",tr("ω velocity")}, + }), + new CUIConfig({ + {"type","LineEdit"},//压强 + {"name",tr("pressure")}, + }), + new CUIConfig({ + {"type","LineEdit"},//湍流粘性比 + {"name",tr("Turbulent viscosity ratio")}, + }), + new CUIConfig({ + {"type","LineEdit"},//湍流强度 + {"name",tr("Turbulence intensity")}, + }), + }), + }); + return nullptr; +} \ No newline at end of file diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h new file mode 100644 index 0000000..a5e662c --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverInitializationManager.h @@ -0,0 +1,37 @@ +#ifndef CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H +#define CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H + +#include +#include "CFDStructDataManager_global.h" +class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverInitializationManager : public CFDStructDataManagerBase +{ + Q_OBJECT +public: + explicit CFDStructDataSolverInitializationManager(QObject *parent = nullptr); + ~CFDStructDataSolverInitializationManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成界面配置 + CUIConfig* genUIConfig(); +signals: + +private: + // 时间模式:定常0,非定常1 + int m_runtype = 0; + // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 + int m_mcyc = 1000; + // 步长模式 >=1 + double m_alf0 = 1.0; + // 时间步长 >0 + double m_realdt = 1.0; + // 时间步数 >=1 + int m_nstep = 10; + // 时均统计量数据采样:0 | 1 + int m_timeaverage = 0; +}; + +#endif // CFDSTRUCTDATASOLVERINITIALIZATIONEMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp new file mode 100644 index 0000000..569b0e7 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.cpp @@ -0,0 +1,79 @@ +#include "CFDStructDataSolverTimeModeManager.h" +#include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" +#include "CUIProperty/CUISigsCenter.h" +#include +#include "CFDStructDataSolverReferenceQuantityManager.h" + +CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +{ + m_uiConfig = nullptr; + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) + { + qDebug() << semaphore << " ========================"; + emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); }); +} + +CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +{ + // CFDStructDataManagerBase::~CFDStructDataManagerBase(); +} + +CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +{ + if (m_uiConfig != nullptr) + { + delete m_uiConfig; + m_uiConfig = nullptr; + } + + // m_uiConfig->printConfig(); + return m_uiConfig; +} + +CUIConfig *CFDStructDataSolverReferenceQuantityManager::genUIConfig() +{ + return new CUIConfig({ + {"type", "Widget"}, + }, + { + new CUIConfig({{"type", "ComboBox"}, // 参考值取自 + {"name", tr("The reference value is taken from")}}, + { + new CUIConfig({ + {"type", "Item"}, // 无 + {"name", tr("none")}, + }), + }), + new CUIConfig({{"type", "GroupBox"}, // 热力学 + {"name", tr("thermodynamics")}}, + { + new CUIConfig({ + {"type", "LineEdit"},//压强 + {"name", tr("pressure")}, + }), + new CUIConfig({ + {"type", "LineEdit"},//温度 + {"name", tr("temperature")}, + }), + }), + new CUIConfig({{"type", "GroupBox"}, // Re数相关 + {"name", tr("Re number related")}}, + { + new CUIConfig({ + {"type", "LineEdit"},//长度 + {"name", tr("length")}, + }), + }), + new CUIConfig({{"type", "GroupBox"}, // 力和力矩 + {"name", tr("Force and torque")}}, + { + new CUIConfig({ + {"type", "LineEdit"},//面积 + {"name", tr("the measure of area")}, + }), + }), + }); + return nullptr; +} \ No newline at end of file diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h new file mode 100644 index 0000000..2a9e6cb --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverReferenceQuantityManager.h @@ -0,0 +1,37 @@ +#ifndef CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H +#define CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H + +#include +#include "CFDStructDataManager_global.h" +class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverReferenceQuantityManager : public CFDStructDataManagerBase +{ + Q_OBJECT +public: + explicit CFDStructDataSolverReferenceQuantityManager(QObject *parent = nullptr); + ~CFDStructDataSolverReferenceQuantityManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成界面配置 + CUIConfig* genUIConfig(); +signals: + +private: + // 时间模式:定常0,非定常1 + int m_runtype = 0; + // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 + int m_mcyc = 1000; + // 步长模式 >=1 + double m_alf0 = 1.0; + // 时间步长 >0 + double m_realdt = 1.0; + // 时间步数 >=1 + int m_nstep = 10; + // 时均统计量数据采样:0 | 1 + int m_timeaverage = 0; +}; + +#endif // CFDSTRUCTDATASOLVERREFERENCEQUANTITYEMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp new file mode 100644 index 0000000..5ffa1c9 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.cpp @@ -0,0 +1,138 @@ +#include "CFDStructDataSolverTimeModeManager.h" +#include "CUIProperty/CUIConfig.h" +#include "CFDStructMain/CFDStructDefine.h" +#include "CFDStructSigsCenter.h" +#include "CUIProperty/CUISigsCenter.h" +#include +#include "CFDStructDataSolverSportsAttributesManager.h" + +CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) +{ + m_uiConfig = nullptr; + // connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { + // qDebug() << semaphore << " ========================"; + // emit CFDStructSigsCenter::getInstance()->sig_solverTimeModeDataChanged(); + // }); +} + +CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() +{ + // CFDStructDataManagerBase::~CFDStructDataManagerBase(); +} + +CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() +{ + if (m_uiConfig != nullptr) + { + delete m_uiConfig; + m_uiConfig = nullptr; + } + return m_uiConfig; +} + +CUIConfig *CFDStructDataSolverSportsAttributesManager::genMovingFrameModeUIConfig() +{ + return new CUIConfig({ + {"type", "Widget"}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, // 运动名称 + {"name", tr("Sports name")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 运动类型 + {"name", tr("Sports type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 运动坐标系 + {"name", tr("Moving Frame")}, + }), + new CUIConfig({ + {"type", "Item"}, // 刚体 + {"name", tr("RigidBody")}, + }), + }), + new CUIConfig({ + {"type", "GroupBox"}, // 运动特征 + {"name", tr("Sports characteristics")}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, // 运动方式 + {"name", tr("Sports Style")}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 转轴原点 + {"name", tr("Axis origin")}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 转轴方向 + {"name", tr("Axis direction")}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 转速 + {"name", tr("speed")}, + }), + }), + // TODO + new CUIConfig({ + {"type", "List"}, // 域列表 + {"name", tr("Domain List")}, + }, + {}), + }); + return nullptr; +} + +CUIConfig *CFDStructDataSolverSportsAttributesManager::genRigidBodyModeUIConfig() +{ + return new CUIConfig({ + {"type", "Widget"}, + }, + { + new CUIConfig({ + {"type", "LineEdit"}, // 运动名称 + {"name", tr("Sports name")}, + }, + {}), + new CUIConfig({ + {"type", "ComboBox"}, // 运动类型 + {"name", tr("Sports type")}, + }, + { + new CUIConfig({ + {"type", "Item"}, // 运动坐标系 + {"name", tr("Moving Frame")}, + }), + new CUIConfig({ + {"type", "Item"}, // 刚体 + {"name", tr("RigidBody")}, + }), + }), + new CUIConfig({ + {"type", "GroupBox"}, // 用户自定义 + {"name", tr("User defined")}, + }, + { + // TODO + new CUIConfig({ + {"type", "LineEdit"}, // 打开文件 + {"name", tr("Open file")}, + }), + new CUIConfig({ + {"type", "LineEdit"}, // 函数名称 + {"name", tr("Function Name")}, + }), + }), + // TODO + new CUIConfig({ + {"type", "List"}, // 域列表 + {"name", tr("Domain List")}, + }, + {}), + }); + return nullptr; +} diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h new file mode 100644 index 0000000..58cb6f2 --- /dev/null +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverSportsAttributesManager.h @@ -0,0 +1,39 @@ +#ifndef CFDSTRUCTDATASOLVERSPORTSATTRIBUTESMANAGER_H +#define CFDSTRUCTDATASOLVERSPORTSATTRIBUTESMANAGER_H + +#include +#include "CFDStructDataManager_global.h" +class CUIConfig; + +class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverSportsAttributesManager : public CFDStructDataManagerBase +{ + Q_OBJECT +public: + explicit CFDStructDataSolverSportsAttributesManager(QObject *parent = nullptr); + ~CFDStructDataSolverSportsAttributesManager(); + + CUIConfig* getParamUIConfig(); + +private: + // 生成运动坐标系的界面配置 + CUIConfig* genMovingFrameModeUIConfig(); + // 生成刚体的界面配置 + CUIConfig* genRigidBodyModeUIConfig(); +signals: + +private: + // // 时间模式:定常0,非定常1 + // int m_runtype = 0; + // // 时间模式:定常0,则是迭代步数;时间模式:非定常1,则是内迭代步数 + // int m_mcyc = 1000; + // // 步长模式 >=1 + // double m_alf0 = 1.0; + // // 时间步长 >0 + // double m_realdt = 1.0; + // // 时间步数 >=1 + // int m_nstep = 10; + // // 时均统计量数据采样:0 | 1 + // int m_timeaverage = 0; +}; + +#endif // CFDSTRUCTDATASOLVERSPORTSATTRIBUTESMANAGER_H diff --git a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp index 2a5bc10..bc545bf 100644 --- a/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp +++ b/CFDStruct/CFDStructMain/CFDStructMainWindow.cpp @@ -1,4 +1,4 @@ -#include "CFDStructMainWindow.h" +#include "CFDStructMainWindow.h" #include "CFDMainTreeWidget.h" #include "GUIFrame/PropertyWidget.h" @@ -193,7 +193,7 @@ void CFDStructMainWindow::addSARibbonCategoryCalculation() //�������� "����͵���" pannel = gategory->addPannel(tr("Import and Export")); //����ͼ��"������" - action = createAction(tr("Mesh Import"), "actionMeshImport", ":/icons/createbox.png", tr("Mesh Import")); + action = createAction(tr("Mesh Import"), "actionMeshImport", ":/img/createbox.png", tr("Mesh Import")); //"������"����"����͵���" pannelAddAction(pannel, action, SARibbonPannelItem::Large); //����ͼ��"����" diff --git a/Resources/Resources.qrc b/Resources/Resources.qrc index eb056cf..4f5b8b6 100644 --- a/Resources/Resources.qrc +++ b/Resources/Resources.qrc @@ -239,6 +239,7 @@ ./icons/BoolCommon.png ./icons/icoR_license.svg + ./img/createbox.png diff --git a/Resources/icons/createbox2.png b/Resources/icons/createbox2.png new file mode 100644 index 0000000000000000000000000000000000000000..770b5986ca07ffea177514e5884ad09f81a014fa GIT binary patch literal 674 zcmV;T0$u%yP)(%+5#=;!X-!3 z_V3+y_ubw9BM2M$XW8=e(dEUtL>E&IR|xhLm-(!P=m zpxPrdEhQ@n(k!VMq^1_3fLpEN@|~sCoh5=<~Et?{K8Dk_L!8bZMvaYRnFR zqe~E1H%NDlKt#c@$Rib3O<_dsb=4Pf&!Rvj6}9 literal 0 HcmV?d00001 diff --git a/Resources/img/createbox.png b/Resources/img/createbox.png new file mode 100644 index 0000000000000000000000000000000000000000..770b5986ca07ffea177514e5884ad09f81a014fa GIT binary patch literal 674 zcmV;T0$u%yP)(%+5#=;!X-!3 z_V3+y_ubw9BM2M$XW8=e(dEUtL>E&IR|xhLm-(!P=m zpxPrdEhQ@n(k!VMq^1_3fLpEN@|~sCoh5=<~Et?{K8Dk_L!8bZMvaYRnFR zqe~E1H%NDlKt#c@$Rib3O<_dsb=4Pf&!Rvj6}9 literal 0 HcmV?d00001