1、补充计算控制的两个数据(并行开关、mpi库类型)

feature/struct-menu-20241023
mzh 1 week ago
parent 570b0cf2cd
commit abb80ac863

@ -29,6 +29,8 @@ void CFDStructDataSolverComputingControlManager::saveDataToDom(rapidjson::Docume
jsonAdd(dom, m_DataSaveFrequency, {"couplingSolver", "unSteady", "savedSteps"}); jsonAdd(dom, m_DataSaveFrequency, {"couplingSolver", "unSteady", "savedSteps"});
jsonAdd(dom, m_DataSaveFrequency, {"couplingSolver", "steady", "savedIters"}); jsonAdd(dom, m_DataSaveFrequency, {"couplingSolver", "steady", "savedIters"});
jsonAdd(dom, m_NumericalComputationCores, {"couplingSolver", "mpi", "core"}); jsonAdd(dom, m_NumericalComputationCores, {"couplingSolver", "mpi", "core"});
jsonAdd(dom, m_enableMPI, {"couplingSolver", "mpi", "on"});
jsonAdd(dom, m_mpiLibType, {"couplingSolver", "mpi", "type"});
} }
CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() { CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() {
@ -59,10 +61,14 @@ CUIConfig *CFDStructDataSolverComputingControlManager::genUIConfig() {
new CUIConfig({ new CUIConfig({
{"type", "CheckBox"}, // 并行 {"type", "CheckBox"}, // 并行
{"name", tr("parallel")}, {"name", tr("parallel")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_enableMPI)},
}), }),
new CUIConfig({ new CUIConfig({
{"type", "ComboBox"}, // MPI库 {"type", "ComboBox"}, // MPI库
{"name", tr("MPI library")}, {"name", tr("MPI library")},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_mpiLibType)},
}, },
{ {
new CUIConfig({ new CUIConfig({

@ -32,6 +32,12 @@ class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataSolverComputingControlManager : p
// ??表中没有 // ??表中没有
// 网格组装核数 // 网格组装核数
int m_MeshAssemblyCores = 0; int m_MeshAssemblyCores = 0;
// 并行开关
int m_enableMPI = 0;
// mpi库类型
int m_mpiLibType = 0;
}; };
#endif // CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H #endif // CFDSTRUCTDATASOLVERCOMPUTINGCONTROLMANAGER_H

@ -1,39 +1,33 @@
#include "CFDStructDataSolverTimeModeManager.h" #include "CFDStructDataSolverTimeModeManager.h"
#include "CUIProperty/CUIConfig.h" #include "CFDStructDataManagerBase.h"
#include "CFDStructMain/CFDStructDefine.h" #include "CFDStructMain/CFDStructDefine.h"
#include "CFDStructSigsCenter.h" #include "CFDStructSigsCenter.h"
#include "CUIProperty/CUIConfig.h"
#include "CUIProperty/CUISigsCenter.h" #include "CUIProperty/CUISigsCenter.h"
#include <QVariant> #include <QVariant>
#include "CFDStructDataManagerBase.h"
#include <rapidjson/document.h> #include <rapidjson/document.h>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h> #include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent) {
CFDStructDataSolverTimeModeManager::CFDStructDataSolverTimeModeManager(QObject *parent) : CFDStructDataManagerBase(parent)
{
m_uiConfig = nullptr; m_uiConfig = nullptr;
connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [ = ](int semaphore) { connect(m_cuiSigsCenter, &CUISigsCenter::sig_cuiPropertyChanged, this, [=](int semaphore) {
emit CFDStructSigsCenter::getInstance()->sig_solverModuleProperty((SolutionAnalysisModuleProperty)semaphore); emit CFDStructSigsCenter::getInstance() -> sig_solverModuleProperty((SolutionAnalysisModuleProperty)semaphore);
}); });
} }
CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() CFDStructDataSolverTimeModeManager::~CFDStructDataSolverTimeModeManager() {
{ // CFDStructDataManagerBase::~CFDStructDataManagerBase();
// CFDStructDataManagerBase::~CFDStructDataManagerBase();
} }
CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig() {
{
if (m_uiConfig != nullptr) { if (m_uiConfig != nullptr) {
delete m_uiConfig; delete m_uiConfig;
m_uiConfig = nullptr; m_uiConfig = nullptr;
} }
// qDebug()<<m_mcyc; // qDebug()<<m_mcyc;
// 如果是定常 // 如果是定常
if (m_runtype == 0) { if (m_runtype == 0) {
m_uiConfig = this->genSteadyModeUIConfig(); m_uiConfig = this->genSteadyModeUIConfig();
@ -41,70 +35,76 @@ CUIConfig *CFDStructDataSolverTimeModeManager::getParamUIConfig()
// 如果是非定常 // 如果是非定常
m_uiConfig = this->genUnsteadyModeUIConfig(); m_uiConfig = this->genUnsteadyModeUIConfig();
} }
// m_uiConfig->printConfig(); // m_uiConfig->printConfig();
return m_uiConfig; return m_uiConfig;
} }
void CFDStructDataSolverTimeModeManager::saveDataToDom(rapidjson::Document &dom) void CFDStructDataSolverTimeModeManager::saveDataToDom(rapidjson::Document &dom) {
{ jsonAdd(dom, m_runtype, {"region", 0, "solver", "time"});
jsonAdd(dom,m_runtype,{"region",0,"solver","time"}); jsonAdd(dom, m_innerIters, {
jsonAdd(dom,m_innerIters,{"couplingSolver", "unSteady", "innerIters",}); "couplingSolver",
jsonAdd(dom,m_iters,{"couplingSolver", "steady", "iters",}); "unSteady",
jsonAdd(dom,m_alf0,{"couplingSolver", "unSteady", "stepType",}); "innerIters",
jsonAdd(dom,m_realdt,{"couplingSolver", "unSteady", "timeStep",}); });
jsonAdd(dom,m_nstep,{"couplingSolver", "unSteady", "timeStepsNumber",}); jsonAdd(dom, m_iters, {
jsonAdd(dom,m_timeaverage,{"couplingSolver", "unSteady", "Timeverage",}); "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() CUIConfig *CFDStructDataSolverTimeModeManager::genSteadyModeUIConfig() {
{ return new CUIConfig({{"type", "Widget"}}, {new CUIConfig({
return new CUIConfig({
{"type", "Widget"}}, {
new CUIConfig({
{"type", "ComboBox"}, {"type", "ComboBox"},
{"name", "Time Mode"}, {"name", "Time Mode"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_runtype)}, {"value_origin", QVA_GLOBAL(&m_runtype)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode}, {"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode},
}, { },
new CUIConfig({ {new CUIConfig({
{"type", "Item"}, {"type", "Item"},
{"name", "steady"}, {"name", "steady"},
}), }),
new CUIConfig({ new CUIConfig({
{"type", "Item"}, {"type", "Item"},
{"name", "unsteady"}, {"name", "unsteady"},
}) })}),
}),
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, {"type", "LineEdit"},
{"name", "iteration count"}, {"name", "iteration count"},
{"value_type", CUI_DATA_TYPE_INT}, {"value_type", CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_iters)}, {"value_origin", QVA_GLOBAL(&m_iters)},
}) })});
});
} }
CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig() {
{ return new CUIConfig({{"type", "Widget"}}, {new CUIConfig({
return new CUIConfig({
{"type", "Widget"}
}, {
new CUIConfig({
{"type", "ComboBox"}, {"type", "ComboBox"},
{"name", "Time Mode"}, {"name", "Time Mode"},
{"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT}, {"value_type", CUI_DATA_TYPE::CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_runtype)}, {"value_origin", QVA_GLOBAL(&m_runtype)},
{"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode}, {"semaphore", (int)SolutionAnalysisModuleProperty::Time_Mode},
}, { },
new CUIConfig({ {new CUIConfig({{"type", "Item"}, {"name", "steady"}}), new CUIConfig({{"type", "Item"}, {"name", "unsteady"}})}),
{"type", "Item"},
{"name", "steady"}
}),
new CUIConfig({
{"type", "Item"},
{"name", "unsteady"}
})
}),
new CUIConfig({ new CUIConfig({
{"type", "LineEdit"}, {"type", "LineEdit"},
{"name", "alf0"}, {"name", "alf0"},
@ -134,6 +134,5 @@ CUIConfig *CFDStructDataSolverTimeModeManager::genUnsteadyModeUIConfig()
{"name", "Time Average"}, {"name", "Time Average"},
{"value_type", CUI_DATA_TYPE_INT}, {"value_type", CUI_DATA_TYPE_INT},
{"value_origin", QVA_GLOBAL(&m_timeaverage)}, {"value_origin", QVA_GLOBAL(&m_timeaverage)},
}) })});
});
} }

Loading…
Cancel
Save