From abb80ac8634f58c3a36c30ae9ae36680f43f123c Mon Sep 17 00:00:00 2001 From: mzh Date: Thu, 7 Nov 2024 11:21:59 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=A1=A5=E5=85=85=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E7=9A=84=E4=B8=A4=E4=B8=AA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=EF=BC=88=E5=B9=B6=E8=A1=8C=E5=BC=80=E5=85=B3=E3=80=81mpi?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tructDataSolverComputingControlManager.cpp | 6 + ...DStructDataSolverComputingControlManager.h | 6 + .../CFDStructDataSolverTimeModeManager.cpp | 209 +++++++++--------- 3 files changed, 116 insertions(+), 105 deletions(-) diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp index f64a7f5..8686890 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.cpp @@ -29,6 +29,8 @@ void CFDStructDataSolverComputingControlManager::saveDataToDom(rapidjson::Docume jsonAdd(dom, m_DataSaveFrequency, {"couplingSolver", "unSteady", "savedSteps"}); jsonAdd(dom, m_DataSaveFrequency, {"couplingSolver", "steady", "savedIters"}); jsonAdd(dom, m_NumericalComputationCores, {"couplingSolver", "mpi", "core"}); + jsonAdd(dom, m_enableMPI, {"couplingSolver", "mpi", "on"}); + jsonAdd(dom, m_mpiLibType, {"couplingSolver", "mpi", "type"}); } CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() { @@ -59,10 +61,14 @@ CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() { new CUIConfig({ {"type", "CheckBox"}, // 并行 {"name", tr("parallel")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_enableMPI)}, }), new CUIConfig({ {"type", "ComboBox"}, // MPI库 {"name", tr("MPI library")}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_mpiLibType)}, }, { new CUIConfig({ diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h index f4f579a..8700945 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverComputingControlManager.h @@ -32,6 +32,12 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverComputingControlManager : p // ??表中没有 // 网格组装核数 int m_MeshAssemblyCores = 0; + + // 并行开关 + int m_enableMPI = 0; + + // mpi库类型 + int m_mpiLibType = 0; }; #endif // CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H diff --git a/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp b/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp index ad5d7dd..53e6cff 100644 --- a/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp +++ b/CFDStruct/CFDStructDataManager/CFDStructDataSolverTimeModeManager.cpp @@ -1,39 +1,33 @@ #include "CFDStructDataSolverTimeModeManager.h" -#include "CUIProperty/CUIConfig.h" +#include "CFDStructDataManagerBase.h" #include "CFDStructMain/CFDStructDefine.h" #include "CFDStructSigsCenter.h" +#include "CUIProperty/CUIConfig.h" #include "CUIProperty/CUISigsCenter.h" #include -#include "CFDStructDataManagerBase.h" #include -#include #include +#include - -CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) -{ +CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) { m_uiConfig = nullptr; - connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { - emit CFDStructSigsCenter::getInstance()->sig_solverModuleProperty((SolutionAnalysisModuleProperty)semaphore); + connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) { + emit CFDStructSigsCenter::getInstance() -> sig_solverModuleProperty((SolutionAnalysisModuleProperty)semaphore); }); - - } -CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() -{ -// CFDStructDataManagerBase::~CFDStructDataManagerBase(); +CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() { + // CFDStructDataManagerBase::~CFDStructDataManagerBase(); } -CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() -{ +CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() { if (m_uiConfig != nullptr) { delete m_uiConfig; m_uiConfig = nullptr; } -// qDebug()<genSteadyModeUIConfig(); @@ -41,99 +35,104 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() // 如果是非定常 m_uiConfig = this->genUnsteadyModeUIConfig(); } -// m_uiConfig->printConfig(); + // m_uiConfig->printConfig(); return m_uiConfig; } -void CFDStructDataSolverTimeModeManager::saveDataToDom(rapidjson::Document &dom) -{ - jsonAdd(dom,m_runtype,{"region",0,"solver","time"}); - jsonAdd(dom,m_innerIters,{"couplingSolver", "unSteady", "innerIters",}); - jsonAdd(dom,m_iters,{"couplingSolver", "steady", "iters",}); - jsonAdd(dom,m_alf0,{"couplingSolver", "unSteady", "stepType",}); - jsonAdd(dom,m_realdt,{"couplingSolver", "unSteady", "timeStep",}); - jsonAdd(dom,m_nstep,{"couplingSolver", "unSteady", "timeStepsNumber",}); - jsonAdd(dom,m_timeaverage,{"couplingSolver", "unSteady", "Timeverage",}); +void CFDStructDataSolverTimeModeManager::saveDataToDom(rapidjson::Document &dom) { + jsonAdd(dom, m_runtype, {"region", 0, "solver", "time"}); + jsonAdd(dom, m_innerIters, { + "couplingSolver", + "unSteady", + "innerIters", + }); + jsonAdd(dom, m_iters, { + "couplingSolver", + "steady", + "iters", + }); + jsonAdd(dom, m_alf0, { + "couplingSolver", + "unSteady", + "stepType", + }); + jsonAdd(dom, m_realdt, { + "couplingSolver", + "unSteady", + "timeStep", + }); + jsonAdd(dom, m_nstep, { + "couplingSolver", + "unSteady", + "timeStepsNumber", + }); + jsonAdd(dom, m_timeaverage, { + "couplingSolver", + "unSteady", + "Timeverage", + }); } -CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() -{ - return new CUIConfig({ - {"type", "Widget"}}, { - new CUIConfig({ - {"type", "ComboBox"}, - {"name", "Time Mode"}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_runtype)}, - {"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode}, - }, { - new CUIConfig({ - {"type", "Item"}, - {"name", "steady"}, - }), - new CUIConfig({ - {"type", "Item"}, - {"name", "unsteady"}, - }) - }), - new CUIConfig({ - {"type", "LineEdit"}, - {"name", "iteration count"}, - {"value_type", CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_iters)}, - }) - }); +CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() { + return new CUIConfig({{"type", "Widget"}}, {new CUIConfig({ + {"type", "ComboBox"}, + {"name", "Time Mode"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_runtype)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode}, + }, + {new CUIConfig({ + {"type", "Item"}, + {"name", "steady"}, + }), + new CUIConfig({ + {"type", "Item"}, + {"name", "unsteady"}, + })}), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "iteration count"}, + {"value_type", CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_iters)}, + })}); } -CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() -{ - return new CUIConfig({ - {"type", "Widget"} - }, { - new CUIConfig({ - {"type", "ComboBox"}, - {"name", "Time Mode"}, - {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_runtype)}, - {"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode}, - }, { - new CUIConfig({ - {"type", "Item"}, - {"name", "steady"} - }), - new CUIConfig({ - {"type", "Item"}, - {"name", "unsteady"} - }) - }), - new CUIConfig({ - {"type", "LineEdit"}, - {"name", "alf0"}, - {"value_type", CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_alf0)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, - {"name", "realdt"}, - {"value_type", CUI_DATA_TYPE_DOUBLE}, - {"value_origin", QVA_GLOBAL(&m_realdt)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, - {"name", "nstep"}, - {"value_type", CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_nstep)}, - }), - new CUIConfig({ - {"type", "LineEdit"}, - {"name", "mcyc"}, - {"value_type", CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_iters)}, - }), - new CUIConfig({ - {"type", "CheckBox"}, - {"name", "Time Average"}, - {"value_type", CUI_DATA_TYPE_INT}, - {"value_origin", QVA_GLOBAL(&m_timeaverage)}, - }) - }); +CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() { + return new CUIConfig({{"type", "Widget"}}, {new CUIConfig({ + {"type", "ComboBox"}, + {"name", "Time Mode"}, + {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_runtype)}, + {"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode}, + }, + {new CUIConfig({{"type", "Item"}, {"name", "steady"}}), new CUIConfig({{"type", "Item"}, {"name", "unsteady"}})}), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "alf0"}, + {"value_type", CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_alf0)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "realdt"}, + {"value_type", CUI_DATA_TYPE_DOUBLE}, + {"value_origin", QVA_GLOBAL(&m_realdt)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "nstep"}, + {"value_type", CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_nstep)}, + }), + new CUIConfig({ + {"type", "LineEdit"}, + {"name", "mcyc"}, + {"value_type", CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_iters)}, + }), + new CUIConfig({ + {"type", "CheckBox"}, + {"name", "Time Average"}, + {"value_type", CUI_DATA_TYPE_INT}, + {"value_origin", QVA_GLOBAL(&m_timeaverage)}, + })}); }