From 2cdaba4b8963e525c9972caea06653c3c4bff47f Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 17 Feb 2017 06:34:56 +0100 Subject: [PATCH] FEM: code formating, white spaces --- src/Mod/Fem/App/AppFemPy.cpp | 2 +- .../Fem/App/FemConstraintFluidBoundary.cpp | 10 ++-- src/Mod/Fem/App/FemConstraintFluidBoundary.h | 6 +- src/Mod/Fem/App/FemConstraintTransform.h | 2 +- src/Mod/Fem/App/FemResultObject.h | 2 +- src/Mod/Fem/App/FemVTKTools.cpp | 20 +++---- src/Mod/Fem/App/FemVTKTools.h | 14 ++--- src/Mod/Fem/Gui/Command.cpp | 2 +- .../Gui/TaskFemConstraintFluidBoundary.cpp | 56 +++++++++---------- .../Fem/Gui/TaskFemConstraintFluidBoundary.h | 6 +- .../Fem/Gui/TaskFemConstraintTransform.cpp | 12 ++-- ...ViewProviderFemConstraintFluidBoundary.cpp | 2 +- src/Mod/Fem/Gui/ViewProviderResult.cpp | 2 +- src/Mod/Fem/Gui/Workbench.cpp | 2 +- 14 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/Mod/Fem/App/AppFemPy.cpp b/src/Mod/Fem/App/AppFemPy.cpp index 701e792ab..2a89e8e51 100644 --- a/src/Mod/Fem/App/AppFemPy.cpp +++ b/src/Mod/Fem/App/AppFemPy.cpp @@ -249,7 +249,7 @@ private: #ifdef FC_USE_VTK Py::Object readResult(const Py::Tuple& args) { - char* fileName = NULL; + char* fileName = NULL; char* objName = NULL; if (!PyArg_ParseTuple(args.ptr(), "et|et","utf-8", &fileName, "utf-8", &objName)) diff --git a/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp b/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp index 2b0c8af66..31c368016 100644 --- a/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/App/FemConstraintFluidBoundary.cpp @@ -42,7 +42,7 @@ using namespace Fem; PROPERTY_SOURCE(Fem::ConstraintFluidBoundary, Fem::Constraint); -// also defined in TaskFemConstraintFluidBoundary.cpp and FoamCaseBuilder/BasicBuilder.py, +// also defined in TaskFemConstraintFluidBoundary.cpp and FoamCaseBuilder/BasicBuilder.py, // update simultaneously // the second (index 1) item is the default enum, as index 0 causes compiling error static const char* BoundaryTypes[] = {"inlet","wall","outlet","interface","freestream", NULL}; @@ -56,8 +56,8 @@ static const char* FreestreamSubtypes[] = {"unspecific", "freestream",NULL}; static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio","intensity&HydraulicDiameter",NULL}; /* only used in TaskPanel static const char* TurbulenceSpecificationHelpTexts[] = { - * "see Ansys fluet manual: Turbulence Specification method", - * "not specified, solver will guess a value based e.g. 0.05 for inlet", + * "see Ansys fluet manual: Turbulence Specification method", + * "not specified, solver will guess a value based e.g. 0.05 for inlet", * "or fully devloped internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL}; */ @@ -65,7 +65,7 @@ static const char* TurbulenceSpecificationHelpTexts[] = { // also defined in FoamCaseBuilder/HeatTransferBuilder.py, update simultaneously static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "HTC","coupled", NULL}; /* only used in TaskPanel -static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [W/m2]", +static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer ()", "fixed value heat flux [W/m2]", "mixed fixedGradient and fixedValue", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL}; */ @@ -126,7 +126,7 @@ void ConstraintFluidBoundary::onChanged(const App::Property* prop) // Note: If we call this at the end, then the arrows are not oriented correctly initially // because the NormalDirection has not been calculated yet Constraint::onChanged(prop); - + if (prop == &BoundaryType) { std::string boundaryType = BoundaryType.getValueAsString(); if (boundaryType == "wall") { diff --git a/src/Mod/Fem/App/FemConstraintFluidBoundary.h b/src/Mod/Fem/App/FemConstraintFluidBoundary.h index 98e8b920e..5638380a5 100644 --- a/src/Mod/Fem/App/FemConstraintFluidBoundary.h +++ b/src/Mod/Fem/App/FemConstraintFluidBoundary.h @@ -45,12 +45,12 @@ public: App::PropertyEnumeration BoundaryType; App::PropertyEnumeration Subtype; App::PropertyFloat BoundaryValue; - App::PropertyLinkSub Direction; - + App::PropertyLinkSub Direction; + App::PropertyEnumeration TurbulenceSpecification; App::PropertyFloat TurbulentIntensityValue; App::PropertyFloat TurbulentLengthValue; - + App::PropertyEnumeration ThermalBoundaryType; App::PropertyFloat TemperatureValue; App::PropertyFloat HeatFluxValue; diff --git a/src/Mod/Fem/App/FemConstraintTransform.h b/src/Mod/Fem/App/FemConstraintTransform.h index 815f1bf8f..02287b833 100644 --- a/src/Mod/Fem/App/FemConstraintTransform.h +++ b/src/Mod/Fem/App/FemConstraintTransform.h @@ -35,7 +35,7 @@ class AppFemExport ConstraintTransform : public Fem::Constraint public: /// Constructor ConstraintTransform(void); - + // Read-only (calculated values). These trigger changes in the ViewProvider App::PropertyLinkSubList RefDispl; App::PropertyLinkList NameDispl; diff --git a/src/Mod/Fem/App/FemResultObject.h b/src/Mod/Fem/App/FemResultObject.h index 8f3e1feef..998b1ffc1 100644 --- a/src/Mod/Fem/App/FemResultObject.h +++ b/src/Mod/Fem/App/FemResultObject.h @@ -50,7 +50,7 @@ public: /// User defined results App::PropertyFloatList Stats; /// Displacement vectors of analysis - + /// returns the type name of the ViewProvider diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index c3b5211a5..909a66df6 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -534,7 +534,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document else { Base::Console().Log("the active object is not the correct type, do nothing\n"); - return NULL; + return NULL; } } @@ -546,8 +546,8 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document // PropertyLink is the property type to store DocumentObject pointer vtkSmartPointer pd = dataset->GetPointData(); - vtkSmartPointer displ = pd->GetArray("Displacement"); // name in vtk file, not the property name - vtkSmartPointer vel = pd->GetArray("U"); // name in vtk file, not the property name + vtkSmartPointer displ = pd->GetArray("Displacement"); // name in vtk file, not the property name + vtkSmartPointer vel = pd->GetArray("U"); // name in vtk file, not the property name if(vel) { importFluidicResult(dataset, result); @@ -568,7 +568,7 @@ App::DocumentObject* FemVTKTools::readResult(const char* filename, App::Document void FemVTKTools::writeResult(const char* filename, const App::DocumentObject* res) { - if (!res) + if (!res) { App::Document* pcDoc = App::GetApplication().getActiveDocument(); if(!pcDoc) @@ -631,7 +631,7 @@ void _calcStat(const std::vector& vel, std::vector& stat double vmin=1.0e100, vmean=0.0, vmax=-1.0e100; //stat of Vx, Vy, Vz is not necessary double vmins[3] = {1.0e100, 1.0e100, 1.0e100}; // set up a very big positive float then reduce it - double vmeans[3] = {0.0, 0.0, 0.0}; + double vmeans[3] = {0.0, 0.0, 0.0}; double vmaxs[3] = {-1.0e100, -1.0e100, -1.0e100}; for(std::vector::const_iterator it=vel.begin(); it!=vel.end(); ++it) { double p[] = {it->x, it->y, it->z}; @@ -734,7 +734,7 @@ void _importResult(const vtkSmartPointer dataset, App::DocumentObjec vtkDataArray* vec = vtkDataArray::SafeDownCast(pd->GetArray(kv.second.c_str())); // name from OpenFOAM/Fem solver export if(!vec) vec = vtkDataArray::SafeDownCast(pd->GetArray(kv.first.c_str())); // name from FreeCAD export - if(nPoints && vec && vec->GetNumberOfComponents() == 1) { + if(nPoints && vec && vec->GetNumberOfComponents() == 1) { App::PropertyFloatList* field = static_cast(res->getPropertyByName(kv.first.c_str())); if (!field) { Base::Console().Error("static_cast((res->getPropertyByName(\"%s\")) failed \n", kv.first.c_str()); @@ -766,7 +766,7 @@ void _importResult(const vtkSmartPointer dataset, App::DocumentObjec } -void _exportResult(const App::DocumentObject* result, vtkSmartPointer grid, +void _exportResult(const App::DocumentObject* result, vtkSmartPointer grid, const std::map& vectors, const std::map scalers, const std::string& essential_property){ @@ -788,7 +788,7 @@ void _exportResult(const App::DocumentObject* result, vtkSmartPointer(res->getPropertyByName(kv.first.c_str())); else Base::Console().Error("PropertyVectorList %s not found \n", kv.first.c_str()); - if(field && field->getValues().size()>1) { // FreeCAD property list + if(field && field->getValues().size()>1) { // FreeCAD property list const std::vector& vel = field->getValues(); vtkSmartPointer data = vtkSmartPointer::New(); if(nPoints != field->getSize()) @@ -905,7 +905,7 @@ void FemVTKTools::importMechanicalResult(vtkSmartPointer dataset, Ap vectors["DisplacementVectors"] = "Displacement"; vectors["StrainVectors"] = "Strain vectors"; vectors["StressVectors"] = "Stress vectors"; - std::map scalers; // App::FloatListProperty name -> vtk name + std::map scalers; // App::FloatListProperty name -> vtk name scalers["UserDefined"] = "User Defined Results"; scalers["Temperature"] = "Temperature"; scalers["PrincipalMax"] = "Maximum Principal stress"; @@ -943,7 +943,7 @@ void FemVTKTools::exportMechanicalResult(const App::DocumentObject* res, vtkSmar vectors["DisplacementVectors"] = "Displacement"; vectors["StrainVectors"] = "Strain vectors"; vectors["StressVectors"] = "Stress vectors"; - std::map scalers; // App::FloatListProperty name -> vtk name + std::map scalers; // App::FloatListProperty name -> vtk name scalers["UserDefined"] = "User Defined Results"; scalers["Temperature"] = "Temperature"; scalers["PrincipalMax"] = "Maximum Principal stress"; diff --git a/src/Mod/Fem/App/FemVTKTools.h b/src/Mod/Fem/App/FemVTKTools.h index ac299db6f..b9ccc6e08 100644 --- a/src/Mod/Fem/App/FemVTKTools.h +++ b/src/Mod/Fem/App/FemVTKTools.h @@ -49,15 +49,15 @@ namespace Fem static void importVTKMesh(vtkSmartPointer grid, FemMesh* mesh, float scale = 1.0); /*! FemMesh read from vtkUnstructuredGrid data file - */ + */ static FemMesh* readVTKMesh(const char* filename, FemMesh* mesh); /*! FemMesh export to vtkUnstructuredGrid instance - */ + */ static void exportVTKMesh(const FemMesh* mesh, vtkSmartPointer grid, float scale = 1.0); /*! FemMesh write to vtkUnstructuredGrid data file - */ + */ static void writeVTKMesh(const char* Filename, const FemMesh* mesh); /*! @@ -65,7 +65,7 @@ namespace Fem */ static void importFluidicResult(vtkSmartPointer dataset, App::DocumentObject* res); static void importMechanicalResult(vtkSmartPointer dataset, App::DocumentObject* res); - + /*! * FemResult export to vtkUnstructuredGrid object */ @@ -76,14 +76,14 @@ namespace Fem * FemResult (activeObject or created if res= NULL) read from vtkUnstructuredGrid dataset file */ static App::DocumentObject* readResult(const char* Filename, App::DocumentObject* res = NULL); - + /*! * write FemResult (activeObject if res= NULL) to vtkUnstructuredGrid dataset file - */ + */ static void writeResult(const char* filename, const App::DocumentObject* res = NULL); }; } #endif //FEM_VTK_TOOLS_H - \ No newline at end of file + diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp index a212a5c8d..8e3d1f2fa 100644 --- a/src/Mod/Fem/Gui/Command.cpp +++ b/src/Mod/Fem/Gui/Command.cpp @@ -1532,7 +1532,7 @@ void CmdFemPostPipelineFromResult::activated(int) Fem::FemResultObject* result = static_cast(ResultFilter.Result[0][0].getObject()); //static_cast failed here Base::Console().Message("Debug: FemResultObject pointer = %p", result ); - + */ App::Document* pcDoc = App::GetApplication().getActiveDocument(); if(!pcDoc) diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 3c8493def..c2394f011 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -85,19 +85,19 @@ static const char* InterfaceSubtypeHelpTexts[] = { "front and back for single layer 2D mesh, also axis-sym axis line", "exchange boundary vale with external program, need extra manual setup like file name", NULL}; -// defined in file FemConstraintFluidBoundary: +// defined in file FemConstraintFluidBoundary: // see Ansys fluet manual: Turbulence Specification method //static const char* TurbulenceSpecifications[] = {"intensity&DissipationRate", "intensity&LengthScale","intensity&ViscosityRatio", "intensity&HydraulicDiameter",NULL}; //activate the heat transfer and radiation model in Solver object explorer static const char* TurbulenceSpecificationHelpTexts[] = { - "explicitly specific intensity k [SI unit] and dissipation rate epsilon [] / omega []", + "explicitly specific intensity k [SI unit] and dissipation rate epsilon [] / omega []", "intensity (0.05 ~ 0.15) and characteristic length scale of max eddy [m]", "intensity (0.05 ~ 0.15) and turbulent viscosity ratio", "for fully devloped internal flow, Turbulence intensity (0-1.0) 0.05 typical", NULL}; //static const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "heatFlux", "HTC","coupled", NULL}; //const char* ThermalBoundaryTypes[] = {"fixedValue","zeroGradient", "fixedGradient", "mixed", "coupled",NULL}; -static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer on boundary()", "fixed value gradient [W/m]", +static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no heat transfer on boundary()", "fixed value gradient [W/m]", "mixed fixedGradient and fixedValue", "fixed heat flux [W/m2]", "Heat transfer coeff [W/(M2)/K]", "conjugate heat transfer with solid", NULL}; // enable & disable quantityUI once valueType is selected @@ -105,7 +105,7 @@ static const char* ThermalBoundaryHelpTexts[] = {"fixed Temperature [K]", "no he void initComboBox(QComboBox* combo, const std::vector& textItems, const char* sItem) { combo->blockSignals(true); - + int iItem = 1; // the first one is "unspecific" (index 0) combo->clear(); for (unsigned int it = 0; it < textItems.size(); it++) @@ -143,12 +143,12 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo this, SLOT(onSubtypeChanged(void))); connect(ui->spinBoundaryValue, SIGNAL(valueChanged(double)), this, SLOT(onBoundaryValueChanged(double))); - + connect(ui->comboTurbulenceSpecification, SIGNAL(currentIndexChanged(int)), this, SLOT(onTurbulenceSpecificationChanged(void))); connect(ui->comboThermalBoundaryType, SIGNAL(currentIndexChanged(int)), this, SLOT(onThermalBoundaryTypeChanged(void))); - + connect(ui->buttonReference, SIGNAL(pressed()), this, SLOT(onButtonReference())); connect(ui->buttonDirection, SIGNAL(pressed()), @@ -161,14 +161,14 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo // Temporarily prevent unnecessary feature recomputes ui->spinBoundaryValue->blockSignals(true); ui->listReferences->blockSignals(true); - + ui->buttonReference->blockSignals(true); ui->buttonDirection->blockSignals(true); ui->checkReverse->blockSignals(true); // Get the feature data Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject()); - + Fem::FemSolverObject* pcSolver = NULL; if (FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) { Fem::FemAnalysis* pcAnalysis = FemGui::ActiveAnalysisObserver::instance()->getActiveObject(); @@ -187,14 +187,14 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo pHeatTransfering = static_cast(pcSolver->getPropertyByName("HeatTransfering")); if (pHeatTransfering->getValue()) { ui->tabThermalBoundary->setEnabled(true); - initComboBox(ui->comboThermalBoundaryType, pcConstraint->ThermalBoundaryType.getEnumVector(), + initComboBox(ui->comboThermalBoundaryType, pcConstraint->ThermalBoundaryType.getEnumVector(), pcConstraint->ThermalBoundaryType.getValueAsString()); - updateThermalBoundaryUI(); + updateThermalBoundaryUI(); } else { ui->tabThermalBoundary->setEnabled(false); //Base::Console().Message("retrieve solver property HeatTransfering as false\n"); - } + } } else { ui->tabThermalBoundary->setEnabled(false); @@ -208,9 +208,9 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo ui->tabTurbulenceBoundary->setEnabled(true); ui->labelTurbulenceSpecification->setText(Base::Tools::fromStdString( pTurbulenceModel->getValueAsString())); - initComboBox(ui->comboTurbulenceSpecification, pcConstraint->TurbulenceSpecification.getEnumVector(), + initComboBox(ui->comboTurbulenceSpecification, pcConstraint->TurbulenceSpecification.getEnumVector(), pcConstraint->TurbulenceSpecification.getValueAsString()); - updateTurbulenceUI(); + updateTurbulenceUI(); } } else { @@ -226,11 +226,11 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(ViewProviderFemCo ui->tabWidget->setCurrentIndex(0); ui->labelHelpText->setText(tr("select boundary type, faces and set value")); - initComboBox(ui->comboBoundaryType, pcConstraint->BoundaryType.getEnumVector(), + initComboBox(ui->comboBoundaryType, pcConstraint->BoundaryType.getEnumVector(), pcConstraint->BoundaryType.getValueAsString()); updateBoundaryTypeUI(); //updateSubtypeUI(); // already called inside updateBoundaryTypeUI(); - + std::vector Objects = pcConstraint->References.getValues(); std::vector SubElements = pcConstraint->References.getSubValues(); std::vector dirStrings = pcConstraint->Direction.getSubValues(); @@ -264,7 +264,7 @@ void TaskFemConstraintFluidBoundary::updateBoundaryTypeUI() { Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject()); std::string boundaryType = pcConstraint->BoundaryType.getValueAsString(); - + // Update subtypes, any change here should be written back to FemConstraintFluidBoundary.cpp if (boundaryType == "wall") { ui->labelBoundaryValue->setText(QString::fromUtf8("velocity (m/s)")); @@ -300,7 +300,7 @@ void TaskFemConstraintFluidBoundary::updateBoundaryTypeUI() } //std::string subtypeLabel = boundaryType + std::string(" type"); //ui->labelSubtype->setText(QString::fromUtf8(subtypeLabel)); // too long to show in UI - + //set subType to default one, the second one as in ConstraintFluidBoundary ui->comboSubtype->setCurrentIndex(1); // each boundary type must have at least 2 subtypes std::vector subtypes = pcConstraint->Subtype.getEnumVector(); @@ -315,9 +315,9 @@ void TaskFemConstraintFluidBoundary::updateSubtypeUI() Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject()); //* Subtype PropertyEnumeration is updated if BoundaryType is changed - std::string boundaryType = pcConstraint->BoundaryType.getValueAsString(); - std::string subtype = Base::Tools::toStdString(ui->comboSubtype->currentText()); - + std::string boundaryType = pcConstraint->BoundaryType.getValueAsString(); + std::string subtype = Base::Tools::toStdString(ui->comboSubtype->currentText()); + if (boundaryType == "inlet" || boundaryType == "outlet") { ui->tabBasicBoundary->setEnabled(true); if (subtype == "totalPressure" || subtype == "staticPressure"){ @@ -373,7 +373,7 @@ void TaskFemConstraintFluidBoundary::updateSubtypeUI() int iInterface = ui->comboSubtype->currentIndex(); ui->labelHelpText->setText(tr(InterfaceSubtypeHelpTexts[iInterface])); } - + } /// hide/disable UI only happend in constructor, update helptext and valuetext here @@ -398,7 +398,7 @@ void TaskFemConstraintFluidBoundary::updateSelectionUI() onButtonReference(true); return; } - + /** not needed for fluid boundary, as it must be Face for 3D part, * Edge type boundary is needed for 2D CFD, but it is not supported yet std::string ref = ui->listReferences->item(0)->text().toStdString(); @@ -498,10 +498,10 @@ void TaskFemConstraintFluidBoundary::onSelectionChanged(const Gui::SelectionChan void TaskFemConstraintFluidBoundary::onBoundaryTypeChanged(void) { Fem::ConstraintFluidBoundary* pcConstraint = static_cast(ConstraintView->getObject()); - pcConstraint->BoundaryType.setValue(ui->comboBoundaryType->currentIndex()); + pcConstraint->BoundaryType.setValue(ui->comboBoundaryType->currentIndex()); updateBoundaryTypeUI(); ConstraintView->updateData(&pcConstraint->BoundaryType); //force a 3D redraw - // bug: cube normal is not correct in redraw, redraw is correct only after close task panel + // bug: cube normal is not correct in redraw, redraw is correct only after close task panel // see note of If ConstraintView->updateData(): the arrows are not oriented correctly initially // because the NormalDirection has not been calculated yet } @@ -669,7 +669,7 @@ void TaskFemConstraintFluidBoundary::changeEvent(QEvent *e) ui->spinBoundaryValue->blockSignals(true); //more ui widget? those UI are does not support tr yet! ui->retranslateUi(proxy); - + ui->spinBoundaryValue->blockSignals(false); } } @@ -712,7 +712,7 @@ bool TaskDlgFemConstraintFluidBoundary::accept() name.c_str(), boundary->getSubtype().c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.BoundaryValue = %f", name.c_str(), boundary->getBoundaryValue()); - + std::string dirname = boundary->getDirectionName().data(); std::string dirobj = boundary->getDirectionObject().data(); @@ -726,7 +726,7 @@ bool TaskDlgFemConstraintFluidBoundary::accept() } //Reverse control is done at BoundaryType selection, this UI is hiden from user //Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", name.c_str(), boundary->getReverse() ? "True" : "False"); - + std::string scale = "1"; scale = boundary->getScale(); //OvG: determine modified scale Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Scale = %s", name.c_str(), scale.c_str()); //OvG: implement modified scale @@ -747,7 +747,7 @@ bool TaskDlgFemConstraintFluidBoundary::accept() App::PropertyEnumeration* pTurbulenceModel = NULL; pHeatTransfering = static_cast(pcSolver->getPropertyByName("HeatTransfering")); pTurbulenceModel = static_cast(pcSolver->getPropertyByName("TurbulenceModel")); - + if (pHeatTransfering && pHeatTransfering->getValue()) { Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.ThermalBoundaryType = '%s'",name.c_str(), boundary->getThermalBoundaryType().c_str()); Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TemperatureValue = %f",name.c_str(), boundary->getTemperatureValue()); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h index 61f02efe2..12b758085 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h @@ -55,18 +55,18 @@ public: std::string getBoundaryType(void) const; std::string getSubtype(void) const; double getBoundaryValue(void) const; - + std::string getTurbulenceModel(void) const; std::string getTurbulenceSpecification(void) const; double getTurbulentIntensityValue(void) const; double getTurbulentLengthValue(void) const; - + bool getHeatTransfering(void) const; std::string getThermalBoundaryType(void) const; double getTemperatureValue(void) const; double getHeatFluxValue(void) const; double getHTCoeffValue(void) const; - + virtual const std::string getReferences() const; const std::string getDirectionName(void) const; const std::string getDirectionObject(void) const; diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp index 4627eb41a..808b582e1 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp @@ -243,8 +243,8 @@ void TaskFemConstraintTransform::addToSelection() QMessageBox::warning(this, tr("Selection error"), tr("Only one face for rectangular transform constraint!")); Gui::Selection().clearSelection(); return; - } - + } + if ((rows==0) && (selection.size()>=2)){ QMessageBox::warning(this, tr("Selection error"), tr("Only one face for rectangular transform constraint!")); Gui::Selection().clearSelection(); @@ -254,7 +254,7 @@ void TaskFemConstraintTransform::addToSelection() Fem::ConstraintTransform* pcConstraint = static_cast(ConstraintView->getObject()); std::vector Objects = pcConstraint->References.getValues(); std::vector SubElements = pcConstraint->References.getSubValues(); - + std::vector ObjDispl = pcConstraint->RefDispl.getValues(); std::vector SubElemDispl = pcConstraint->RefDispl.getSubValues(); for (std::vector::iterator it = selection.begin(); it != selection.end(); ++it){//for every selected object @@ -300,7 +300,7 @@ void TaskFemConstraintTransform::addToSelection() this, SLOT(setSelection(QListWidgetItem*))); for (std::size_t i = 0; i < ObjDispl.size(); i++) { if ((makeRefText(ObjDispl[i], SubElemDispl[i]))==(makeRefText(obj, subNames[subIt]))){ - Objects.push_back(obj); + Objects.push_back(obj); SubElements.push_back(subNames[subIt]); ui->lw_Rect->addItem(makeRefText(obj, subNames[subIt])); connect(ui->lw_Rect, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), @@ -310,7 +310,7 @@ void TaskFemConstraintTransform::addToSelection() if (Objects.size() == 0){ QMessageBox::warning(this, tr("Selection error"), tr("Only transformable faces can be selected! Apply displacement constraint to surface first then apply constraint to surface")); Gui::Selection().clearSelection(); - return; + return; } } } @@ -521,7 +521,7 @@ bool TaskDlgFemConstraintTransform::accept() Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Y_rot = %f", name.c_str(), parameters->get_Y_rot()); Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Z_rot = %f", - name.c_str(), parameters->get_Z_rot()); + name.c_str(), parameters->get_Z_rot()); Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.TransformType = %s", name.c_str(), parameters->get_transform_type().c_str()); std::string scale = parameters->getScale(); //OvG: determine modified scale diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp index 202713e9d..4bfd8769e 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintFluidBoundary.cpp @@ -145,7 +145,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro FaceColor.setValue(0.0,0.0,1.0); } } - + if (boundaryType == "inlet" || boundaryType == "outlet"){ #ifdef USE_MULTIPLE_COPY //OvG: need access to cp for scaling diff --git a/src/Mod/Fem/Gui/ViewProviderResult.cpp b/src/Mod/Fem/Gui/ViewProviderResult.cpp index 1059b0259..9296363c8 100644 --- a/src/Mod/Fem/Gui/ViewProviderResult.cpp +++ b/src/Mod/Fem/Gui/ViewProviderResult.cpp @@ -45,7 +45,7 @@ ViewProviderResult::~ViewProviderResult() } -/* not needed since _ViewProviderFemResult.py is made +/* not needed since _ViewProviderFemResult.py is made bool ViewProviderResult::doubleClicked(void) { Gui::Command::runCommand(Gui::Command::Gui, "Gui.runCommand('Fem_ShowResult')"); diff --git a/src/Mod/Fem/Gui/Workbench.cpp b/src/Mod/Fem/Gui/Workbench.cpp index ecc672164..db76a3988 100755 --- a/src/Mod/Fem/Gui/Workbench.cpp +++ b/src/Mod/Fem/Gui/Workbench.cpp @@ -53,7 +53,7 @@ Workbench::~Workbench() void Workbench::setupContextMenu(const char* recipient, Gui::MenuItem* item) const { StdWorkbench::setupContextMenu( recipient, item ); - *item << "Separator" + *item << "Separator" << "Fem_ClearMesh" << "Fem_PrintMeshInfo"; }